From nobody Mon Oct 28 03:15:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcJSD0fqNz5blRR; Mon, 28 Oct 2024 03:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcJSD07SKz4TnB; Mon, 28 Oct 2024 03:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730085356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qZqVOvcZlpaXtAQrWdKBg/0zmVQxhhGliEqn3sGeTeI=; b=Kl+x9yJP/TyjkxWUUybwr55l1N/+sn7Ottbe/z3PqlPgQpUYMAjYyInd+GuSXgzU1dOOES eUBk9EcZvhd21YqkdiCZY0Rugxzt67zzcKrazRFriwV8o3kF4eWziIfj5D/artPwJAJ8F9 uxEuj569QuhdbF2HmON1kK4E2P6a9OJ7QC3l1I3Lfpb4pt8MVa0iTBAa4SE/ZNiMs0/5Yt s4CqOcSCv7bvrsUg9GZIqm5UHfPFlvf4xkmAXqmgifrX3mWPItaZOsaWset7tfewIJ0TX/ qQ4JTjlq6RcjKZNX7wPsarD17Oa4JEd+MWdg4ri+cRNjTSmLB4nb09iJPMIHpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730085356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qZqVOvcZlpaXtAQrWdKBg/0zmVQxhhGliEqn3sGeTeI=; b=Jz5Th7MVfV9Z3aqNrKskgaOTYrP5975iGaZ3RDI45odrEiuqd7pA+Yr506GsfwwiRisn45 x9zKIM0wg0jJ+dKl3c1F1bCntQZ5MOcKmPQRx6oFg0B4+sPgvo8whrrpwLFDFUhNHR6EzN 0wNaGsXKy6qKiEB0CemXsw8mtHz6seojR8WcEBNLmmQWi561RXeDTpCYk9KHAzxvXq/jzg 4sTsGMsEMgQeBhPP+vuIV/6Na2yJ7ehT7SS2LEbRS/PzDl6iPr8+jHFkY2uJ/cP603xetZ b14T/pZK4raHWAu2eMUV6lh70EAc9Qugn6j/Qbq7n+Dh7HhzSro2MkSl2weLLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730085356; a=rsa-sha256; cv=none; b=k6J2SJf+5EocHAr3wsHq1C2ZCr7aPJPJYUoKtqr8as9wqKYVytVeGg88mMRSrR1hQhXKQP wnCR3le3PRTiLvYjWXHCWqEUPuqLLbbFks4DCPtH+pEbIdSSK2jPdZ2tMuIhH0MJRz1Cil 8CfSu1kgy5Z9TIgH6BdNPUomeRns6ZTIVJ7hkQFuSV5wmLC1A93555kovINZg1bX+tC9e+ w01lO4q3CiF4ToCGFcOYa+7qjPC9XOtT3nxTmc5iaAct4XZE/AJ/PeMHWFnEKt+rhVJz9X qIPdb5tLExqe8zwKARpGfi7bZwZ49aB+jTtfFk5G7SW1KW8OqhusUuTk7nTjgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcJSC6P64zMcl; Mon, 28 Oct 2024 03:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49S3FtB2022365; Mon, 28 Oct 2024 03:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49S3Ftro022362; Mon, 28 Oct 2024 03:15:55 GMT (envelope-from git) Date: Mon, 28 Oct 2024 03:15:55 GMT Message-Id: <202410280315.49S3Ftro022362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a1d1b9049bcb - main - liquidio.4: remove extra search keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1d1b9049bcbe02a49f0f143ca9ecdc54ea31d3b Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d1b9049bcbe02a49f0f143ca9ecdc54ea31d3b commit a1d1b9049bcbe02a49f0f143ca9ecdc54ea31d3b Author: Alexander Ziaee AuthorDate: 2024-10-27 17:26:02 +0000 Commit: Kevin Bowling CommitDate: 2024-10-28 03:15:17 +0000 liquidio.4: remove extra search keywords Approved by: emaste MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1500 --- share/man/man4/liquidio.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/liquidio.4 b/share/man/man4/liquidio.4 index 4713863c398f..27372e606212 100644 --- a/share/man/man4/liquidio.4 +++ b/share/man/man4/liquidio.4 @@ -34,7 +34,7 @@ .Os .Sh NAME .Nm liquidio -.Nd "Cavium 10Gb/25Gb Ethernet driver for the FreeBSD operating system" +.Nd Cavium 10Gb/25Gb Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your From nobody Mon Oct 28 03:20:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcJYD0kKJz5blTG; Mon, 28 Oct 2024 03:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcJYC6yygz4Vdh; Mon, 28 Oct 2024 03:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730085616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBwkI10YYU3ddPfLr7AOEadIdKkf9Wdaf9TH2agxA7w=; b=qPvOyjQQVEF15vhlrhKo2cnP9TS+FsyAWubwd7LpiUNd7aEa4RYE6wOxqvJamnCorKabDG wRyr6ymKAOVISO8sN1KOp6KTvxskUELcq3oyzv65haQNND9NOsJjI9LNGyH3zt6kUOElSY FEiCfSXoKo7ElUCUKFvElD3RM9fZIxh351pIyyONHbA2BZTiQ9cdZjvMJQI1yrHmIf/LhL AMZruTe9rOx6j6p4EtSawvELiJrbOkf6HEw5+XCVIQmKz0ZENdZabsR7AHKeyV0DjOc0Pw sJm9W/rv9g2IE86rb3lGu/PLdyKzNlmCjJAw3ja7UW+z3kGbl86aSpiGiYMTaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730085616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBwkI10YYU3ddPfLr7AOEadIdKkf9Wdaf9TH2agxA7w=; b=VEw+G8GFeKDfA3Gc2zBvl0R9aGMa9kNK8zR4UC4lxZX1m154F0A6uR8eYrUrhsUC57juNn SYwlQLP9Lard5y42sdHlHwBn/zuBrl4/i2r9hByL9YKC64sDs+paiKcUDBTdqASX5tndZS vQ7ttHkXd72oc4umgwhatKKilagfyPbFy6rxywcwV8SDudUz9KVm/VtZ95JhRrWR4EKyQi SZOl5AcAF4cBZQn0AwbRVB88nebY1w4rKS7k89b/tR8J0fhxaVlPoafVedfjRd3mgbK+3S aKCkJ9eDNgGfmBEWwPzY5dacI+jNcGP1sUi66sifgh4nq2/9lG64iMpZaRMAAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730085616; a=rsa-sha256; cv=none; b=WP91jzmtcFprE6DN8VZfGMlvK1u0TAQqVJEuWUsU5B+VfIB8fEcfRVe2RSKfxP1vbRv2H5 O8KXNEzns/kzv1iwkE9iQs2nhc5QqH79qiWqoMGjO0U95QhEiKgWYUV3Dollu3IjXeAvfZ s4DQLMztIsHLeFaDUC2+Uqnpv3ZCIzJmM3CQb3qbjcZTz1aijXUsz973pe80qYnhYjNsio bWcQLkBQm/nES9c2qjGSmE/xowgB4hq41oKE+Z+3r3qXwxk0BMyzMnnPwgZ0uAGzDvC6Vn kAFY/7IVBeB7RXYS6weOje2OOUR93ewFOnsDr0lgRXkYtD1iVxajC/iNS6yheQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcJYC62TbzMcm; Mon, 28 Oct 2024 03:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49S3KFZT031100; Mon, 28 Oct 2024 03:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49S3KFIK031089; Mon, 28 Oct 2024 03:20:15 GMT (envelope-from git) Date: Mon, 28 Oct 2024 03:20:15 GMT Message-Id: <202410280320.49S3KFIK031089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f4bd011a3822 - main - ixl.4 + ice.4: intro sentence for HARDWARE notes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4bd011a382269965a4f75aa01b6e6b1ce2a3eba Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f4bd011a382269965a4f75aa01b6e6b1ce2a3eba commit f4bd011a382269965a4f75aa01b6e6b1ce2a3eba Author: Alexander Ziaee AuthorDate: 2024-10-27 07:16:19 +0000 Commit: Kevin Bowling CommitDate: 2024-10-28 03:18:14 +0000 ixl.4 + ice.4: intro sentence for HARDWARE notes MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1495 --- share/man/man4/ice.4 | 5 ++++- share/man/man4/ixl.4 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 index da46c758479c..63fdb244f3ed 100644 --- a/share/man/man4/ice.4 +++ b/share/man/man4/ice.4 @@ -114,7 +114,10 @@ Update Utility for Intel Network Adapter 800 series; installed by the package. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +The +.Nm +driver supports the Intel Ethernet 800 series. +Most adapters in this series with SFP28/QSFP28 cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index bd183be48cd2..fb9d519b22a8 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -116,7 +116,10 @@ kernel; install the package for the latest driver. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 700 Series with SFP+/SFP28/QSFP+ cages +The +.Nm +driver supports the Intel Ethernet 700 series. +Most adapters in this series with SFP+/SFP28/QSFP+ cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. From nobody Mon Oct 28 03:27:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcJk341Tgz5blqj; Mon, 28 Oct 2024 03:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcJk330vzz4WK7; Mon, 28 Oct 2024 03:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjgaXdkP+K4Me/UC3d91yabqtQGHLkxUgvK2h0rglbw=; b=H4uEdSsLBnzNxXyscCF0LwkQAZ5CaaJea7rvgUFBt+p+QW/M9Ss3Z8b1suFwI63lh5b96n jUbo88LvNrmhd2djsZ4+xYs8iHqLVqtf+CFCsrofgpraP4SE9LALTo6Nylc5UrMXFtXwzF IhVKGNjvPR8SRSolrURe+kEjYcHJxHqcPhTvjCKHtKYBmbzdLRaoZZXAAqKGhw+y2sXjBN sWxJumdx9OxG8DVXQ4/R8EK1MtHMQVBGIzzrIu+y+xWld3StnA2By6essUUNHhw+MNJz8C bszepY617YObJr6Wc6LqxRFAyMMM3tbU5N9acetWY92fQd15Q7anFgn/P27aIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jjgaXdkP+K4Me/UC3d91yabqtQGHLkxUgvK2h0rglbw=; b=cVvfYRn6LiUOB4Es417e0rcvMfPzjAiRZFND8g38bP/ktNx5MtSFbsxUrQXDCLI9v4ac37 YBgYCvN057c4/CSDueu50zDA3ZjB4wRo6DZMGIzZR8gLKfjmOtObN2D0qpJzw3lRKoMPYr dx+dBEMlppGR3YKDlX3Hknic+bMHzfVD286GeRIy2Srl4g01kNzw8kCrEsKXpWiXgOHZw0 D9QUt3tBfRrq8Ab6Vu/E3x9ESHeZHWBnPzZM7dH2PEEG769fWYIclcQabhdoAB/QEjgX9e B/fVDA34HatU1xYaF8DwVOvniNSxHR+HGauW8BhwY/WtEr/Xcbnk3J32pk3Wqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730086075; a=rsa-sha256; cv=none; b=QQIjt95r1USl9gENXSY8aFEQ46dry+8MNbtvm9ovRoQT44WcTmm9Bxk0ZZTq6KhgeLbyVD KNd/HNaEvcVRXuQ4joQChKMB0gfRtUJ6F4h28Azlw3Na87Zp0LTwxhGL7JFDQJ9ZuSYiak ABMOqOPs4QwYkhD1OaO6MUqg4pP6M3Sf0wFqdn1ATzPpqqJLb7157tFNOOdjlmyxIBFaaf /MVLGoXm3tmdF5pjf3ixS2gGbMWW5WU3MPXN/0exyu8Obtpsxj7jV7agdNI/ewPPKy5Yr9 idQ4C/2WkY2H8VbEWWzZMd2UFWvz/3jq2zI96XuzeVU3OpSAeRI/8prr+sTpQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcJk31wl1zMKC; Mon, 28 Oct 2024 03:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49S3RtEs041189; Mon, 28 Oct 2024 03:27:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49S3Rtbx041186; Mon, 28 Oct 2024 03:27:55 GMT (envelope-from git) Date: Mon, 28 Oct 2024 03:27:55 GMT Message-Id: <202410280327.49S3Rtbx041186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c222619cd480 - main - if_ffec: fix imx6sx compatible flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c222619cd4807e9e0274e6fadcbe259cf5cabc26 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c222619cd4807e9e0274e6fadcbe259cf5cabc26 commit c222619cd4807e9e0274e6fadcbe259cf5cabc26 Author: Gary Bisson AuthorDate: 2024-10-17 09:55:54 +0000 Commit: Kevin Bowling CommitDate: 2024-10-28 03:26:50 +0000 if_ffec: fix imx6sx compatible flags The i.MX 6 SoloX does support Gigabit and AVB features as can be seen in its technical reference manual [1] or even Linux kernel [2]. Fixes: 94bc2117b4a ("Add i.MX 8M Quad support") [1] https://www.nxp.com/webapp/Download?colCode=IMX6SXRM [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/freescale/fec_main.c?h=linux-6.6.y#n206 MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson --- sys/dev/ffec/if_ffec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 1a1993c22be7..1a562b149f61 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -121,7 +121,8 @@ static struct ofw_compat_data compat_data[] = { {"fsl,imx53-fec", FECTYPE_IMX53}, {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE }, {"fsl,imx6ul-fec", FECTYPE_IMX6 | FECFLAG_RACC }, - {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC }, + {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | + FECFLAG_AVB }, {"fsl,imx7d-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | FECFLAG_AVB }, {"fsl,mvf600-fec", FECTYPE_MVF | FECFLAG_RACC }, From nobody Mon Oct 28 03:27:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcJk44nvnz5bldB; Mon, 28 Oct 2024 03:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcJk43FTTz4WQq; Mon, 28 Oct 2024 03:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jd7RZmQP3uiuP4+GsMrh5Or3tFaGm2DtgfDH1KHDNwg=; b=b4hhGWMf/WIhEZQ077jLadg/gKTXIqj0iCFpKktUePXT5qeP4Nru1T2g2ztn+CE3+voDXl +tS/bBZ5x3hf4/+sbrGzoATxpe57BSWQNCHjsgBMzNHPnSvpZ+eZQ2OlD3bYxR9mvUIrdQ GE0RC3UfayFblDZGGLR46P9tYK+meEQQoZgauC+tlEn1NXEh1zzbd7fUSiKh7CqG6+qqoI vRmDyELSNbkV2sa/VtgcnT/+OJ9v1bmStMcKWnwytGRCR8hnxJM/Nlj1p7JvR7oHgjgGuk f3Z91dd1Xqaq0C3U2tgC+LMfRRHiIEKOz37t2yPj3nGVnzTWCMG+CTmP5LtgzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jd7RZmQP3uiuP4+GsMrh5Or3tFaGm2DtgfDH1KHDNwg=; b=e1VTY+U4dBoBGXX/+o8puxL7zTaY0ckZE/5fqxvlCkLkTGGd+TxZghT/rGvCG1x4651slX POXwkDAOSEFQBfXuk+M/ylnnRI/2uQY/m5brPYfGnlCNGnaIcRULWjndty5YKLjmfnQo1V +0GR4CAO79nqiAHRJ/z7SdnYI+DreuHn0eRcNFiRimC1TjE2mK/WCyulv6NtVIBhyBmMBL Lenfei8aK8LoObZy/FuL2irkdFQWHvewNE1s4vnM8jRleBJkRUDPgPif9ort33smyKxxjN c9aEZGOLuy3DH728YM2uBJyvxRlhpJOYyzyrEVsvtpPy1J/3YbhJMmGz8rTPxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730086076; a=rsa-sha256; cv=none; b=SmF5Tb87baEo/9ELd1RavkFEPNyJ+Sq4dRbpI6RQGo3af/hs0sXiLuM1m1gejCXy//AsKQ vQnko6zOPN7WdFu9oVOdL9PcR9jdRzQE0remj39Tud3UMy/yZcok6N4D7hcW58ekheSe5W gJ6IZwWxX2C0MAcTrzinIUJnYhBxycpu+LWKYkpQkZcUZDse+rVtRVka75ofLIzha5d5ki k/y5xnvoQA9TYa0auO+zNdJnZQ8kEw36rp4t7Djt71mfH1KVtVJUbewpIZ4kGCHjfk3DXM OfneFtapXUN5mbp6YBQtEpp9NT/0O1OGyuRVOpK00aQhbgO0LXM8OZt8j0CkVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcJk42h2vzMS9; Mon, 28 Oct 2024 03:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49S3RuiF041234; Mon, 28 Oct 2024 03:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49S3RuXD041231; Mon, 28 Oct 2024 03:27:56 GMT (envelope-from git) Date: Mon, 28 Oct 2024 03:27:56 GMT Message-Id: <202410280327.49S3RuXD041231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 6a7aa5530c0d - main - if_ffec: fix MAC address bootverbose print List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7aa5530c0d860c98c982968ac27728daaac7aa Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7aa5530c0d860c98c982968ac27728daaac7aa commit 6a7aa5530c0d860c98c982968ac27728daaac7aa Author: Gary Bisson AuthorDate: 2024-10-17 10:02:48 +0000 Commit: Kevin Bowling CommitDate: 2024-10-28 03:27:18 +0000 if_ffec: fix MAC address bootverbose print Remove extraneous colon at the end. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson --- sys/dev/ffec/if_ffec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 1a562b149f61..17fab283fc81 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -968,7 +968,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, uint8_t *hwaddr) if (bootverbose) { device_printf(sc->dev, - "MAC address %02x:%02x:%02x:%02x:%02x:%02x:\n", + "MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); } From nobody Mon Oct 28 03:30:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcJnH0J4Rz5bldb; Mon, 28 Oct 2024 03:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcJnG6Cg9z4WrV; Mon, 28 Oct 2024 03:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M4/7y/7u26kqp10+oCojIoLpEgEF+h8we/zJbeFR43s=; b=LXPgOSBiyCkOVz5kz1E+XRqzSklKnjD4zPBhmacx/RrYwB+nN2JQUCUFCHUUOcbLkLucgL 382o3YFy0jjK6D6I8pNiSWzhPXYwk5uJVAbVSTVm7PF8eiwfNCN5ceO2lCCpudFk/f3wwv q8xqvwgbOMjZVAux1MIYV5wAulIWEtC2WI6+iCgXRCxIZYhl3yEqzbyp44SAGTVu/m4JxE j3pct6APsNMytAzLg1yJbtKmTdWG+ZDkriHnDZk4+FbolwFGzWw5tU1tuoxjD1RvqjfqyJ 8PpM/rg+PdcWEOA3gsPRMZLXl365MmMwyFhs5nNKDYIA3ClcZdWIijZtpMQ+cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730086242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M4/7y/7u26kqp10+oCojIoLpEgEF+h8we/zJbeFR43s=; b=qDVkdNmUcVA2C0OwsaLVb2LW5L5sftO2LjIxhJ5LRszYrSpIJ/zJggANHotv0sgJ2xiVff Vtj7FeXk6bMkjrckGF1kR8uk2QnZ2N2PjB2coV5zK6oOQcxaEtDiDSGyrxPEiQD5yLNKSW ePnblYcrIiCCV5+7Mwx16R184ijADaPJ+wwe56+olPm3RsIf1dS8CXeoNnhUWdW8/7qdPE xunWqGXyxTnMNHSJqS87/xSaQ64kOR8qsXEqiqH5CnN9YTy3f5j4N0phdUpv06RiJLb2xV Qk/v1NRn7RZssGyTYyyLcKev5s2VhASLDF7zmi+igIGCHXrXtRDqx4mnvbyHdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730086242; a=rsa-sha256; cv=none; b=DpmjP+vDcKvgxbvD/IJul2xfVAC5ygrlS9UBBYY3+6vd1d/mVPXIk+TWrQ6n4Mr2cF+uk5 baZ6BaCKHFQYIj7R/44PLWwGVDX3n9mhHyRVr6zP4+QKSlgnQfJKX3O8QXOGoemGi1/3DR TineUSVaghE8FROHlGBAQXi8ntWhDvbkAfmriqyTwUPxTUxDaQn281c9W76ZmFLkbC/sjL gvlilvJz1ZadMTL5Q2b/yZJE4qsQ+hkfepjn3/Y675LivyeYGZdp6tLJdnYXw5JyUzM81T Sh4EQHwtOCgZy26oYZFjpl+zZoHr4LjapPNXEwU2SbRcBecj/Nl5vPXrtWIVJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcJnG5js5zMf9; Mon, 28 Oct 2024 03:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49S3Ug17054318; Mon, 28 Oct 2024 03:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49S3UguG054315; Mon, 28 Oct 2024 03:30:42 GMT (envelope-from git) Date: Mon, 28 Oct 2024 03:30:42 GMT Message-Id: <202410280330.49S3UguG054315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 65691b2dafda - main - libexec/rc/rc.d/netif: Typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65691b2dafda23691c3989749def755a98e731ec Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=65691b2dafda23691c3989749def755a98e731ec commit 65691b2dafda23691c3989749def755a98e731ec Author: Robert William Vesterman AuthorDate: 2024-10-18 02:54:39 +0000 Commit: Kevin Bowling CommitDate: 2024-10-28 03:30:19 +0000 libexec/rc/rc.d/netif: Typo fix Just fixing a typo ("configuriing" => "configuring"). MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1484 --- libexec/rc/rc.d/netif | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 4fe9b60cbb20..8c033acaf828 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -151,7 +151,7 @@ vnet_down() # netif_common routine # Common configuration subroutine for network interfaces. This -# routine takes all the preparatory steps needed for configuriing +# routine takes all the preparatory steps needed for configuring # an interface and then calls $routine. netif_common() { From nobody Mon Oct 28 10:36:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcVDn1QFbz5bCDj; Mon, 28 Oct 2024 10:36:41 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcVDn0nVqz4KJG; Mon, 28 Oct 2024 10:36:41 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730111801; 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=J0evUUhgIho5KSBF3iSKLgS7hnT6Od9EHZUIpFRz/q0=; b=e5HEJZ2l3wPXStymJm6Sjb4JBHvB+LN8BQhU55pJjzyNQjGME1ZFunqIpm4NeYr5gfOJ+0 oR0CNvmxo+wBhDASCMwUCUdbvfrB1UXBW99nuHTZzf+NCgs+xi+W4743vZvxEVewYSCxcu J+lXSirlZ0wWSEQt0GnXWnoh4wAvheVsEdmzEffujdHGRXFnI1j6TKIaq9yPzpEI/5bIuG xTxTtNfKy1V+qqsZLIpXX/bN8jCHY9iA7tp9iC21S1zVJtsLYKuZJSVHbrm9YjE7PP3z2w WqjxGNtW7eA7ZlVX7RSmtv2q/jwZdZx/1zEGuGJGsgA+EDXlJCcjf8BISKkCJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730111801; 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=J0evUUhgIho5KSBF3iSKLgS7hnT6Od9EHZUIpFRz/q0=; b=xJ7mLDPdppSfeIRShEeYmXGcDYTiXuJ9rrDqtce8wOINpf35OKgHkmINUgWqg4B9k8ISNh prEiVE1YLE+xnnwxU1QxB7pRTh2zn0u7LnH77bGfzVN9SMRritoTn/fN9CHzCbWufTQgbn 6FpgjzWZrYRdFwm3awYURhLArovQSG1TeV8ZMp1QKa+J107ttpK4fiUXm+NkQwvuVefadI 6W/2Btz5rO5ZBA0uk4Jn0PW1U1+NgVyQL098nidfLfQtnus1fHMYrDirO3qIhpWTriWElM m/OWbWNNyPgydFCq23sz+OgKHUpu5u8KSMRiGqYcUgjpcdNei3JqyI+7Ji8MUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730111801; a=rsa-sha256; cv=none; b=iD7zswMHef9RV+uv8nYlwadgp6UTPTTmusVl2hYOlwPsosNWbNTJW9scynq5xJHkGrmz9W uMsWox9yVymcSZcOsPGCGZY5LzsVXFm1CZetfC6XAR9bkRjas9xfVlcGw/JRIwscUbEC6c vH+Tj5yzEKJSrxMv/pum0H1B3GrI4BGcpH29zugs4CVHvfzozaC+Yn5WYkJ6eRByfwCdIB +QICCRXCx99QdH0evFQ/IDewvOGoKs+h+Tzbr4lQ0I7KYzr97ITjhqhg+7MpElm4X0fN1Z i9hOdQ082s1sHRTyX8AMIrS/IwdtpTcca/Rv+gBSOWNyZJDv3r4liRSC7rn+dQ== Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_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: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XcVDm6qPFz1SM9; Mon, 28 Oct 2024 10:36:40 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 5720A1D022D; Mon, 28 Oct 2024 11:36:39 +0100 (CET) Date: Mon, 28 Oct 2024 11:36:39 +0100 From: Baptiste Daroussin To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 23dee252daf2 - main - loader: Change this BIOS tradeoff: Add back zip and use text only Message-ID: <5xlrksb3pagvnhqoisbak4iyzeffry6eocjpj5jda663boxrgw@b2dn52brqptl> References: <202410250312.49P3C6AH005000@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202410250312.49P3C6AH005000@gitrepo.freebsd.org> On Fri 25 Oct 03:12, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=23dee252daf2ff60e521c9c019e64134b63ce90f > I am not sure this is related, pkgbase builder are now failing with: ld: error: undefined symbol: gfx_state >>> referenced by gfx_bios.c >>> gfx_bios.o:(bi_load_vbe_data) >>> referenced by vidconsole.c:1065 >>> (/home/pkgbuild/worktrees/main/stand/i386/libi386/vidconsole.c:1065) >>> vidconsole.o:(vidc_putchar) in archive >>> /home/pkgbuild/obj/home/pkgbuild/worktrees/main/amd64.amd64/stand/i386/libi386/libi386.a Best regards, Bapt From nobody Mon Oct 28 12:05:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcXCJ4qWxz5bGXH; Mon, 28 Oct 2024 12:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcXCJ4Xbnz4RTx; Mon, 28 Oct 2024 12:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730117132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yxfTfqPPjLQig+D6h22za/OqUOVBWnuR2IDFsVj70I=; b=I62fYJT9XdE32EfMCnMqP4RyJ6V8IAk8J95qXiFYjC3D0ygEMxIWUVmRH33wel6u1sON9L MzXcUdIzz3qpHutb0oT8PCj4fPHarQXlSeWWNzAzXX/nT161JGNdo6LbM4wbtLLzIWNOvX eB0Sl2V9/aALHACTVikrUAD8O0SozIJaghWSfSXO7WLTkC04cV8UcIaXLsujAVYm24Ur/s jMWG7wvi1CONiLLlOgOfHZRhwadEqWXjEE3azONpxhjyAT385Wbll6eNX3E1Lr3Zsx1XV4 jsrWLHe3qrrUbtmsbkiddRc41Ay6za+JMYeMbklG/QbEd0QMIs5E+sD8QzFoBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730117132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yxfTfqPPjLQig+D6h22za/OqUOVBWnuR2IDFsVj70I=; b=kFx6kj9g0dRld7lIUpaaBKPDF1w2NifJZ+jispMTsiccHXM/3fyAgHwDRfZ1MjTpa0qbLl LP2vfRnULzObon55fIyf+hzc3zbBD8mzEkRFN+hsOHlU+z82Dk4vuSwbEn9iHDGTpCemUT 43zS66q3zQ6lN3ArEjAHOcZzEIdgzD+zHX654dru2nB8tckqI2QwBr0n3IhH3aT0boV221 5bmFukQP8PBotMoJFC2ZCi/HOMOowsXNBnl5WjJl40E6rDYHpMI7FqvLbn2YBBec7epp3r EV4yCaboPF1emr8q7WR+zGb7CIt0QCU8sftqb4EzUoC2dYLIWamXfKyaFpsMKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730117132; a=rsa-sha256; cv=none; b=X/b6wO7AnQZ7Bt8Y5UmHbi8TxAbXDAk47lnl0cjejPouIpDMcwTMVEP/jEsvg407GmG5qa ZvLSyEKHD30cNkNvQmEo/4PMCkiGaI2A6HAhG23d442rFRoUWgU4/CHd3kWr0IbCdAD8Lc XxmP1aDaI3s0SynVHMfgwTtl8ouFDJWJtb6zSXcGwRKsVH6Vfh0X5FUkQrZcrxXmj96dPH 0BYnbDdFZzxcCZFHbSpRuwrq+Fo0OzQJAnRRP35KbUOPukAGKKdLzHvzkUf3ZBTZ/WpTvT 7hzqiq5gEf9HPloOYoe21hMGE1UPmwqy0WUax+I+DKqwGCRQbd0NxEy5ZSMgFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcXCJ41Yszf5J; Mon, 28 Oct 2024 12:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SC5WDA000358; Mon, 28 Oct 2024 12:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SC5W4a000355; Mon, 28 Oct 2024 12:05:32 GMT (envelope-from git) Date: Mon, 28 Oct 2024 12:05:32 GMT Message-Id: <202410281205.49SC5W4a000355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ac1d519c01ca - main - LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac1d519c01ca8beb59f27962c7052d09a03f72c8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ac1d519c01ca8beb59f27962c7052d09a03f72c8 commit ac1d519c01ca8beb59f27962c7052d09a03f72c8 Author: Bjoern A. Zeeb AuthorDate: 2024-10-28 12:02:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 12:05:06 +0000 LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 Bring ing the LinuxKPI 802.11 compat bits which are not altering the mac80211 ops KPI. * Add various functions for drvier updates. * Add functions (some compat code to I assume cleanup some mac80211 ops) emulating chanctx changes doing (*config) updates. * Adjust structs and defines. * Deal with an enum growing more than 32 bits in printf. * Add a mtx to struct wiphy which is exposed to the drivers. Handle initialization and destruction for now. * Implementation of wiphy_work and wiphy_delayed_work. * Set was_assoc for deassoc/deauth in prep_tx_info. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- .../linuxkpi/common/include/linux/ieee80211.h | 43 +++- sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/cfg80211.h | 250 +++++++++++++++++++-- sys/compat/linuxkpi/common/include/net/mac80211.h | 173 +++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.c | 202 ++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 19 +- 6 files changed, 635 insertions(+), 53 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index ce6a18f798d1..865d85c6f7b7 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -42,8 +42,8 @@ extern int linuxkpi_debug_80211; #ifndef D80211_TODO #define D80211_TODO 0x1 #endif -#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ - printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) +#define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) /* 9.4.2.55 Management MIC element (CMAC-256, GMAC-128, and GMAC-256). */ @@ -138,16 +138,18 @@ enum wlan_ht_cap_sm_ps { #define WLAN_PMKID_LEN 16 #define WLAN_PMK_LEN_SUITE_B_192 48 -#define WLAN_KEY_LEN_WEP40 5 -#define WLAN_KEY_LEN_WEP104 13 -#define WLAN_KEY_LEN_TKIP 32 -#define WLAN_KEY_LEN_CCMP 16 -#define WLAN_KEY_LEN_GCMP 16 -#define WLAN_KEY_LEN_AES_CMAC 16 -#define WLAN_KEY_LEN_GCMP_256 32 -#define WLAN_KEY_LEN_BIP_CMAC_256 32 -#define WLAN_KEY_LEN_BIP_GMAC_128 16 -#define WLAN_KEY_LEN_BIP_GMAC_256 32 +enum ieee80211_key_len { + WLAN_KEY_LEN_WEP40 = 5, + WLAN_KEY_LEN_WEP104 = 13, + WLAN_KEY_LEN_TKIP = 32, + WLAN_KEY_LEN_CCMP = 16, + WLAN_KEY_LEN_GCMP = 16, + WLAN_KEY_LEN_AES_CMAC = 16, + WLAN_KEY_LEN_GCMP_256 = 32, + WLAN_KEY_LEN_BIP_CMAC_256 = 32, + WLAN_KEY_LEN_BIP_GMAC_128 = 16, + WLAN_KEY_LEN_BIP_GMAC_256 = 32, +}; /* 802.11-2020, 9.4.2.55.3, Table 9-185 Subfields of the A-MPDU Parameters field */ enum ieee80211_min_mpdu_start_spacing { @@ -483,9 +485,14 @@ enum ieee80211_back { WLAN_ACTION_ADDBA_REQ = 0, }; +enum ieee80211_sa_query { + WLAN_ACTION_SA_QUERY_RESPONSE = 1, +}; + /* 802.11-2020, Table 9-51-Category values */ enum ieee80211_category { WLAN_CATEGORY_BACK = 3, + WLAN_CATEGORY_SA_QUERY = 8, /* net80211::IEEE80211_ACTION_CAT_SA_QUERY */ }; /* 80211-2020 9.3.3.2 Format of Management frames */ @@ -601,6 +608,7 @@ enum ieee80211_eid { WLAN_EID_TIM = 5, WLAN_EID_COUNTRY = 7, /* IEEE80211_ELEMID_COUNTRY */ WLAN_EID_REQUEST = 10, + WLAN_EID_QBSS_LOAD = 11, /* IEEE80211_ELEMID_BSSLOAD */ WLAN_EID_CHANNEL_SWITCH = 37, WLAN_EID_MEASURE_REPORT = 39, WLAN_EID_HT_CAPABILITY = 45, /* IEEE80211_ELEMID_HTCAP */ @@ -612,6 +620,7 @@ enum ieee80211_eid { WLAN_EID_MULTI_BSSID_IDX = 85, WLAN_EID_EXT_CAPABILITY = 127, WLAN_EID_VHT_CAPABILITY = 191, /* IEEE80211_ELEMID_VHT_CAP */ + WLAN_EID_S1G_TWT = 216, WLAN_EID_VENDOR_SPECIFIC = 221, /* IEEE80211_ELEMID_VENDOR */ }; @@ -760,6 +769,16 @@ enum ieee80211_tx_pwr_interpretation_subfield_enc { IEEE80211_TPE_REG_CLIENT_EIRP_PSD, }; +enum ieee80211_tx_pwr_category_6ghz { + IEEE80211_TPE_CAT_6GHZ_DEFAULT, +}; + +/* 802.11-2020, 9.4.2.27 BSS Load element */ +struct ieee80211_bss_load_elem { + uint16_t sta_count; + uint8_t channel_util; + uint16_t avail_adm_capa; +}; /* net80211: IEEE80211_IS_CTL() */ static __inline bool diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 6916957731e2..254ed6e13f5c 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -84,6 +84,7 @@ enum nl80211_reg_rule_flags { NL80211_RRF_NO_6GHZ_VLP_CLIENT = BIT(14), NL80211_RRF_NO_6GHZ_AFC_CLIENT = BIT(15), NL80211_RRF_PSD = BIT(16), + NL80211_RRF_ALLOW_6GHZ_VLP_AP = BIT(17), }; #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS|NL80211_RRF_NO_HT40PLUS) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 7e57ce67cc26..f489e7a7da11 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include /* linux_80211.c */ @@ -49,8 +51,8 @@ extern int linuxkpi_debug_80211; #ifndef D80211_IMPROVE #define D80211_IMPROVE 0x2 #endif -#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ - printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) +#define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) #define IMPROVE(...) if (linuxkpi_debug_80211 & D80211_IMPROVE) \ printf("%s:%d: XXX LKPI80211 IMPROVE\n", __func__, __LINE__) @@ -106,6 +108,11 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_NO_80MHZ = BIT(7), IEEE80211_CHAN_NO_160MHZ = BIT(8), IEEE80211_CHAN_NO_OFDM = BIT(9), + IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = BIT(10), + IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = BIT(11), + IEEE80211_CHAN_PSD = BIT(12), + IEEE80211_CHAN_ALLOW_6GHZ_VLP_AP = BIT(13), + IEEE80211_CHAN_CAN_MONITOR = BIT(14), }; #define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS) @@ -275,6 +282,9 @@ struct cfg80211_bss_ies { struct cfg80211_bss { /* XXX TODO */ struct cfg80211_bss_ies *ies; + struct cfg80211_bss_ies *beacon_ies; + + int32_t signal; }; struct cfg80211_chan_def { @@ -283,6 +293,7 @@ struct cfg80211_chan_def { enum nl80211_chan_width width; uint32_t center_freq1; uint32_t center_freq2; + uint16_t punctured; }; struct cfg80211_ftm_responder_stats { @@ -378,11 +389,16 @@ struct cfg80211_match_set { struct cfg80211_scan_request { /* XXX TODO */ - int duration, duration_mandatory, flags; bool no_cck; bool scan_6ghz; + bool duration_mandatory; + int8_t tsf_report_link_id; + uint16_t duration; + uint32_t flags; struct wireless_dev *wdev; struct wiphy *wiphy; + uint64_t scan_start; + uint32_t rates[NUM_NL80211_BANDS]; int ie_len; uint8_t *ie; uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; @@ -774,6 +790,7 @@ struct linuxkpi_ieee80211_regdomain { #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 0x05 #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 0x06 #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991 0x07 +#define IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC 0x08 #define IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK 0x01 @@ -895,16 +912,26 @@ struct ieee80211_sta_he_6ghz_capa { }; struct ieee80211_eht_mcs_nss_supp_20mhz_only { - uint8_t rx_tx_mcs7_max_nss; - uint8_t rx_tx_mcs9_max_nss; - uint8_t rx_tx_mcs11_max_nss; - uint8_t rx_tx_mcs13_max_nss; + union { + struct { + uint8_t rx_tx_mcs7_max_nss; + uint8_t rx_tx_mcs9_max_nss; + uint8_t rx_tx_mcs11_max_nss; + uint8_t rx_tx_mcs13_max_nss; + }; + uint8_t rx_tx_max_nss[4]; + }; }; struct ieee80211_eht_mcs_nss_supp_bw { - uint8_t rx_tx_mcs9_max_nss; - uint8_t rx_tx_mcs11_max_nss; - uint8_t rx_tx_mcs13_max_nss; + union { + struct { + uint8_t rx_tx_mcs9_max_nss; + uint8_t rx_tx_mcs11_max_nss; + uint8_t rx_tx_mcs13_max_nss; + }; + uint8_t rx_tx_max_nss[3]; + }; }; struct ieee80211_eht_cap_elem_fixed { @@ -1096,7 +1123,7 @@ struct wiphy_iftype_ext_capab { const uint8_t *extended_capabilities_mask; uint8_t extended_capabilities_len; uint16_t eml_capabilities; - + uint16_t mld_capa_and_ops; }; struct tid_config_support { @@ -1133,10 +1160,23 @@ enum wiphy_flags { WIPHY_FLAG_4ADDR_AP = BIT(14), WIPHY_FLAG_4ADDR_STATION = BIT(15), WIPHY_FLAG_SUPPORTS_MLO = BIT(16), + WIPHY_FLAG_DISABLE_WEXT = BIT(17), }; -struct wiphy { +struct wiphy_work; +typedef void (*wiphy_work_fn)(struct wiphy *, struct wiphy_work *); +struct wiphy_work { + struct list_head entry; + wiphy_work_fn fn; +}; +struct wiphy_delayed_work { + struct wiphy_work work; + struct wiphy *wiphy; + struct timer_list timer; +}; +struct wiphy { + struct mutex mtx; struct device *dev; struct mac_address *addresses; int n_addresses; @@ -1185,6 +1225,9 @@ struct wiphy { uint8_t priv[0] __aligned(CACHE_LINE_SIZE); }; +#define lockdep_assert_wiphy(wiphy) \ + lockdep_assert_held(&(wiphy)->mtx) + struct wireless_dev { /* XXX TODO, like ic? */ int iftype; @@ -1249,6 +1292,15 @@ struct cfg80211_ops { struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t); void linuxkpi_wiphy_free(struct wiphy *wiphy); +void linuxkpi_wiphy_work_queue(struct wiphy *, struct wiphy_work *); +void linuxkpi_wiphy_work_cancel(struct wiphy *, struct wiphy_work *); +void linuxkpi_wiphy_work_flush(struct wiphy *, struct wiphy_work *); +void lkpi_wiphy_delayed_work_timer(struct timer_list *); +void linuxkpi_wiphy_delayed_work_queue(struct wiphy *, + struct wiphy_delayed_work *, unsigned long); +void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *, + struct wiphy_delayed_work *); + int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, struct linuxkpi_ieee80211_regdomain *regd); uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); @@ -1300,16 +1352,8 @@ wiphy_dev(struct wiphy *wiphy) return (wiphy->dev); } -#define wiphy_err(_wiphy, _fmt, ...) \ - dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) - -static __inline const struct linuxkpi_ieee80211_regdomain * -wiphy_dereference(struct wiphy *wiphy, - const struct linuxkpi_ieee80211_regdomain *regd) -{ - TODO(); - return (NULL); -} +#define wiphy_dereference(wiphy, p) \ + rcu_dereference_check(p, lockdep_is_held(&(wiphy)->mtx)) static __inline void wiphy_lock(struct wiphy *wiphy) @@ -1661,6 +1705,12 @@ wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) set_bit(ef, wiphy->ext_features); } +static inline bool +wiphy_ext_feature_isset(struct wiphy *wiphy, enum nl80211_ext_feature ef) +{ + return (test_bit(ef, wiphy->ext_features)); +} + static __inline void * wiphy_net(struct wiphy *wiphy) { @@ -1984,6 +2034,44 @@ cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) return (false); } +static __inline bool +cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) +{ + TODO(); + return (false); +} + +static __inline unsigned int +cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) +{ + TODO(); + return (0); +} + +static inline void +_ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *band, + struct ieee80211_sband_iftype_data *iftype_data, size_t nitems) +{ + band->iftype_data = iftype_data; + band->n_iftype_data = nitems; +} + +static inline const struct ieee80211_sband_iftype_data * +ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *band, + enum nl80211_iftype iftype) +{ + const struct ieee80211_sband_iftype_data *iftype_data; + int i; + + for (i = 0; i < band->n_iftype_data; i++) { + iftype_data = (const void *)&band->iftype_data[i]; + if (iftype_data->types_mask & BIT(iftype)) + return (iftype_data); + } + + return (NULL); +} + static __inline const struct ieee80211_sta_eht_cap * ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, enum nl80211_iftype iftype) @@ -1992,8 +2080,122 @@ ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, return (NULL); } +static inline bool +cfg80211_ssid_eq(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2) +{ + int error; + + if (ssid1 == NULL || ssid2 == NULL) /* Can we KASSERT this? */ + return (false); + + if (ssid1->ssid_len != ssid2->ssid_len) + return (false); + error = memcmp(ssid1->ssid, ssid2->ssid, ssid2->ssid_len); + if (error != 0) + return (false); + return (true); +} + +static inline void +cfg80211_rx_unprot_mlme_mgmt(struct net_device *ndev, const uint8_t *hdr, + uint32_t len) +{ + TODO(); +} + +static inline const struct wiphy_iftype_ext_capab * +cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype iftype) +{ + + TODO(); + return (NULL); +} + +static inline int +nl80211_chan_width_to_mhz(enum nl80211_chan_width width) +{ + switch (width) { + case NL80211_CHAN_WIDTH_5: + return (5); + break; + case NL80211_CHAN_WIDTH_10: + return (10); + break; + case NL80211_CHAN_WIDTH_20_NOHT: + case NL80211_CHAN_WIDTH_20: + return (20); + break; + case NL80211_CHAN_WIDTH_40: + return (40); + break; + case NL80211_CHAN_WIDTH_80: + case NL80211_CHAN_WIDTH_80P80: + return (80); + break; + case NL80211_CHAN_WIDTH_160: + return (160); + break; + case NL80211_CHAN_WIDTH_320: + return (320); + break; + } +} + +/* -------------------------------------------------------------------------- */ + +static inline void +wiphy_work_init(struct wiphy_work *wwk, wiphy_work_fn fn) +{ + INIT_LIST_HEAD(&wwk->entry); + wwk->fn = fn; +} + +static inline void +wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_queue(wiphy, wwk); +} + +static inline void +wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_cancel(wiphy, wwk); +} + +static inline void +wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_flush(wiphy, wwk); +} + +static inline void +wiphy_delayed_work_init(struct wiphy_delayed_work *wdwk, wiphy_work_fn fn) +{ + wiphy_work_init(&wdwk->work, fn); + timer_setup(&wdwk->timer, lkpi_wiphy_delayed_work_timer, 0); +} + +static inline void +wiphy_delayed_work_queue(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk, + unsigned long delay) +{ + linuxkpi_wiphy_delayed_work_queue(wiphy, wdwk, delay); +} + +static inline void +wiphy_delayed_work_cancel(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk) +{ + linuxkpi_wiphy_delayed_work_cancel(wiphy, wdwk); +} + +/* -------------------------------------------------------------------------- */ + +#define wiphy_err(_wiphy, _fmt, ...) \ + dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) #define wiphy_info(wiphy, fmt, ...) \ - printf("%s:%d XXX TODO " fmt, __func__, __LINE__, __VA_ARGS__) + dev_info(&(wiphy)->dev, fmt, ##__VA_ARGS__) +#define wiphy_info_once(wiphy, fmt, ...) \ + dev_info_once(&(wiphy)->dev, fmt, ##__VA_ARGS__) #ifndef LINUXKPI_NET80211 #define ieee80211_channel linuxkpi_ieee80211_channel diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index c3b07b68090a..6dbf07c85bb8 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -83,6 +83,7 @@ enum mcast_filter_flags { FIF_OTHER_BSS = BIT(4), FIF_PSPOLL = BIT(5), FIF_CONTROL = BIT(6), + FIF_MCAST_ACTION = BIT(7), }; enum ieee80211_bss_changed { @@ -117,6 +118,9 @@ enum ieee80211_bss_changed { BSS_CHANGED_TWT = BIT(28), BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT(30), BSS_CHANGED_EHT_PUNCTURING = BIT(31), + BSS_CHANGED_MLD_VALID_LINKS = BIT_ULL(32), + BSS_CHANGED_MLD_TTLM = BIT_ULL(33), + BSS_CHANGED_TPE = BIT_ULL(34), }; /* 802.11 Figure 9-256 Suite selector format. [OUI(3), SUITE TYPE(1)] */ @@ -167,13 +171,24 @@ enum ieee80211_bss_changed { #define TKIP_PN_TO_IV16(_x) ((uint16_t)(_x & 0xffff)) #define TKIP_PN_TO_IV32(_x) ((uint32_t)((_x >> 16) & 0xffffffff)) -struct ieee80211_sta; +enum ieee80211_neg_ttlm_res { + NEG_TTLM_RES_ACCEPT, + NEG_TTLM_RES_REJECT, +}; + +#define IEEE80211_TTLM_NUM_TIDS 8 +struct ieee80211_neg_ttlm { + uint16_t downlink[IEEE80211_TTLM_NUM_TIDS]; + uint16_t uplink[IEEE80211_TTLM_NUM_TIDS]; +}; /* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */ #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x3 #define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2 #define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT) +struct ieee80211_sta; + struct ieee80211_ampdu_params { struct ieee80211_sta *sta; enum ieee80211_ampdu_mlme_action action; @@ -217,11 +232,13 @@ struct mac80211_fils_discovery { }; struct ieee80211_chanctx_conf { - /* TODO FIXME */ - int rx_chains_dynamic, rx_chains_static; - bool radar_enabled; struct cfg80211_chan_def def; struct cfg80211_chan_def min_def; + struct cfg80211_chan_def ap; + + uint8_t rx_chains_dynamic; + uint8_t rx_chains_static; + bool radar_enabled; /* Must stay last. */ uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); @@ -240,12 +257,39 @@ struct ieee80211_ema_beacons { } bcn[0]; }; +struct ieee80211_chanreq { + struct cfg80211_chan_def oper; +}; + #define WLAN_MEMBERSHIP_LEN (8) #define WLAN_USER_POSITION_LEN (16) +/* + * 802.11ac-2013, 8.4.2.164 VHT Transmit Power Envelope element + * 802.11-???? ? + */ +struct ieee80211_parsed_tpe_eirp { + int8_t power[5]; + uint8_t count; + bool valid; +}; +struct ieee80211_parsed_tpe_psd { + int8_t power[16]; + uint8_t count; + bool valid; +}; +struct ieee80211_parsed_tpe { + /* We see access to [0] so assume at least 2. */ + struct ieee80211_parsed_tpe_eirp max_local[2]; + struct ieee80211_parsed_tpe_eirp max_reg_client[2]; + struct ieee80211_parsed_tpe_psd psd_local[2]; + struct ieee80211_parsed_tpe_psd psd_reg_client[2]; +}; + struct ieee80211_bss_conf { /* TODO FIXME */ struct ieee80211_vif *vif; + struct cfg80211_bss *bss; const uint8_t *bssid; uint8_t addr[ETH_ALEN]; uint8_t link_id; @@ -308,6 +352,7 @@ struct ieee80211_bss_conf { struct mac80211_fils_discovery fils_discovery; struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_vif *mbssid_tx_vif; + struct ieee80211_parsed_tpe tpe; int ack_enabled, bssid_index, bssid_indicator, cqm_rssi_hyst, cqm_rssi_thold, ema_ap, frame_time_rts_th, ftm_responder; int htc_trig_based_pkt_ext; @@ -322,6 +367,7 @@ struct ieee80211_bss_conf { struct ieee80211_channel_switch { /* TODO FIXME */ int block_tx, count, delay, device_timestamp, timestamp; + uint8_t link_id; struct cfg80211_chan_def chandef; }; @@ -444,6 +490,10 @@ enum ieee80211_hw_flags { IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, IEEE80211_HW_SUPPORTS_RC_TABLE, IEEE80211_HW_DETECTS_COLOR_COLLISION, + IEEE80211_HW_DISALLOW_PUNCTURING, + IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ, + IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN, + IEEE80211_HW_HANDLES_QUIET_CSA, /* Keep last. */ NUM_IEEE80211_HW_FLAGS @@ -500,6 +550,7 @@ enum ieee802111_key_flag { IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(6), IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(7), IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(8), + IEEE80211_KEY_FLAG_SPP_AMSDU = BIT(9), }; struct ieee80211_key_conf { @@ -569,6 +620,9 @@ enum ieee80211_rx_status_flags { RX_FLAG_SKIP_MONITOR = BIT(26), RX_FLAG_8023 = BIT(27), RX_FLAG_RADIOTAP_TLV_AT_END = BIT(28), + RX_FLAG_MACTIME = BIT(29), + RX_FLAG_MACTIME_IS_RTAP_TS64 = BIT(30), + RX_FLAG_FAILED_PLCP_CRC = BIT(31), }; enum mac80211_rx_encoding { @@ -742,7 +796,9 @@ enum ieee80211_vif_driver_flags { IEEE80211_VIF_BEACON_FILTER = BIT(0), IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), - IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), + IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), /* Renamed to IEEE80211_VIF_EML_ACTIVE. */ + IEEE80211_VIF_EML_ACTIVE = BIT(4), + IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW = BIT(5), }; #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 @@ -799,6 +855,8 @@ struct ieee80211_vif_chanctx_switch { struct ieee80211_prep_tx_info { u16 duration; bool success; + bool was_assoc; + int link_id; }; /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */ @@ -813,6 +871,7 @@ struct ieee80211_tx_info { struct { struct ieee80211_tx_rate rates[4]; bool use_rts; + uint8_t antennas:2; struct ieee80211_vif *vif; struct ieee80211_key_conf *hw_key; enum ieee80211_tx_control_flags flags; @@ -1044,6 +1103,8 @@ struct ieee80211_ops { int (*change_vif_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16, u16, struct ieee80211_bss_conf *[IEEE80211_MLD_MAX_NUM_LINKS]); int (*change_sta_links)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u16, u16); + bool (*can_activate_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16); + enum ieee80211_neg_ttlm_res (*can_neg_ttlm)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_neg_ttlm *); /* #ifdef CONFIG_MAC80211_DEBUGFS */ /* Do not change depending on compile-time option. */ void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *); @@ -2052,7 +2113,6 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) static __inline void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) { - linuxkpi_ieee80211_tx_status(hw, skb); } @@ -2060,14 +2120,14 @@ static __inline void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) { IMPROVE(); - ieee80211_tx_status(hw, skb); + linuxkpi_ieee80211_tx_status(hw, skb); } static __inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb) { IMPROVE(); - ieee80211_tx_status(hw, skb); + linuxkpi_ieee80211_tx_status(hw, skb); } static __inline void @@ -2370,7 +2430,102 @@ ieee80211_get_eht_iftype_cap_vif(const struct ieee80211_supported_band *band, return (NULL); } +static inline uint32_t +ieee80211_vif_usable_links(const struct ieee80211_vif *vif) +{ + TODO(); + return (1); +} + +static inline bool +ieee80211_vif_link_active(const struct ieee80211_vif *vif, uint8_t link_id) +{ + if (ieee80211_vif_is_mld(vif)) + return (vif->active_links & BIT(link_id)); + return (link_id == 0); +} + +static inline void +ieee80211_set_active_links_async(struct ieee80211_vif *vif, + uint32_t new_active_links) +{ + TODO(); +} + +static inline int +ieee80211_set_active_links(struct ieee80211_vif *vif, + uint32_t active_links) +{ + TODO(); + return (-ENXIO); +} + +static inline void +ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp __unused) +{ + IMPROVE("we notify user space by a vap state change eventually"); + linuxkpi_ieee80211_beacon_loss(vif); +} + #define ieee80211_send_bar(_v, _r, _t, _s) \ linuxkpi_ieee80211_send_bar(_v, _r, _t, _s) +/* -------------------------------------------------------------------------- */ + +int lkpi_80211_update_chandef(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *); + +static inline int +ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf) +{ + int error; + + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + +static inline void +ieee80211_emulate_remove_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf __unused) +{ + hw->conf.radar_enabled = false; + lkpi_80211_update_chandef(hw, NULL); +} + +static inline void +ieee80211_emulate_change_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, uint32_t changed __unused) +{ + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + lkpi_80211_update_chandef(hw, chanctx_conf); +} + +static inline int +ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, + struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, + enum ieee80211_chanctx_switch_mode mode __unused) +{ + struct ieee80211_chanctx_conf *chanctx_conf; + int error; + + /* Sanity check. */ + if (n_vifs <= 0) + return (-EINVAL); + if (vifs == NULL || vifs[0].new_ctx == NULL) + return (-EINVAL); + + /* + * What to do if n_vifs > 1? + * Does that make sense for drivers not supporting chanctx? + */ + hw->conf.radar_enabled = vifs[0].new_ctx->radar_enabled; + chanctx_conf = vifs[0].new_ctx; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + +/* -------------------------------------------------------------------------- */ + #endif /* _LINUXKPI_NET_MAC80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4171f0789977..9e4c368617b6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -895,14 +895,14 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, if (linuxkpi_debug_80211 & D80211_TRACE) printf("%s:%d [%s:%d] assoc %d aid %d beacon_int %u " "dtim_period %u sync_dtim_count %u sync_tsf %ju " - "sync_device_ts %u bss_changed %#08x\n", + "sync_device_ts %u bss_changed %#010jx\n", __func__, __LINE__, _f, _l, vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, vif->bss_conf.sync_device_ts, - bss_changed); + (uintmax_t)bss_changed); #endif if (vif->bss_conf.beacon_int != ni->ni_intval) { @@ -926,14 +926,14 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, if (linuxkpi_debug_80211 & D80211_TRACE) printf("%s:%d [%s:%d] assoc %d aid %d beacon_int %u " "dtim_period %u sync_dtim_count %u sync_tsf %ju " - "sync_device_ts %u bss_changed %#08x\n", + "sync_device_ts %u bss_changed %#010jx\n", __func__, __LINE__, _f, _l, vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, vif->bss_conf.sync_device_ts, - bss_changed); + (uintmax_t)bss_changed); #endif return (bss_changed); @@ -1775,6 +1775,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -1809,6 +1810,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -2162,6 +2164,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -2196,6 +2199,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -2300,6 +2304,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -2334,6 +2339,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -5331,18 +5337,158 @@ linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *hdr, bool nonqos_ok) return (tid); } +/* -------------------------------------------------------------------------- */ + +static void +lkpi_wiphy_work(struct work_struct *work) +{ + struct lkpi_wiphy *lwiphy; + struct wiphy *wiphy; + struct wiphy_work *wk; + + lwiphy = container_of(work, struct lkpi_wiphy, wwk); + wiphy = LWIPHY_TO_WIPHY(lwiphy); + + wiphy_lock(wiphy); + + LKPI_80211_LWIPHY_WORK_LOCK(lwiphy); + wk = list_first_entry_or_null(&lwiphy->wwk_list, struct wiphy_work, entry); + /* If there is nothing we do nothing. */ + if (wk == NULL) { + LKPI_80211_LWIPHY_WORK_UNLOCK(lwiphy); + wiphy_unlock(wiphy); + return; + } + list_del_init(&wk->entry); + + /* More work to do? */ + if (!list_empty(&lwiphy->wwk_list)) + schedule_work(work); + LKPI_80211_LWIPHY_WORK_UNLOCK(lwiphy); + + /* Finally call the (*wiphy_work_fn)() function. */ + wk->fn(wiphy, wk); + + wiphy_unlock(wiphy); +} + +void +linuxkpi_wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + struct lkpi_wiphy *lwiphy; + + lwiphy = WIPHY_TO_LWIPHY(wiphy); + + LKPI_80211_LWIPHY_WORK_LOCK(lwiphy); + /* Do not double-queue. */ + if (list_empty(&wwk->entry)) *** 212 LINES SKIPPED *** From nobody Mon Oct 28 12:22:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcXZq1F9Rz5bHdJ for ; Mon, 28 Oct 2024 12:22:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 4XcXZp3Njlz4StF for ; Mon, 28 Oct 2024 12:22:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7edb3f93369so2544028a12.1 for ; Mon, 28 Oct 2024 05:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1730118145; x=1730722945; 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=5fKJ5Nwb/QrM7JnuU8+zWI2YIn1/SIUsOyuYrVkCkII=; b=NK6LEYB3e1qv0qBaVK40OE9LDJNPtVVG4DHf7THXuontOJ2veAgHzoLtB4YiD17GaB uzX41nSstKix9talj0eMWESReymwNRTiLmmbPhg76YcNoD5l0SD8lEv7DgGreSMt21ie 5rZHfwLqOnctgJt1qQUHFwNqYk9jTj5011jIiQNmyEw23F1n1B4VKHtAygC3g9vjdCD5 lLREbz/0byz4UkdE8InBAxfDCOjBTA0m0C/0iBGe3XAxZLRx4wgD5+BKTPPoEvAaYwjH la1zuqk2xMSPY1NlhGLzTqwi4bl5KK0Cqvjl2Qn3ruJ7XPebQORTWJTxZY2uHOeUxwAy ChkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730118145; x=1730722945; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5fKJ5Nwb/QrM7JnuU8+zWI2YIn1/SIUsOyuYrVkCkII=; b=iEBTTxaJeICnchKuLC1t9MioDIsW+DWCKq4GrbsjJsc9egFcwnPI0aZz9D6WtiGi4a UF8ye+oCuO62E0xxvt3duSrqgwVGP+auIVFEvEm/BJBDpNUjzb6rYkHSaFC3lwrHuWGD K13yOiyyHWGQgZugJ5iVEMqQlK1+mtswW9pXGBeGg4+AGIKLRX1iaLl/07ReiOzjIdjm tyjFSZEl5Kbqr7QUWp5GUOlfDZ/owXlESd9tvdXguStu8eCv1d9htKMZiRlwyI431h+R J1RLWh7Gfto8JKDXXkDD4cQAUL6x6t8EatIpq2eDxIIgg2tzxKdGWQQ1NrkjbgwjCUsS Bwwg== X-Forwarded-Encrypted: i=1; AJvYcCUjHtk8H/AnJ1qW7GsgGjEe8Y6IZmvI8Sj6wINvXR5elWKvpikAhC7b2f2AIFPBBhX7umeoe8ajyEF6OtorIQD4uTiT@freebsd.org X-Gm-Message-State: AOJu0Ywelz7V2Q5QeD6Su0rlItF4hBGLtRBF1xo4Jyi1slyeC7FNp0yP HRW/YWsCV/VmaDIykrn9rSr7nKoaVt+tAWH4sNAQNfdobEWnA5/nhgubr28vGYNwCtTZPgIE+ap SEx6MAZt7wHLbqgvFq8xU9L9KsGDdljLW8aHzVw== X-Google-Smtp-Source: AGHT+IEhlsEUOWiut88Gc4NyQvJz4J64esdbD625zjRq19pmZTviOnIg3SoSsKdS+2d/z6L60fsJg3ACKmSgi4yPKJE= X-Received: by 2002:a05:6a21:2d85:b0:1d9:2bed:c7d8 with SMTP id adf61e73a8af0-1d9a85053b0mr10838407637.43.1730118145220; Mon, 28 Oct 2024 05:22:25 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202410250312.49P3C6AH005000@gitrepo.freebsd.org> <5xlrksb3pagvnhqoisbak4iyzeffry6eocjpj5jda663boxrgw@b2dn52brqptl> In-Reply-To: <5xlrksb3pagvnhqoisbak4iyzeffry6eocjpj5jda663boxrgw@b2dn52brqptl> From: Warner Losh Date: Mon, 28 Oct 2024 06:22:13 -0600 Message-ID: Subject: Re: git: 23dee252daf2 - main - loader: Change this BIOS tradeoff: Add back zip and use text only To: Baptiste Daroussin Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="0000000000007741f80625888596" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XcXZp3Njlz4StF X-Spamd-Bar: ---- --0000000000007741f80625888596 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Oct 28, 2024, 4:36=E2=80=AFAM Baptiste Daroussin = wrote: > On Fri 25 Oct 03:12, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D23dee252daf2ff60e521c9c019e6413= 4b63ce90f > > > > I am not sure this is related, pkgbase builder are now failing with: > > ld: error: undefined symbol: gfx_state > >>> referenced by gfx_bios.c > >>> gfx_bios.o:(bi_load_vbe_data) > >>> referenced by vidconsole.c:1065 > >>> (/home/pkgbuild/worktrees/main/stand/i386/libi386/vidconsole.c:1065) > >>> vidconsole.o:(vidc_putchar) in archive > >>> > /home/pkgbuild/obj/home/pkgbuild/worktrees/main/amd64.amd64/stand/i386/l= ibi386/libi386.a > Might be a no clean, non meta mode issue since this is only a command line change. Though vidconsole shouldn't be reference to be pulled from the library. Warner Best regards, > Bapt > --0000000000007741f80625888596 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Oct 28, 2024, 4:36=E2=80=AFAM Baptiste Darouss= in <bapt@freebsd.org> wrote:<= br>
On Fri 25 Oct 03:12, Warner Losh wr= ote:
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D23dee252daf2ff60e521c9c019e641= 34b63ce90f
>

I am not sure this is related, pkgbase builder are now failing with:

ld: error: undefined symbol: gfx_state
>>> referenced by gfx_bios.c
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gfx_bios= .o:(bi_load_vbe_data)
>>> referenced by vidconsole.c:1065
>>> (/home/pkgbuild/worktrees/main/stand/i386/libi386/vidconsole.c= :1065)
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vidconso= le.o:(vidc_putchar) in archive
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/home/pk= gbuild/obj/home/pkgbuild/worktrees/main/amd64.amd64/stand/i386/libi386/libi= 386.a

Might be a no clean, non meta mode issue since this is only a command = line change. Though vidconsole shouldn't be reference to be pulled from= the library.

Warner

=
Best regards,
Bapt
--0000000000007741f80625888596-- From nobody Mon Oct 28 12:33:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcXqk65T6z5bJ3S; Mon, 28 Oct 2024 12:33:38 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcXqk5ZgZz4Trd; Mon, 28 Oct 2024 12:33:38 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730118818; 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=zyKPKUhYz4JfHrk+pphfgLkXHPTqVTfTAr+rpKLM440=; b=HitWped9qPODcPv/f3AEt3F0q5uEMrgm6Dypbv6/f95HikmIxAj3QdShckeTFrFLfOmPk1 HH4njaaC9q6sXm8lJ7hpSH6CB8J1cJT0gtfAFcWHtOn3pRRpp++isMFC+PL7yJrIQXo84x 0E9gzOtfFOqUaT66AG5R7Pv/GJ+88fwxvm20UE2ukhEuS1/n6NUDs5LhIYdOvi9DFhXvHo YDFfkNcQQrlcXeuruV2kRJ4DNKXHuag9W/sugSwnt6f1Q/jEcLUQiBRukAr6gF3zuky4Lj gTie8U6SNBgnygAgGkd0bMfLviV80NfEYwuv2Ohf3SVXmNG2Z37VgOxOf9cOzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730118818; 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=zyKPKUhYz4JfHrk+pphfgLkXHPTqVTfTAr+rpKLM440=; b=JVcKCDAJbOfCYtK37qG8ww7679d6NOmOiel1rpUapsC2f2aiIEzCDzJtDvASSfl+2pqgw2 oX+BExqDwokIuKnZfN3kmVJBwP63CDA//7Y5mW27l4fOLDgpwBxsLWeYtlmO3kOmF2eY6q ahYWU56YZ1QtqNMUDTcuXz+KKIP6BKZZzmXxHN5oOd8MhP6OtiXp6igXqMzJ3xGF6nZ/OE WFj0+LAn59kyB43s5k2gmzN1lRNaYLZ2SmEF/svQfyKa6RJOM+VsHEOLD7ijsRqtW1rBCv 5KMNCf7Ivm+rr4Wo9a5uxF4AUL5AvqnmjA7LAsKTjID9+SXtuKxuzWLkYKsudQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730118818; a=rsa-sha256; cv=none; b=F2g3XQKohT0Rfa6BojOqCSS04vXAbRIT+DIhe7U6vjj9TN/c6QzTInY4FKo0yBgQLnyMk0 zRbhaXnKHPvsMY6JUT5aZOvJ88nE/Lef8QVHtkjRFOmV+J/K6LTJDDfzAMTYoFp1OZBOWx YDSc3scbI89IMk9qJiMUPbK1+CRP6hagJSuA4TqTSGRJhBuOMgMtWqtA0+tve8cHgtwXcR WcCAQfPCwppOwyyELoX4WdsuB4KB0jseujsMv4DriuzdzlzHXLYZIBKkawBFzMu1dmtT35 WRTr5qH+kV53LcmTDZKBbGdPGMoXX3XAwg3irQBVGQIy0wxj75+4/jgN82sSVg== Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_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: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XcXqk4TNyzG9v; Mon, 28 Oct 2024 12:33:38 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 2F75F1D034B; Mon, 28 Oct 2024 13:33:37 +0100 (CET) Date: Mon, 28 Oct 2024 13:33:37 +0100 From: Baptiste Daroussin To: Warner Losh Cc: Warner Losh , src-committers , "" , "" Subject: Re: git: 23dee252daf2 - main - loader: Change this BIOS tradeoff: Add back zip and use text only Message-ID: References: <202410250312.49P3C6AH005000@gitrepo.freebsd.org> <5xlrksb3pagvnhqoisbak4iyzeffry6eocjpj5jda663boxrgw@b2dn52brqptl> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon 28 Oct 06:22, Warner Losh wrote: > On Mon, Oct 28, 2024, 4:36 AM Baptiste Daroussin wrote: > > > On Fri 25 Oct 03:12, Warner Losh wrote: > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=23dee252daf2ff60e521c9c019e64134b63ce90f > > > > > > > I am not sure this is related, pkgbase builder are now failing with: > > > > ld: error: undefined symbol: gfx_state > > >>> referenced by gfx_bios.c > > >>> gfx_bios.o:(bi_load_vbe_data) > > >>> referenced by vidconsole.c:1065 > > >>> (/home/pkgbuild/worktrees/main/stand/i386/libi386/vidconsole.c:1065) > > >>> vidconsole.o:(vidc_putchar) in archive > > >>> > > /home/pkgbuild/obj/home/pkgbuild/worktrees/main/amd64.amd64/stand/i386/libi386/libi386.a > > > > Might be a no clean, non meta mode issue since this is only a command line > change. Though vidconsole shouldn't be reference to be pulled from the > library. > > Warner > pkgbase building is calling the default make buildworld in incremental way, so yes no clean. Best regards, Bapt From nobody Mon Oct 28 12:46:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcY6D1JDtz5bKGR; Mon, 28 Oct 2024 12:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcY6D0gFJz4YbJ; Mon, 28 Oct 2024 12:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1n+uk7GoCPXbMBOtf9p5UoS+FZ6lG+C7J+OSsDpi/0A=; b=Ubv9nwq5+INrO+/ksf/Yfvmv3CbIm796EIi1uIFL+zPM5wN8IMDeGI4mHplK+b2v8EChnU Y0scrPgAGCkETh1A35iz7C4y2LsD++0w7byOGi2tAB7CqGx8nI/YdzuuU7IZkGi8dPRKsW A1qeMEYSUq0Oqoco4//C6VLPb2N0l96Me3JZ5sU0SUIcr/btNM5K2n0dOfMc0kDbmNDYv/ pRMoOfLnFmNCpw9Bzche4W3hK8Ne1f1t7kAd2riqepbRZwViZDoq7dBEF1sKHSxZYlvqi5 NqjqQh+wezXB1cXy/vQHorFSnngJtnaCDHabAFwJu27PfLwVuNKbJFekErf/Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1n+uk7GoCPXbMBOtf9p5UoS+FZ6lG+C7J+OSsDpi/0A=; b=czak1TqmyP3f9dlnVOiw6RD7FkoFwvJmRoVlWoRS2j/YYWkvYw4VHRSx+4QqwUmYtqin7U BSPZG0kihb5ledkpLg1nsqdnC9uX0qs86MVBCeF9eEl7/ZeM8sPKPcJ5UA9SkMkleS2hzR 51F2uaiDIjkGN2loaHgo9oBGBdrTD6DiDmol4qYmufIeE6vQuDTxfIG8j/zCHe56iKVqg0 0RaWMUZvlDUfUakWyK+mSOTZ9ZjANc7Sury8q1Nj+RewNvOKZoafhDjW6/wAFgsixTaUWP l89fLNNljRJCjQrurAMfYS4xpINW7/Ibk2VQ8YIbHFmh4eeHHdSrjYaCNRm+2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730119572; a=rsa-sha256; cv=none; b=jh70ZSpkyha0DboJWnyVMO4UayuuFC2hTOPSru1UXwpyykREiMV41sHUXtjIkw/janZDek bvGTSjeGsZp3bRfsg6R/sUgB7r8eYADU1tpX0Lu63E12kf3xxr6YEveCoGdgtkwGcL9zl2 ZLeNbB87Xg+78FzxBzBd/w36xUv/1s6UvbAfHiqXZ+yIQAmJRjvPCNJqXwdY8nTVuC+Sk2 /pGuDHH+tK43UL6rWR9K2X2nv6X0K4H9+Ch0J2pm8GrBu0tFGgjd4LG7a8nq1EORbXTswh ALoSGEhNoR6sLvDCNTT5McLuEbKGRUCpu5j/BfWOuTaYKjqQjcsjuj1Ug/tGEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcY6D0BgnzfxX; Mon, 28 Oct 2024 12:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SCkB8J075663; Mon, 28 Oct 2024 12:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SCkB94075660; Mon, 28 Oct 2024 12:46:11 GMT (envelope-from git) Date: Mon, 28 Oct 2024 12:46:11 GMT Message-Id: <202410281246.49SCkB94075660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a94328b63c20 - stable/14 - vnode.9: Document vnode_if.awk and vnode_if.src List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a94328b63c20498d72672bb13d2bb4d89fdf274b Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=a94328b63c20498d72672bb13d2bb4d89fdf274b commit a94328b63c20498d72672bb13d2bb4d89fdf274b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-10-09 10:04:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-10-28 12:45:53 +0000 vnode.9: Document vnode_if.awk and vnode_if.src Discussed with: bjk, imp Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27196 (cherry picked from commit e018265679389cfcebe172d4bf61aa4fe4f58b0a) --- share/man/man9/vnode.9 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 3d34b48c2ee0..5dd087725e92 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -24,7 +24,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 February 12, 2014 +.Dd October 9, 2024 .Dt VNODE 9 .Os .Sh NAME @@ -104,9 +104,21 @@ the vnode. The .Va v_op field is used by the -.Dv VOP_* -macros to call functions in the file system which implement the vnode's +.Fn VOP_* +functions to call functions in the file system which implement the vnode's functionality. +.Pp +The +.Fn VOP_* +function declarations and definitions are generated from +.Pa sys/kern/vnode_if.src +by the +.Pa sys/tools/vndoe_if.awk +script. +The interfaces are documented in their respective manual pages like +.Xr VOP_READ 9 +and +.Xr VOP_WRITE 9 . .Sh VNODE TYPES .Bl -tag -width VSOCK .It Dv VNON @@ -154,6 +166,16 @@ when holding a .Nm interlock, will cause a LOR (Lock Order Reversal) due to the intertwining of VM Objects and Vnodes. +.Sh FILES +.Bl -tag -width "sys/tools/vnode_if.awk" -compact +.It Pa sys/kern/vnode_if.src +The input file for +.Pa sys/tools/vnode_if.awk . +.It Pa sys/tools/vnode_if.awk +The script generating the source code of the +.Fn VOP_* +functions. +.El .Sh SEE ALSO .Xr malloc 9 , .Xr VFS 9 , From nobody Mon Oct 28 12:46:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcY6H0qnWz5bK4s; Mon, 28 Oct 2024 12:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcY6H02yrz4YYD; Mon, 28 Oct 2024 12:46:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cisndk7xE+qEmle2t69Q8nU3td2jA0pa+XSTaGfmy7Q=; b=d7uDxoZdkrIio0U5xS4130hd1GbvTeMy339iTlF8MO4FagObnCQhkAaZXZ5wMI5LPy0HgX FfP7TTu9hy4O/9o6/JeK8pJ1Dd5xDSiNxPOn6Wj59/BtJimU9Y3eBVIRCtgy1nY2VeM6gX eWjpLzB1e0DqrMSJ8Jlp6RkvDk3oGrbOnGAEMji3Oqdir4Y3J9mS7A169l8z9PytAH+/Od yHyfhCZgtgqL6W1zVQRLsXbyh4kKmpgY1y0FzDh2vkIsoQrJ5HF8zebbMP5CLGPplgBq1t lRp8qgbxQeVomrwezUsnraUz3LRciaPqsiNTkQ36kQnQ1/8FN0GMzjJpfcet3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cisndk7xE+qEmle2t69Q8nU3td2jA0pa+XSTaGfmy7Q=; b=cz4VPpyNfV0qqnlpVh1QB0mS3G3cEWfw5buv702KPrxP59NQ3pRYeKrxpZK6CM+7UoeVQj A8qdG1T/vPlcaRhefWs5UrapErflAonVO5tV83VfH68WWDJFSvZqHnpuEnU7frG0/pjbLJ HryE3UmM01xlg32KwI04gScxOtmU4y5YDkEsAfY/x8zd/eTJDpsGa1A5gsbdQ8SIal8gMi nlBvgzafCra+jiRuqz+oqjNWs6iiQYPMFZliU+gyiG40ccoaoAcDtkXrzvA3FYMo31WKod wapY9+MYM2pP9ibG2qEYyc7xuQGo71i6sMWLs5D6kdhS682uIqwIoEfUcWv43g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730119575; a=rsa-sha256; cv=none; b=OV3PTUBJsT8xqXEBlAzcDHnj8/EyxMUmr0dGAoPtw1xKtbZpR3T002V078cysokLtd+kL5 RehiOeySCWov0KJfocQK1lOoVsPexU8I69kl2f0OPy6cKVKffon87eghj3ITKPI/n3Ky8z 7W0LIe3hrKj/h8t5SGvSAxxEjFuJ+VeTqbuNFRZg+hfSoRuRrrzvqzVPHwCBeO9kyHtmZL ontS3A8CwEe/v4Dva6ysybap/Zf+zZkQVC+GzGPuO4X2r11yBhz1ODScWMzRxmCri7fNho dmgRTC+oGbZZsJKddr+YCfIfH64ZVWkJk/SthmNNt3iIBDDDsHaz6GmXzeyqzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcY6G6Z3Zzg0Q; Mon, 28 Oct 2024 12:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SCkEmI075810; Mon, 28 Oct 2024 12:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SCkE6C075807; Mon, 28 Oct 2024 12:46:14 GMT (envelope-from git) Date: Mon, 28 Oct 2024 12:46:14 GMT Message-Id: <202410281246.49SCkE6C075807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 0313a36cb9d6 - stable/13 - rc/tests: Skip oomprotect tests in a jail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0313a36cb9d60c1f2a197bfc186dc4dd6515a71d Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=0313a36cb9d60c1f2a197bfc186dc4dd6515a71d commit 0313a36cb9d60c1f2a197bfc186dc4dd6515a71d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-10-14 10:28:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-10-28 12:46:05 +0000 rc/tests: Skip oomprotect tests in a jail oomprotect cannot be used in a jail. Reviewed by: bnovkov, christos, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 1 week (cherry picked from commit 6fa42b91ca3f481912af98c4d49c44507eb1b8e1) --- libexec/rc/tests/rc_subr_test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 0ca790e39a14..4a54f991d72d 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -35,6 +35,10 @@ oomprotect_all_head() oomprotect_all_body() { + if [ "$(sysctl -n security.jail.jailed)" != 0 ]; then + atf_skip "protect(1) cannot be used in a jail" + fi + __name="$(atf_get ident)" __pidfile="$(mktemp -t "${__name}.pid")" __childpidfile="$(mktemp -t "${__name}.childpid")" @@ -72,6 +76,10 @@ oomprotect_yes_head() oomprotect_yes_body() { + if [ "$(sysctl -n security.jail.jailed)" != 0 ]; then + atf_skip "protect(1) cannot be used in a jail" + fi + __name="$(atf_get ident)" __pidfile="$(mktemp -t "${__name}.pid")" __script=$(mktemp -t "${__name}.script") From nobody Mon Oct 28 12:46:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcY6J3P2nz5bK4w; Mon, 28 Oct 2024 12:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcY6J1H3Nz4YTS; Mon, 28 Oct 2024 12:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ubDqbl4PqZUgS1UtEXgo3cywX5ZTFltzGcpEdbwt434=; b=x8gqbOxUsfOhVeNG49B00k/oA2DgvU4nAR4kLU6jkHGSSZyB9uSubMy03Pm8CC8d3ygYZm 6If8zdPAb/YFpgKjWsFkPYPXayJmUot0oSIpNxCSeBhC3iLPFz8jRT67INJ9hFnUzx0wAq AZlF4LGggYsyRCCB8ew37zWK94rOObzxkWihq8+O4SjTkBxeZR5/eaEC14GzyYT1lgPiQT w14AyAFciV8qunoKaPgKmMelI2LYaAZfYi/0V2jvlkEmqPK7gUV8/DpqhnXNDXXPB2qnJO KfLQJhZR5vjG8vfFQNY089myekely+pqBhFRngKGxYT17gEzdlAEY6gQuQmwBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730119576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ubDqbl4PqZUgS1UtEXgo3cywX5ZTFltzGcpEdbwt434=; b=Lf5ujI+LMwRl8MhM9WBxzXUIJHwyQ+qYGtv7+aLBLTAtE71dGLByglHF0ox8lbm3cyqKZq Jm5OQpgq1KCG46In97X4Yw5hbq/1nMRt86MwfojijEu1U+Ydfu/0kEOOiLPA72fqwtnCNX 5rpOscjlfvC1AP+hFsevg2eSx9e3fCwMaxtMDxbaKyQOGrf//geIhngs7B5rrh0rj18kOv YDzQeynOr4BQMccF7OfnsNwc2fUJasEZ7frIPN9t8SQEO/Q7fNTOIDjgKkJsNcOuMhYfec qBxVnNdSCT+ScvrdR1la64JrvxLUX8XObLu/TpI19cxswsjNDbewbPt6f76ijA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730119576; a=rsa-sha256; cv=none; b=H3UQwwYesj3X+HNQwWYbvftCM12/g6fsQYIROP6QMLimwI473Tq35e7VRYgFzhgDuHjeBa RGB1cmt0yTmLMRO076yQkCP7oKVztwpqNBOdq6CeJDsUIyn07MqDHaTwnefp+LJ322if4/ SXYTB0iPOPRV92zrVapF7GmU0kkzQWKYBo/Vd4+T7pTkg1+IzHaKam3HM0aO4CxR5DAnQd g5xlaj2toVpZSIGMQs3JFODHugojAmcEyJ/CoFkM6wTQM2Y/VFcSkjyc3qs55a3chWQoOg SbIYCUkgwMfEit0R9R6fa//BAASQNpXlhROj1za6D/ZaLTFecPtfqqvKwN/DqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcY6J0NW0zg0R; Mon, 28 Oct 2024 12:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SCkFMO075853; Mon, 28 Oct 2024 12:46:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SCkFTT075850; Mon, 28 Oct 2024 12:46:15 GMT (envelope-from git) Date: Mon, 28 Oct 2024 12:46:15 GMT Message-Id: <202410281246.49SCkFTT075850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 7bdde516fc2b - stable/13 - vnode.9: Document vnode_if.awk and vnode_if.src List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7bdde516fc2b1ab828e2c4a9c473ba30018b30c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=7bdde516fc2b1ab828e2c4a9c473ba30018b30c7 commit 7bdde516fc2b1ab828e2c4a9c473ba30018b30c7 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-10-09 10:04:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-10-28 12:46:05 +0000 vnode.9: Document vnode_if.awk and vnode_if.src Discussed with: bjk, imp Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27196 (cherry picked from commit e018265679389cfcebe172d4bf61aa4fe4f58b0a) --- share/man/man9/vnode.9 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/share/man/man9/vnode.9 b/share/man/man9/vnode.9 index 6befe7337b94..c4bfab5f849f 100644 --- a/share/man/man9/vnode.9 +++ b/share/man/man9/vnode.9 @@ -24,7 +24,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 February 12, 2014 +.Dd October 9, 2024 .Dt VNODE 9 .Os .Sh NAME @@ -104,9 +104,21 @@ the vnode. The .Va v_op field is used by the -.Dv VOP_* -macros to call functions in the file system which implement the vnode's +.Fn VOP_* +functions to call functions in the file system which implement the vnode's functionality. +.Pp +The +.Fn VOP_* +function declarations and definitions are generated from +.Pa sys/kern/vnode_if.src +by the +.Pa sys/tools/vndoe_if.awk +script. +The interfaces are documented in their respective manual pages like +.Xr VOP_READ 9 +and +.Xr VOP_WRITE 9 . .Sh VNODE TYPES .Bl -tag -width VSOCK .It Dv VNON @@ -154,6 +166,16 @@ when holding a .Nm interlock, will cause a LOR (Lock Order Reversal) due to the intertwining of VM Objects and Vnodes. +.Sh FILES +.Bl -tag -width "sys/tools/vnode_if.awk" -compact +.It Pa sys/kern/vnode_if.src +The input file for +.Pa sys/tools/vnode_if.awk . +.It Pa sys/tools/vnode_if.awk +The script generating the source code of the +.Fn VOP_* +functions. +.El .Sh SEE ALSO .Xr malloc 9 , .Xr VFS 9 , From nobody Mon Oct 28 14:49:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrj5605z5bRQ3; Mon, 28 Oct 2024 14:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrj4VLVz4njP; Mon, 28 Oct 2024 14:49:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WbbXhRAlPjsCBT5LzX+bKqfAEk9dVfh/jw1Me3qQDn0=; b=dGwoKEsxlQjr+NG+qc723Kf3ISdqpKvpsivZqO3AU4HGo/LDGH6JKp82/8jyYbsQMJ+u6r PumcDLxY/McJi7FGP0opN4J9c+h5HnYzL6vE6Vb8HrNFINWq/jbevH2UoPmiuzFabTCE/B FCJvCpB5/PEGg4ljNYxizu7kQ+j0ZX1dNF/DyBfEWMvP3IQY94YNJGGMroX5nk2J4ocFSt PxMe8zOHe4+W5aFRMV433iebha2kd4gEnMhRqHaR5GD9zKNliiYTAXUR5PrYhItwCKV2BI Rm+SSqR7JiEWGR97RFzBIJT6kSHx9oLZ49CgU7IYx2465xmHSPlJnQiXMhhczA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WbbXhRAlPjsCBT5LzX+bKqfAEk9dVfh/jw1Me3qQDn0=; b=YN7YAo3GmYx3CbW0a4iL5WIJIHSRcNh5G38vRGzYPqH1YPVKsp6DSP3SS6Izoeu2WA6x/w BYEEJnhkNxxgXXag5QTISZ+wImYlqinMG7PY0svEmrZwIda8lBUWnqc7ARRaCZwnmtIrah jHEGMcrzCe6grwgIrp762h58KcO7gEyTQ8jZLyJXaJutGUniv6gEXwI8pDN9Yeken1PsoU Jj84yDWsftgK5jD/KaWPU6pvQhnvYJWzFfUonn0hu1n+eg2s53yPUBe5ZquseuF+sC5FGx Wm6qtJaaGmUrNZPAQP2fQEVWW5eutGeYLDJnt+mY3fLUyfmVkjwpXMGqjI9R1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126981; a=rsa-sha256; cv=none; b=CG91jOym631kavyxYHuFyPYQnwTbf0iMv0qvEozEOWh3czarnW7R1nDubeV5VMMnud09rP KyAG4gFJEwqbKQl/kMd4ZbjrgKeXFBQhsXGCNYCT07OcSBHs2AROUxINffV0JLUYWpqBzG LoivIUC1rUTo5McMDhT13UCDsWwwzJ2ytp27f5/AIGOj/LAEa/ZkidRBCNaj/kmK33aZ7K mAz+4TojzDf+D+NyJrbRbVBuwNI7Vo8kZZyY9tGWZ/5wXLMc788622JR7C0fwnhaa9Oilx Ns4vw+9tcFKpCPIq13WgwL3030LwhCLWucoQylJ8iWuoEBPQBaKq3ME9j8mgaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrj3yPZzjvj; Mon, 28 Oct 2024 14:49:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEnfhv099012; Mon, 28 Oct 2024 14:49:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEnfIV099009; Mon, 28 Oct 2024 14:49:41 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:41 GMT Message-Id: <202410281449.49SEnfIV099009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f0b989348fe6 - main - iwlwifi,rtw88,rtw89: temporary disable build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0b989348fe6e6fffd2522e28090f24e63253a57 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f0b989348fe6e6fffd2522e28090f24e63253a57 commit f0b989348fe6e6fffd2522e28090f24e63253a57 Author: Bjoern A. Zeeb AuthorDate: 2024-10-27 22:55:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 12:15:25 +0000 iwlwifi,rtw88,rtw89: temporary disable build I tried to use LINUXKPI_VERSION to work out a plan which allows us to compile linuxkpi_wlan and the LinuxKPI based wireless drivers without interruption and flip a switch on the go. I assume, with a lot of extra detours making the linuxkpi_wlan implementation KPI changes compile time dependent would have been possible and might be needed in the future. One problem is that the various drivers currently in main were from different sources or different hashes of the Linux wireless-testing.git repository at last and we have no common base to use and LINUXKPI_VERSION checks seem to slightly overlap. Pulling drivers from official Linux version releases now will avoid that problem and keep all drivers on the same KPI level in the future which should avoid this problem. The other problem is that the merges from the vendor branches are independent and so the first merge will need to have the LinuxKPI changes before but in between the (old) drivers will not compile (unless linuxkpi_wlan can deal with both KPI versions). For this time it was simply not possible to align all the changes and instead we disable building the drivers over the merge window only not to break intermediate builds. After LinuxKPI 802.11 was updated and drivers are merged from vendor branches we will re-attach them to the build. Sponsored by: The FreeBSD Foundation --- sys/modules/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index d76e16b1da1b..2b64ca437b7f 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -569,12 +569,12 @@ _mlx5ib= mlx5ib ${MACHINE_CPUARCH} == "i386" _ena= ena _gve= gve -_iwlwifi= iwlwifi +#_iwlwifi= iwlwifi .if ${MK_SOURCELESS_UCODE} != "no" _iwlwififw= iwlwififw .endif -_rtw88= rtw88 -_rtw89= rtw89 +#_rtw88= rtw88 +#_rtw89= rtw89 _vmware= vmware .endif From nobody Mon Oct 28 14:49:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrl0C2fz5bRQD; Mon, 28 Oct 2024 14:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrk6PQ4z4npH; Mon, 28 Oct 2024 14:49:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dkHjABAbEJIQ9GT22vrN0eUIUYcH/Z4srrtPVNcbx88=; b=j7i5sRPuw9bPR6hg2VfytQRpGEz3/BNX82/FCTMw4Q9y4Gkwv2Hvb9ykYQmSoac2k5FTvA DpFaj7AgsQU1plWOEWKS4qig4M6ckva17iTllomBrXILQh02BO5VmQhwzW/LvEi9D3f15r Gx6QZ9sbSYbaf0LmoIp4wxNq498DjMmR/+8lfZznLwfOZk1u5R3k6ccXBr5HgISiW/hJsv fAFbkvNdnCMl8PNHuoOMeBuMPaUnN4j1mZVusgxpbqlJme4eUyM3JwL5ysrXqd01Gi1m5e 0l1tzm8n72B12yUHreErEkQm6qbr2sDVtCYnpR4v/Qo4kGvpsx49zsstxRBV3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dkHjABAbEJIQ9GT22vrN0eUIUYcH/Z4srrtPVNcbx88=; b=WbBdzqDfsgZD1iPiU6stTfQw9MnxyfQvAVlUqmipZ5GohaprWn1C6LQ+shPBhBa6lJWPTO mC8gO+bagvwNfjVUMsHLv7gHMWI8bVMccb6NXf33k5u2m2DOjcDJ1JL5N8tWUcFK4c01S6 v3R+36GphqGcSC7pxRsX5U/MVse8+u5nm7aSsne1yaaf+pGGrsixqmau23KZ46N8he7xDE ghmfaoBEPDti8xk2Dm0+j/ARAj96umL+mY2naSodHstkuvTWDxsYfInsBxHrMvRdxiQMxC VrYBfwLZZfAooZB4+GYTg9Dts98aZfruT4NENnd9NhTNQqUsJHmqf3XeGkDTsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126982; a=rsa-sha256; cv=none; b=IXtgGOCN10eqWvXQIY7jM7UHBIkVRusmSu7YWPfgW2N9vlMWgcTVfgIpLWF4Mq7k+XDI2K lM56wr2bZv55b4Sj1LidxyQ8oRgrEQJS7bCx0BIghYOEtAQO6H2sU92H/PaVyxcbSCXgXq TQwJuJctSgj0agk/ecYVZoKRBf8Obyzq/sDoINdIRxjMbwnpPGzrs0IoueSttzVfW26z39 DThHYPSfLtxy+XU0i8+oEzEaeoz1OIQ3UUIH2TDl5CxS0eYA7X1AH6sL7lMPRxGPGgnLD+ cDkmQN6kR9a9eXNciH158aMh78/EENgy5PMpuRUJLyUSOZa6i2o5TPMMVdu4LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrk4czmzjc4; Mon, 28 Oct 2024 14:49:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEngO4099081; Mon, 28 Oct 2024 14:49:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEngWu099078; Mon, 28 Oct 2024 14:49:42 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:42 GMT Message-Id: <202410281449.49SEngWu099078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7b43f4d06419 - main - LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b43f4d064195bcf66816cb9fe350a1392fe24ce Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7b43f4d064195bcf66816cb9fe350a1392fe24ce commit 7b43f4d064195bcf66816cb9fe350a1392fe24ce Author: Bjoern A. Zeeb AuthorDate: 2024-10-28 12:15:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 12:16:06 +0000 LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 Bring in the LinuxKPI 802.11 compat bits which are altering the mac80211 KPI. * In struct ieee80211_bss_conf chandef -> chanreq. * Various struct ieee80211_ops gained a link_id arguemnt, stop gained a suspend flag. * Various functions gained a link_id argument. * ieee80211_tx_status() was renamed to ieee80211_tx_status_skb() Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 22 ++++++++++++---------- sys/compat/linuxkpi/common/src/linux_80211.c | 14 +++++++------- sys/compat/linuxkpi/common/src/linux_80211.h | 2 +- .../linuxkpi/common/src/linux_80211_macops.c | 6 +++--- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 6dbf07c85bb8..dff152caf140 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -297,7 +297,7 @@ struct ieee80211_bss_conf { uint8_t transmitter_bssid[ETH_ALEN]; struct ieee80211_ftm_responder_params *ftmr_params; struct ieee80211_p2p_noa_attr p2p_noa_attr; - struct cfg80211_chan_def chandef; + struct ieee80211_chanreq chanreq; __be32 arp_addr_list[1]; /* XXX TODO */ struct ieee80211_rate *beacon_rate; struct { @@ -796,7 +796,9 @@ enum ieee80211_vif_driver_flags { IEEE80211_VIF_BEACON_FILTER = BIT(0), IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), +#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION < 60600) /* v6.6 */ IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), /* Renamed to IEEE80211_VIF_EML_ACTIVE. */ +#endif IEEE80211_VIF_EML_ACTIVE = BIT(4), IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW = BIT(5), }; @@ -970,7 +972,7 @@ enum ieee80211_offload_flags { struct ieee80211_ops { /* TODO FIXME */ int (*start)(struct ieee80211_hw *); - void (*stop)(struct ieee80211_hw *); + void (*stop)(struct ieee80211_hw *, bool); int (*config)(struct ieee80211_hw *, u32); void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type); @@ -993,7 +995,7 @@ struct ieee80211_ops { void (*mgd_prepare_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); void (*mgd_complete_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); - void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *); + void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int); void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool); void (*flush_sta)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); @@ -1024,10 +1026,10 @@ struct ieee80211_ops { bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *, struct sk_buff *, struct sk_buff *); int (*pre_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); - int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); + int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *); void (*channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); void (*channel_switch_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *); - void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); + void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *); void (*channel_switch_rx_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); int (*tdls_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *, struct sk_buff *, u32); void (*tdls_cancel_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); @@ -1561,7 +1563,7 @@ ieee80211_beacon_loss(struct ieee80211_vif *vif) } static __inline void -ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t) +ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t, uint32_t link_id) { TODO(); } @@ -1587,7 +1589,7 @@ ieee80211_csa_update_counter(struct ieee80211_vif *vif) } static __inline void -ieee80211_csa_finish(struct ieee80211_vif *vif) +ieee80211_csa_finish(struct ieee80211_vif *vif, uint32_t link_id) { TODO(); } @@ -2111,7 +2113,7 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) } static __inline void -ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) +ieee80211_tx_status_skb(struct ieee80211_hw *hw, struct sk_buff *skb) { linuxkpi_ieee80211_tx_status(hw, skb); } @@ -2225,7 +2227,7 @@ ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter) } static __inline int -ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif) +ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif, uint32_t link_id) { TODO(); return (-1); @@ -2240,7 +2242,7 @@ ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth, } static __inline bool -ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif) +ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif, uint32_t link_id) { TODO(); return (true); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 9e4c368617b6..6de5c42fe59d 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1267,9 +1267,9 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int } else { error = lkpi_80211_mo_add_chanctx(hw, chanctx_conf); if (error == 0 || error == EOPNOTSUPP) { - vif->bss_conf.chandef.chan = chanctx_conf->def.chan; - vif->bss_conf.chandef.width = chanctx_conf->def.width; - vif->bss_conf.chandef.center_freq1 = + vif->bss_conf.chanreq.oper.chan = chanctx_conf->def.chan; + vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; + vif->bss_conf.chanreq.oper.center_freq1 = chanctx_conf->def.center_freq1; #ifdef LKPI_80211_HT if (vif->bss_conf.chandef.width == NL80211_CHAN_WIDTH_40) { @@ -1280,7 +1280,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chandef.center_freq1 -= 10; } #endif - vif->bss_conf.chandef.center_freq2 = + vif->bss_conf.chanreq.oper.center_freq2 = chanctx_conf->def.center_freq2; } else { ic_printf(vap->iv_ic, "%s:%d: mo_add_chanctx " @@ -2833,7 +2833,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif->lvif_ifllevent = EVENTHANDLER_REGISTER(iflladdr_event, lkpi_vif_iflladdr, vif, EVENTHANDLER_PRI_ANY); vif->bss_conf.link_id = 0; /* Non-MLO operation. */ - vif->bss_conf.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; + vif->bss_conf.chanreq.oper.width = NL80211_CHAN_WIDTH_20_NOHT; vif->bss_conf.use_short_preamble = false; /* vap->iv_flags IEEE80211_F_SHPREAMBLE */ vif->bss_conf.use_short_slot = false; /* vap->iv_flags IEEE80211_F_SHSLOT */ vif->bss_conf.qos = false; @@ -3019,7 +3019,7 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap) lkpi_80211_mo_remove_interface(hw, vif); /* Single VAP, so we can do this here. */ - lkpi_80211_mo_stop(hw); + lkpi_80211_mo_stop(hw, false); /* XXX SUSPEND */ mtx_destroy(&lvif->mtx); free(lvif, M_80211_VAP); @@ -3076,7 +3076,7 @@ lkpi_ic_parent(struct ieee80211com *ic) start_all = true; } else { #ifdef HW_START_STOP - lkpi_80211_mo_stop(hw); + lkpi_80211_mo_stop(hw, false); /* XXX SUSPEND */ #endif } LKPI_80211_LHW_UNLOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index b6ac3e85f80f..8605ec86ad1b 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -392,7 +392,7 @@ struct lkpi_wiphy { mtx_assert(&(_ltxq)->ltxq_mtx, MA_NOTOWNED) int lkpi_80211_mo_start(struct ieee80211_hw *); -void lkpi_80211_mo_stop(struct ieee80211_hw *); +void lkpi_80211_mo_stop(struct ieee80211_hw *, bool); int lkpi_80211_mo_get_antenna(struct ieee80211_hw *, u32 *, u32 *); int lkpi_80211_mo_set_frag_threshold(struct ieee80211_hw *, uint32_t); int lkpi_80211_mo_set_rts_threshold(struct ieee80211_hw *, uint32_t); diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 8cc885c037e3..246a0c84dfa8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -74,7 +74,7 @@ out: } void -lkpi_80211_mo_stop(struct ieee80211_hw *hw) +lkpi_80211_mo_stop(struct ieee80211_hw *hw, bool suspend) { struct lkpi_hw *lhw; @@ -82,8 +82,8 @@ lkpi_80211_mo_stop(struct ieee80211_hw *hw) if (lhw->ops->stop == NULL) return; - LKPI_80211_TRACE_MO("hw %p", hw); - lhw->ops->stop(hw); + LKPI_80211_TRACE_MO("hw %p suspend %d", hw, suspend); + lhw->ops->stop(hw, suspend); lhw->sc_flags &= ~LKPI_MAC80211_DRV_STARTED; } From nobody Mon Oct 28 14:49:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrm6npVz5bRBq; Mon, 28 Oct 2024 14:49:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrm4Nlmz4nth; Mon, 28 Oct 2024 14:49:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGmFqfUI5ltKFXPX7QKz3X2UWZLlmnxGL58B3gspTxY=; b=qiup9qcFLqzaG2zdLh8uPuFXNH8KSG0FwRxCWdL2jfYVHJFNUM3k8GjbZRpjlqKb1Dw2gi qhwBHMYNNavAJSTQyUzMoowvZUFqMab53MgAmY/khdcvXI15JFSjFaXBGKLRrxVksSE72f chXk/egVmcn5ldUjW9mniXFdWLE25ZGuhYstqIGH4T8PG8dtU+C8dB33ILMSqUNP2W6LhV QdnlvU+HtdMoQ+cC+eQmFo4HWMVN1h5Gu6VTLM9NYKmphebs0WQMRdVMhE3GTgg0/aqWR8 ieHk9Ft1T2m9PQ+93NuKho4PDVEdX6qfr4AjU4KLW+mbU6JP9/K3JMIW93ZZYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGmFqfUI5ltKFXPX7QKz3X2UWZLlmnxGL58B3gspTxY=; b=nTpr9/XwZX1Fnr7Xm4tPvUza/mM/QRBrIlKYuPF5Jz0vCufavSZnhBfcT39kdvL6Fl0/fb ISCKKocio4Ac7gmLgNnrWh5/AW53BJvORn+lwYN7HzyzpvfDb9wu2czVrHBJ6Am5ep6iSD L9eSw9I4wYBmK4yTHt8xjQg3g/50tByL2Oz4TNVS8PdQmbgRwkYmHYP8G/wIABf0LE8Dye QjpYCnh8YEStdWCQdy3we2yZ4HZXJdjfp2/z0TPbLbznvN9kt0WOk7Jg/sFr8+0myNTh64 sZ21AcaqZ3h8Dvcn+/Tf5I0Mzjn3NvN+P5eY2m3TX6RMQPx0LKkTm3WILMFUiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126984; a=rsa-sha256; cv=none; b=YP+aZ1LHmmnZ+Cs3TkYRAVuuobeBjgafSQNd2oEfKhVdZxtcv7uj4HhxfKUMuco09WH5ns KQrmwftGl+lz8jUMofCge9SymbFnr2qZpoj9ZS0E0EKGD3tNs8lIGMD/ODyYVO5psBp5Lq 5UMCzLavkEzLloqWSkdC+jMkUkRKKr838XnV5Y2TTb1MfT1MBRzpwkNF1MFbrLmKdw93bp ewxnurjOla9b+zYXauwUapeHopT92CbZc/mKEOB+OcQ1WZsVu1k9L36G55o4rfahhViijo hIGOoBWCV/iFiYwUtH/tK4p4DG2GsFtrERadmb4YWTOyHYRNbLM6QrQOP+H/xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrm3k8Hzk4Z; Mon, 28 Oct 2024 14:49:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEnix4099131; Mon, 28 Oct 2024 14:49:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEnhe0099127; Mon, 28 Oct 2024 14:49:43 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:43 GMT Message-Id: <202410281449.49SEnhe0099127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a4128aad8503 - main - iwlwifi: update Intel's iwlwifi/mvm driver. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4128aad8503277614f2d214011ef60a19447b83 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a4128aad8503277614f2d214011ef60a19447b83 commit a4128aad8503277614f2d214011ef60a19447b83 Merge: 7b43f4d06419 5d6ad179ba13 Author: Bjoern A. Zeeb AuthorDate: 2024-09-27 21:53:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 14:42:25 +0000 iwlwifi: update Intel's iwlwifi/mvm driver. This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ). Sponsored by: The FreeBSD Foundation MFC after: 14 days share/man/man4/iwlwifi.4 | 40 +- share/man/man4/iwlwififw.4 | 238 ++- sys/contrib/dev/iwlwifi/cfg/22000.c | 4 +- sys/contrib/dev/iwlwifi/cfg/ax210.c | 12 +- sys/contrib/dev/iwlwifi/cfg/bz.c | 29 +- sys/contrib/dev/iwlwifi/cfg/sc.c | 48 +- sys/contrib/dev/iwlwifi/fw/acpi.c | 649 ++----- sys/contrib/dev/iwlwifi/fw/acpi.h | 220 +-- sys/contrib/dev/iwlwifi/fw/api/alive.h | 6 +- sys/contrib/dev/iwlwifi/fw/api/binding.h | 4 +- sys/contrib/dev/iwlwifi/fw/api/coex.h | 81 +- sys/contrib/dev/iwlwifi/fw/api/commands.h | 30 + sys/contrib/dev/iwlwifi/fw/api/config.h | 4 +- sys/contrib/dev/iwlwifi/fw/api/d3.h | 107 +- sys/contrib/dev/iwlwifi/fw/api/datapath.h | 36 +- sys/contrib/dev/iwlwifi/fw/api/dbg-tlv.h | 81 +- sys/contrib/dev/iwlwifi/fw/api/debug.h | 40 +- sys/contrib/dev/iwlwifi/fw/api/location.h | 160 +- sys/contrib/dev/iwlwifi/fw/api/mac-cfg.h | 60 +- sys/contrib/dev/iwlwifi/fw/api/mac.h | 17 +- sys/contrib/dev/iwlwifi/fw/api/nvm-reg.h | 198 +- sys/contrib/dev/iwlwifi/fw/api/offload.h | 8 +- sys/contrib/dev/iwlwifi/fw/api/phy-ctxt.h | 24 +- sys/contrib/dev/iwlwifi/fw/api/phy.h | 9 +- sys/contrib/dev/iwlwifi/fw/api/power.h | 134 +- sys/contrib/dev/iwlwifi/fw/api/rfi.h | 7 +- sys/contrib/dev/iwlwifi/fw/api/rs.h | 4 +- sys/contrib/dev/iwlwifi/fw/api/rx.h | 26 +- sys/contrib/dev/iwlwifi/fw/api/scan.h | 49 +- sys/contrib/dev/iwlwifi/fw/api/sta.h | 4 +- sys/contrib/dev/iwlwifi/fw/api/stats.h | 153 +- sys/contrib/dev/iwlwifi/fw/api/time-event.h | 80 +- sys/contrib/dev/iwlwifi/fw/api/tx.h | 23 +- sys/contrib/dev/iwlwifi/fw/api/txq.h | 14 +- sys/contrib/dev/iwlwifi/fw/dbg.c | 295 ++- sys/contrib/dev/iwlwifi/fw/dbg.h | 4 +- sys/contrib/dev/iwlwifi/fw/debugfs.c | 17 +- sys/contrib/dev/iwlwifi/fw/dump.c | 3 +- sys/contrib/dev/iwlwifi/fw/error-dump.h | 33 +- sys/contrib/dev/iwlwifi/fw/file.h | 71 +- sys/contrib/dev/iwlwifi/fw/img.h | 4 +- sys/contrib/dev/iwlwifi/fw/init.c | 7 +- sys/contrib/dev/iwlwifi/fw/notif-wait.h | 3 +- sys/contrib/dev/iwlwifi/fw/pnvm.c | 49 +- sys/contrib/dev/iwlwifi/fw/regulatory.c | 639 +++++++ sys/contrib/dev/iwlwifi/fw/regulatory.h | 220 +++ sys/contrib/dev/iwlwifi/fw/rs.c | 1 - sys/contrib/dev/iwlwifi/fw/runtime.h | 30 +- sys/contrib/dev/iwlwifi/fw/uefi.c | 462 ++++- sys/contrib/dev/iwlwifi/fw/uefi.h | 245 ++- sys/contrib/dev/iwlwifi/iwl-config.h | 43 +- sys/contrib/dev/iwlwifi/iwl-context-info-gen3.h | 13 +- sys/contrib/dev/iwlwifi/iwl-csr.h | 10 +- sys/contrib/dev/iwlwifi/iwl-dbg-tlv.c | 94 +- sys/contrib/dev/iwlwifi/iwl-dbg-tlv.h | 6 +- sys/contrib/dev/iwlwifi/iwl-debug.c | 5 +- sys/contrib/dev/iwlwifi/iwl-devtrace.h | 2 + sys/contrib/dev/iwlwifi/iwl-drv.c | 151 +- sys/contrib/dev/iwlwifi/iwl-drv.h | 12 +- sys/contrib/dev/iwlwifi/iwl-eeprom-parse.c | 879 --------- sys/contrib/dev/iwlwifi/iwl-eeprom-read.c | 397 ---- sys/contrib/dev/iwlwifi/iwl-eeprom-read.h | 12 - sys/contrib/dev/iwlwifi/iwl-fh.h | 85 +- sys/contrib/dev/iwlwifi/iwl-io.c | 4 +- sys/contrib/dev/iwlwifi/iwl-modparams.h | 21 +- sys/contrib/dev/iwlwifi/iwl-nvm-parse.c | 223 ++- sys/contrib/dev/iwlwifi/iwl-nvm-parse.h | 23 +- sys/contrib/dev/iwlwifi/iwl-nvm-utils.c | 118 ++ .../{iwl-eeprom-parse.h => iwl-nvm-utils.h} | 19 +- sys/contrib/dev/iwlwifi/iwl-op-mode.h | 32 +- sys/contrib/dev/iwlwifi/iwl-prph.h | 42 +- sys/contrib/dev/iwlwifi/iwl-trans.c | 456 ++++- sys/contrib/dev/iwlwifi/iwl-trans.h | 736 ++------ sys/contrib/dev/iwlwifi/mei/iwl-mei.h | 7 +- sys/contrib/dev/iwlwifi/mvm/coex.c | 124 +- sys/contrib/dev/iwlwifi/mvm/constants.h | 26 +- sys/contrib/dev/iwlwifi/mvm/d3.c | 649 ++++++- sys/contrib/dev/iwlwifi/mvm/debugfs-vif.c | 272 ++- sys/contrib/dev/iwlwifi/mvm/debugfs.c | 418 ++--- sys/contrib/dev/iwlwifi/mvm/debugfs.h | 1 + sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c | 277 ++- sys/contrib/dev/iwlwifi/mvm/ftm-responder.c | 49 +- sys/contrib/dev/iwlwifi/mvm/fw.c | 522 ++---- sys/contrib/dev/iwlwifi/mvm/link.c | 953 +++++++++- sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c | 117 +- sys/contrib/dev/iwlwifi/mvm/mac80211.c | 1423 +++++++++------ sys/contrib/dev/iwlwifi/mvm/mld-key.c | 42 +- sys/contrib/dev/iwlwifi/mvm/mld-mac.c | 11 +- sys/contrib/dev/iwlwifi/mvm/mld-mac80211.c | 672 ++++--- sys/contrib/dev/iwlwifi/mvm/mld-sta.c | 98 +- sys/contrib/dev/iwlwifi/mvm/mvm.h | 592 ++++-- sys/contrib/dev/iwlwifi/mvm/nvm.c | 19 +- sys/contrib/dev/iwlwifi/mvm/offloading.c | 8 +- sys/contrib/dev/iwlwifi/mvm/ops.c | 319 +++- sys/contrib/dev/iwlwifi/mvm/phy-ctxt.c | 115 +- sys/contrib/dev/iwlwifi/mvm/power.c | 179 +- sys/contrib/dev/iwlwifi/mvm/rfi.c | 8 +- sys/contrib/dev/iwlwifi/mvm/rs-fw.c | 33 +- sys/contrib/dev/iwlwifi/mvm/rx.c | 329 +++- sys/contrib/dev/iwlwifi/mvm/rxmq.c | 473 ++--- sys/contrib/dev/iwlwifi/mvm/scan.c | 694 +++++-- sys/contrib/dev/iwlwifi/mvm/sf.c | 5 +- sys/contrib/dev/iwlwifi/mvm/sta.c | 258 ++- sys/contrib/dev/iwlwifi/mvm/sta.h | 47 +- sys/contrib/dev/iwlwifi/mvm/tdls.c | 39 +- sys/contrib/dev/iwlwifi/mvm/testmode.h | 92 + sys/contrib/dev/iwlwifi/mvm/time-event.c | 470 ++++- sys/contrib/dev/iwlwifi/mvm/time-event.h | 21 +- sys/contrib/dev/iwlwifi/mvm/tt.c | 146 +- sys/contrib/dev/iwlwifi/mvm/tx.c | 325 ++-- sys/contrib/dev/iwlwifi/mvm/utils.c | 99 +- sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c | 42 +- sys/contrib/dev/iwlwifi/pcie/ctxt-info.c | 6 +- sys/contrib/dev/iwlwifi/pcie/drv.c | 211 ++- sys/contrib/dev/iwlwifi/pcie/internal.h | 362 +++- sys/contrib/dev/iwlwifi/pcie/rx.c | 47 +- sys/contrib/dev/iwlwifi/pcie/trans-gen2.c | 29 +- sys/contrib/dev/iwlwifi/pcie/trans.c | 482 ++--- sys/contrib/dev/iwlwifi/pcie/tx-gen2.c | 1191 +++++++++++- sys/contrib/dev/iwlwifi/pcie/tx.c | 1270 +++++++++++-- sys/contrib/dev/iwlwifi/queue/tx.c | 1903 -------------------- sys/contrib/dev/iwlwifi/queue/tx.h | 183 -- sys/contrib/dev/iwlwifi/tests/Makefile | 7 + sys/contrib/dev/iwlwifi/tests/devinfo.c | 78 + sys/contrib/dev/iwlwifi/tests/module.c | 10 + sys/modules/iwlwifi/Makefile | 7 +- usr.sbin/fwget/pci/pci_network_intel | 33 +- 127 files changed, 14847 insertions(+), 9011 deletions(-) diff --cc share/man/man4/iwlwifi.4 index ddeeb549d0f4,000000000000..c5622f2586f1 mode 100644,000000..100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@@ -1,227 -1,0 +1,255 @@@ +.\"- +.\" Copyright (c) 2021-2024 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" - .Dd September 30, 2024 ++.Dd October 12, 2024 +.Dt IWLWIFI 4 +.Os +.Sh NAME +.Nm iwlwifi +.Nd Intel IEEE 802.11a/b/g/n/ac/ax wireless network driver +.Sh SYNOPSIS +The driver will auto-load without any user interaction using +.Xr devmatch 8 +if enabled in +.Xr rc.conf 5 . +.Pp +Only if auto-loading is explicitly disabled, place the following +lines in +.Xr rc.conf 5 +to manually load the driver as a module at boot time: +.Bd -literal -offset indent +kld_list="${kld_list} if_iwlwifi" +.Ed +.Pp +The driver should automatically load any +.Xr iwlwififw 4 +firmware needed for the particular chipset. +.Pp +It is discouraged to load the driver from +.Xr loader 8 . +.Sh DESCRIPTION +The +.Nm +driver is derived from Intel's Linux iwlwifi driver +.Pp +.Nm +will be a successor to +.Xr iwm 4 +and may supersede that driver in the future. +It still complements the +.Xr iwn 4 +driver which supports older chipsets. +.Pp +The driver uses the +.\" No LinuxKPI man pages so no .Xr here. +.Em linuxkpi_wlan +and +.Em linuxkpi +compat framework to bridge between the Linux and +native +.Fx +driver code as well as to the native +.Xr net80211 4 +wireless stack. +.Pp +While +.Nm +supports all 802.11 a/b/g/n/ac/ax +the compatibility code currently only supports 802.11 a/b/g modes. +Support for 802.11 n/ac is to come. 802.11ax and 6Ghz support are planned. +.Sh HARDWARE +The +.Nm +driver supports PCIe devices from the +.Em mvm - sub-driver with the following chipsets: ++sub-driver with the following chipset generations: ++.Pp ++.\" awk -F\\t '{ print $5 }' ~/tmp/iwlwifi_pci_ids_name.txt | \ ++.\" grep -v undefined | sort -V | uniq | grep -v ^$ | \ ++.\" awk '{ printf ".It\n%s\n", $0 }' ++.Bl -bullet -compact ++.It ++7000 ++.It ++8000 ++.It ++9000 ++.It ++22000 ++.It ++AX210 ++.It ++BZ ++.It ++SC ++.El ++.Pp ++These chipset generations match the following common device names: +.Pp +.Bl -bullet -compact +.\" --------------------------------------------------------------------- +.\" This list is manually generated from a sysctl and post-processing. +.\" Edits will be overwritten on next update. ++.\" awk -F\\t '{ if ($2 == "") { next; } if (seen[$2]) { next; } \ ++.\" seen[$2]=1; printf ".It\n%s\n", $2; }' iwlwifi_pci_ids_name.txt +.\" --------------------------------------------------------------------- +.It +Intel(R) Dual Band Wireless AC 7260 +.It +Intel(R) Dual Band Wireless N 7260 +.It +Intel(R) Wireless N 7260 +.It +Intel(R) Dual Band Wireless AC 3160 +.It +Intel(R) Dual Band Wireless N 3160 +.It +Intel(R) Wireless N 3160 +.It +Intel(R) Dual Band Wireless AC 3165 +.It +Intel(R) Dual Band Wireless AC 3168 +.It +Intel(R) Dual Band Wireless AC 7265 +.It +Intel(R) Wireless N 7265 +.It +Intel(R) Dual Band Wireless N 7265 +.It +Intel(R) Dual Band Wireless AC 8260 +.It +Intel(R) Dual Band Wireless N 8260 +.It +Intel(R) Dual Band Wireless AC 4165 +.It +Intel(R) Dual Band Wireless AC 8265 +.It +Intel(R) Dual Band Wireless AC 8275 +.It +Killer (R) Wireless-AC 1550 Wireless Network Adapter (9260NGW) 160MHz +.It +Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW) +.It +Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW) +.It +Killer(R) Wireless-AC 1550s Wireless Network Adapter (9560D2W) 160MHz +.It +Killer(R) Wireless-AC 1550i Wireless Network Adapter (9560NGW) 160MHz +.It +Killer(R) Wi-Fi 6E AX1690s 160MHz Wireless Network Adapter (411D2W) +.It +Killer(R) Wi-Fi 6E AX1690i 160MHz Wireless Network Adapter (411NGW) +.It +Intel(R) Wireless-AC 9260-1 +.It +Intel(R) Wi-Fi 6 AX200 160MHz +.It +Killer(R) Wi-Fi 6 AX1650w 160MHz Wireless Network Adapter (200D2W) +.It +Killer(R) Wi-Fi 6 AX1650x 160MHz Wireless Network Adapter (200NGW) +.It +Intel(R) Wi-Fi 6 AX201 160MHz +.It +Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W) +.It +Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW) +.It +Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201NGW) +.It +Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201D2W) +.It +Intel(R) Wi-Fi 6E AX211 160MHz +.It +Intel(R) Wi-Fi 6 AX210 160MHz +.It +Killer(R) Wi-Fi 6E AX1675w 160MHz Wireless Network Adapter (210D2W) +.It +Killer(R) Wi-Fi 6E AX1675x 160MHz Wireless Network Adapter (210NGW) +.It +Intel(R) Wi-Fi 6E AX411 160MHz +.It +Killer(R) Wi-Fi 6E AX1675s 160MHz Wireless Network Adapter (211NGW) +.It +Killer(R) Wi-Fi 6E AX1675i 160MHz Wireless Network Adapter (211NGW) +.It +Intel(R) Wireless-AC 9461 160MHz +.It +Intel(R) Wireless-AC 9461 +.It +Intel(R) Wireless-AC 9462 160MHz +.It +Intel(R) Wireless-AC 9462 +.It +Intel(R) Wireless-AC 9560 160MHz +.It +Intel(R) Wireless-AC 9560 +.It +Intel(R) Wireless-AC 9270 160MHz +.It +Intel(R) Wireless-AC 9270 +.It +Intel(R) Wireless-AC 9162 160MHz +.It +Intel(R) Wireless-AC 9162 +.It +Intel(R) Wireless-AC 9260 160MHz +.It +Intel(R) Wireless-AC 9260 +.It +Intel(R) Wi-Fi 6 AX101 +.It +Intel(R) Wi-Fi 6 AX203 +.It - Intel(R) Wi-Fi 6E AX221 160MHz - .It +Intel(R) Wi-Fi 6E AX231 160MHz +.It - Intel(R) TBD Bz device ++Intel(R) Wi-Fi 7 BE201 320MHz +.It - Intel(R) Wi-Fi 6 AX204 160MHz ++Intel(R) Wi-Fi 7 BE200 320MHz ++.It ++Intel(R) Wi-Fi 7 BE202 160MHz +.It +Intel(R) TBD Sc device ++.It ++Intel(R) TBD Sc2 device ++.It ++Intel(R) TBD Sc2f device +.\" --------------------------------------------------------------------- +.El +.Sh BUGS +Certainly. +.Sh SEE ALSO +.Xr iwlwififw 4 , +.Xr iwm 4 , +.Xr iwn 4 , +.Xr wlan 4 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.1 . diff --cc share/man/man4/iwlwififw.4 index debd0cda36b5,000000000000..491a634e70b5 mode 100644,000000..100644 --- a/share/man/man4/iwlwififw.4 +++ b/share/man/man4/iwlwififw.4 @@@ -1,1362 -1,0 +1,1566 @@@ +.\"- - .\" Copyright (c) 2021-2023 The FreeBSD Foundation ++.\" Copyright (c) 2021-2024 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" - .Dd September 21, 2023 ++.Dd October 12, 2024 +.Dt iwlwififw 4 +.Os +.Sh NAME +.Nm iwlwififw +.Nd Firmware modules for Intel iwlwifi wireless network driver +.Sh SYNOPSIS +The +.Xr iwlwifi 4 +driver should auto-load any firmware needed. +It is discouraged to load the driver or firmware manually from +.Xr loader 8 . +.Sh DESCRIPTION +Multiple modules provide access to firmware for the various chipset +models supported by the +.Xr iwlwifi 4 +driver. +.Pp ++One can use ++.Xr fwget 8 ++to install the correct firmware package. ++.Pp +.Bl -column -compact "Vendor" "Device" "Subv. " "Subd. " "Firmware-Prefix" +.It Ar Name +.It Ar Vendor Ta Ar Device Ta Ar Subv. Ta Ar Subd. Ta Ar Firmware-Prefix - .\" --------------------------------------------------------------------- - .\" This list is manually generated from a sysctl and post-processing. - .\" Edits will be overwritten on next update. - .\" --------------------------------------------------------------------- ++.% --------------------------------------------------------------------- ++.% This list is manually generated from a sysctl and post-processing ++.% by sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh generating the list. ++.% Edits will be overwritten on next update. ++.% --------------------------------------------------------------------- +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4070 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4072 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4170 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4c60 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4c70 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4060 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x406a Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4160 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4062 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4162 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4270 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4272 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4260 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x426a Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4262 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4470 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4472 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4460 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x446a Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4462 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4870 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x486e Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4a70 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4a6e Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4a6c Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4570 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4560 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4370 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4360 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x5070 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x5072 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x5170 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x5770 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4020 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x402a Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0x4220 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0x4420 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc070 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc072 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc170 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc060 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc06a Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc160 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc062 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc162 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc770 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc760 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc270 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xcc70 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xcc60 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc272 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc260 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc26a Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc262 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc470 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc472 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc460 Ta iwlwifi-7260 +.It "" +.It Intel(R) Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc462 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc570 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc560 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc370 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc360 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc020 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc02a Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b2 Ta any Ta 0xc220 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless N 7260 +.It 0x8086 Ta 0x08b1 Ta any Ta 0xc420 Ta iwlwifi-7260 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0070 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0072 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0170 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0172 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless N 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0060 Ta iwlwifi-3160 +.It "" +.It Intel(R) Wireless N 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0062 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x0270 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x0272 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0470 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x0472 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x0370 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8070 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8072 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8170 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8172 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless N 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8060 Ta iwlwifi-3160 +.It "" +.It Intel(R) Wireless N 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8062 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x8270 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x8370 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b4 Ta any Ta 0x8272 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8470 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x8570 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x1070 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3160 +.It 0x8086 Ta 0x08b3 Ta any Ta 0x1170 Ta iwlwifi-3160 +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x4010 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x4012 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3166 Ta any Ta 0x4212 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x4410 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x4510 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x4110 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3166 Ta any Ta 0x4310 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3166 Ta any Ta 0x4210 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x8010 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3165 +.It 0x8086 Ta 0x3165 Ta any Ta 0x8110 Ta iwlwifi-7265D +.It "" +.It Intel(R) Dual Band Wireless AC 3168 +.It 0x8086 Ta 0x24fb Ta any Ta 0x2010 Ta iwlwifi-3168 +.It "" +.It Intel(R) Dual Band Wireless AC 3168 +.It 0x8086 Ta 0x24fb Ta any Ta 0x2110 Ta iwlwifi-3168 +.It "" +.It Intel(R) Dual Band Wireless AC 3168 +.It 0x8086 Ta 0x24fb Ta any Ta 0x2050 Ta iwlwifi-3168 +.It "" +.It Intel(R) Dual Band Wireless AC 3168 +.It 0x8086 Ta 0x24fb Ta any Ta 0x2150 Ta iwlwifi-3168 +.It "" +.It Intel(R) Dual Band Wireless AC 3168 +.It 0x8086 Ta 0x24fb Ta any Ta 000000 Ta iwlwifi-3168 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5010 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5110 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5100 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5310 Ta iwlwifi-7265 +.It "" +.It Intel(R) Wireless N 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5302 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5210 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5c10 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5012 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5412 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5410 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5510 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5400 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x1010 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5000 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x500a Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5200 Ta iwlwifi-7265 +.It "" +.It Intel(R) Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5002 Ta iwlwifi-7265 +.It "" +.It Intel(R) Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5102 Ta iwlwifi-7265 +.It "" +.It Intel(R) Wireless N 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5202 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9010 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9012 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x900a Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9110 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9112 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x9210 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x9200 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9510 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x9310 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9410 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5020 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x502a Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless N 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5420 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5090 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5190 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5590 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5290 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5490 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x5f10 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x5212 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095b Ta any Ta 0x520a Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9000 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9400 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 7265 +.It 0x8086 Ta 0x095a Ta any Ta 0x9e10 Ta iwlwifi-7265 +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0010 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1010 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x10b0 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0130 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1130 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0132 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1132 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0110 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x01f0 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0012 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1012 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1110 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0050 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0250 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1050 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x0150 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f3 Ta any Ta 0x1150 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f4 Ta any Ta 0x0030 Ta iwlwifi-8000C +.It "" +.It Intel(R) Dual Band Wireless AC 8260 +.It 0x8086 Ta 0x24f4 Ta any Ta 0x1030 Ta iwlwifi-8000C *** 32164 LINES SKIPPED *** From nobody Mon Oct 28 14:49:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrr2y5Dz5bRKm; Mon, 28 Oct 2024 14:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrr24R5z4nmS; Mon, 28 Oct 2024 14:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mABYZ26/+LDgNufE66iN6J5qTG0cD8NptXXkkHanXMw=; b=FnJLSleoFh4jtGtjptWteLnXmaq3tcEsigLV+U7Sj9DNePPPqdtrjJ/6IcQ38/oEPGNeh4 bw0TYbBNK3Ypt27VT0e6JaQokII773ny9TMvxrxgqMSnUZLnDOu/VwULOlqWqiKxYmKWcg QIgaUzyVHGqOhgDBHtX6rOfRZvE5vi7dRnqc/TzWQ61/fpI4iT5Wft8nSzKUne9oT7dwuB EjubN4lej3BOrC1q3NLh6vM76LXYQ63U1dYKHpoTB8NsTMvmpyL+4ttdmG4EsVoVQYvNtK Cb0jOOOP/BRVq2oboTyZG4QKL906hy4kjx0h6BvDFFn+pDPxhJ4Ydkq+vLDS8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mABYZ26/+LDgNufE66iN6J5qTG0cD8NptXXkkHanXMw=; b=JM1vJVAonLv78Nml6FzmWxtNW4C77xRof3ylIn+sRrecm3bMtgBYciyw5tUdHEPsxiK6EL jJb0ezVZ4I18bV2fFoUvv6cRkbImbT9KW/Q39oAPN2d8EachtzRrybvUtYgepEcmqRq2z+ LGq6dzEuOtv6TYrzRZs8A0puilzMr+R7a9G7Fj+jwaTNfx5RA85EIdkdyZMjGfGlrEkWnU QOTbsq3jyL2UXncgIPyYKh3J9ilRdrIIVENvYs+eoc29l03Dz6qqD4wkQrIK+SkCFDAC2O wCOx/UtPjh+HuLGZSc7IkSmhNtw5JdIHzi6JOcipW1dYVTxQvS1Zey9u6MLmng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126988; a=rsa-sha256; cv=none; b=qILcR8RhuXEfnTpZcs0c1HLPHny29xSAwf/jgtxedhU4u1jE/V8nCDU83zPEv20BIBEDOK 70Wq31BEbzLFUhNIhnfJAMCr1BD95VyeELC3KMhCDg/woPQKAN8C1pPKI2S7a3YwP+BUn0 bR9m4PcKRSKQ8NWNSuLQrC3ZO6klfAZnNvRl8NVWfpawW/X8aW3mNYCUfWKDdzX/XhaVnx 53+BuvntjJ+u1r3aYL8YJMl+1Q9UIlombsd/hAqxlO4EpG4ux/Co11V2s3Y27cmQ4FrvtS JcKWxVjfonpdkhRhl8ohOXMjWrwMzBr0HqXMKbfYsG1lEOiDxBH2+3hAGGryeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrr1JFCzk2H; Mon, 28 Oct 2024 14:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEnmOi099225; Mon, 28 Oct 2024 14:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEnlFw099222; Mon, 28 Oct 2024 14:49:47 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:47 GMT Message-Id: <202410281449.49SEnlFw099222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6d67aabd6355 - main - rtw89: update Realtek's rtw89 driver. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6d67aabd63555ab62a2f2b7f52a75ef100a2fe75 commit 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75 Merge: 11c53278a8a3 5b760eaecd6c Author: Bjoern A. Zeeb AuthorDate: 2024-10-04 00:00:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 14:42:36 +0000 rtw89: update Realtek's rtw89 driver. This adds support for the Realtek 8922AE PCI wireless network (Wi-Fi 7) adapter. This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ). Sponsored by: The FreeBSD Foundation MFC after: 14 days share/man/man4/rtw89.4 | 11 +- sys/contrib/dev/rtw89/Kconfig | 19 + sys/contrib/dev/rtw89/Makefile | 18 +- sys/contrib/dev/rtw89/acpi.c | 131 +- sys/contrib/dev/rtw89/acpi.h | 53 +- sys/contrib/dev/rtw89/cam.c | 277 +- sys/contrib/dev/rtw89/cam.h | 180 +- sys/contrib/dev/rtw89/chan.c | 2305 +++++++++++++- sys/contrib/dev/rtw89/chan.h | 48 + sys/contrib/dev/rtw89/coex.c | 2996 +++++++++++++++--- sys/contrib/dev/rtw89/coex.h | 176 ++ sys/contrib/dev/rtw89/core.c | 1233 ++++++-- sys/contrib/dev/rtw89/core.h | 1468 ++++++++- sys/contrib/dev/rtw89/debug.c | 440 ++- sys/contrib/dev/rtw89/debug.h | 19 +- sys/contrib/dev/rtw89/efuse.c | 11 +- sys/contrib/dev/rtw89/efuse.h | 18 +- sys/contrib/dev/rtw89/efuse_be.c | 562 ++++ sys/contrib/dev/rtw89/fw.c | 4264 ++++++++++++++++++++++--- sys/contrib/dev/rtw89/fw.h | 2637 ++++++++++------ sys/contrib/dev/rtw89/mac.c | 1738 ++++++++--- sys/contrib/dev/rtw89/mac.h | 377 ++- sys/contrib/dev/rtw89/mac80211.c | 138 +- sys/contrib/dev/rtw89/mac_be.c | 2606 ++++++++++++++++ sys/contrib/dev/rtw89/pci.c | 794 ++++- sys/contrib/dev/rtw89/pci.h | 623 +++- sys/contrib/dev/rtw89/pci_be.c | 618 ++++ sys/contrib/dev/rtw89/phy.c | 2610 ++++++++++++++-- sys/contrib/dev/rtw89/phy.h | 429 ++- sys/contrib/dev/rtw89/phy_be.c | 1002 ++++++ sys/contrib/dev/rtw89/ps.c | 97 +- sys/contrib/dev/rtw89/ps.h | 8 + sys/contrib/dev/rtw89/reg.h | 4292 ++++++++++++++++++++++++- sys/contrib/dev/rtw89/regd.c | 522 +++- sys/contrib/dev/rtw89/rtw8851b.c | 243 +- sys/contrib/dev/rtw89/rtw8851b_table.c | 1409 +++++---- sys/contrib/dev/rtw89/rtw8851b_table.h | 3 - sys/contrib/dev/rtw89/rtw8851be.c | 7 + sys/contrib/dev/rtw89/rtw8852a.c | 158 +- sys/contrib/dev/rtw89/rtw8852a_table.c | 2 + sys/contrib/dev/rtw89/rtw8852a_table.h | 1 - sys/contrib/dev/rtw89/rtw8852ae.c | 7 + sys/contrib/dev/rtw89/rtw8852b.c | 1988 +----------- sys/contrib/dev/rtw89/rtw8852b.h | 122 - sys/contrib/dev/rtw89/rtw8852b_common.c | 2053 ++++++++++++ sys/contrib/dev/rtw89/rtw8852b_common.h | 388 +++ sys/contrib/dev/rtw89/rtw8852b_rfk.c | 25 +- sys/contrib/dev/rtw89/rtw8852b_table.c | 459 +-- sys/contrib/dev/rtw89/rtw8852b_table.h | 3 - sys/contrib/dev/rtw89/rtw8852be.c | 7 + sys/contrib/dev/rtw89/rtw8852bt.h | 13 + sys/contrib/dev/rtw89/rtw8852bt_rfk.c | 4019 ++++++++++++++++++++++++ sys/contrib/dev/rtw89/rtw8852bt_rfk.h | 22 + sys/contrib/dev/rtw89/rtw8852bt_rfk_table.c | 490 +++ sys/contrib/dev/rtw89/rtw8852bt_rfk_table.h | 38 + sys/contrib/dev/rtw89/rtw8852c.c | 231 +- sys/contrib/dev/rtw89/rtw8852c.h | 20 +- sys/contrib/dev/rtw89/rtw8852c_rfk.c | 93 +- sys/contrib/dev/rtw89/rtw8852c_rfk.h | 3 + sys/contrib/dev/rtw89/rtw8852c_rfk_table.c | 42 +- sys/contrib/dev/rtw89/rtw8852c_table.c | 4488 +++++++++++++++------------ sys/contrib/dev/rtw89/rtw8852c_table.h | 3 - sys/contrib/dev/rtw89/rtw8852ce.c | 29 + sys/contrib/dev/rtw89/rtw8922a.c | 2639 ++++++++++++++++ sys/contrib/dev/rtw89/rtw8922a.h | 73 + sys/contrib/dev/rtw89/rtw8922a_rfk.c | 391 +++ sys/contrib/dev/rtw89/rtw8922a_rfk.h | 18 + sys/contrib/dev/rtw89/rtw8922ae.c | 94 + sys/contrib/dev/rtw89/sar.c | 222 +- sys/contrib/dev/rtw89/sar.h | 14 +- sys/contrib/dev/rtw89/ser.c | 44 +- sys/contrib/dev/rtw89/txrx.h | 279 ++ sys/contrib/dev/rtw89/util.c | 106 + sys/contrib/dev/rtw89/util.h | 5 + sys/contrib/dev/rtw89/wow.c | 787 ++++- sys/contrib/dev/rtw89/wow.h | 87 + sys/modules/rtw89/Makefile | 11 +- 77 files changed, 45379 insertions(+), 8477 deletions(-) diff --cc share/man/man4/rtw89.4 index 2e1f2676eb8e,000000000000..14259ae5e077 mode 100644,000000..100644 --- a/share/man/man4/rtw89.4 +++ b/share/man/man4/rtw89.4 @@@ -1,126 -1,0 +1,127 @@@ +.\"- +.\" Copyright (c) 2023-2024 Bjoern A. Zeeb +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" - .Dd October 10, 2024 ++.Dd October 12, 2024 +.Dt RTW89 4 +.Os +.Sh NAME +.Nm rtw89 +.Nd Realtek IEEE 802.11ax wireless network driver +.Sh SYNOPSIS +The driver will auto-load without any user interaction using +.Xr devmatch 8 +if enabled in +.Xr rc.conf 5 . +.Pp +Only if auto-loading is explicitly disabled, place the following +lines in +.Xr rc.conf 5 +to manually load the driver as a module at boot time: +.Bd -literal -offset indent +kld_list="${kld_list} if_rtw89" +.Ed +.Pp +It is discouraged to load the driver from +.Xr loader 8 . +.Sh DESCRIPTION +The +.Nm +driver is derived from Realtek's Linux rtw89 driver. +.Pp +This driver requires firmware to be loaded before it will work. +The package +.Pa wifi-firmware-rtw89-kmod +from the +.Pa ports/net/wifi-firmware-rtw89-kmod +port needs to be installed before the driver is loaded. +Otherwise no +.Xr wlan 4 +interface can be created using +.Xr ifconfig 8 . +One should use +.Xr fwget 8 +to install the correct firmware package. +.Pp +The driver uses the +.\" No LinuxKPI man pages so no .Xr here. +.Em linuxkpi_wlan +and +.Em linuxkpi +compat framework to bridge between the Linux and +native +.Fx +driver code as well as to the native +.Xr net80211 4 +wireless stack. +.Pp +While +.Nm +supports all 802.11 a/b/g/n/ac and ax +the compatibility code currently only supports 802.11 a/b/g modes. +Support for 802.11 n/ac is to come. +.Sh LOADER TUNABLES +.Bl -tag -width indent +.It Va compat.linuxkpi.skb.mem_limit +If you are running a 64bit system with more than 4GB of main memory +you need to set this tunable to +.Sy 1 +in +.Xr loader.conf 5 +and reboot once to make it effective. +This tunable will work around a problem with DMA and limit allocations +for network buffer memory to the lower 32bit of physical memory and +make the driver work. +.El +.Sh HARDWARE +The +.Nm +driver supports PCIe devices with the following chipsets: +.Pp +.Bl -tag -width Ds -offset indent -compact - .It Realtek 802.11ax wireless 8851be (RTL8851BE) - .It Realtek 802.11ax wireless 8852ae (RTL8852AE) - .It Realtek 802.11ax wireless 8852be (RTL8852BE) - .It Realtek 802.11ax wireless 8852ce (RTL8852CE) ++.It Realtek 8851BE Wi-Fi 6 (RTL8851BE) ++.It Realtek 8852AE Wi-Fi 6 (RTL8852AE) ++.It Realtek 8852BE Wi-Fi 6 (RTL8852BE) ++.It Realtek 8852CE Wi-Fi 6E (RTL8852CE) ++.It Realtek 8922AE Wi-Fi 7 (RTL8922AE) +.El +.Sh BUGS +Certainly. +.Pp +Does not seem to work (reliably) on machines with more than 4GB of +main memory. +See in the +.Sx LOADER TUNABLES +section above. +.Sh SEE ALSO +.Xr wlan 4 , +.Xr fwget 8 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 14.2 . diff --cc sys/contrib/dev/rtw89/Makefile index 41940099af1b,000000000000..1f1050a7a89d mode 100644,000000..100644 --- a/sys/contrib/dev/rtw89/Makefile +++ b/sys/contrib/dev/rtw89/Makefile @@@ -1,61 -1,0 +1,75 @@@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +obj-$(CONFIG_RTW89_CORE) += rtw89_core.o +rtw89_core-y += core.o \ + mac80211.o \ + mac.o \ ++ mac_be.o \ + phy.o \ ++ phy_be.o \ + fw.o \ + cam.o \ + efuse.o \ ++ efuse_be.o \ + regd.o \ + sar.o \ + coex.o \ + ps.o \ + chan.o \ + ser.o \ - acpi.o ++ acpi.o \ ++ util.o + +rtw89_core-$(CONFIG_PM) += wow.o + +obj-$(CONFIG_RTW89_8851B) += rtw89_8851b.o +rtw89_8851b-objs := rtw8851b.o \ + rtw8851b_table.o \ + rtw8851b_rfk.o \ + rtw8851b_rfk_table.o + +obj-$(CONFIG_RTW89_8851BE) += rtw89_8851be.o +rtw89_8851be-objs := rtw8851be.o + +obj-$(CONFIG_RTW89_8852A) += rtw89_8852a.o +rtw89_8852a-objs := rtw8852a.o \ + rtw8852a_table.o \ + rtw8852a_rfk.o \ + rtw8852a_rfk_table.o + +obj-$(CONFIG_RTW89_8852AE) += rtw89_8852ae.o +rtw89_8852ae-objs := rtw8852ae.o + ++obj-$(CONFIG_RTW89_8852B_COMMON) += rtw89_8852b_common.o ++rtw89_8852b_common-objs := rtw8852b_common.o ++ +obj-$(CONFIG_RTW89_8852B) += rtw89_8852b.o +rtw89_8852b-objs := rtw8852b.o \ + rtw8852b_table.o \ + rtw8852b_rfk.o \ + rtw8852b_rfk_table.o + +obj-$(CONFIG_RTW89_8852BE) += rtw89_8852be.o +rtw89_8852be-objs := rtw8852be.o + +obj-$(CONFIG_RTW89_8852C) += rtw89_8852c.o +rtw89_8852c-objs := rtw8852c.o \ + rtw8852c_table.o \ + rtw8852c_rfk.o \ + rtw8852c_rfk_table.o + +obj-$(CONFIG_RTW89_8852CE) += rtw89_8852ce.o +rtw89_8852ce-objs := rtw8852ce.o + ++obj-$(CONFIG_RTW89_8922A) += rtw89_8922a.o ++rtw89_8922a-objs := rtw8922a.o \ ++ rtw8922a_rfk.o ++ ++obj-$(CONFIG_RTW89_8922AE) += rtw89_8922ae.o ++rtw89_8922ae-objs := rtw8922ae.o ++ +rtw89_core-$(CONFIG_RTW89_DEBUG) += debug.o + +obj-$(CONFIG_RTW89_PCI) += rtw89_pci.o - rtw89_pci-y := pci.o ++rtw89_pci-y := pci.o pci_be.o + diff --cc sys/contrib/dev/rtw89/acpi.c index 83252c861c82,000000000000..272795188f99 mode 100644,000000..100644 --- a/sys/contrib/dev/rtw89/acpi.c +++ b/sys/contrib/dev/rtw89/acpi.c @@@ -1,60 -1,0 +1,159 @@@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2021-2023 Realtek Corporation + */ + +#include +#include + +#include "acpi.h" +#include "debug.h" + +#if defined(__linux__) +static const guid_t rtw89_guid = GUID_INIT(0xD2A8C3E8, 0x4B69, 0x4F00, + 0x82, 0xBD, 0xFE, 0x86, + 0x07, 0x80, 0x3A, 0xA7); + - static int rtw89_acpi_dsm_get(struct rtw89_dev *rtwdev, union acpi_object *obj, - u8 *value) ++static ++int rtw89_acpi_dsm_get_value(struct rtw89_dev *rtwdev, union acpi_object *obj, ++ u8 *value) +{ - switch (obj->type) { - case ACPI_TYPE_INTEGER: - *value = (u8)obj->integer.value; - break; - case ACPI_TYPE_BUFFER: - *value = obj->buffer.pointer[0]; - break; - default: - rtw89_debug(rtwdev, RTW89_DBG_UNEXP, - "acpi dsm return unhandled type: %d\n", obj->type); ++ if (obj->type != ACPI_TYPE_INTEGER) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, ++ "acpi: expect integer but type: %d\n", obj->type); + return -EINVAL; + } + ++ *value = (u8)obj->integer.value; ++ return 0; ++} ++ ++static bool chk_acpi_policy_6ghz_sig(const struct rtw89_acpi_policy_6ghz *p) ++{ ++ return p->signature[0] == 0x00 && ++ p->signature[1] == 0xE0 && ++ p->signature[2] == 0x4C; ++} ++ ++static ++int rtw89_acpi_dsm_get_policy_6ghz(struct rtw89_dev *rtwdev, ++ union acpi_object *obj, ++ struct rtw89_acpi_policy_6ghz **policy_6ghz) ++{ ++ const struct rtw89_acpi_policy_6ghz *ptr; ++ u32 expect_len; ++ u32 len; ++ ++ if (obj->type != ACPI_TYPE_BUFFER) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, ++ "acpi: expect buffer but type: %d\n", obj->type); ++ return -EINVAL; ++ } ++ ++ len = obj->buffer.length; ++ if (len < sizeof(*ptr)) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", ++ __func__, len); ++ return -EINVAL; ++ } ++ ++ ptr = (typeof(ptr))obj->buffer.pointer; ++ if (!chk_acpi_policy_6ghz_sig(ptr)) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); ++ return -EINVAL; ++ } ++ ++ expect_len = struct_size(ptr, country_list, ptr->country_count); ++ if (len < expect_len) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: expect %u but length: %u\n", ++ __func__, expect_len, len); ++ return -EINVAL; ++ } ++ ++ *policy_6ghz = kmemdup(ptr, expect_len, GFP_KERNEL); ++ if (!*policy_6ghz) ++ return -ENOMEM; ++ ++ rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_6ghz: ", *policy_6ghz, ++ expect_len); ++ return 0; ++} ++ ++static bool chk_acpi_policy_6ghz_sp_sig(const struct rtw89_acpi_policy_6ghz_sp *p) ++{ ++ return p->signature[0] == 0x52 && ++ p->signature[1] == 0x54 && ++ p->signature[2] == 0x4B && ++ p->signature[3] == 0x07; ++} ++ ++static ++int rtw89_acpi_dsm_get_policy_6ghz_sp(struct rtw89_dev *rtwdev, ++ union acpi_object *obj, ++ struct rtw89_acpi_policy_6ghz_sp **policy) ++{ ++ const struct rtw89_acpi_policy_6ghz_sp *ptr; ++ u32 buf_len; ++ ++ if (obj->type != ACPI_TYPE_BUFFER) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, ++ "acpi: expect buffer but type: %d\n", obj->type); ++ return -EINVAL; ++ } ++ ++ buf_len = obj->buffer.length; ++ if (buf_len < sizeof(*ptr)) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", ++ __func__, buf_len); ++ return -EINVAL; ++ } ++ ++ ptr = (typeof(ptr))obj->buffer.pointer; ++ if (!chk_acpi_policy_6ghz_sp_sig(ptr)) { ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); ++ return -EINVAL; ++ } ++ ++ *policy = kmemdup(ptr, sizeof(*ptr), GFP_KERNEL); ++ if (!*policy) ++ return -ENOMEM; ++ ++ rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_6ghz_sp: ", *policy, ++ sizeof(*ptr)); + return 0; +} + +int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev, - enum rtw89_acpi_dsm_func func, u8 *value) ++ enum rtw89_acpi_dsm_func func, ++ struct rtw89_acpi_dsm_result *res) +{ + union acpi_object *obj; + int ret; + + obj = acpi_evaluate_dsm(ACPI_HANDLE(rtwdev->dev), &rtw89_guid, + 0, func, NULL); + if (!obj) { - rtw89_debug(rtwdev, RTW89_DBG_UNEXP, ++ rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi dsm fail to evaluate func: %d\n", func); + return -ENOENT; + } + - ret = rtw89_acpi_dsm_get(rtwdev, obj, value); ++ if (func == RTW89_ACPI_DSM_FUNC_6G_BP) ++ ret = rtw89_acpi_dsm_get_policy_6ghz(rtwdev, obj, ++ &res->u.policy_6ghz); ++ else if (func == RTW89_ACPI_DSM_FUNC_6GHZ_SP_SUP) ++ ret = rtw89_acpi_dsm_get_policy_6ghz_sp(rtwdev, obj, ++ &res->u.policy_6ghz_sp); ++ else ++ ret = rtw89_acpi_dsm_get_value(rtwdev, obj, &res->u.value); + + ACPI_FREE(obj); + return ret; +} +#elif defined(__FreeBSD__) +int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev, - enum rtw89_acpi_dsm_func func, u8 *value) ++ enum rtw89_acpi_dsm_func func, ++ struct rtw89_acpi_dsm_result *res) +{ + return -ENOENT; +} +#endif diff --cc sys/contrib/dev/rtw89/core.c index fff00da406e2,000000000000..d1f82bfad4a9 mode 100644,000000..100644 --- a/sys/contrib/dev/rtw89/core.c +++ b/sys/contrib/dev/rtw89/core.c @@@ -1,4040 -1,0 +1,4779 @@@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2019-2020 Realtek Corporation + */ + +#if defined(__FreeBSD__) +#define LINUXKPI_PARAM_PREFIX rtw89_ +#endif + +#include +#include + +#include "cam.h" +#include "chan.h" +#include "coex.h" +#include "core.h" +#include "efuse.h" +#include "fw.h" +#include "mac.h" +#include "phy.h" +#include "ps.h" +#include "reg.h" +#include "sar.h" +#include "ser.h" +#include "txrx.h" +#include "util.h" ++#include "wow.h" + +static bool rtw89_disable_ps_mode; +module_param_named(disable_ps_mode, rtw89_disable_ps_mode, bool, 0644); +MODULE_PARM_DESC(disable_ps_mode, "Set Y to disable low power mode"); + +#define RTW89_DEF_CHAN(_freq, _hw_val, _flags, _band) \ + { .center_freq = _freq, .hw_value = _hw_val, .flags = _flags, .band = _band, } +#define RTW89_DEF_CHAN_2G(_freq, _hw_val) \ + RTW89_DEF_CHAN(_freq, _hw_val, 0, NL80211_BAND_2GHZ) +#define RTW89_DEF_CHAN_5G(_freq, _hw_val) \ + RTW89_DEF_CHAN(_freq, _hw_val, 0, NL80211_BAND_5GHZ) +#define RTW89_DEF_CHAN_5G_NO_HT40MINUS(_freq, _hw_val) \ + RTW89_DEF_CHAN(_freq, _hw_val, IEEE80211_CHAN_NO_HT40MINUS, NL80211_BAND_5GHZ) +#define RTW89_DEF_CHAN_6G(_freq, _hw_val) \ + RTW89_DEF_CHAN(_freq, _hw_val, 0, NL80211_BAND_6GHZ) + +static struct ieee80211_channel rtw89_channels_2ghz[] = { + RTW89_DEF_CHAN_2G(2412, 1), + RTW89_DEF_CHAN_2G(2417, 2), + RTW89_DEF_CHAN_2G(2422, 3), + RTW89_DEF_CHAN_2G(2427, 4), + RTW89_DEF_CHAN_2G(2432, 5), + RTW89_DEF_CHAN_2G(2437, 6), + RTW89_DEF_CHAN_2G(2442, 7), + RTW89_DEF_CHAN_2G(2447, 8), + RTW89_DEF_CHAN_2G(2452, 9), + RTW89_DEF_CHAN_2G(2457, 10), + RTW89_DEF_CHAN_2G(2462, 11), + RTW89_DEF_CHAN_2G(2467, 12), + RTW89_DEF_CHAN_2G(2472, 13), + RTW89_DEF_CHAN_2G(2484, 14), +}; + +static struct ieee80211_channel rtw89_channels_5ghz[] = { + RTW89_DEF_CHAN_5G(5180, 36), + RTW89_DEF_CHAN_5G(5200, 40), + RTW89_DEF_CHAN_5G(5220, 44), + RTW89_DEF_CHAN_5G(5240, 48), + RTW89_DEF_CHAN_5G(5260, 52), + RTW89_DEF_CHAN_5G(5280, 56), + RTW89_DEF_CHAN_5G(5300, 60), + RTW89_DEF_CHAN_5G(5320, 64), + RTW89_DEF_CHAN_5G(5500, 100), + RTW89_DEF_CHAN_5G(5520, 104), + RTW89_DEF_CHAN_5G(5540, 108), + RTW89_DEF_CHAN_5G(5560, 112), + RTW89_DEF_CHAN_5G(5580, 116), + RTW89_DEF_CHAN_5G(5600, 120), + RTW89_DEF_CHAN_5G(5620, 124), + RTW89_DEF_CHAN_5G(5640, 128), + RTW89_DEF_CHAN_5G(5660, 132), + RTW89_DEF_CHAN_5G(5680, 136), + RTW89_DEF_CHAN_5G(5700, 140), + RTW89_DEF_CHAN_5G(5720, 144), + RTW89_DEF_CHAN_5G(5745, 149), + RTW89_DEF_CHAN_5G(5765, 153), + RTW89_DEF_CHAN_5G(5785, 157), + RTW89_DEF_CHAN_5G(5805, 161), + RTW89_DEF_CHAN_5G_NO_HT40MINUS(5825, 165), + RTW89_DEF_CHAN_5G(5845, 169), + RTW89_DEF_CHAN_5G(5865, 173), + RTW89_DEF_CHAN_5G(5885, 177), +}; + ++static_assert(RTW89_5GHZ_UNII4_START_INDEX + RTW89_5GHZ_UNII4_CHANNEL_NUM == ++ ARRAY_SIZE(rtw89_channels_5ghz)); ++ +static struct ieee80211_channel rtw89_channels_6ghz[] = { + RTW89_DEF_CHAN_6G(5955, 1), + RTW89_DEF_CHAN_6G(5975, 5), + RTW89_DEF_CHAN_6G(5995, 9), + RTW89_DEF_CHAN_6G(6015, 13), + RTW89_DEF_CHAN_6G(6035, 17), + RTW89_DEF_CHAN_6G(6055, 21), + RTW89_DEF_CHAN_6G(6075, 25), + RTW89_DEF_CHAN_6G(6095, 29), + RTW89_DEF_CHAN_6G(6115, 33), + RTW89_DEF_CHAN_6G(6135, 37), + RTW89_DEF_CHAN_6G(6155, 41), + RTW89_DEF_CHAN_6G(6175, 45), + RTW89_DEF_CHAN_6G(6195, 49), + RTW89_DEF_CHAN_6G(6215, 53), + RTW89_DEF_CHAN_6G(6235, 57), + RTW89_DEF_CHAN_6G(6255, 61), + RTW89_DEF_CHAN_6G(6275, 65), + RTW89_DEF_CHAN_6G(6295, 69), + RTW89_DEF_CHAN_6G(6315, 73), + RTW89_DEF_CHAN_6G(6335, 77), + RTW89_DEF_CHAN_6G(6355, 81), + RTW89_DEF_CHAN_6G(6375, 85), + RTW89_DEF_CHAN_6G(6395, 89), + RTW89_DEF_CHAN_6G(6415, 93), + RTW89_DEF_CHAN_6G(6435, 97), + RTW89_DEF_CHAN_6G(6455, 101), + RTW89_DEF_CHAN_6G(6475, 105), + RTW89_DEF_CHAN_6G(6495, 109), + RTW89_DEF_CHAN_6G(6515, 113), + RTW89_DEF_CHAN_6G(6535, 117), + RTW89_DEF_CHAN_6G(6555, 121), + RTW89_DEF_CHAN_6G(6575, 125), + RTW89_DEF_CHAN_6G(6595, 129), + RTW89_DEF_CHAN_6G(6615, 133), + RTW89_DEF_CHAN_6G(6635, 137), + RTW89_DEF_CHAN_6G(6655, 141), + RTW89_DEF_CHAN_6G(6675, 145), + RTW89_DEF_CHAN_6G(6695, 149), + RTW89_DEF_CHAN_6G(6715, 153), + RTW89_DEF_CHAN_6G(6735, 157), + RTW89_DEF_CHAN_6G(6755, 161), + RTW89_DEF_CHAN_6G(6775, 165), + RTW89_DEF_CHAN_6G(6795, 169), + RTW89_DEF_CHAN_6G(6815, 173), + RTW89_DEF_CHAN_6G(6835, 177), + RTW89_DEF_CHAN_6G(6855, 181), + RTW89_DEF_CHAN_6G(6875, 185), + RTW89_DEF_CHAN_6G(6895, 189), + RTW89_DEF_CHAN_6G(6915, 193), + RTW89_DEF_CHAN_6G(6935, 197), + RTW89_DEF_CHAN_6G(6955, 201), + RTW89_DEF_CHAN_6G(6975, 205), + RTW89_DEF_CHAN_6G(6995, 209), + RTW89_DEF_CHAN_6G(7015, 213), + RTW89_DEF_CHAN_6G(7035, 217), + RTW89_DEF_CHAN_6G(7055, 221), + RTW89_DEF_CHAN_6G(7075, 225), + RTW89_DEF_CHAN_6G(7095, 229), + RTW89_DEF_CHAN_6G(7115, 233), +}; + +static struct ieee80211_rate rtw89_bitrates[] = { + { .bitrate = 10, .hw_value = 0x00, }, + { .bitrate = 20, .hw_value = 0x01, }, + { .bitrate = 55, .hw_value = 0x02, }, + { .bitrate = 110, .hw_value = 0x03, }, + { .bitrate = 60, .hw_value = 0x04, }, + { .bitrate = 90, .hw_value = 0x05, }, + { .bitrate = 120, .hw_value = 0x06, }, + { .bitrate = 180, .hw_value = 0x07, }, + { .bitrate = 240, .hw_value = 0x08, }, + { .bitrate = 360, .hw_value = 0x09, }, + { .bitrate = 480, .hw_value = 0x0a, }, + { .bitrate = 540, .hw_value = 0x0b, }, +}; + +static const struct ieee80211_iface_limit rtw89_iface_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_STATION), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_AP), + }, +}; + ++static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = { ++ { ++ .max = 1, ++ .types = BIT(NL80211_IFTYPE_STATION), ++ }, ++ { ++ .max = 1, ++ .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | ++ BIT(NL80211_IFTYPE_P2P_GO), ++ }, ++}; ++ +static const struct ieee80211_iface_combination rtw89_iface_combs[] = { + { + .limits = rtw89_iface_limits, + .n_limits = ARRAY_SIZE(rtw89_iface_limits), + .max_interfaces = 2, + .num_different_channels = 1, - } ++ }, ++ { ++ .limits = rtw89_iface_limits_mcc, ++ .n_limits = ARRAY_SIZE(rtw89_iface_limits_mcc), ++ .max_interfaces = 2, ++ .num_different_channels = 2, ++ }, +}; + +bool rtw89_ra_report_to_bitrate(struct rtw89_dev *rtwdev, u8 rpt_rate, u16 *bitrate) +{ + struct ieee80211_rate rate; + + if (unlikely(rpt_rate >= ARRAY_SIZE(rtw89_bitrates))) { + rtw89_debug(rtwdev, RTW89_DBG_UNEXP, "invalid rpt rate %d\n", rpt_rate); + return false; + } + + rate = rtw89_bitrates[rpt_rate]; + *bitrate = rate.bitrate; + + return true; +} + +static const struct ieee80211_supported_band rtw89_sband_2ghz = { + .band = NL80211_BAND_2GHZ, + .channels = rtw89_channels_2ghz, + .n_channels = ARRAY_SIZE(rtw89_channels_2ghz), + .bitrates = rtw89_bitrates, + .n_bitrates = ARRAY_SIZE(rtw89_bitrates), + .ht_cap = {0}, + .vht_cap = {0}, +}; + +static const struct ieee80211_supported_band rtw89_sband_5ghz = { + .band = NL80211_BAND_5GHZ, + .channels = rtw89_channels_5ghz, + .n_channels = ARRAY_SIZE(rtw89_channels_5ghz), + + /* 5G has no CCK rates, 1M/2M/5.5M/11M */ + .bitrates = rtw89_bitrates + 4, + .n_bitrates = ARRAY_SIZE(rtw89_bitrates) - 4, + .ht_cap = {0}, + .vht_cap = {0}, +}; + +static const struct ieee80211_supported_band rtw89_sband_6ghz = { + .band = NL80211_BAND_6GHZ, + .channels = rtw89_channels_6ghz, + .n_channels = ARRAY_SIZE(rtw89_channels_6ghz), + + /* 6G has no CCK rates, 1M/2M/5.5M/11M */ + .bitrates = rtw89_bitrates + 4, + .n_bitrates = ARRAY_SIZE(rtw89_bitrates) - 4, +}; + +static void rtw89_traffic_stats_accu(struct rtw89_dev *rtwdev, + struct rtw89_traffic_stats *stats, + struct sk_buff *skb, bool tx) +{ + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + ++ if (tx && ieee80211_is_assoc_req(hdr->frame_control)) ++ rtw89_wow_parse_akm(rtwdev, skb); ++ + if (!ieee80211_is_data(hdr->frame_control)) + return; + + if (is_broadcast_ether_addr(hdr->addr1) || + is_multicast_ether_addr(hdr->addr1)) + return; + + if (tx) { + stats->tx_cnt++; + stats->tx_unicast += skb->len; + } else { + stats->rx_cnt++; + stats->rx_unicast += skb->len; + } +} + +void rtw89_get_default_chandef(struct cfg80211_chan_def *chandef) +{ + cfg80211_chandef_create(chandef, &rtw89_channels_2ghz[0], + NL80211_CHAN_NO_HT); +} + - static void rtw89_get_channel_params(const struct cfg80211_chan_def *chandef, - struct rtw89_chan *chan) ++void rtw89_get_channel_params(const struct cfg80211_chan_def *chandef, ++ struct rtw89_chan *chan) +{ + struct ieee80211_channel *channel = chandef->chan; + enum nl80211_chan_width width = chandef->width; + u32 primary_freq, center_freq; + u8 center_chan; + u8 bandwidth = RTW89_CHANNEL_WIDTH_20; + u32 offset; + u8 band; + + center_chan = channel->hw_value; + primary_freq = channel->center_freq; + center_freq = chandef->center_freq1; + + switch (width) { + case NL80211_CHAN_WIDTH_20_NOHT: + case NL80211_CHAN_WIDTH_20: + bandwidth = RTW89_CHANNEL_WIDTH_20; + break; + case NL80211_CHAN_WIDTH_40: + bandwidth = RTW89_CHANNEL_WIDTH_40; + if (primary_freq > center_freq) { + center_chan -= 2; + } else { + center_chan += 2; + } + break; + case NL80211_CHAN_WIDTH_80: + case NL80211_CHAN_WIDTH_160: + bandwidth = nl_to_rtw89_bandwidth(width); + if (primary_freq > center_freq) { + offset = (primary_freq - center_freq - 10) / 20; + center_chan -= 2 + offset * 4; + } else { + offset = (center_freq - primary_freq - 10) / 20; + center_chan += 2 + offset * 4; + } + break; + default: + center_chan = 0; + break; + } + + switch (channel->band) { + default: + case NL80211_BAND_2GHZ: + band = RTW89_BAND_2G; + break; + case NL80211_BAND_5GHZ: + band = RTW89_BAND_5G; + break; + case NL80211_BAND_6GHZ: + band = RTW89_BAND_6G; + break; + } + + rtw89_chan_create(chan, center_chan, channel->hw_value, band, bandwidth); +} + +void rtw89_core_set_chip_txpwr(struct rtw89_dev *rtwdev) +{ ++ struct rtw89_hal *hal = &rtwdev->hal; + const struct rtw89_chip_info *chip = rtwdev->chip; + const struct rtw89_chan *chan; + enum rtw89_sub_entity_idx sub_entity_idx; ++ enum rtw89_sub_entity_idx roc_idx; + enum rtw89_phy_idx phy_idx; + enum rtw89_entity_mode mode; + bool entity_active; + + entity_active = rtw89_get_entity_state(rtwdev); + if (!entity_active) + return; + + mode = rtw89_get_entity_mode(rtwdev); - if (WARN(mode != RTW89_ENTITY_MODE_SCC, "Invalid ent mode: %d\n", mode)) ++ switch (mode) { ++ case RTW89_ENTITY_MODE_SCC: ++ case RTW89_ENTITY_MODE_MCC: ++ sub_entity_idx = RTW89_SUB_ENTITY_0; ++ break; ++ case RTW89_ENTITY_MODE_MCC_PREPARE: ++ sub_entity_idx = RTW89_SUB_ENTITY_1; ++ break; ++ default: ++ WARN(1, "Invalid ent mode: %d\n", mode); + return; ++ } ++ ++ roc_idx = atomic_read(&hal->roc_entity_idx); ++ if (roc_idx != RTW89_SUB_ENTITY_IDLE) ++ sub_entity_idx = roc_idx; + - sub_entity_idx = RTW89_SUB_ENTITY_0; + phy_idx = RTW89_PHY_0; + chan = rtw89_chan_get(rtwdev, sub_entity_idx); + chip->ops->set_txpwr(rtwdev, chan, phy_idx); +} + - void rtw89_set_channel(struct rtw89_dev *rtwdev) ++int rtw89_set_channel(struct rtw89_dev *rtwdev) +{ ++ struct rtw89_hal *hal = &rtwdev->hal; + const struct rtw89_chip_info *chip = rtwdev->chip; - const struct cfg80211_chan_def *chandef; ++ const struct rtw89_chan_rcd *chan_rcd; ++ const struct rtw89_chan *chan; + enum rtw89_sub_entity_idx sub_entity_idx; ++ enum rtw89_sub_entity_idx roc_idx; + enum rtw89_mac_idx mac_idx; + enum rtw89_phy_idx phy_idx; - struct rtw89_chan chan; + struct rtw89_channel_help_params bak; + enum rtw89_entity_mode mode; - bool band_changed; + bool entity_active; + + entity_active = rtw89_get_entity_state(rtwdev); + + mode = rtw89_entity_recalc(rtwdev); - if (WARN(mode != RTW89_ENTITY_MODE_SCC, "Invalid ent mode: %d\n", mode)) - return; ++ switch (mode) { ++ case RTW89_ENTITY_MODE_SCC: ++ case RTW89_ENTITY_MODE_MCC: ++ sub_entity_idx = RTW89_SUB_ENTITY_0; ++ break; ++ case RTW89_ENTITY_MODE_MCC_PREPARE: ++ sub_entity_idx = RTW89_SUB_ENTITY_1; ++ break; ++ default: ++ WARN(1, "Invalid ent mode: %d\n", mode); ++ return -EINVAL; ++ } ++ ++ roc_idx = atomic_read(&hal->roc_entity_idx); ++ if (roc_idx != RTW89_SUB_ENTITY_IDLE) ++ sub_entity_idx = roc_idx; + - sub_entity_idx = RTW89_SUB_ENTITY_0; + mac_idx = RTW89_MAC_0; + phy_idx = RTW89_PHY_0; - chandef = rtw89_chandef_get(rtwdev, sub_entity_idx); - rtw89_get_channel_params(chandef, &chan); - if (WARN(chan.channel == 0, "Invalid channel\n")) - return; + - band_changed = rtw89_assign_entity_chan(rtwdev, sub_entity_idx, &chan); ++ chan = rtw89_chan_get(rtwdev, sub_entity_idx); ++ chan_rcd = rtw89_chan_rcd_get(rtwdev, sub_entity_idx); + - rtw89_chip_set_channel_prepare(rtwdev, &bak, &chan, mac_idx, phy_idx); ++ rtw89_chip_set_channel_prepare(rtwdev, &bak, chan, mac_idx, phy_idx); + - chip->ops->set_channel(rtwdev, &chan, mac_idx, phy_idx); ++ chip->ops->set_channel(rtwdev, chan, mac_idx, phy_idx); + - chip->ops->set_txpwr(rtwdev, &chan, phy_idx); ++ chip->ops->set_txpwr(rtwdev, chan, phy_idx); + - rtw89_chip_set_channel_done(rtwdev, &bak, &chan, mac_idx, phy_idx); ++ rtw89_chip_set_channel_done(rtwdev, &bak, chan, mac_idx, phy_idx); + - if (!entity_active || band_changed) { - rtw89_btc_ntfy_switch_band(rtwdev, phy_idx, chan.band_type); ++ if (!entity_active || chan_rcd->band_changed) { ++ rtw89_btc_ntfy_switch_band(rtwdev, phy_idx, chan->band_type); + rtw89_chip_rfk_band_changed(rtwdev, phy_idx); + } + + rtw89_set_entity_state(rtwdev, true); ++ return 0; +} + +void rtw89_get_channel(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif, + struct rtw89_chan *chan) +{ + const struct cfg80211_chan_def *chandef; + + chandef = rtw89_chandef_get(rtwdev, rtwvif->sub_entity_idx); + rtw89_get_channel_params(chandef, chan); +} + +static enum rtw89_core_tx_type *** 50395 LINES SKIPPED *** From nobody Mon Oct 28 14:49:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrp358mz5bRQR; Mon, 28 Oct 2024 14:49:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrp26qZz4nk0; Mon, 28 Oct 2024 14:49:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Arfec9t6/mQPdS1WcmDXLpUeWwRD824kefnDvnB3TW8=; b=psj8mGdYtq2GFvR8u6R6j2hwVrJk4CXFDb5hL6WLBVCoHQiCA3Qo773tLQC2PGP7w2IJfv yvZIMKDQElSSjIApggWnxJeNK+EEOQppuVmY9roCpCdC/D/JUM2ASiNZhPsAiiBscRpElc 7k2/8Fh5OxtfBAodPR4An3hNpNrjpTVsMW8AdKUGM5NIqCGd+byrTa96ffdZXIuBSzInoE bWskv+cJYt2SGw/kxuzXD0fbxYi5QiR0c+FBumNvLGEPQ98/MlkH9D3OJZ/Inq4xErnih5 hlzezDqSUGhB6ae4eacqG/z9V2m8P7JW/+ig/jGvyKgHpA12tSDM2t9Azi/Vug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Arfec9t6/mQPdS1WcmDXLpUeWwRD824kefnDvnB3TW8=; b=oGer96OJCYOAI3HajsOAG9HhwlJZdhagU+alxcgRMvQihfQ+Ozk5TsHe4yCGpf04O3Azir Qu6LJuqi+K8phSQbzIwqCZ3fnh4emA2FyxBLlx8nZwSBmYAyJtNDEQJW7rasXZYoaSFerb q3QJISJRWOdMbX0f2SfYRgxKPiSJ4dr06t04mmtCZXsD221y0Pl97O9sQa6mxqLMBOdtlQ F0hApTIbNTAOcPD0kRYYqOfPEm0Xrmy/SKYGOhRnkzgmFheF2SZ0V+5UZ6pZN454CvsdTF mhA0ZGTj+vSiKwRvDzenKz0Iyn2hQbSPlG9V2XmkRRuyyAlom6qw9P4G3B1IBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126986; a=rsa-sha256; cv=none; b=OSO/Frbg9jw0d28sw4TANhQL/BVgzyau1s/AqIunm9f0u2IKAjvDR4l37uqhGS5z3PKzzD 6VgrPotbhCESl/7yxSRG3dbzcu/7KjPdoc2ZZ0H4LvpzF42yYApPI19Im+BAoXb+wLBELY K06jL0Lfuc5w1eH5c3SBIib62VSag+NlU7GVtsdURTS2WONrN7yAYJBHTjsUbS587C2S6J MUraEEawbF4L4f7i401CWQfhUf/n6Mg4VyjMFHCSsaCx8F7Q2vGy0i2cLgbutqD0pgO2xE 8gGMGap2vRGQCZLRdBkOqxLvFhBTrUmRXemmDnFUePqQrePkZI3X2Z4y5sT1UA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrp19D5zk2G; Mon, 28 Oct 2024 14:49:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEnkug099178; Mon, 28 Oct 2024 14:49:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEnj6a099174; Mon, 28 Oct 2024 14:49:45 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:45 GMT Message-Id: <202410281449.49SEnj6a099174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 11c53278a8a3 - main - rtw88: update Realtek's rtw88 driver. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11c53278a8a3e86e14377f09bbaa7bad193d3713 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=11c53278a8a3e86e14377f09bbaa7bad193d3713 commit 11c53278a8a3e86e14377f09bbaa7bad193d3713 Merge: a4128aad8503 8e9553a4cdee Author: Bjoern A. Zeeb AuthorDate: 2024-09-24 23:50:22 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 14:42:32 +0000 rtw88: update Realtek's rtw88 driver. This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ). Sponsored by: The FreeBSD Foundation MFC after: 14 days sys/contrib/dev/rtw88/Makefile | 9 + sys/contrib/dev/rtw88/coex.c | 4 +- sys/contrib/dev/rtw88/debug.c | 54 +- sys/contrib/dev/rtw88/debug.h | 23 +- sys/contrib/dev/rtw88/fw.c | 92 +- sys/contrib/dev/rtw88/fw.h | 5 + sys/contrib/dev/rtw88/mac.c | 27 +- sys/contrib/dev/rtw88/mac80211.c | 12 +- sys/contrib/dev/rtw88/main.c | 25 +- sys/contrib/dev/rtw88/main.h | 27 +- sys/contrib/dev/rtw88/pci.c | 28 +- sys/contrib/dev/rtw88/pci.h | 2 +- sys/contrib/dev/rtw88/phy.c | 3 + sys/contrib/dev/rtw88/ps.c | 2 + sys/contrib/dev/rtw88/reg.h | 27 + sys/contrib/dev/rtw88/regd.c | 24 +- sys/contrib/dev/rtw88/regd.h | 2 + sys/contrib/dev/rtw88/rtw8703b.c | 2122 +++++++++++++++++++++++++++++++ sys/contrib/dev/rtw88/rtw8703b.h | 102 ++ sys/contrib/dev/rtw88/rtw8703b_tables.c | 902 +++++++++++++ sys/contrib/dev/rtw88/rtw8703b_tables.h | 14 + sys/contrib/dev/rtw88/rtw8723cs.c | 34 + sys/contrib/dev/rtw88/rtw8723d.c | 674 +--------- sys/contrib/dev/rtw88/rtw8723d.h | 268 +--- sys/contrib/dev/rtw88/rtw8723x.c | 724 +++++++++++ sys/contrib/dev/rtw88/rtw8723x.h | 518 ++++++++ sys/contrib/dev/rtw88/rtw8821c.c | 70 +- sys/contrib/dev/rtw88/rtw8821c.h | 1 + sys/contrib/dev/rtw88/rtw8821c_table.c | 1154 ++++++++++++----- sys/contrib/dev/rtw88/rtw8821cu.c | 40 +- sys/contrib/dev/rtw88/rtw8822b.c | 1 + sys/contrib/dev/rtw88/rtw8822c.c | 1 + sys/contrib/dev/rtw88/rtw8822c_table.c | 1239 ++++++++---------- sys/contrib/dev/rtw88/rtw8822cu.c | 4 +- sys/contrib/dev/rtw88/rx.h | 2 + sys/contrib/dev/rtw88/sar.c | 4 + sys/contrib/dev/rtw88/sdio.c | 35 +- sys/contrib/dev/rtw88/tx.c | 3 +- sys/contrib/dev/rtw88/usb.c | 87 +- sys/modules/rtw88/Makefile | 2 + 40 files changed, 6278 insertions(+), 2089 deletions(-) diff --cc sys/contrib/dev/rtw88/Makefile index fd212c09d88a,000000000000..8f47359b4380 mode 100644,000000..100644 --- a/sys/contrib/dev/rtw88/Makefile +++ b/sys/contrib/dev/rtw88/Makefile @@@ -1,78 -1,0 +1,87 @@@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +obj-$(CONFIG_RTW88_CORE) += rtw88_core.o +rtw88_core-y += main.o \ + mac80211.o \ + util.o \ + debug.o \ + tx.o \ + rx.o \ + mac.o \ + phy.o \ + coex.o \ + efuse.o \ + fw.o \ + ps.o \ + sec.o \ + bf.o \ + sar.o \ + regd.o + +rtw88_core-$(CONFIG_PM) += wow.o + +obj-$(CONFIG_RTW88_8822B) += rtw88_8822b.o +rtw88_8822b-objs := rtw8822b.o rtw8822b_table.o + +obj-$(CONFIG_RTW88_8822BE) += rtw88_8822be.o +rtw88_8822be-objs := rtw8822be.o + +obj-$(CONFIG_RTW88_8822BS) += rtw88_8822bs.o +rtw88_8822bs-objs := rtw8822bs.o + +obj-$(CONFIG_RTW88_8822BU) += rtw88_8822bu.o +rtw88_8822bu-objs := rtw8822bu.o + +obj-$(CONFIG_RTW88_8822C) += rtw88_8822c.o +rtw88_8822c-objs := rtw8822c.o rtw8822c_table.o + +obj-$(CONFIG_RTW88_8822CE) += rtw88_8822ce.o +rtw88_8822ce-objs := rtw8822ce.o + +obj-$(CONFIG_RTW88_8822CS) += rtw88_8822cs.o +rtw88_8822cs-objs := rtw8822cs.o + +obj-$(CONFIG_RTW88_8822CU) += rtw88_8822cu.o +rtw88_8822cu-objs := rtw8822cu.o + ++obj-$(CONFIG_RTW88_8723X) += rtw88_8723x.o ++rtw88_8723x-objs := rtw8723x.o ++ ++obj-$(CONFIG_RTW88_8703B) += rtw88_8703b.o ++rtw88_8703b-objs := rtw8703b.o rtw8703b_tables.o ++ ++obj-$(CONFIG_RTW88_8723CS) += rtw88_8723cs.o ++rtw88_8723cs-objs := rtw8723cs.o ++ +obj-$(CONFIG_RTW88_8723D) += rtw88_8723d.o +rtw88_8723d-objs := rtw8723d.o rtw8723d_table.o + +obj-$(CONFIG_RTW88_8723DE) += rtw88_8723de.o +rtw88_8723de-objs := rtw8723de.o + +obj-$(CONFIG_RTW88_8723DS) += rtw88_8723ds.o +rtw88_8723ds-objs := rtw8723ds.o + +obj-$(CONFIG_RTW88_8723DU) += rtw88_8723du.o +rtw88_8723du-objs := rtw8723du.o + +obj-$(CONFIG_RTW88_8821C) += rtw88_8821c.o +rtw88_8821c-objs := rtw8821c.o rtw8821c_table.o + +obj-$(CONFIG_RTW88_8821CE) += rtw88_8821ce.o +rtw88_8821ce-objs := rtw8821ce.o + +obj-$(CONFIG_RTW88_8821CS) += rtw88_8821cs.o +rtw88_8821cs-objs := rtw8821cs.o + +obj-$(CONFIG_RTW88_8821CU) += rtw88_8821cu.o +rtw88_8821cu-objs := rtw8821cu.o + +obj-$(CONFIG_RTW88_PCI) += rtw88_pci.o +rtw88_pci-objs := pci.o + +obj-$(CONFIG_RTW88_SDIO) += rtw88_sdio.o +rtw88_sdio-objs := sdio.o + +obj-$(CONFIG_RTW88_USB) += rtw88_usb.o +rtw88_usb-objs := usb.o diff --cc sys/contrib/dev/rtw88/debug.c index d745c774aa6f,000000000000..e84f25b34c46 mode 100644,000000..100644 --- a/sys/contrib/dev/rtw88/debug.c +++ b/sys/contrib/dev/rtw88/debug.c @@@ -1,1339 -1,0 +1,1311 @@@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2018-2019 Realtek Corporation + */ + +#include +#include +#include "main.h" +#include "coex.h" +#include "sec.h" +#include "fw.h" +#include "debug.h" +#include "phy.h" +#include "reg.h" +#include "ps.h" +#include "regd.h" + +#ifdef CONFIG_RTW88_DEBUGFS + +struct rtw_debugfs_priv { + struct rtw_dev *rtwdev; + int (*cb_read)(struct seq_file *m, void *v); + ssize_t (*cb_write)(struct file *filp, const char __user *buffer, + size_t count, loff_t *loff); + union { + u32 cb_data; + u8 *buf; + struct { + u32 page_offset; + u32 page_num; + } rsvd_page; + struct { + u8 rf_path; + u32 rf_addr; + u32 rf_mask; + }; + struct { + u32 addr; + u32 len; + } read_reg; + struct { + u8 bit; + } dm_cap; + }; +}; + +static const char * const rtw_dm_cap_strs[] = { + [RTW_DM_CAP_NA] = "NA", + [RTW_DM_CAP_TXGAPK] = "TXGAPK", +}; + +static int rtw_debugfs_single_show(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + + return debugfs_priv->cb_read(m, v); +} + +static ssize_t rtw_debugfs_common_write(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct rtw_debugfs_priv *debugfs_priv = filp->private_data; + + return debugfs_priv->cb_write(filp, buffer, count, loff); +} + +static ssize_t rtw_debugfs_single_write(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; + + return debugfs_priv->cb_write(filp, buffer, count, loff); +} + +static int rtw_debugfs_single_open_rw(struct inode *inode, struct file *filp) +{ + return single_open(filp, rtw_debugfs_single_show, inode->i_private); +} + +static int rtw_debugfs_close(struct inode *inode, struct file *filp) +{ + return 0; +} + +static const struct file_operations file_ops_single_r = { + .owner = THIS_MODULE, + .open = rtw_debugfs_single_open_rw, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static const struct file_operations file_ops_single_rw = { + .owner = THIS_MODULE, + .open = rtw_debugfs_single_open_rw, + .release = single_release, + .read = seq_read, + .llseek = seq_lseek, + .write = rtw_debugfs_single_write, +}; + +static const struct file_operations file_ops_common_write = { + .owner = THIS_MODULE, + .write = rtw_debugfs_common_write, + .open = simple_open, + .release = rtw_debugfs_close, +}; + +static int rtw_debugfs_get_read_reg(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 val, len, addr; + + len = debugfs_priv->read_reg.len; + addr = debugfs_priv->read_reg.addr; + switch (len) { + case 1: + val = rtw_read8(rtwdev, addr); + seq_printf(m, "reg 0x%03x: 0x%02x\n", addr, val); + break; + case 2: + val = rtw_read16(rtwdev, addr); + seq_printf(m, "reg 0x%03x: 0x%04x\n", addr, val); + break; + case 4: + val = rtw_read32(rtwdev, addr); + seq_printf(m, "reg 0x%03x: 0x%08x\n", addr, val); + break; + } + return 0; +} + +static int rtw_debugfs_get_rf_read(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 val, addr, mask; + u8 path; + + path = debugfs_priv->rf_path; + addr = debugfs_priv->rf_addr; + mask = debugfs_priv->rf_mask; + + mutex_lock(&rtwdev->mutex); + val = rtw_read_rf(rtwdev, path, addr, mask); + mutex_unlock(&rtwdev->mutex); + + seq_printf(m, "rf_read path:%d addr:0x%08x mask:0x%08x val=0x%08x\n", + path, addr, mask, val); + + return 0; +} + +static int rtw_debugfs_get_fix_rate(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + u8 fix_rate = dm_info->fix_rate; + + if (fix_rate >= DESC_RATE_MAX) { + seq_printf(m, "Fix rate disabled, fix_rate = %u\n", fix_rate); + return 0; + } + + seq_printf(m, "Data frames fixed at desc rate %u\n", fix_rate); + return 0; +} + +static int rtw_debugfs_copy_from_user(char tmp[], int size, + const char __user *buffer, size_t count, + int num) +{ + int tmp_len; + + memset(tmp, 0, size); + + if (count < num) + return -EFAULT; + + tmp_len = (count > size - 1 ? size - 1 : count); + + if (copy_from_user(tmp, buffer, tmp_len)) + return -EFAULT; + + tmp[tmp_len] = '\0'; + + return 0; +} + +static ssize_t rtw_debugfs_set_read_reg(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u32 addr, len; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2); + if (ret) + return ret; + + num = sscanf(tmp, "%x %x", &addr, &len); + + if (num != 2) + return -EINVAL; + + if (len != 1 && len != 2 && len != 4) { + rtw_warn(rtwdev, "read reg setting wrong len\n"); + return -EINVAL; + } + debugfs_priv->read_reg.addr = addr; + debugfs_priv->read_reg.len = len; + + return count; +} + +static int rtw_debugfs_get_dump_cam(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 val, command; + u32 hw_key_idx = debugfs_priv->cb_data << RTW_SEC_CAM_ENTRY_SHIFT; + u32 read_cmd = RTW_SEC_CMD_POLLING; + int i; + + seq_printf(m, "cam entry%d\n", debugfs_priv->cb_data); + seq_puts(m, "0x0 0x1 0x2 0x3 "); + seq_puts(m, "0x4 0x5\n"); + mutex_lock(&rtwdev->mutex); + for (i = 0; i <= 5; i++) { + command = read_cmd | (hw_key_idx + i); + rtw_write32(rtwdev, RTW_SEC_CMD_REG, command); + val = rtw_read32(rtwdev, RTW_SEC_READ_REG); + seq_printf(m, "%8.8x", val); + if (i < 2) + seq_puts(m, " "); + } + seq_puts(m, "\n"); + mutex_unlock(&rtwdev->mutex); + return 0; +} + +static int rtw_debugfs_get_rsvd_page(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u8 page_size = rtwdev->chip->page_size; + u32 buf_size = debugfs_priv->rsvd_page.page_num * page_size; + u32 offset = debugfs_priv->rsvd_page.page_offset * page_size; + u8 *buf; + int i; + int ret; + + buf = vzalloc(buf_size); + if (!buf) + return -ENOMEM; + + ret = rtw_fw_dump_fifo(rtwdev, RTW_FW_FIFO_SEL_RSVD_PAGE, offset, + buf_size, (u32 *)buf); + if (ret) { + rtw_err(rtwdev, "failed to dump rsvd page\n"); + vfree(buf); + return ret; + } + + for (i = 0 ; i < buf_size ; i += 8) { + if (i % page_size == 0) + seq_printf(m, "PAGE %d\n", (i + offset) / page_size); + seq_printf(m, "%8ph\n", buf + i); + } + vfree(buf); + + return 0; +} + +static ssize_t rtw_debugfs_set_rsvd_page(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u32 offset, page_num; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2); + if (ret) + return ret; + + num = sscanf(tmp, "%d %d", &offset, &page_num); + + if (num != 2) { + rtw_warn(rtwdev, "invalid arguments\n"); + return -EINVAL; + } + + debugfs_priv->rsvd_page.page_offset = offset; + debugfs_priv->rsvd_page.page_num = page_num; + + return count; +} + +static ssize_t rtw_debugfs_set_single_input(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; - struct rtw_dev *rtwdev = debugfs_priv->rtwdev; - char tmp[32 + 1]; + u32 input; - int num; + int ret; + - ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 1); ++ ret = kstrtou32_from_user(buffer, count, 0, &input); + if (ret) + return ret; + - num = kstrtoint(tmp, 0, &input); - - if (num) { - rtw_warn(rtwdev, "kstrtoint failed\n"); - return num; - } - + debugfs_priv->cb_data = input; + + return count; +} + +static ssize_t rtw_debugfs_set_write_reg(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct rtw_debugfs_priv *debugfs_priv = filp->private_data; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u32 addr, val, len; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3); + if (ret) + return ret; + + /* write BB/MAC register */ + num = sscanf(tmp, "%x %x %x", &addr, &val, &len); + + if (num != 3) + return -EINVAL; + + switch (len) { + case 1: + rtw_dbg(rtwdev, RTW_DBG_DEBUGFS, + "reg write8 0x%03x: 0x%08x\n", addr, val); + rtw_write8(rtwdev, addr, (u8)val); + break; + case 2: + rtw_dbg(rtwdev, RTW_DBG_DEBUGFS, + "reg write16 0x%03x: 0x%08x\n", addr, val); + rtw_write16(rtwdev, addr, (u16)val); + break; + case 4: + rtw_dbg(rtwdev, RTW_DBG_DEBUGFS, + "reg write32 0x%03x: 0x%08x\n", addr, val); + rtw_write32(rtwdev, addr, (u32)val); + break; + default: + rtw_dbg(rtwdev, RTW_DBG_DEBUGFS, + "error write length = %d\n", len); + break; + } + + return count; +} + +static ssize_t rtw_debugfs_set_h2c(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct rtw_debugfs_priv *debugfs_priv = filp->private_data; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u8 param[8]; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3); + if (ret) + return ret; + + num = sscanf(tmp, "%hhx,%hhx,%hhx,%hhx,%hhx,%hhx,%hhx,%hhx", + ¶m[0], ¶m[1], ¶m[2], ¶m[3], + ¶m[4], ¶m[5], ¶m[6], ¶m[7]); + if (num != 8) { + rtw_warn(rtwdev, "invalid H2C command format for debug\n"); + return -EINVAL; + } + + mutex_lock(&rtwdev->mutex); + rtw_fw_h2c_cmd_dbg(rtwdev, param); + mutex_unlock(&rtwdev->mutex); + + return count; +} + +static ssize_t rtw_debugfs_set_rf_write(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct rtw_debugfs_priv *debugfs_priv = filp->private_data; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u32 path, addr, mask, val; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 4); + if (ret) + return ret; + + num = sscanf(tmp, "%x %x %x %x", &path, &addr, &mask, &val); + + if (num != 4) { + rtw_warn(rtwdev, "invalid args, [path] [addr] [mask] [val]\n"); + return -EINVAL; + } + + mutex_lock(&rtwdev->mutex); + rtw_write_rf(rtwdev, path, addr, mask, val); + mutex_unlock(&rtwdev->mutex); + rtw_dbg(rtwdev, RTW_DBG_DEBUGFS, + "write_rf path:%d addr:0x%08x mask:0x%08x, val:0x%08x\n", + path, addr, mask, val); + + return count; +} + +static ssize_t rtw_debugfs_set_rf_read(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + char tmp[32 + 1]; + u32 path, addr, mask; + int num; + int ret; + + ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3); + if (ret) + return ret; + + num = sscanf(tmp, "%x %x %x", &path, &addr, &mask); + + if (num != 3) { + rtw_warn(rtwdev, "invalid args, [path] [addr] [mask] [val]\n"); + return -EINVAL; + } + + debugfs_priv->rf_path = path; + debugfs_priv->rf_addr = addr; + debugfs_priv->rf_mask = mask; + + return count; +} + +static ssize_t rtw_debugfs_set_fix_rate(struct file *filp, + const char __user *buffer, + size_t count, loff_t *loff) +{ + struct seq_file *seqpriv = (struct seq_file *)filp->private_data; + struct rtw_debugfs_priv *debugfs_priv = seqpriv->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + u8 fix_rate; - char tmp[32 + 1]; + int ret; + - ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 1); ++ ret = kstrtou8_from_user(buffer, count, 0, &fix_rate); + if (ret) + return ret; + - ret = kstrtou8(tmp, 0, &fix_rate); - if (ret) { - rtw_warn(rtwdev, "invalid args, [rate]\n"); - return ret; - } - + dm_info->fix_rate = fix_rate; + + return count; +} + +static int rtw_debug_get_mac_page(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 page = debugfs_priv->cb_data; + int i, n; + int max = 0xff; + + rtw_read32(rtwdev, debugfs_priv->cb_data); + for (n = 0; n <= max; ) { + seq_printf(m, "\n%8.8x ", n + page); + for (i = 0; i < 4 && n <= max; i++, n += 4) + seq_printf(m, "%8.8x ", + rtw_read32(rtwdev, (page | n))); + } + seq_puts(m, "\n"); + return 0; +} + +static int rtw_debug_get_bb_page(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 page = debugfs_priv->cb_data; + int i, n; + int max = 0xff; + + rtw_read32(rtwdev, debugfs_priv->cb_data); + for (n = 0; n <= max; ) { + seq_printf(m, "\n%8.8x ", n + page); + for (i = 0; i < 4 && n <= max; i++, n += 4) + seq_printf(m, "%8.8x ", + rtw_read32(rtwdev, (page | n))); + } + seq_puts(m, "\n"); + return 0; +} + +static int rtw_debug_get_rf_dump(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + u32 addr, offset, data; + u8 path; + + mutex_lock(&rtwdev->mutex); + + for (path = 0; path < rtwdev->hal.rf_path_num; path++) { + seq_printf(m, "RF path:%d\n", path); + for (addr = 0; addr < 0x100; addr += 4) { + seq_printf(m, "%8.8x ", addr); + for (offset = 0; offset < 4; offset++) { + data = rtw_read_rf(rtwdev, path, addr + offset, + 0xffffffff); + seq_printf(m, "%8.8x ", data); + } + seq_puts(m, "\n"); + } + seq_puts(m, "\n"); + } + + mutex_unlock(&rtwdev->mutex); + + return 0; +} + +static void rtw_print_cck_rate_txt(struct seq_file *m, u8 rate) +{ + static const char * const + cck_rate[] = {"1M", "2M", "5.5M", "11M"}; + u8 idx = rate - DESC_RATE1M; + + seq_printf(m, " CCK_%-5s", cck_rate[idx]); +} + +static void rtw_print_ofdm_rate_txt(struct seq_file *m, u8 rate) +{ + static const char * const + ofdm_rate[] = {"6M", "9M", "12M", "18M", "24M", "36M", "48M", "54M"}; + u8 idx = rate - DESC_RATE6M; + + seq_printf(m, " OFDM_%-4s", ofdm_rate[idx]); +} + +static void rtw_print_ht_rate_txt(struct seq_file *m, u8 rate) +{ + u8 mcs_n = rate - DESC_RATEMCS0; + + seq_printf(m, " MCS%-6u", mcs_n); +} + +static void rtw_print_vht_rate_txt(struct seq_file *m, u8 rate) +{ + u8 idx = rate - DESC_RATEVHT1SS_MCS0; + u8 n_ss, mcs_n; + + /* n spatial stream */ + n_ss = 1 + idx / 10; + /* MCS n */ + mcs_n = idx % 10; + seq_printf(m, " VHT%uSMCS%u", n_ss, mcs_n); +} + +static void rtw_print_rate(struct seq_file *m, u8 rate) +{ + switch (rate) { + case DESC_RATE1M...DESC_RATE11M: + rtw_print_cck_rate_txt(m, rate); + break; + case DESC_RATE6M...DESC_RATE54M: + rtw_print_ofdm_rate_txt(m, rate); + break; + case DESC_RATEMCS0...DESC_RATEMCS15: + rtw_print_ht_rate_txt(m, rate); + break; + case DESC_RATEVHT1SS_MCS0...DESC_RATEVHT2SS_MCS9: + rtw_print_vht_rate_txt(m, rate); + break; + default: + seq_printf(m, " Unknown rate=0x%x\n", rate); + break; + } +} + +#define case_REGD(src) \ + case RTW_REGD_##src: return #src + +static const char *rtw_get_regd_string(u8 regd) +{ + switch (regd) { + case_REGD(FCC); + case_REGD(MKK); + case_REGD(ETSI); + case_REGD(IC); + case_REGD(KCC); + case_REGD(ACMA); + case_REGD(CHILE); + case_REGD(UKRAINE); + case_REGD(MEXICO); + case_REGD(CN); + case_REGD(WW); + default: + return "Unknown"; + } +} + +static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + struct rtw_hal *hal = &rtwdev->hal; + u8 path, rate, bw, ch, regd; + struct rtw_power_params pwr_param = {0}; + + mutex_lock(&rtwdev->mutex); + bw = hal->current_band_width; + ch = hal->current_channel; + regd = rtw_regd_get(rtwdev); + + seq_printf(m, "channel: %u\n", ch); + seq_printf(m, "bandwidth: %u\n", bw); + seq_printf(m, "regulatory: %s\n", rtw_get_regd_string(regd)); + seq_printf(m, "%-4s %-10s %-9s %-9s (%-4s %-4s %-4s) %-4s\n", + "path", "rate", "pwr", "base", "byr", "lmt", "sar", "rem"); + + mutex_lock(&hal->tx_power_mutex); + for (path = RF_PATH_A; path <= RF_PATH_B; path++) { + /* there is no CCK rates used in 5G */ + if (hal->current_band_type == RTW_BAND_5G) + rate = DESC_RATE6M; + else + rate = DESC_RATE1M; + + /* now, not support vht 3ss and vht 4ss*/ + for (; rate <= DESC_RATEVHT2SS_MCS9; rate++) { + /* now, not support ht 3ss and ht 4ss*/ + if (rate > DESC_RATEMCS15 && + rate < DESC_RATEVHT1SS_MCS0) + continue; + + rtw_get_tx_power_params(rtwdev, path, rate, bw, + ch, regd, &pwr_param); + + seq_printf(m, "%4c ", path + 'A'); + rtw_print_rate(m, rate); + seq_printf(m, " %3u(0x%02x) %4u %4d (%4d %4d %4d) %4d\n", + hal->tx_pwr_tbl[path][rate], + hal->tx_pwr_tbl[path][rate], + pwr_param.pwr_base, + min3(pwr_param.pwr_offset, + pwr_param.pwr_limit, + pwr_param.pwr_sar), + pwr_param.pwr_offset, pwr_param.pwr_limit, + pwr_param.pwr_sar, + pwr_param.pwr_remnant); + } + } + + mutex_unlock(&hal->tx_power_mutex); + mutex_unlock(&rtwdev->mutex); + + return 0; +} + +void rtw_debugfs_get_simple_phy_info(struct seq_file *m) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + struct rtw_hal *hal = &rtwdev->hal; + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + struct rtw_traffic_stats *stats = &rtwdev->stats; + + seq_printf(m, "%-40s = %ddBm/ %d\n", "RSSI/ STA Channel", + dm_info->rssi[RF_PATH_A] - 100, hal->current_channel); + + seq_printf(m, "TP {Tx, Rx} = {%u, %u}Mbps\n", + stats->tx_throughput, stats->rx_throughput); + + seq_puts(m, "[Tx Rate] = "); + rtw_print_rate(m, dm_info->tx_rate); + seq_printf(m, "(0x%x)\n", dm_info->tx_rate); + + seq_puts(m, "[Rx Rate] = "); + rtw_print_rate(m, dm_info->curr_rx_rate); + seq_printf(m, "(0x%x)\n", dm_info->curr_rx_rate); +} + +static int rtw_debugfs_get_phy_info(struct seq_file *m, void *v) +{ + struct rtw_debugfs_priv *debugfs_priv = m->private; + struct rtw_dev *rtwdev = debugfs_priv->rtwdev; + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + struct rtw_traffic_stats *stats = &rtwdev->stats; + struct rtw_pkt_count *last_cnt = &dm_info->last_pkt_count; + struct rtw_efuse *efuse = &rtwdev->efuse; + struct ewma_evm *ewma_evm = dm_info->ewma_evm; + struct ewma_snr *ewma_snr = dm_info->ewma_snr; + u8 ss, rate_id; + + seq_puts(m, "==========[Common Info]========\n"); + seq_printf(m, "Is link = %c\n", rtw_is_assoc(rtwdev) ? 'Y' : 'N'); + seq_printf(m, "Current CH(fc) = %u\n", rtwdev->hal.current_channel); + seq_printf(m, "Current BW = %u\n", rtwdev->hal.current_band_width); + seq_printf(m, "Current IGI = 0x%x\n", dm_info->igi_history[0]); + seq_printf(m, "TP {Tx, Rx} = {%u, %u}Mbps\n", + stats->tx_throughput, stats->rx_throughput); + seq_printf(m, "1SS for TX and RX = %c\n\n", rtwdev->hal.txrx_1ss ? + 'Y' : 'N'); + + seq_puts(m, "==========[Tx Phy Info]========\n"); + seq_puts(m, "[Tx Rate] = "); + rtw_print_rate(m, dm_info->tx_rate); + seq_printf(m, "(0x%x)\n\n", dm_info->tx_rate); + + seq_puts(m, "==========[Rx Phy Info]========\n"); + seq_printf(m, "[Rx Beacon Count] = %u\n", last_cnt->num_bcn_pkt); + seq_puts(m, "[Rx Rate] = "); + rtw_print_rate(m, dm_info->curr_rx_rate); + seq_printf(m, "(0x%x)\n", dm_info->curr_rx_rate); + + seq_puts(m, "[Rx Rate Count]:\n"); + seq_printf(m, " * CCK = {%u, %u, %u, %u}\n", + last_cnt->num_qry_pkt[DESC_RATE1M], + last_cnt->num_qry_pkt[DESC_RATE2M], + last_cnt->num_qry_pkt[DESC_RATE5_5M], + last_cnt->num_qry_pkt[DESC_RATE11M]); + + seq_printf(m, " * OFDM = {%u, %u, %u, %u, %u, %u, %u, %u}\n", + last_cnt->num_qry_pkt[DESC_RATE6M], + last_cnt->num_qry_pkt[DESC_RATE9M], + last_cnt->num_qry_pkt[DESC_RATE12M], + last_cnt->num_qry_pkt[DESC_RATE18M], + last_cnt->num_qry_pkt[DESC_RATE24M], + last_cnt->num_qry_pkt[DESC_RATE36M], + last_cnt->num_qry_pkt[DESC_RATE48M], + last_cnt->num_qry_pkt[DESC_RATE54M]); + + for (ss = 0; ss < efuse->hw_cap.nss; ss++) { + rate_id = DESC_RATEMCS0 + ss * 8; + seq_printf(m, " * HT_MCS[%u:%u] = {%u, %u, %u, %u, %u, %u, %u, %u}\n", + ss * 8, ss * 8 + 7, + last_cnt->num_qry_pkt[rate_id], + last_cnt->num_qry_pkt[rate_id + 1], + last_cnt->num_qry_pkt[rate_id + 2], + last_cnt->num_qry_pkt[rate_id + 3], + last_cnt->num_qry_pkt[rate_id + 4], + last_cnt->num_qry_pkt[rate_id + 5], + last_cnt->num_qry_pkt[rate_id + 6], + last_cnt->num_qry_pkt[rate_id + 7]); + } + + for (ss = 0; ss < efuse->hw_cap.nss; ss++) { + rate_id = DESC_RATEVHT1SS_MCS0 + ss * 10; + seq_printf(m, " * VHT_MCS-%uss MCS[0:9] = {%u, %u, %u, %u, %u, %u, %u, %u, %u, %u}\n", + ss + 1, + last_cnt->num_qry_pkt[rate_id], + last_cnt->num_qry_pkt[rate_id + 1], + last_cnt->num_qry_pkt[rate_id + 2], + last_cnt->num_qry_pkt[rate_id + 3], + last_cnt->num_qry_pkt[rate_id + 4], + last_cnt->num_qry_pkt[rate_id + 5], + last_cnt->num_qry_pkt[rate_id + 6], + last_cnt->num_qry_pkt[rate_id + 7], + last_cnt->num_qry_pkt[rate_id + 8], + last_cnt->num_qry_pkt[rate_id + 9]); + } + + seq_printf(m, "[RSSI(dBm)] = {%d, %d}\n", + dm_info->rssi[RF_PATH_A] - 100, + dm_info->rssi[RF_PATH_B] - 100); + seq_printf(m, "[Rx EVM(dB)] = {-%d, -%d}\n", + dm_info->rx_evm_dbm[RF_PATH_A], + dm_info->rx_evm_dbm[RF_PATH_B]); + seq_printf(m, "[Rx SNR] = {%d, %d}\n", + dm_info->rx_snr[RF_PATH_A], + dm_info->rx_snr[RF_PATH_B]); + seq_printf(m, "[CFO_tail(KHz)] = {%d, %d}\n", + dm_info->cfo_tail[RF_PATH_A], *** 15572 LINES SKIPPED *** From nobody Mon Oct 28 14:49:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcbrs6YQnz5bRL3; Mon, 28 Oct 2024 14:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcbrs39wxz4nmd; Mon, 28 Oct 2024 14:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQB4ahHw/HHeeyIknkwrmLg08/bZgM11PY2zP01zoyU=; b=d9XhyeO3jGuD44LUn5yd+LzI7HbsXI2zzPn3PIdj17gVkwqCWkbPNHcuSnDqjJ8Rsiff2C ulkwlGNU+zqwn1zIIWEcZSxRvnRUjSDn9xthVsBtgE1M4jlpsGzCZ3e3FpMJxSwHIv8lG7 MqsYZtao0EDF4oTtTp9H5r3gZgPRIiaeur3OboOpo7+iF4csOboTMf3AYFS26bft5l2ao7 jzUuouPUVA0seRsaeTaqQ0Toy9SJnOX9reEvnSZRm8Aq/1Um2Il48xQohXMxFymPF2LrdE GEl4qRxa3GwJAcykKcTHPg1Hsfv0Ydp+fMAA0qrb/dRTngR1Xyicp0BBXUW8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730126989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQB4ahHw/HHeeyIknkwrmLg08/bZgM11PY2zP01zoyU=; b=YUYFLvpDzjNKQ8QW7HrreIfteo62LiEo+eqTWzObT7webkJnq8Ito7TaQIqyt+0c0g5xPV PmkJYp3J7bW/72CUm97z2gPxDfW6syZNzDUW7KLBHLJWpjVsbEhtaTNBoq8M1haZWpeOY3 lHLOMUBJtPPEaS56wNPwdkjTMc6WCPpFH5ANGGzWE7LcxKS6ctffRfoiOBhMZHO3KfTFe/ xswHJbfSp6si5RWfObxT12R8v5aCY2IbMDZGQa90Kb5H1FFMZryFXIrlhgkHjw2Xgt7ySC r1CB3OtI7l/qaggfQeU2xfvw6httfj3z9sy5ToN/6fG9zFbncSrf9wUugf9b2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730126989; a=rsa-sha256; cv=none; b=oTrHn0Z0dFBVd1V+ViDPMAAPkc2ORYB9+HKrIfeKgO4ufFXEHW+8G7MyJr159YkVOiyrne tZdy9Tv/9e4l9WSb0WN41Zf3il13Uw79ft3plAjWRohCpWLC7XufmtIjHwvCcnUIzbPzp2 5B6PCNrHuUKiP1DHMlkk1PvbPPqiUc5aLTPw2W6LVWOOW0B1fOc5dM2fp+C1IZilaY/Y2Q PUq88C6ZPO9Lb/TpYpP3aBGsgTDdnKgY1se0vUJwyyaE+uCrd7t+GwwCjqcOuKqYMotc3I nhrKSonia4/2j9K+UyTyHMYqaFEyPNKvZuBcbFCjMh74F2o7W4L0CkxIn6VOlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcbrs1wbrzjvk; Mon, 28 Oct 2024 14:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SEnn0w099278; Mon, 28 Oct 2024 14:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SEnn1a099274; Mon, 28 Oct 2024 14:49:49 GMT (envelope-from git) Date: Mon, 28 Oct 2024 14:49:49 GMT Message-Id: <202410281449.49SEnn1a099274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2ac644317e67 - main - iwlwifi,rtw88,rtw89: connect to build again List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ac644317e671b001d3fb8fd924a1ae808a0bf32 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2ac644317e671b001d3fb8fd924a1ae808a0bf32 commit 2ac644317e671b001d3fb8fd924a1ae808a0bf32 Author: Bjoern A. Zeeb AuthorDate: 2024-10-28 14:09:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-28 14:42:37 +0000 iwlwifi,rtw88,rtw89: connect to build again Sponsored by: The FreeBSD Foundation Fixes: f0b989348fe6 (revert) MFC after: 14 days --- sys/modules/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 2b64ca437b7f..d76e16b1da1b 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -569,12 +569,12 @@ _mlx5ib= mlx5ib ${MACHINE_CPUARCH} == "i386" _ena= ena _gve= gve -#_iwlwifi= iwlwifi +_iwlwifi= iwlwifi .if ${MK_SOURCELESS_UCODE} != "no" _iwlwififw= iwlwififw .endif -#_rtw88= rtw88 -#_rtw89= rtw89 +_rtw88= rtw88 +_rtw89= rtw89 _vmware= vmware .endif From nobody Mon Oct 28 15:14:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XccPc3W3Gz5bSXf; Mon, 28 Oct 2024 15:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XccPc34mlz4tNB; Mon, 28 Oct 2024 15:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dG2Za7mkC5lLORqIejH1lINh0vMqvFW6WwTTyuU3zEc=; b=Gv4ta1uaAMNL+dkPbZcMm1ARvSwLm2228Y7ZrhnOOPfqBgonu9jSPy81wGHtw26TfHzsj6 jkpMI8tdw2nE1erTxTmqWibmak5HxdsElX0jbIUOQtCV2TJTVR24+QAdBGE1qGgr55nqpJ SSmIoihN4S3Xvp1OyhNNN3n6q+lx6gHlQaIZSoFSFWMNsBtKoeVRjpqtbz8psrvGPHTkSz sj6iIVZ43wdIomWgzCzLNJlsSNtAosp8POosX9fuZKShuh3iAC/V70rWuABLf6uH8+y7WU Zyaa8ezP4Bf+wuxsNH0r+97RaBDlGrBrcD5xq0JTg3NbulTvZI8TGGO9nejxdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dG2Za7mkC5lLORqIejH1lINh0vMqvFW6WwTTyuU3zEc=; b=a/XidCAkO5dQsZrQdMPQixI+8ra9OuDzmOwQjbcKLmnM+z/78kgmL64jKzm21JoWOy21xI QA1iGKUbsdW/pknjgU4eKAIvIVsxn6I/aZ6+yEXt6Xe2GQRAlaMyxlxBVmb/RnH6MGsCgc yNriLMk3D9tA7s1M4CWXmqhYhKm694XA7qxwz33a9EzLcvsghXrCYuxc/7DhAVWdigI/vR zrjwhiPZV8mVkZMsB7H2SqsSt48H4LXGgHt8qQGRAR6dJsX/+KuCyL6gZWOiEVtT5dj8TD xdrXrWc29ydpT9RdQKcgb7sTey06CciX6K/3qZFnkmRMi1IFgu/pNz6FNfY05A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730128484; a=rsa-sha256; cv=none; b=sTK8122NxyZ6NORE+ens/7GC+nVIrAxLrAX4hTmCYMVMjbyp97BrEFfTSiJKkcNueXwImP /0zghCeljQCPhhEo8HwMagvX6kv5HxB0xxaJhaCuQReVCrC8PH5XclcFyL4bF2ob/9ViUz Y59afB0OhUuh4qe/HxnSsOE57l6M89YhqVZ1RNi720kPA08U66j2xfYggpkdz3ouhc/qwg KdveKCAHtBIQNLHitXG7yvnRsAW2RaWu2qYhcw6Z0l9jnwQbAilu7B0IltPnFvpybtcirS rGzggpLfp9MkP0eHKWxW5O44PEnZmhdW8bQYwQpeq+tt/0GX6K3bhizEMdmHlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XccPc2hzQzkZY; Mon, 28 Oct 2024 15:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFEik5053649; Mon, 28 Oct 2024 15:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFEial053646; Mon, 28 Oct 2024 15:14:44 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:14:44 GMT Message-Id: <202410281514.49SFEial053646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 878ede1a0d0f - main - fstyp: Fix some memory safety bugs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 878ede1a0d0f10f851b2bc54be1e28f512bfc016 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=878ede1a0d0f10f851b2bc54be1e28f512bfc016 commit 878ede1a0d0f10f851b2bc54be1e28f512bfc016 Author: Mark Johnston AuthorDate: 2024-10-28 13:51:58 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 15:03:53 +0000 fstyp: Fix some memory safety bugs In the hammer2 label reader, make sure to check for a NULL return from read_buf(). In the NTFS label reader, - Avoid an infinite loop if a record length is 0. - Avoid walking past the end of the buffer. - When a label is found, avoid reading past the end of the buffer. PR: 278281 Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47292 --- usr.sbin/fstyp/hammer2.c | 2 ++ usr.sbin/fstyp/ntfs.c | 36 ++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/usr.sbin/fstyp/hammer2.c b/usr.sbin/fstyp/hammer2.c index e0c036c7442a..aeb29762fb6b 100644 --- a/usr.sbin/fstyp/hammer2.c +++ b/usr.sbin/fstyp/hammer2.c @@ -220,6 +220,8 @@ read_label(FILE *fp, char *label, size_t size) broot.data_off = (i * HAMMER2_ZONE_BYTES64) | HAMMER2_PBUFRADIX; vols[i] = read_buf(fp, broot.data_off & ~HAMMER2_OFF_MASK_RADIX, sizeof(*vols[i])); + if (vols[i] == NULL) + errx(1, "failed to read volume header"); broot.mirror_tid = vols[i]->voldata.mirror_tid; if (best_i < 0 || best.mirror_tid < broot.mirror_tid) { best_i = i; diff --git a/usr.sbin/fstyp/ntfs.c b/usr.sbin/fstyp/ntfs.c index a3457c285edc..be8095d5ee27 100644 --- a/usr.sbin/fstyp/ntfs.c +++ b/usr.sbin/fstyp/ntfs.c @@ -137,9 +137,8 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) struct ntfs_filerec *fr; struct ntfs_attr *atr; off_t voloff; - char *ap; int8_t mftrecsz; - int recsize; + size_t recsize; #endif /* WITH_ICONV */ filerecp = NULL; @@ -152,7 +151,8 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) goto ok; mftrecsz = bf->bf_mftrecsz; - recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); + recsize = (mftrecsz > 0) ? + (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + recsize * NTFS_VOLUMEINO; @@ -165,16 +165,28 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) if (fr->fr_hdrmagic != NTFS_FILEMAGIC) goto fail; - for (ap = filerecp + fr->fr_attroff; - atr = (struct ntfs_attr *)ap, (int)atr->a_type != -1; - ap += atr->reclen) { - if (atr->a_type != NTFS_A_VOLUMENAME) - continue; - - convert_label(ap + atr->a_dataoff, - atr->a_datalen, label, size); - break; + for (size_t ioff = fr->fr_attroff; + ioff + sizeof(struct ntfs_attr) < recsize; + ioff += atr->reclen) { + atr = (struct ntfs_attr *)(filerecp + ioff); + if ((int)atr->a_type == -1) + goto ok; + if (atr->a_type == NTFS_A_VOLUMENAME) { + if ((size_t)atr->a_dataoff + atr->a_datalen > recsize) { + warnx("ntfs: Volume name attribute overflow"); + goto fail; + } + convert_label(filerecp + ioff + atr->a_dataoff, + atr->a_datalen, label, size); + goto ok; + } + if (atr->reclen == 0) { + warnx("ntfs: Invalid attribute record length"); + goto fail; + } } + warnx("ntfs: Volume name not found"); + goto fail; ok: #else From nobody Mon Oct 28 15:14:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XccPd4p2wz5bS5Y; Mon, 28 Oct 2024 15:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XccPd45MFz4tQg; Mon, 28 Oct 2024 15:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MaUD7SdS1czCczHsCOpeF8eXoQhXAFA/eRtCJKyytXo=; b=VX1PdND9Oc91s1HRwoM7GkkQyr0fyXbKri7MCkUKe2Hsu6OnajnCezhTDXEm4iuS2Nhp9k kHqnGrQVhLaT6HqLUXncKNQndb+uCJeFiikZ7WcMZmscpCi0NQGwAnjd1d0eY/dXzHXtxu ulm84Nl5OSpKc8GREt+4F59sZBlqN7gtIBPE4HoNbt2TS9WOkw+rl6pYcNiKhxWqUbZM1q 0oJmC+IPqiT2PEz2GkB2lHqW89ib+OYnpzu8j3SpJBJY8PIgd8rhw2m4l3NCj/gi2u73QR /1b1zQt5Oj5CecM7Cq340b4j/KeRZ4HefQpHcEbuszvP0pMdviWeoS9GaHu/5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MaUD7SdS1czCczHsCOpeF8eXoQhXAFA/eRtCJKyytXo=; b=bZi371ATGIbVJS2gxik2fHftWXOs8Gab1eFKi+XeSiHshDcBTCvmw/8McM0nHRHB7+SSIS b81WhzZeTBHyCO2e84G3TaH5pXJ3fru6h159PZZndd2Ugehd9ffBHxsaCnE8HZW/7XETbE 110+ZK4V8GLO9RiXXv3QQ4lZ0SJkTBpikdlaKpP1jpO3Qk4cpsRDoNjM3XJmZMr9Gsgv3K KMRKVS9QxfIjNIsYb8dXhgkP7LFGfCEQeWgO7CSQ72aewlticITZ8PiboXUuOCVhM7uUCE LqbCRHwSZp20OEh+AyA96HERSuYJ3ksmTnKO/cfG6V+QxxvhrAhIAUf79b4Urw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730128485; a=rsa-sha256; cv=none; b=UoPaMvG3cePpqb6jjM1jMX0CQqLyE/g9Fm50EI9gIVtM42tTUlpdZ/Cbs+iam9Wnn6HCpE 3HpGZpt6o2yLz1WtuTfJGLDm8oP6ueWf1LJgcgCUX4c61vPS3SIn9RTdf36AbIYnrXPSYH b34OKxM+cXlSCUtoJqu3pWIhkav4HEAtT2j130Q4nGnnUJgYQKfx+MMwDgJKJJpdPYADZ1 hcz5OIQmVh30NQ/suSGkiFaQLxZHxUGC4UMeQv/y9tAMj16sy4rpUE8EImf3URs0OOPIq6 EvW6cRptb205nZpeGOUSVcwdZsCCDaR4xD65vERyqIWn4FW5k/JurnkHC1vXug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XccPd3hWDzks8; Mon, 28 Oct 2024 15:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFEjwK053704; Mon, 28 Oct 2024 15:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFEjVO053701; Mon, 28 Oct 2024 15:14:45 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:14:45 GMT Message-Id: <202410281514.49SFEjVO053701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2bbfbf80d3bb - main - if_bridge: Mask MEXTPG if some members don't support it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bbfbf80d3bb828ac782c2d990a1fba0eb51e45a Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2bbfbf80d3bb828ac782c2d990a1fba0eb51e45a commit 2bbfbf80d3bb828ac782c2d990a1fba0eb51e45a Author: Mark Johnston AuthorDate: 2024-10-28 13:52:07 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 15:14:21 +0000 if_bridge: Mask MEXTPG if some members don't support it Similar to how the network stack needs to use mb_unmapped_to_ext() to convert mbufs before passing them to an unsupported driver, if_bridge needs to avoid passing M_EXTPG mbufs to interfaces that don't support them. Thus, clear IFCAP_MEXTPG on the bridge if any member interfaces don't handle unmapped mbufs. PR: 278245 Reviewed by: jhb, gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47294 --- sys/net/if_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 723b92d3dcd5..299b6d80dcde 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -193,7 +193,7 @@ * List of capabilities to possibly mask on the member interface. */ #define BRIDGE_IFCAPS_MASK (IFCAP_TOE|IFCAP_TSO|IFCAP_TXCSUM|\ - IFCAP_TXCSUM_IPV6) + IFCAP_TXCSUM_IPV6|IFCAP_MEXTPG) /* * List of capabilities to strip From nobody Mon Oct 28 15:14:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XccPf61LFz5bSdL; Mon, 28 Oct 2024 15:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XccPf5KQYz4tCK; Mon, 28 Oct 2024 15:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WSvQU20AJ+DvlhpDpWPsTX1p1O0LMzOZJ/57s7B5gq8=; b=IYkHPuZ0IklYsbQCenZ+eoJ2/j5NsfhIjgHNlqcBE371yWUOUhoM4Hs1Bi5gy1aT6T1sEW AxaXDK52EyaegRB8LVsnCL2VUMH+SvRrCgxxTOeEiHqMcYrM858OJPHfrQNqLIll9uIdXv 5zrQmanEuc4Pgnjv0j6YxjUjluu2bRh9ipUWbPu34rqHXm3Z8CZBwyjSX6VXy/Ytb6dtoU LpVGoqqwi7xKXaxFwm4N4W2bZDBI8UwOqXqZHAd7YLifGpTu+6agWTgoeAuWxe8+Xv3C/+ gNrAfi1FRgW0Qc3IUCSjsNHGmuCLyjL7S1G7/yBoQI67pTjdHaTsMKlFyff5MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WSvQU20AJ+DvlhpDpWPsTX1p1O0LMzOZJ/57s7B5gq8=; b=rUb4BuZs7mBXzyuCGVtfpOPD12QHK2fKx7VF4E/tPLUAZs4wsVEArK18g+5H2bGd0DHQx9 TzdnkXIG4e0Ld1S7ti0YGcYSjyq+RTrIn0XdDS1Jo1A38HnI6LSUGkZ8q8Y0gfYIxsV+tj Zt7FyULva+zELBhYvx+qtEo3zlR1CXSdzOLzc7iTM+w8in+3LF/3MmwiAMWHI4ibdCLm1e lNf1EJvFW9gdT/ZnBYq8Ydw+Gu9tmS6ww1DZvBTDwDbf0EmFxi9EUIrzqzh2X6scdtr5wl crgVdUtyeqMOXHQa7QtokpNkIUbK+JRVz2V85OlwLGPrqhT97sPWOKcbz1nI7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730128486; a=rsa-sha256; cv=none; b=Wax76XEP/GSYhaeN5p5inq92EfdhBCJxDzP1YLVndVsjx/MukdeNR0OsqOWo8uYGb4GIK2 /RZwp9WKr9VuxtBRcTBz2muMYNUBCXN/ptlz2DP0Kc3SrK3BE6PYVESYC8lgFPnSZRLlnQ 46v2+1bnejgOCtj6zGYBanAZ3lnemrEy87SGQRPweUga9kAZ/3CTCR1k3NR16IAoQsrhSO anJSyEM/gen04v1z3O72n9WTheuS2VqyQZZu7XP1jfhHDmA1Z9BbY4Xektfwp9Pz7YiiNv sSUzi3YjzbY7HvRUsaXeAMyklCrBSeF6VaL43eQnNWeN0qP1HbWXigwSas8UKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XccPf4xZKzkgN; Mon, 28 Oct 2024 15:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFEk15053750; Mon, 28 Oct 2024 15:14:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFEkMG053747; Mon, 28 Oct 2024 15:14:46 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:14:46 GMT Message-Id: <202410281514.49SFEkMG053747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 01c738cd5c39 - main - if_tuntap: Enable MEXTPG support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01c738cd5c3938374cce8293c82753d977966154 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=01c738cd5c3938374cce8293c82753d977966154 commit 01c738cd5c3938374cce8293c82753d977966154 Author: Mark Johnston AuthorDate: 2024-10-28 13:52:14 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 15:14:36 +0000 if_tuntap: Enable MEXTPG support Fix tunread() to use m_mbuftouio() instead of manually copying (which doesn't work for unmapped mbufs). Reviewed by: jhb, gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47295 --- sys/net/if_tuntap.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 00ebc9546af6..f82480971b10 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -944,11 +944,11 @@ tuncreate(struct cdev *dev) ifp->if_ioctl = tunifioctl; ifp->if_flags = iflags; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_capabilities |= IFCAP_LINKSTATE; + ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_MEXTPG; if ((tp->tun_flags & TUN_L2) != 0) ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO; - ifp->if_capenable |= IFCAP_LINKSTATE; + ifp->if_capenable |= IFCAP_LINKSTATE | IFCAP_MEXTPG; if ((tp->tun_flags & TUN_L2) != 0) { ifp->if_init = tunifinit; @@ -1728,18 +1728,9 @@ tunread(struct cdev *dev, struct uio *uio, int flag) vhdr.hdr.csum_offset); error = uiomove(&vhdr, len, uio); } - - while (m && uio->uio_resid > 0 && error == 0) { - len = min(uio->uio_resid, m->m_len); - if (len != 0) - error = uiomove(mtod(m, void *), len, uio); - m = m_free(m); - } - - if (m) { - TUNDEBUG(ifp, "Dropping mbuf\n"); - m_freem(m); - } + if (error == 0) + error = m_mbuftouio(uio, m, 0); + m_freem(m); return (error); } From nobody Mon Oct 28 15:14:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XccPh103bz5bSXp; Mon, 28 Oct 2024 15:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XccPg60b4z4tJ1; Mon, 28 Oct 2024 15:14:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gH1e7xaGl4Rr7H08Vq2xKgONw4PfpmhRERcj1urQFiI=; b=TnsZfHGMH9hnBium1ps0k4uNnWzlQVbR/TZX6SQj+77B/cIZykk6qnQn6wbZL5rp36SUm9 tDJhMLAx0wuBOmFBmuljnLrjvm6eGxjeulkzJHAbMWfZxq2KsVygCEbARko9kb7l/NiW2S cpiNpAQI0ykVqqMa3SXWpFUNuf8+atTRJmlmUl3QA1vN0DTFusLul01GGm0QNHwOn83Fx1 zgWTDqrwA832/iPjyAasaLIGOSfgmw1V3SoMzr4CVFjlUSSSVOL7axnFRP8XKwP+LVkPJ/ dz314NRi/SSi8bTcKkaNanSUc1CGcupG3lrZ6sEjcugUCzczylxP4Up+o2ujEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730128487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gH1e7xaGl4Rr7H08Vq2xKgONw4PfpmhRERcj1urQFiI=; b=LDz9a6ANUj+8mBazAThmo7Kmmippgc99lOOJJfFyWIV+xwl3XEUnHCKpxkwcbHUSzyK+qS fpUcU6NshYGUoojogzh5Bvqnf2RZKJkip9jtdNMeyD81QtqNWlo6Gb+Lon96an5uVXzsj/ szxFWtc+S9ttAyexq6cOOIkG2vbK6PhxN8cq0DSVarfqapjDqHOQeTv9duElK/5XV+eVQK EeDRiEjeFgVZJXWsVXjypYcy7OL4dCxdeNwDW4CsaOX4tpBzzmHBUkpE88scIoOR/IGA1o BNt1b1UUc1hUNtKtZ4ZGRaPjgweA74HGaoRAzTqF3flMMsE+FxqEIh1SpEaEfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730128487; a=rsa-sha256; cv=none; b=Ak6Zzo8fLytnjZH4VazFfAD6Hnzl/PwvOYhM1v16T3GwnwyEZpxQxbDBIhAT+36rcRYBEc qCDP69iLzPcUyMjY/+K9nZmH60t1MRzs/4+roZGKKhu7ceNG3XFlb+BkBaUkTedvP4Fziy H4BF1K8UfFyKw4oGhKgUEpes7viODJrCwZ4eSIlt7P6kqxhzkBptGP9mTYSA6TaUO5+8md AY3x3H0YdC4omaRS/t36DUJFToyJDXAlbWuRtZ6cfzzt8cLagpsRHWtEysV0OCk4gc9Xxr p6q9/p0EZpoPb7zzn7UETwaFY4KL910SxVBEna1s83fWMQZZRbX+UFXS4W/k6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XccPg5cjFzkKr; Mon, 28 Oct 2024 15:14:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFEllJ053799; Mon, 28 Oct 2024 15:14:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFElr9053796; Mon, 28 Oct 2024 15:14:47 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:14:47 GMT Message-Id: <202410281514.49SFElr9053796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: abfd031b482f - main - camcontrol: Plug a memory leak in getdevtree() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abfd031b482f92320e29a2c2ac80fcd23e134446 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=abfd031b482f92320e29a2c2ac80fcd23e134446 commit abfd031b482f92320e29a2c2ac80fcd23e134446 Author: Mark Johnston AuthorDate: 2024-10-28 13:52:32 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 15:14:36 +0000 camcontrol: Plug a memory leak in getdevtree() PR: 275338 MFC after: 1 week --- sbin/camcontrol/camcontrol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 3aa91eb00ecf..b7ad7f7d4b25 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -653,6 +653,7 @@ getdevtree(int argc, char **argv, char *combinedopt) if (need_close) fprintf(stdout, ")\n"); + free(ccb.cdm.matches); close(fd); return (error); From nobody Mon Oct 28 15:26:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xccg42Dlmz5bSpx; Mon, 28 Oct 2024 15:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xccg41jgbz3xr5; Mon, 28 Oct 2024 15:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fc68uLoo2tYhgjnha+t9ZlFrWgbm7k8wmikx7Kpn3W4=; b=LTr0xKgMJpT8YymPN3HylN3K6at9qYND+FCDRHU63w2Y+13KWgc0/Aze35MlK1Y9UdFqU+ UY8PG46FfhWvjeGgokPeCAU7ucwLUip5qloAw+UWWoZzvEqmM2O2PxWolXllU0rKIAsLP3 V29M1A/x/NScqjyy/I+Kxmg8Io33ioLrRXDj71ZmWvOOZPAa77aAZeKrFPP6903pwqwYAl mLFV7E0JnODqct4elGsOckrDRYXwQY0cHU4BIyVtfAydqhxHF1XIwVHhe+6MeBTQPnxND6 0kxXpmg9xPSorHglW+3DeSSE82nB815BuinOGaxfBjlDpKlxNAfDncLsqE/kww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fc68uLoo2tYhgjnha+t9ZlFrWgbm7k8wmikx7Kpn3W4=; b=VUlefofdhcufU6PTxjKydxtbisyFYmmGseJ2HfvGtFTlXX4vgO39hWRgH+TD//vRRQavMV zkIPcuVQPo47bp7ifL4Ons/IAf3G+L+mVQDkrW9HcXlM3ksZwoyi3+7HYELCpEBmlXEnPg Ps2p58qgjiVdW3WEZEGaIiN4j76ezkEloIyDuJ1nty/oRj6wvi/En7Vtf18p3ExdrvHB71 2IDqqhowiw0KSkuzIo0/KFFjQz9mG9SyBSUaUcMRCA7lJnqnjxG3cfDz3Xg2ixYXxkAF18 t/CtctvfUA8QGh66I+PJcYO85hVp6J7evXofLfb1HvxSyn9qngEoTxhCNIJB/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730129184; a=rsa-sha256; cv=none; b=LXjAb241H+NVB4gGJwIIU+XnuMwi9TACu/6dwf8xjvhqtL2E3mYKNcS2lyBwUycGNh+x6v s0tVIUyu0HSw1+kT+3AdjkmlGA+vWp7WbdjErjj6sCGkq95BWeg2eMNhPQ7S0ryNLxKAGA nNpCzDO4nXbOXROW63/Xiq3Rl9KrIthK2EXWG4o5137rTM3NEJtxIMIdx9IVj3eZ1+/1/U w7TXywxx6CN3TSyvqCuapVYOrBCCg3U1PTuJeKAPploCgT7V7ipQGqM0+b3ZzNNdR5aCTQ 6U+uw89sv/Fu52Hx2nyR+lR0pgcHZQcYqL9DMK7L19LLVIfg8H2A4jw5BxCyLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xccg41JnczkhN; Mon, 28 Oct 2024 15:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFQOav073017; Mon, 28 Oct 2024 15:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFQOG0073014; Mon, 28 Oct 2024 15:26:24 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:26:24 GMT Message-Id: <202410281526.49SFQOG0073014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 759ddb4d246f - main - manuals: Misc syntax fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 759ddb4d246f5db5963369a82f1ab165d0dfccce Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=759ddb4d246f5db5963369a82f1ab165d0dfccce commit 759ddb4d246f5db5963369a82f1ab165d0dfccce Author: Graham Percival AuthorDate: 2024-10-16 22:46:40 +0000 Commit: Mitchell Horne CommitDate: 2024-10-28 15:26:03 +0000 manuals: Misc syntax fixes These were reported by `mandoc -T lint ...` as errors. Signed-off-by: Graham Percival Reviewed by: mhorne, Alexander Ziaee Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1472 --- sbin/ipf/ipf/ipf.5 | 2 +- sbin/ipf/ipf/ipf.8 | 3 ++- sbin/nvmecontrol/nvmecontrol.8 | 4 ++-- stand/libsa/libsa.3 | 2 ++ stand/man/loader.efi.8 | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sbin/ipf/ipf/ipf.5 b/sbin/ipf/ipf/ipf.5 index 9cde8be0b1d5..423e0de1b34e 100644 --- a/sbin/ipf/ipf/ipf.5 +++ b/sbin/ipf/ipf/ipf.5 @@ -295,7 +295,7 @@ proto-unr (protocol unreachable) the IP protocol specified in the packet is not available to receive packets. -.DE +.RE .PP An example that shows how to send back a port unreachable packet for UDP packets to 192.168.1.0/24 is as follows: diff --git a/sbin/ipf/ipf/ipf.8 b/sbin/ipf/ipf/ipf.8 index 1c45b017e117..38cac51435d1 100644 --- a/sbin/ipf/ipf/ipf.8 +++ b/sbin/ipf/ipf/ipf.8 @@ -158,7 +158,8 @@ Zero global statistics held in the kernel for filtering only (this doesn't affect fragment or state statistics). .DT .SH ENVIRONMENT -.NM utilizes the following environment variable. +.B ipf +utilizes the following environment variable. .TP .B IPF_PREDEFINED ipfilter variables, see VARIABLES in ipf(5), can be specified in this diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index cb3e8aa9080f..76c79778021d 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -998,13 +998,13 @@ If the .Dq nvmecontrol identify -n 1 nvme2 command ended with .Pp -.Bl -verbatim +.Bd -literal LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: Good LBA Format #01: Data Size: 512 Metadata Size: 8 Performance: Good LBA Format #02: Data Size: 4096 Metadata Size: 0 Performance: Good LBA Format #03: Data Size: 4096 Metadata Size: 8 Performance: Good LBA Format #04: Data Size: 4096 Metadata Size: 64 Performance: Good -.El +.Ed .Pp then this would give a 4k data format for at least namespace 1, with no metadata. diff --git a/stand/libsa/libsa.3 b/stand/libsa/libsa.3 index 7643423b342a..3e3f70610516 100644 --- a/stand/libsa/libsa.3 +++ b/stand/libsa/libsa.3 @@ -597,6 +597,8 @@ string after the device specification is written. .It Xo .Ft int .Fn devinit void +.Xc +.Pp Calls all the .Fa dv_init routines in the diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 9feafd820f9c..736b07d2922d 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -393,10 +393,10 @@ Boot to FW : false BootCurrent: 0001 Timeout : 2 seconds BootOrder : 0000, 0001, 0003, 0004, 0005, 0006, 0001, 0008, 000A, 000B, 000C, 000E, 0007 -... +\&... +Boot0001* FreeBSD ZPOOL HD(1,GPT,b5d0f86b-265d-1e1b-18aa-0ed55e1e73bd,0x28,0x96000)/File(\EFI\FREEBSD\LOADER.EFI) nda0p1:/EFI/FREEBSD/LOADER.EFI /boot/efi//EFI/FREEBSD/LOADER.EFI -... +\&... .Ed Often there are several options, depending on the BIOS. The entry that we booted with is marked with a From nobody Mon Oct 28 15:26:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xccg545w7z5bSq1; Mon, 28 Oct 2024 15:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xccg53V3Dz3xr6; Mon, 28 Oct 2024 15:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XI9VW0PnzzwhRXrYP6uTj0NYebubIFj3tt8Fe0t+Tao=; b=tEhx/um6bTG3EkskumI6lAs2N5YXGT6bGizfx7GDWLBSGj1dA8a9r7xpPrAswGvj2oSo6o XUvqAESex49WRUW6PiJ06HrUQQ7H1rjQCNS+DZjjClYTTu83RkaI/4Ja2M/ph/tZfa2oog hPtQ7MieMwbpBLKpfP2w/PYsXGaiQ7O3fzuk1zrF67gndY73BBRAANg2V7+h3GyWYiZisy RXfoEgorLX5gugW4VDxq73rrsNPuimLSguDrgPwa2Lo6B3guPAFhzRrmG3HK7bSx5/1oac pswyn0yRE2MYNIRxzyU/8W8gS1pNJNPoh4w70bUjvX89uLfeNQlTp3K5ubCYEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XI9VW0PnzzwhRXrYP6uTj0NYebubIFj3tt8Fe0t+Tao=; b=pGNMkKbuFrUoN4ETE/zTcPYWbSLDDF6Y2/JJPHni2TEDGZqZ00e+RPQnycxHAaEHynOQZs SMHXDRfkq9npfjmJxTeMJMGOqzOCjN+FgSsuAXxxGGcZbn8aF3oPGMkUrpBia6fb7QBqq1 Wts69N7vr1XIoaBjZufPf0KjXrw8VEG1EZNQHUvBQ80EjGJLRQrawG3L0vv8sEqnTbB+Hz 73/j6KtZAviAdLttYwEFAJbr+BKK3ewPrybhhkcpRDfGGTR5pIDa176pmDHvPpTqYGG6hA i8KrU+YxP8/5GBev0zbyahenexq/D1qJREEaYvckoKn8XsLkWFcIA+Eie1Oz5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730129185; a=rsa-sha256; cv=none; b=V5cfqU9zJ0GCrvBI2gJUcsNgsAfMA67sAzEBahv2THfZBKwPq5FlvBCBkvGlp1JfMnzUVT PCAqF67DYIG9lWD4uGlqKbs+Befqpb26AgnuCv+CiDzft7+rGvF95tzoIyazKAcd7SF3eq M8proUEJqz2cKpuDCQZ18EfqFgK91djoWPIHMCE3hgye5NYxP0m3sLUM8HW/aY8RldT28O dg29O1ydIjT4CGqiYCAcMQTtAKHWmnhTRZYnQ/c/FGzRcJlh+ZyGORnBX0TOIXLlGrTZKk 6Yls9+WadAePSRP3MR+afupl6YEfFrR/xX2muQlXyq9IUhjzS/bghoCZyB4b8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xccg51z6KzkLJ; Mon, 28 Oct 2024 15:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFQPc9073064; Mon, 28 Oct 2024 15:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFQP7J073061; Mon, 28 Oct 2024 15:26:25 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:26:25 GMT Message-Id: <202410281526.49SFQP7J073061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b74aaa1a2199 - main - manuals: Fix dates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b74aaa1a2199261f9078247d29481a994b6b5e42 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b74aaa1a2199261f9078247d29481a994b6b5e42 commit b74aaa1a2199261f9078247d29481a994b6b5e42 Author: Graham Percival AuthorDate: 2024-10-16 23:03:49 +0000 Commit: Mitchell Horne CommitDate: 2024-10-28 15:26:03 +0000 manuals: Fix dates These were reported by `mandoc -T lint ...` as warnings. Signed-off-by: Graham Percival Reviewed by: mhorne MFC after: 3 days Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1475 --- lib/libpmc/pmc.amd.3 | 2 +- lib/libusb/libusb.3 | 2 +- libexec/rtld-elf/rtld.1 | 2 +- share/man/man4/enic.4 | 2 +- usr.sbin/gssd/gssd.8 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libpmc/pmc.amd.3 b/lib/libpmc/pmc.amd.3 index ee0aae26d42f..047b31aa78bb 100644 --- a/lib/libpmc/pmc.amd.3 +++ b/lib/libpmc/pmc.amd.3 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd 24 June, 2023 +.Dd June 24, 2023 .Dt PMC.AMD 3 .Os .Sh NAME diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index 43afa55380a8..fe07e86623c8 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January, 26, 2023 +.Dd January 26, 2023 .Dt LIBUSB 3 .Os .Sh NAME diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 31e046a5cdc4..5631c28e1f84 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -26,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 24, 2025 +.Dd July 24, 2024 .Dt RTLD 1 .Os .Sh NAME diff --git a/share/man/man4/enic.4 b/share/man/man4/enic.4 index 257a95fa9d32..1783b05dfa12 100644 --- a/share/man/man4/enic.4 +++ b/share/man/man4/enic.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Sept 7, 2022 +.Dd September 7, 2022 .Dt ENIC 4 .Os .Sh NAME diff --git a/usr.sbin/gssd/gssd.8 b/usr.sbin/gssd/gssd.8 index 4240bf28867d..8c330a134a6f 100644 --- a/usr.sbin/gssd/gssd.8 +++ b/usr.sbin/gssd/gssd.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 10 2020 +.Dd April 10, 2020 .Dt GSSD 8 .Os .Sh NAME From nobody Mon Oct 28 15:31:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XccnN1zr3z5bTQh; Mon, 28 Oct 2024 15:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XccnM71rPz40LJ; Mon, 28 Oct 2024 15:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gsrxrhl005K3bN0kWLlhTKV0waDhsJD8i72+qPZOE/0=; b=k+cgnYKMhoXjV2hE+gqgb6YItAOKe/kb6y9IoGXliLOlOda/UsT3HBslm0ptHcvg6Ysqe7 xZnGkyA6xJJkNDVUu+Z42EBww3UmUFKX9nfshRtXT3gkcB0dsnuroNhA3gZwBcU1YJP9/G QSDqxNT3WeebSWmCCiprXlwom3shYlboloy/8bB9NOTT+A0cipg4f645bwi2jKXdIfFW/P ePrupA65nvvW+kTZf8LTCCBtcv4oKEi1OGE0QsSDxG5wfjU/UdKytwTJEfBP4Ypx9PP+30 QrZE6PDLaLvsneGIuA6BAMNq6m6uVmKK8R0tH9MTtM4QM3wKI1H/thWEn7Y7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730129512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gsrxrhl005K3bN0kWLlhTKV0waDhsJD8i72+qPZOE/0=; b=jVl79LE5gC+2aRguzB2mce1zlIHOiCWru5P00/3gQkBHPFq1izGCXFzCq4q7SxU29xb5B7 HUH3UPeFhIoMpv0Zh2r3GJAxMsTfxRRGv81+Ly4s2EU7ONMaF0hRt/4LlGr78oHO36crnA /U/xkPhC9wxQ5KxXsNbMLSEg2n1PHVzQ3zpofKThEt68k6qXIYBrohkznCnWs4MX60ObDW AaPR0ntvO8OtwybrlX0AxvF5Dbd6mDWRW0/yu3dNG7nNv9h3XjFau1wMYf1fK7MbfxipEa RigFvpw05YyAiSrv3JYp880Gg8rAaaLbFD+blrm1+PHOhA/XZwLQWLVnkTqAdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730129512; a=rsa-sha256; cv=none; b=i2REfPTsP+8uCAGAt1vsGNQPi+SxZ6HYn84EAkfwOVKodwK5s5/fgH6oTdANF5NHv4GPo6 d6RJp+r4T3G1duziOTr6fFfcJLW4+D+R2EpGw6AY7UgYYwLzWJH7oOkyakzwK3bwv6rgWD BxClFWpQ8NToX7mAWHhg4hWPUffWwcPXaFUNJVba0mwL02n+mNLGb9K+6bZUm0nMn5Wmbl 0nwuXlc19M1on4FAySbHxdeNIjID4GPfFQMitEo1zhnttTei5hasiuh1gwC3uY9K/uTXWP jRFQ+/YQaVt8UrsWFYU0Wzoonzkbm+8fRkhiNO6Hc6MEuvKDLHMWdi5Er0kZZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XccnM6dbFzkkd; Mon, 28 Oct 2024 15:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SFVpP5088632; Mon, 28 Oct 2024 15:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SFVpQB088629; Mon, 28 Oct 2024 15:31:51 GMT (envelope-from git) Date: Mon, 28 Oct 2024 15:31:51 GMT Message-Id: <202410281531.49SFVpQB088629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: f35ccf46c7c6 - main - flua: lposix: add fnmatch function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f35ccf46c7c6cb7d26994ec5dc5926ea53be0116 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=f35ccf46c7c6cb7d26994ec5dc5926ea53be0116 commit f35ccf46c7c6cb7d26994ec5dc5926ea53be0116 Author: Stefan Eßer AuthorDate: 2024-10-28 15:22:08 +0000 Commit: Stefan Eßer CommitDate: 2024-10-28 15:31:08 +0000 flua: lposix: add fnmatch function The fnmatch function matches a string against a shell-style filename pattern. It is a complex function and cannot easily be implenented using regular expressions. Adding fnmatch to flua increases the amd64 binary by less than 1 KB. Approved by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46849 --- libexec/flua/linit_flua.c | 1 + libexec/flua/modules/lposix.c | 41 +++++++++++++++++++++++++++++++++++++++++ libexec/flua/modules/lposix.h | 1 + 3 files changed, 43 insertions(+) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 5cae7531b7da..8eaa4af1ffca 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -57,6 +57,7 @@ static const luaL_Reg loadedlibs[] = { #endif /* FreeBSD Extensions */ {"lfs", luaopen_lfs}, + {"posix.fnmatch", luaopen_posix_fnmatch}, {"posix.libgen", luaopen_posix_libgen}, {"posix.stdlib", luaopen_posix_stdlib}, {"posix.sys.stat", luaopen_posix_sys_stat}, diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index 77e152754b8c..0f3ea7722d4d 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,23 @@ err: } +static int +lua_fnmatch(lua_State *L) +{ + const char *pattern, *string; + int flags, n; + + n = lua_gettop(L); + luaL_argcheck(L, n == 2 || n == 3, 4, "need 2 or 3 arguments"); + + pattern = luaL_checkstring(L, 1); + string = luaL_checkstring(L, 2); + flags = luaL_optinteger(L, 3, 0); + lua_pushinteger(L, fnmatch(pattern, string, flags)); + + return (1); +} + static int lua_uname(lua_State *L) { @@ -462,6 +480,11 @@ static const struct luaL_Reg stdliblib[] = { { NULL, NULL }, }; +static const struct luaL_Reg fnmatchlib[] = { + REG_SIMPLE(fnmatch), + { NULL, NULL }, +}; + static const struct luaL_Reg sys_statlib[] = { REG_SIMPLE(chmod), { NULL, NULL }, @@ -506,6 +529,24 @@ luaopen_posix_stdlib(lua_State *L) return (1); } +int +luaopen_posix_fnmatch(lua_State *L) +{ + luaL_newlib(L, fnmatchlib); + +#define setkv(f) do { \ + lua_pushinteger(L, f); \ + lua_setfield(L, -2, #f); \ +} while (0) + setkv(FNM_PATHNAME); + setkv(FNM_NOESCAPE); + setkv(FNM_NOMATCH); + setkv(FNM_PERIOD); +#undef setkv + + return 1; +} + int luaopen_posix_sys_stat(lua_State *L) { diff --git a/libexec/flua/modules/lposix.h b/libexec/flua/modules/lposix.h index 9d2c97b0d2dc..da7079056826 100644 --- a/libexec/flua/modules/lposix.h +++ b/libexec/flua/modules/lposix.h @@ -7,6 +7,7 @@ #include +int luaopen_posix_fnmatch(lua_State *L); int luaopen_posix_libgen(lua_State *L); int luaopen_posix_stdlib(lua_State *L); int luaopen_posix_sys_stat(lua_State *L); From nobody Mon Oct 28 16:10:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcddd20t0z5bVqg; Mon, 28 Oct 2024 16:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcddd1SxBz45bb; Mon, 28 Oct 2024 16:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730131813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blSYExY82ds9ZhDJqR2ZWtzq1T9sTkoEbSpcS9tvFp0=; b=UoAVLuouXJhzlYVHP2vhhtt6fYTjJH2pL9x0vizxGqDhLSN0fOGDvPon5AT+YVHd7g8XHD nGoIFBPW8mBvv+7DnQiH2J8ZnRgIVCSTFfLTOZUPIYNL5bMsEJnjX7vDHwYVdj9FaRPK/v RX/TiuNkx+3vtk8UmZHaE8fY+8QLWZELC67SgYNKw8BF0VLCLgQexb4HJyLpX7lT05UmCM Yocu51ZXMXjmVhvTbxAYOso2pezXziqx5J732llVU6u2QllJTAVWAwSXOhPZW30pEm61N4 a8WvyrN5VwjQV5qvP9Ap/+tqaTjLgTgLt9697gIQTNTSldEzkbC2azGF35+uww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730131813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blSYExY82ds9ZhDJqR2ZWtzq1T9sTkoEbSpcS9tvFp0=; b=IEkiRhfyAP1+S5hYB2z8shkBQvFB13/bH9V9Ho+bPajvYgB2UkN6FU9XhyGc4JVcezFCU5 1jc7QyYTMJZN80K9u25uV7vzoxiWBj/f1Ca3E8kFPMlfcb0lx6m6b0y+Ll9fYmO4YCW1b2 vlrmkcCoPL5yXBl9igKMwR08yLDyGoNoxjTFJIg+g1k4pmbJLaOcAib9+FCfFdqAGk/63z NDngYCM/M/V0EAk2afhmj4nael9HEkI8UUPQyUSYkx2TBRwRgCMhJ9MymQi/7sivF9iM9Q /uxSA7UGLdOij95SbBXQF8c5HGCI//Uou17eIZ6y/W/2KXsYi4jeJy4I3QHc9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730131813; a=rsa-sha256; cv=none; b=WjDO33smE7fL0Fi6NiPK6tBIxqruaEWrckd0BNTF/6BEA4VZi51/n0no/S4KrID5Mdz4C1 BNHfuOnDdhiH6iPM6+A4oWTldsKt3/HX3kTtYQS4+pMlYVKPTkYa7IrsFr13ZkokasTdYu G0LsccA90RWcUlNDnQ0ytPVWVCzb/0GapvQcS9z7DNAYyp9DCJNrAAjBb3F6sdygaXx+hw Gjy7Ejiitaxd/G9ubDddClZ9xwJ+lt5AuJ/xumLp2nt0LZO+d8W/x6d6BzgH+il9yjpbOI UmQdSw/W6zV5r+7DviQ3HvfM8+2M31g0LJErqdo39RAqUqsvtqrnsWMWK3mLGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcddd0xBWzlZW; Mon, 28 Oct 2024 16:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SGADWO054140; Mon, 28 Oct 2024 16:10:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SGADAr054135; Mon, 28 Oct 2024 16:10:13 GMT (envelope-from git) Date: Mon, 28 Oct 2024 16:10:13 GMT Message-Id: <202410281610.49SGADAr054135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b1c2fc54f32c - stable/13 - alc(4): disable MSI-X by default on Killer cards List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1c2fc54f32c2e670bb419230de917901d1dff6b Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b1c2fc54f32c2e670bb419230de917901d1dff6b commit b1c2fc54f32c2e670bb419230de917901d1dff6b Author: Lexi Winter AuthorDate: 2024-04-22 22:09:26 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 16:09:41 +0000 alc(4): disable MSI-X by default on Killer cards Several users with alc(4)-based "Killer" Ethernet cards have reported issues with this driver not passing traffic, which are solved by disabling MSI-X using the provided tunable. To work around this issue, disable MSI-X by default on this card. This is done by having msix_disable default to 2, which means "auto-detect". The user can still override this to either 0 or 1 as desired. Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's unlikely this will cause any practical performance issues; on the other hand, the card not working by default likely causes issues for many new FreeBSD users who find their network port doesn't work and have no idea why. PR: 230807 MFC after: 1 week Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1185 (cherry picked from commit 05a95d19cb248203acdd4e069d3eedfe597c3b49) --- share/man/man4/alc.4 | 6 +++++- sys/dev/alc/if_alc.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/share/man/man4/alc.4 b/share/man/man4/alc.4 index 478558657799..5ce5ce97d68a 100644 --- a/share/man/man4/alc.4 +++ b/share/man/man4/alc.4 @@ -136,7 +136,11 @@ This tunable disables MSI support on the Ethernet hardware. The default value is 0. .It Va hw.alc.msix_disable This tunable disables MSI-X support on the Ethernet hardware. -The default value is 0. +The default value is 2, which means to enable or disable MSI-X based on the +card type; for "Killer" cards (E2x00) MSI-X will be disabled, while on other +cards it will be enabled. +Set this to 0 to force MSI-X to be enabled, or 1 to force it to be disabled +regardless of card type. .El .Sh SYSCTL VARIABLES The following variables are available as both diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index e6c0470d48c7..b1fdb55b1109 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -92,8 +92,14 @@ MODULE_DEPEND(alc, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; -static int msix_disable = 0; TUNABLE_INT("hw.alc.msi_disable", &msi_disable); + +/* + * The default value of msix_disable is 2, which means to decide whether to + * enable MSI-X in alc_attach() depending on the card type. The operator can + * set this to 0 or 1 to override the default. + */ +static int msix_disable = 2; TUNABLE_INT("hw.alc.msix_disable", &msix_disable); /* @@ -1413,6 +1419,14 @@ alc_attach(device_t dev) case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; + + /* + * Disable MSI-X by default on Killer devices, since this is + * reported by several users to not work well. + */ + if (msix_disable == 2) + msix_disable = 1; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && @@ -1442,6 +1456,14 @@ alc_attach(device_t dev) default: break; } + + /* + * The default value of msix_disable is 2, which means auto-detect. If + * we didn't auto-detect it, default to enabling it. + */ + if (msix_disable == 2) + msix_disable = 0; + sc->alc_flags |= ALC_FLAG_JUMBO; /* From nobody Mon Oct 28 16:59:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcfkl4YtSz5bYMK; Mon, 28 Oct 2024 16:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcfkl3Rhvz4Dl4; Mon, 28 Oct 2024 16:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lhiPjJdG+g92IDfteoKIH+09E5L1IcRcBJnvRs73x/g=; b=T+QbSKnvj2vku3gIcUaewfdfFFVSctOoJcBVbmq0nGyrn/wV36ejlUm73mo0r7XuUt1GuV vm4qOxJHyM8uXqB3OEVuPwGJppZg2M40TK7Q0MxpnU+SEouSs/9eS6dFVTRpyEpvr9M9xW GK42uHLlobcauOEkNBeVZyLdXHfFWrj6PtEe82G6oupz+b1w4PlFMrZGdMs+Vt1RXYaFBW Uf8fUEa9fmx9Y3kTET51qQLo2kxoMb+r1wlEJJHz89r+9yPuGhUcAV1P4bSnKd/I1UF7aM Qbb4hz2rDcELxgltSt1pu3EP/AJtAAIZ8G8XHuSyLGFNJFZclItp/p24az40ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lhiPjJdG+g92IDfteoKIH+09E5L1IcRcBJnvRs73x/g=; b=hcjc4dgrpnjU3jDBwwtRI0xLofq/QIpMLhKPG0lVT4Z7TJspZu/Lp1nVjFVdKZHVQsPJpS /KFr7irgcXCqrLeeWxj3NlHPYXuyJPHcF/ZGvC2fG0/hozRKrKgYZPw9r7LLzcPgaX5YoO 7HXBaP3sps/8Lr8KXXmuFhIMeBq+4Gh7UqO0mqSh6IHeijTu/aUj7oSRdcf9DQl4PRKLB3 PN5QRpearKFnT2bel7wnLPCBa3uEyHVAjqWqcahq46jGFMVGeWb7DyOShEuzgI+1+Y1W8P nH9LNaNog1wjj/2zug5mt21Q2TRzf2mwF6gybxQMnv/AqsV8PqU7T2Q+AGIkXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730134783; a=rsa-sha256; cv=none; b=oGhQpbEX++vc4sYY7f3Z3Jxb/Epgq0phFuVqPObJf3AYB/A7rOCbOYui0j/Z9kfv2RU2pz cHcoDOZoafhdg/smn4uCoc5TSwSZyJBqG1yynQH+tpOWxQrVWGWzsAocgar958TbEXAKEn iotrpFGr9YR9T8GQBeAU73v7HrKmfIqCbU29twuaLNVjXz+DLLORLNzjoze7L2J46rVNJ/ la27jlvfI5+Uf2TvOeYlRPvKDPUGfanrqBRF1CEzlNKYpxhXaNq7pTkSHDBVN8Er5jTFxr gP9BCqYu3yg0IimqA5ySzYRkObm9wiy97NLk5rHDSlD70EyjYxOGWK8uYNnLcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcfkl2wpZznFQ; Mon, 28 Oct 2024 16:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SGxhTg039933; Mon, 28 Oct 2024 16:59:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SGxhFp039930; Mon, 28 Oct 2024 16:59:43 GMT (envelope-from git) Date: Mon, 28 Oct 2024 16:59:43 GMT Message-Id: <202410281659.49SGxhFp039930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9f984fc683d7 - stable/14 - netmap: Make memory pools NUMA-aware List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f984fc683d7a8df452411ba6f25b838d6a7ea81 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9f984fc683d7a8df452411ba6f25b838d6a7ea81 commit 9f984fc683d7a8df452411ba6f25b838d6a7ea81 Author: Mark Johnston AuthorDate: 2024-10-14 13:30:09 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 16:39:50 +0000 netmap: Make memory pools NUMA-aware Each netmap adapter associated with a physical adapter is attached to a netmap memory pool. contigmalloc() is used to allocate physically contiguous memory for the pool, but ideally we would ensure that all such memory is allocated from the NUMA domain local to the adapter. Augment netmap's memory pools with a NUMA domain ID, similar to how IOMMU groups are handled in the Linux port. That is, when attaching to a physical adapter, ensure that the associated memory pools are local to the adapter's associated memory domain, creating new pools as needed. Some types of ifnets do not have any defined NUMA affinity; in this case the domain ID in question is the sentinel value -1. Add a sysctl, dev.netmap.port_numa_affinity, which can be used to enable the new behaviour. Keep it disabled by now to avoid surprises in case netmap applications are relying on zero-copy optimizations to forward packets between ports belonging to different NUMA domains. Reviewed by: vmaffione MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46666 (cherry picked from commit 1bae9dc584272dd75dc4e04cb5d73be0e9fb562a) --- share/man/man4/netmap.4 | 12 +++++++++- sys/dev/netmap/netmap.c | 4 ++-- sys/dev/netmap/netmap_kern.h | 27 ++++++++++++++++++--- sys/dev/netmap/netmap_mem2.c | 56 +++++++++++++++++++++++++++++--------------- sys/dev/netmap/netmap_mem2.h | 2 +- 5 files changed, 75 insertions(+), 26 deletions(-) diff --git a/share/man/man4/netmap.4 b/share/man/man4/netmap.4 index fd713f3c384b..e258b60e11f6 100644 --- a/share/man/man4/netmap.4 +++ b/share/man/man4/netmap.4 @@ -25,7 +25,7 @@ .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" -.Dd March 6, 2022 +.Dd October 10, 2024 .Dt NETMAP 4 .Os .Sh NAME @@ -938,6 +938,16 @@ switches that can be created. This tunable can be specified at loader time. .It Va dev.netmap.ptnet_vnet_hdr: 1 Allow ptnet devices to use virtio-net headers +.It Va dev.netmap.port_numa_affinity: 0 +On +.Xr numa 4 +systems, allocate memory for netmap ports from the local NUMA domain when +possible. +This can improve performance by reducing the number of remote memory accesses. +However, when forwarding packets between ports attached to different NUMA +domains, this will prevent zero-copy forwarding optimizations and thus may hurt +performance. +Note that this setting must be specified as a loader tunable at boot time. .El .Sh SYSTEM CALLS .Nm diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 832d0ecc0c6e..f531151fb656 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -4010,8 +4010,8 @@ netmap_attach_common(struct netmap_adapter *na) na->active_fds = 0; if (na->nm_mem == NULL) { - /* use iommu or global allocator */ - na->nm_mem = netmap_mem_get_iommu(na); + /* select an allocator based on IOMMU and NUMA affinity */ + na->nm_mem = netmap_mem_get_allocator(na); } if (na->nm_bdg_attach == NULL) /* no special nm_bdg_attach callback. On VALE diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 8618aaf82299..22bd213d9c42 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -81,6 +81,7 @@ #if defined(__FreeBSD__) #include +#include #define likely(x) __builtin_expect((long)!!(x), 1L) #define unlikely(x) __builtin_expect((long)!!(x), 0L) @@ -1726,10 +1727,30 @@ extern int netmap_generic_txqdisc; #define NM_IS_NATIVE(ifp) (NM_NA_VALID(ifp) && NA(ifp)->nm_dtor == netmap_hw_dtor) #if defined(__FreeBSD__) +extern int netmap_port_numa_affinity; -/* Assigns the device IOMMU domain to an allocator. - * Returns -ENOMEM in case the domain is different */ -#define nm_iommu_group_id(dev) (-1) +static inline int +nm_iommu_group_id(struct netmap_adapter *na) +{ + return (-1); +} + +static inline int +nm_numa_domain(struct netmap_adapter *na) +{ + int domain; + + /* + * If the system has only one NUMA domain, don't bother distinguishing + * between IF_NODOM and domain 0. + */ + if (vm_ndomains == 1 || netmap_port_numa_affinity == 0) + return (-1); + domain = if_getnumadomain(na->ifp); + if (domain == IF_NODOM) + domain = -1; + return (domain); +} /* Callback invoked by the dma machinery after a successful dmamap_load */ static void netmap_dmamap_cb(__unused void *arg, diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index 1ba966e7666a..50a5d2bc50f2 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -37,8 +37,8 @@ #endif /* __APPLE__ */ #ifdef __FreeBSD__ -#include /* prerequisite */ -#include +#include +#include #include #include /* MALLOC_DEFINE */ #include @@ -174,7 +174,8 @@ struct netmap_mem_d { struct netmap_obj_pool pools[NETMAP_POOLS_NR]; nm_memid_t nm_id; /* allocator identifier */ - int nm_grp; /* iommu group id */ + int nm_grp; /* iommu group id */ + int nm_numa_domain; /* local NUMA domain */ /* list of all existing allocators, sorted by nm_id */ struct netmap_mem_d *prev, *next; @@ -310,7 +311,7 @@ netmap_mem_rings_delete(struct netmap_adapter *na) static int netmap_mem_map(struct netmap_obj_pool *, struct netmap_adapter *); static int netmap_mem_unmap(struct netmap_obj_pool *, struct netmap_adapter *); -static int nm_mem_check_group(struct netmap_mem_d *, bus_dma_tag_t); +static int nm_mem_check_group(struct netmap_mem_d *, void *); static void nm_mem_release_id(struct netmap_mem_d *); nm_memid_t @@ -576,6 +577,7 @@ struct netmap_mem_d nm_mem = { /* Our memory allocator. */ .nm_id = 1, .nm_grp = -1, + .nm_numa_domain = -1, .prev = &nm_mem, .next = &nm_mem, @@ -615,6 +617,7 @@ static const struct netmap_mem_d nm_blueprint = { }, .nm_grp = -1, + .nm_numa_domain = -1, .flags = NETMAP_MEM_PRIVATE, @@ -625,7 +628,6 @@ static const struct netmap_mem_d nm_blueprint = { #define STRINGIFY(x) #x - #define DECLARE_SYSCTLS(id, name) \ SYSBEGIN(mem2_ ## name); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_size, \ @@ -649,9 +651,14 @@ DECLARE_SYSCTLS(NETMAP_IF_POOL, if); DECLARE_SYSCTLS(NETMAP_RING_POOL, ring); DECLARE_SYSCTLS(NETMAP_BUF_POOL, buf); +int netmap_port_numa_affinity = 0; +SYSCTL_INT(_dev_netmap, OID_AUTO, port_numa_affinity, + CTLFLAG_RDTUN, &netmap_port_numa_affinity, 0, + "Use NUMA-local memory for memory pools when possible"); + /* call with nm_mem_list_lock held */ static int -nm_mem_assign_id_locked(struct netmap_mem_d *nmd, int grp_id) +nm_mem_assign_id_locked(struct netmap_mem_d *nmd, int grp_id, int domain) { nm_memid_t id; struct netmap_mem_d *scan = netmap_last_mem_d; @@ -666,6 +673,7 @@ nm_mem_assign_id_locked(struct netmap_mem_d *nmd, int grp_id) if (id != scan->nm_id) { nmd->nm_id = id; nmd->nm_grp = grp_id; + nmd->nm_numa_domain = domain; nmd->prev = scan->prev; nmd->next = scan; scan->prev->next = nmd; @@ -688,7 +696,7 @@ nm_mem_assign_id(struct netmap_mem_d *nmd, int grp_id) int ret; NM_MTX_LOCK(nm_mem_list_lock); - ret = nm_mem_assign_id_locked(nmd, grp_id); + ret = nm_mem_assign_id_locked(nmd, grp_id, -1); NM_MTX_UNLOCK(nm_mem_list_lock); return ret; @@ -728,7 +736,7 @@ netmap_mem_find(nm_memid_t id) } static int -nm_mem_check_group(struct netmap_mem_d *nmd, bus_dma_tag_t dev) +nm_mem_check_group(struct netmap_mem_d *nmd, void *dev) { int err = 0, id; @@ -1399,7 +1407,7 @@ netmap_config_obj_allocator(struct netmap_obj_pool *p, u_int objtotal, u_int obj /* call with NMA_LOCK held */ static int -netmap_finalize_obj_allocator(struct netmap_obj_pool *p) +netmap_finalize_obj_allocator(struct netmap_mem_d *nmd, struct netmap_obj_pool *p) { int i; /* must be signed */ size_t n; @@ -1442,8 +1450,16 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) * can live with standard malloc, because the hardware will not * access the pages directly. */ - clust = contigmalloc(n, M_NETMAP, M_NOWAIT | M_ZERO, - (size_t)0, -1UL, PAGE_SIZE, 0); + if (nmd->nm_numa_domain == -1) { + clust = contigmalloc(n, M_NETMAP, + M_NOWAIT | M_ZERO, (size_t)0, -1UL, PAGE_SIZE, 0); + } else { + struct domainset *ds; + + ds = DOMAINSET_PREF(nmd->nm_numa_domain); + clust = contigmalloc_domainset(n, M_NETMAP, + ds, M_NOWAIT | M_ZERO, (size_t)0, -1UL, PAGE_SIZE, 0); + } if (clust == NULL) { /* * If we get here, there is a severe memory shortage, @@ -1637,7 +1653,7 @@ netmap_mem_finalize_all(struct netmap_mem_d *nmd) nmd->lasterr = 0; nmd->nm_totalsize = 0; for (i = 0; i < NETMAP_POOLS_NR; i++) { - nmd->lasterr = netmap_finalize_obj_allocator(&nmd->pools[i]); + nmd->lasterr = netmap_finalize_obj_allocator(nmd, &nmd->pools[i]); if (nmd->lasterr) goto error; nmd->nm_totalsize += nmd->pools[i].memtotal; @@ -1805,24 +1821,26 @@ netmap_mem_private_new(u_int txr, u_int txd, u_int rxr, u_int rxd, return d; } -/* Reference iommu allocator - find existing or create new, - * for not hw addapeters fallback to global allocator. +/* Reference IOMMU and NUMA local allocator - find existing or create new, + * for non-hw adapters, fall back to global allocator. */ struct netmap_mem_d * -netmap_mem_get_iommu(struct netmap_adapter *na) +netmap_mem_get_allocator(struct netmap_adapter *na) { - int i, err, grp_id; + int i, domain, err, grp_id; struct netmap_mem_d *nmd; if (na == NULL || na->pdev == NULL) return netmap_mem_get(&nm_mem); + domain = nm_numa_domain(na->pdev); grp_id = nm_iommu_group_id(na->pdev); NM_MTX_LOCK(nm_mem_list_lock); nmd = netmap_last_mem_d; do { - if (!(nmd->flags & NETMAP_MEM_HIDDEN) && nmd->nm_grp == grp_id) { + if (!(nmd->flags & NETMAP_MEM_HIDDEN) && + nmd->nm_grp == grp_id && nmd->nm_numa_domain == domain) { nmd->refcount++; NM_DBG_REFC(nmd, __FUNCTION__, __LINE__); NM_MTX_UNLOCK(nm_mem_list_lock); @@ -1837,7 +1855,7 @@ netmap_mem_get_iommu(struct netmap_adapter *na) *nmd = nm_mem_blueprint; - err = nm_mem_assign_id_locked(nmd, grp_id); + err = nm_mem_assign_id_locked(nmd, grp_id, domain); if (err) goto error_free; @@ -2881,7 +2899,7 @@ netmap_mem_pt_guest_create(nm_memid_t mem_id) ptnmd->pt_ifs = NULL; /* Assign new id in the guest (We have the lock) */ - err = nm_mem_assign_id_locked(&ptnmd->up, -1); + err = nm_mem_assign_id_locked(&ptnmd->up, -1, -1); if (err) goto error; diff --git a/sys/dev/netmap/netmap_mem2.h b/sys/dev/netmap/netmap_mem2.h index 1681d5c7721f..0123b010e944 100644 --- a/sys/dev/netmap/netmap_mem2.h +++ b/sys/dev/netmap/netmap_mem2.h @@ -146,7 +146,7 @@ struct netmap_mem_d* netmap_mem_private_new( u_int txr, u_int txd, u_int rxr, u_ #define netmap_mem_get(d) __netmap_mem_get(d, __FUNCTION__, __LINE__) #define netmap_mem_put(d) __netmap_mem_put(d, __FUNCTION__, __LINE__) struct netmap_mem_d* __netmap_mem_get(struct netmap_mem_d *, const char *, int); -struct netmap_mem_d* netmap_mem_get_iommu(struct netmap_adapter *); +struct netmap_mem_d* netmap_mem_get_allocator(struct netmap_adapter *); void __netmap_mem_put(struct netmap_mem_d *, const char *, int); struct netmap_mem_d* netmap_mem_find(nm_memid_t); unsigned netmap_mem_bufsize(struct netmap_mem_d *nmd); From nobody Mon Oct 28 16:59:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcfkm6mHYz5bY7K; Mon, 28 Oct 2024 16:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcfkm468gz4Ddt; Mon, 28 Oct 2024 16:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gnrtF2l39thkYI6RhfRAnGA7KYK/uiemtuSbjSiLXQk=; b=B74gtlXAUcW5UvylZu2h7eG1FTk0OLG8VHk7ilU6iEnV9Bva+04v0sFlxAUHh7PYGWd5aB xRP1quzLeGridehEg3WLGkokM9yl0PQO17W2xwOzMCUH2CuGsUNV+67c7X33VxgWDPx07n v/b8UpokYE39zQ8FHVk8q1oMOgzaeMBgw0URhtkj+22X/vIQvzsELCPzOhR2UxKZ/OhYXv 93U/4frDS8swUhOn4b934WsJsL5/8LO86zZpbRDORzn8l5+yh6dEcOlE1etTAit8NEuCEH CS3enFV1ce2qeIh/aQL6sxGTafUFLiXmPF+snql5vK0WR+Qzfupuq1yMp9DSog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gnrtF2l39thkYI6RhfRAnGA7KYK/uiemtuSbjSiLXQk=; b=CZYHTwxYt3a280NcfgyPlZ/MAHKKb6KzCuSE5xbt6CHEBBEG9EfLCChDjzCQA6j+xIRHq6 ehtiI0PZG1sOMfWQ7HXAHh/ID6rGTmWcwyDGqDVJ4++dBqfV9RCleOm3lMLz9T0cLTiVom mzAWnB3endnpHhOWJwZQ7T9GN+6cD48uBbA8U9rEBtkedvQ8SbYpljdixNGcDVpXLztgH5 cQUh6Y7pSdyQ8qySXB7GFpG6FGcNuYEEbPBOW8y3yUIg/Ml3A/oMCE5+MW4444qtsZB+Dd Tz5YnRl9rt5AkeMPYxr4SX6cBzL26fMSUNpgFp4gw7RI3fETiE1C7Khc2C1xoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730134784; a=rsa-sha256; cv=none; b=bYkVxmMD5x8BVuk20N/nMEfYaHofIp/XnEp/v8YR5oypPa4+8bv+IoxSnHwdby/Nfzs3Fq N+eV2LgO9IbWEbfiw3qSjaUp3Shr7PoFCIP7zIUB0wknvGxHx8bcHVqBIdBxPjIIBhrDGh uH5QcsTLpi7meLiRwNSD+eCgyEXerjYuWF2VNHrH9GLuA2ljofMXbOnmiPWE0mDptgqfdT mnQAv2frnq6oTYXA3JVE+jhWjSXgHonVcuvGtr7m98xOCHFYfigxY4LuKPA23m5iQC7bBJ apeZ9h291zFRYFE6YYIaMJHiXaJ6iNoJhFGyOO4eJUqVyVi8RwkNj4bWNSK8Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcfkm3jjpzmpX; Mon, 28 Oct 2024 16:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SGxiFR039987; Mon, 28 Oct 2024 16:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SGxiwM039984; Mon, 28 Oct 2024 16:59:44 GMT (envelope-from git) Date: Mon, 28 Oct 2024 16:59:44 GMT Message-Id: <202410281659.49SGxiwM039984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7d3f9eb16890 - stable/14 - makefs: Record a larger TXG number in the uberblock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d3f9eb168904b0f201c6bb377818d238060075a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d3f9eb168904b0f201c6bb377818d238060075a commit 7d3f9eb168904b0f201c6bb377818d238060075a Author: Mark Johnston AuthorDate: 2024-10-14 13:08:09 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 16:39:50 +0000 makefs: Record a larger TXG number in the uberblock By default, OpenZFS will perform metadata verification of the most recent TXGs, but this can be very slow since all data in a pool generated by makefs was logically written in a single transaction. Avoid triggering this verification by default, but add an option to restore the previous behaviour and enable it in regression test cases. Reported by: cperciva Tested by: cperciva (previous version) MFC after: 2 weeks (cherry picked from commit 4e15366c6a6907bcd0e2c28885ba5878ed4280d2) --- usr.sbin/makefs/makefs.8 | 3 +++ usr.sbin/makefs/tests/makefs_zfs_tests.sh | 2 +- usr.sbin/makefs/zfs.c | 13 +++++++++++++ usr.sbin/makefs/zfs/zfs.h | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index c6aeae961196..0cc2619e6c89 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -536,6 +536,9 @@ By default, allocates large (up to 512MB) metaslabs with the expectation that the image will be auto-expanded upon first use. This option allows the default heuristic to be overridden. +.It verify-txgs +Prompt OpenZFS to verify pool metadata during import. +This is disabled by default as it may significantly increase import times. .It poolname The name of the ZFS pool. This option must be specified. diff --git a/usr.sbin/makefs/tests/makefs_zfs_tests.sh b/usr.sbin/makefs/tests/makefs_zfs_tests.sh index 6e20ae33b354..9196232ed3b3 100644 --- a/usr.sbin/makefs/tests/makefs_zfs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_zfs_tests.sh @@ -28,7 +28,7 @@ # SUCH DAMAGE. # -MAKEFS="makefs -t zfs -o nowarn=true" +MAKEFS="makefs -t zfs -o verify-txgs=true -o nowarn=true" ZFS_POOL_NAME="makefstest$$" TEST_ZFS_POOL_NAME="$TMPDIR/poolname" diff --git a/usr.sbin/makefs/zfs.c b/usr.sbin/makefs/zfs.c index b16a48564f04..43469c2358be 100644 --- a/usr.sbin/makefs/zfs.c +++ b/usr.sbin/makefs/zfs.c @@ -91,6 +91,8 @@ zfs_prep_opts(fsinfo_t *fsopts) 0, 0, "Prefix for all dataset mount points" }, { '\0', "ashift", &zfs->ashift, OPT_INT32, MINBLOCKSHIFT, MAXBLOCKSHIFT, "ZFS pool ashift" }, + { '\0', "verify-txgs", &zfs->verify_txgs, OPT_BOOL, + 0, 0, "Make OpenZFS verify data upon import" }, { '\0', "nowarn", &zfs->nowarn, OPT_BOOL, 0, 0, "Suppress warning about experimental ZFS support" }, { .name = NULL } @@ -594,7 +596,18 @@ pool_labels_write(zfs_opt_t *zfs) ub = (uberblock_t *)(&label->vl_uberblock[0] + uoff); ub->ub_magic = UBERBLOCK_MAGIC; ub->ub_version = SPA_VERSION; + + /* + * Upon import, OpenZFS will perform metadata verification of + * the last TXG by default. If all data is written in the same + * TXG, it'll all get verified, which can be painfully slow in + * some cases, e.g., initial boot in a cloud environment with + * slow storage. So, fabricate additional TXGs to avoid this + * overhead, unless the user requests otherwise. + */ ub->ub_txg = TXG; + if (!zfs->verify_txgs) + ub->ub_txg += TXG_SIZE; ub->ub_guid_sum = zfs->poolguid + zfs->vdevguid; ub->ub_timestamp = 0; diff --git a/usr.sbin/makefs/zfs/zfs.h b/usr.sbin/makefs/zfs/zfs.h index ff94c270bbf6..924fad83f63e 100644 --- a/usr.sbin/makefs/zfs/zfs.h +++ b/usr.sbin/makefs/zfs/zfs.h @@ -55,6 +55,7 @@ _Static_assert(MINBLOCKSIZE == SPA_MINBLOCKSIZE, ""); /* All data was written in this transaction group. */ #define TXG 4 +#define TXG_SIZE 4 typedef struct zfs_dsl_dataset zfs_dsl_dataset_t; typedef struct zfs_dsl_dir zfs_dsl_dir_t; @@ -82,6 +83,7 @@ typedef struct { int ashift; /* vdev block size */ uint64_t mssize; /* metaslab size */ STAILQ_HEAD(, dataset_desc) datasetdescs; /* non-root dataset descrs */ + bool verify_txgs; /* verify data upon import */ /* Pool state. */ uint64_t poolguid; /* pool and root vdev GUID */ From nobody Mon Oct 28 16:59:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcfkp0v0zz5bXx7; Mon, 28 Oct 2024 16:59:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcfkn5RyNz4DlF; Mon, 28 Oct 2024 16:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqeuqgweu9Gq+HkBwC+ouzE7cK7Ko5leyykYIMWW7sU=; b=S6d4q+u0Be9OFxON+CGrB7kmwBhUbWaTpbbCcX4U7YAmobA3pRjyg9nJwaoOSRIAhzPbKh XIh2L8kfzaF4bSG1bWYT2SC1yQVy+iwOnVfn9gDhpeuSEB8totFAFNKqr61BfmWaeLgQgT KcgjuWYhL4YedKSNhVCPb37IIFXY/UCHQboPd7UrVAq2VjPRvOCnbWo6LkiSfHEX4RM0hb N25HzsgZxcZzv375o4zcQx/nzWjX7K9O8KTgisvWCRIEU/7QVmdBLa88gHq3HSVV3VjiCC XHPEa959e8BltrWw5GfVnPEtiDZzQwsC/O9H+9PNG8tTxzUHwg7oTiQ1YJOaLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730134785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wqeuqgweu9Gq+HkBwC+ouzE7cK7Ko5leyykYIMWW7sU=; b=xI9+LEgJYPAJb5Bqb3wm9mBE2hDzUFcBfxe3u/Vk91bTaBKawlVFTFHdTXgQXLpXutYhT2 v+4Xa/MATxLXpm0bukA4c0G+khq0mFbJhbJxc/U1OotcjXZE4AxZhTlWGjsMZJM8vbvamL SavLVitlyMBhOu2Cx2qdVYYUVWRAzWuTB3sdODEKF84ufa4pcdcNv58wCLztQG+4N8S/gY FYRV7FC7T1FXZDbmSe03A1S3VQRRkrUAteNBDLfO8v//Rk6v4DVGOOKw6/psPC9EWn1lu+ kIMc1Og6tjP6yxrRqpnwZeI5Pd7YJql5WM/H140UPo8Ze7DmOjYHzagj7NNupw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730134785; a=rsa-sha256; cv=none; b=ijQeLMEYp0LZNRLb6QJit4h9mmslmEhMI3PC80RS4WZkUIYS2/rCwiWhxmhSd33xUXeU1S Epfy+PYiKFlL+SJL5QDCDJ7oVZNePI9SZoEh4HyHkQe9cB0ySRE0fs0aNc7wcP4hAIVXBf K4xslybsdeU3bg9DkaoGO+G2trTv/Xz6l5hxKsWkvTt2O3s8LfMWDBUeOFSGCqbPR/BBQw YvcGIQ4DOB1kjOfYvKSNws9T7WKJEUaSQi/hwFq44FHR6fADKrYzKU4IcExaGizoGOPWGa I+Ac+wvoSDm61ApP2CbsKeNuuJHJz4aeW4NpJ3FDfpsxDdslOL89Xqjdkt3jAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcfkn4kSbzmly; Mon, 28 Oct 2024 16:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SGxjdb040041; Mon, 28 Oct 2024 16:59:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SGxjUa040038; Mon, 28 Oct 2024 16:59:45 GMT (envelope-from git) Date: Mon, 28 Oct 2024 16:59:45 GMT Message-Id: <202410281659.49SGxjUa040038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b240f05f13c9 - stable/14 - cdefs: Use __has_feature to gate the definition of __nosanitize* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b240f05f13c9e68fd48e716cd0d5fa2e77aefa11 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b240f05f13c9e68fd48e716cd0d5fa2e77aefa11 commit b240f05f13c9e68fd48e716cd0d5fa2e77aefa11 Author: Mark Johnston AuthorDate: 2024-10-19 13:55:12 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 16:39:50 +0000 cdefs: Use __has_feature to gate the definition of __nosanitize* clang 12 does not implement the coverage sanitizer, and the build fails when __attribute__((no_sanitize("coverage"))) is used. Try to work around the problem by giving __nosanitize* a non-trivial definition only when the corresponding sanitizer is actually enabled in the build. Tested by reading disassembly of pmap_update_strided() and pmap_enter() in a kernel compiled with "options COVERAGE", and similar sanity checks for the other sanitizers. I also test-booted KASAN and KMSAN kernels in amd64 bhyve. Suggested by: jrtc27 Reviewed by: imp Fixes: a78bacf3b0ec ("cdefs: Add __nosanitizecoverage") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47193 (cherry picked from commit 3dc6188294dd4f907f5f63cc3f1a79ea20dba99f) --- sys/sys/cdefs.h | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 4fa4decd7652..1481bc1d89d1 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -872,21 +872,33 @@ * GCC has the nosanitize attribute, but as a function attribute only, and * warns on use as a variable attribute. */ -#if __has_attribute(no_sanitize) && defined(__clang__) +#if __has_feature(address_sanitizer) && defined(__clang__) #ifdef _KERNEL -#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address"))) -#define __nosanitizememory __attribute__((no_sanitize("kernel-memory"))) +#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address"))) #else -#define __nosanitizeaddress __attribute__((no_sanitize("address"))) -#define __nosanitizememory __attribute__((no_sanitize("memory"))) +#define __nosanitizeaddress __attribute__((no_sanitize("address"))) #endif -#define __nosanitizecoverage __attribute__((no_sanitize("coverage"))) -#define __nosanitizethread __attribute__((no_sanitize("thread"))) #else -#define __nosanitizeaddress -#define __nosanitizecoverage -#define __nosanitizememory -#define __nosanitizethread +#define __nosanitizeaddress +#endif +#if __has_feature(coverage_sanitizer) && defined(__clang__) +#define __nosanitizecoverage __attribute__((no_sanitize("coverage"))) +#else +#define __nosanitizecoverage +#endif +#if __has_feature(memory_sanitizer) && defined(__clang__) +#ifdef _KERNEL +#define __nosanitizememory __attribute__((no_sanitize("kernel-memory"))) +#else +#define __nosanitizememory __attribute__((no_sanitize("memory"))) +#endif +#else +#define __nosanitizememory +#endif +#if __has_feature(thread_sanitizer) && defined(__clang__) +#define __nosanitizethread __attribute__((no_sanitize("thread"))) +#else +#define __nosanitizethread #endif /* From nobody Mon Oct 28 17:35:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcgWq0Bqlz5bZc1; Mon, 28 Oct 2024 17:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcgWp6pcPz4J3C; Mon, 28 Oct 2024 17:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730136919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyIHKbGTzuUR6/1Sul7XvmQbXmTXL5NVXc9GvgypRPQ=; b=dASCv6O6Xg6tPx3JT11WFzz7GKOsDLOGjYhiRunREVQ3e2ZeF5dLH7dmREdsMKFF57S12Y SEEdOa9zyWIHjfvABQJm1an/Yk8HwhNXl7vNSkcHfp2XU1xjPrwcaUyXEhjHVWahcBy0iI 3tvAbZIYD4UUyMY5tsZ3T/ZE8v6jLQo0WsEa6JvBM57uCoAM4OkZCqextypvS9w5lnVKiJ XkZ3fEx6cdL2SA2bcal2E4VWpVatovR0KP4ojwvZpwpeoOwbTZ4B/lwZFPOwhgIf56/ecw jSRUUTnc96xE0p/uXWeQa13uMnIBc9fI/5rjjee+8xE4xnBZmIY5tseGLy/GTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730136919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyIHKbGTzuUR6/1Sul7XvmQbXmTXL5NVXc9GvgypRPQ=; b=U0g+TFWnHuY8K2l2lMpDW8WkwFSHW642XK1bhfzTOqVCsMCrPtTKx1s0Fso6GRep97ifKg JPwirkwhMzNBP2ISbTYfnXMJWmPZTzEWjYoBbJ7JW0lup0a1B8j6RvnthFtiW4ZomszDI6 TMXFNHZ4jCmcoWP/MJdNOg4Z6Pja5KD0MW1Pa1ZpTTYJxW/Ptg7o0wZhdI+FKCsveyvZFF ksIcvKhkroDwCye1HXD0XflmaHtYaXLRPma69fR+YVoOD0kcJBTg3rj+SwgDaHFwni3z2u vXo4+NGcW8RSh06zIHGOECCQZRbD1+l+DW92oBVHYT350DlKV1A8tsXYIYIb1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730136919; a=rsa-sha256; cv=none; b=GoiphwZwsHKRVonbU/jIQ6H6n09c7kQdsdvhP0K9bu+fKxO+bMEMyQQVCwoCI+K4IzWFfb MVvhK2GE97rAaW4i+X9R+nl545BvyX/NzrI/twfF/zmM5hq99d52HLc5CXpjDEHlnM2LLG h57qZYtIEH+9ILimJjx1IsPvXmYvN/ko6WFK0OHkZLnVruiq+6NKg56uuyU5sYy/gMUJ64 OPoDXbqDVEhHFo8YtY8HgurBWD83yhv2duaF9ueQM4DwT0JjOuq/ABCgDRarEnY70jdVw4 6f9+T3mcMvxo4rgfY4qemX9UBj/PfTMUrGXD3Ki5OUnfK9uuNI0aWGhKdlhtTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcgWp6PlkzpFj; Mon, 28 Oct 2024 17:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SHZIM6012744; Mon, 28 Oct 2024 17:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SHZIG1012741; Mon, 28 Oct 2024 17:35:18 GMT (envelope-from git) Date: Mon, 28 Oct 2024 17:35:18 GMT Message-Id: <202410281735.49SHZIG1012741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: b8c3dd46bba0 - main - Fix gcc unused value warnings in FreeBSD zfs_prop.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8c3dd46bba0451cfecf2fcfbc6aff0459a487bd Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b8c3dd46bba0451cfecf2fcfbc6aff0459a487bd commit b8c3dd46bba0451cfecf2fcfbc6aff0459a487bd Author: Dimitry Andric AuthorDate: 2024-10-27 14:15:54 +0000 Commit: Dimitry Andric CommitDate: 2024-10-28 17:34:58 +0000 Fix gcc unused value warnings in FreeBSD zfs_prop.c With gcc we are seeing the following -Werror warnings: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:53:33: error: statement with no effect [-Werror=unused-value] 53 | #define simd_stat_init() 0 | ^ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1092:9: note: in expansion of macro 'simd_stat_init' 1092 | simd_stat_init(); | ^~~~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c: In function 'zcommon_fini': /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:54:33: error: statement with no effect [-Werror=unused-value] 54 | #define simd_stat_fini() 0 | ^ /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1100:9: note: in expansion of macro 'simd_stat_fini' 1100 | simd_stat_fini(); | ^~~~~~~~~~~~~~ Both `simd_stat_init()` and `simd_stat_fini()` are defined in the FreeBSD specific version of `simd.h`: #define simd_stat_init() 0 #define simd_stat_fini() 0 These should both be defined as `do {} while (0)` instead, similar to other macros in this file. Reviewed by: mav, tsoome (upstream) Obtained from: https://github.com/openzfs/zfs/pull/16693 MFC after: 3 days Differential Revision: --- sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h index 6bc46755c4e3..d16e1db5e826 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h @@ -50,7 +50,7 @@ #define kfpu_fini() do {} while (0) #endif -#define simd_stat_init() 0 -#define simd_stat_fini() 0 +#define simd_stat_init() do {} while (0) +#define simd_stat_fini() do {} while (0) #endif From nobody Mon Oct 28 17:35:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcgWr0tXRz5bZHm; Mon, 28 Oct 2024 17:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcgWr0GQ7z4J3D; Mon, 28 Oct 2024 17:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730136920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggBEEQplvZtmtfHd/jcST8ZiWI/HyTkj52DQrW5ce1s=; b=KT8EnrsPVZpuBqqpqPkqQ238h7T6rmz53yjIVofxbeNWRs5usorkY9jkij34cp4BJuvTYO m9SbS4QUyH+6tad2NVri+jCEsotJ10jjjUQuzHW1cBK25joH5lgwnNk8V9PkfwaSSBgjnm +xVA4mpbx1uTMZlGCs80m5/cl7BV4eWegKrgyYMCXz7N6PofgHbKG2zIN57DxGrizPYm8Q x9VfmkgjwwtG1QmaI54SCd7RIfivC44QpYsXeN66yVzixS24Soqd+9t4wQtTN/7JT57/XH j8BzmmX8enTKwfovnKFompjufbzYvtT7jQyQdrAcGSL9RIHf5CoWLC3bKloc+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730136920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggBEEQplvZtmtfHd/jcST8ZiWI/HyTkj52DQrW5ce1s=; b=u94pm7xSeef8KCYOVLoHUwrAkk1leyngYiK1jXss9+2vPuKAamCPzeKI4qB9RfGWgGUKz9 BT5xtQWz3tPVasE/wYTb6pNFXGFTzvPmYCH49D0cWhom+DsHYKiZv9tnun57JJi2UznrJt RujDSM3e2SuOJxHmAO3hopGxOiz1JbP4wxm84vMGLY/tmstBYuf1Ud+XYDdEGbGKJ0XKLY UQ6vD3wg20VgeJcF/zQSKt/cscSAtXT68fsrcOzY5HXiZ9KBFQ2xIETqMLO7Kpg+Hjv+Pb M+zddJSQ8uQOpmdQ3z3R0tVExmDY315pXkLpWlWe7XiBfYQtFEGmpPweArIH3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730136920; a=rsa-sha256; cv=none; b=qpP3wV9A+9NFSg6DmCnmMXvo0N2NufYVcPlBSZrXgfAApbH50hhrSDdtYnBfwZlUQNtWzX Xondr6wOpuzvQw+YrGfaebyrM9XeM9QXsT+YhIOjSD6mYKyAF+m3WkL1ESdEloCy5Iv1qy DYO4jexvUweE9h+Y1L/Fb2LforN2/0lQv0Vx0rgnlQWLnu7PmUw3TIIw6eXecqjwdvYeM/ /duVyH7KReVaH8rz84S9w1Yenimr4gqExctsU13EAsF5CqJr4CKX62WvGCx1TdUbyeLH+b KqHzxwE0/p0rtlGDsI7nY3qCaMEINBge5z4u6h8NGFXiDIEh7I1/fbBiYBcNjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcgWq6zHrzpFk; Mon, 28 Oct 2024 17:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SHZJ0Z012792; Mon, 28 Oct 2024 17:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SHZJuL012789; Mon, 28 Oct 2024 17:35:19 GMT (envelope-from git) Date: Mon, 28 Oct 2024 17:35:19 GMT Message-Id: <202410281735.49SHZJuL012789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: f3457ed94241 - main - Tentatively merge llvm fix for buildworld WITH_ASAN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3457ed94241be9d4c2c3ab337c9086d5c45c43f Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f3457ed94241be9d4c2c3ab337c9086d5c45c43f commit f3457ed94241be9d4c2c3ab337c9086d5c45c43f Author: Dimitry Andric AuthorDate: 2024-10-28 17:33:49 +0000 Commit: Dimitry Andric CommitDate: 2024-10-28 17:34:58 +0000 Tentatively merge llvm fix for buildworld WITH_ASAN Building world using WITH_ASAN results in an assertion when compiling certain source files referencing ifuncs: Assertion failed: (isa(Callee) || isa(Callee)), function analyzeAllUses, file /root/freebsd/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp, line 514. This was already reported upstream a while ago, in , but now there is finally a candidate fix, which seems trivial so I am importing it right away. Reported by: markj PR: 280936 Pull Request: https://github.com/llvm/llvm-project/pull/113841 MFC after: 3 days --- contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp index 27360d0e84cb..5d81658409da 100644 --- a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp +++ b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp @@ -528,7 +528,7 @@ void StackSafetyLocalAnalysis::analyzeAllUses(Value *Ptr, // dso_preemptable aliases or aliases with interposable linkage. const GlobalValue *Callee = dyn_cast(CB.getCalledOperand()->stripPointerCasts()); - if (!Callee) { + if (!Callee || isa(Callee)) { US.addRange(I, UnknownRange, /*IsSafe=*/false); break; } From nobody Mon Oct 28 18:36:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xchtt5bddz5bdF0; Mon, 28 Oct 2024 18:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xchtt50vzz4NVP; Mon, 28 Oct 2024 18:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730140614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zz2c5WtohPJNEzYLvISFCRH3EqxVAdlqhkuCE0h+Lmg=; b=LyWAUjY928J+tDhZtgEkkl0/8xnQJrut7+iXtkc3B6aXz3CUyajdMc/G9m3fZhKeS9TqfL gHhHPPT5ZeGAlEeSXDq7sEth0VAblLDlARDvhhANsN+UwGUlreoPAr0nRBIQH7rC/QzwDm 0T/aI67iyUFGKti0IPjcMmdsOHIImMybjqxQCEgLtOIHuuN5PLR1VWuyaNezpNY/tDh2uj D44izwT4rsqgPfaGgq5zcd0GiVeimurP/zXsxo1zfzMuQlgV3uhKgkL7ZtthRwzEgwlaJU bEJFnh3OqrbrUU0nJ5Iqi8PfAok81A85Z1qoGpgBsVZbyTWxxNwVb7fdB7d8MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730140614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zz2c5WtohPJNEzYLvISFCRH3EqxVAdlqhkuCE0h+Lmg=; b=VXamHMe4ogQAZNLBkKzORlXoB1SrUUIahqRrmooirXZqy6K2iv1nPIMRHQP8RZtBnhdAq1 76GuhZ5m6yF/m2WNTiA3g/nmPrjDpm/yKhej49SHI1h1tidfyKpAx0xZPHTOJNFs2cj2Pi gQODTHXjCopsdWq5L/FLRSFe9Lae2CVKUJYl4XYmzwPrdJjANKT4G2w5ezF+V7BmKGeaVB MgBydN8URRPyDVDYmltTDgaKQhImTgQlB+upc3EIdkiJ2PhKYwljErSNaPffU+zQq8oInQ 3HFUC+A7uY76gGmOMxEdE2YB+Qvpe0ciokJwAfVR04BYCnOFOQZmsJOa3CEvXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730140614; a=rsa-sha256; cv=none; b=TOnHqZDUiqhXpdqbPI24t6dY89DyBbsoeD8AKoyG0rmrWA92Uf3WP2N6najy0whZ0AN2HP ePHbILg5ZQB0jIc3aqgHOGFiBSFAEusziPs1IeQ6w3P6jrNdi9TZzmAN8FSV0Ah1bg/7VE NWv0TeFamvZaNxTaw4J0YRsUNJUGqGUUfT9GqMKDgvHi0U9DaIJRd2dBPxf/9RA0MsL/fG FqsYG1aXaRpEZhlbsR1kUjTNKr3AoJbINO99BHgkFWyu9xfneVV+1NL329cwjglZxTPngp eyF7hyN9rfQ9qpn2fcMzDFjGRMUQltK2yrtTLDcM+zSnQkFo8EknqZJslFHM3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xchtt4YGhzqJG; Mon, 28 Oct 2024 18:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SIasec023812; Mon, 28 Oct 2024 18:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SIas4D023809; Mon, 28 Oct 2024 18:36:54 GMT (envelope-from git) Date: Mon, 28 Oct 2024 18:36:54 GMT Message-Id: <202410281836.49SIas4D023809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 7200d90644ba - main - ktls.4: note that security/gnutls now supports ktls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7200d90644ba61d63e6fec33855bba5d3b7eb7bd Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7200d90644ba61d63e6fec33855bba5d3b7eb7bd commit 7200d90644ba61d63e6fec33855bba5d3b7eb7bd Author: Alan Somers AuthorDate: 2024-10-28 15:14:06 +0000 Commit: Alan Somers CommitDate: 2024-10-28 18:36:10 +0000 ktls.4: note that security/gnutls now supports ktls [skip ci] PR: 278083 MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: diizzy Differential Revision: https://reviews.freebsd.org/D47310 --- share/man/man4/ktls.4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 46a37d5dd636..2b4bc315d670 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd December 14, 2021 +.Dd October 28, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -221,7 +221,9 @@ OpenSSL 3.0 and later include support for .Nm . The .Fa security/openssl-devel -port may also be built with support for +and +.Fa security/gnutls +ports may also be built with support for .Nm by enabling the .Dv KTLS From nobody Mon Oct 28 18:58:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcjMn5qbnz5bfK2; Mon, 28 Oct 2024 18:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcjMn4fR2z4PrK; Mon, 28 Oct 2024 18:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730141909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=52SbUZ5sUqy4ub3uOQIr/FThes+tvNyBAR15D81VikM=; b=OEs7oUwSS9DVVbZ7+6h52R4AZQ2XS41QApkCbOhrQBsbR60n3V/Q2Fz3PviilE1HlKh4QR qB4cFOv17u6YJmOh63v4/2+DUsuTr8EBJuKYEnWwLO0IheCkgulGYl5RmSVzXHR3JquKbX oc9cC4VrXtRMVBe50CEiYFvUvUgsKj4Gb+u61b1qIaFTE21O7jRbYuuOyGDOe15r2rQmHQ oN2aziC1iS52UCALvkeYKNJWcayzFTiTSF3Hz47ovIUDYGefqIt9Zm/nSys+l058rY+Nwy 29fjcBvZnfk5VTUPzDCVF8llh6C04QnxkVDz0vVIEdMhTWkCZJKM9GOKbgoMkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730141909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=52SbUZ5sUqy4ub3uOQIr/FThes+tvNyBAR15D81VikM=; b=p/V9M0ZHcN//yWsVUdobeOAsPF86Ty21aLUGhXJFxjrrYjz1tTwvIMkqLFbFPjMb7rmXEm ej1HZAXKeGH/tXQX9wixmt+BQEsFGSUKTL08RYvQDCeF6M3WypMCegBsG7crObOkMND08u Tjc8GwqnuapKOPzDSPJDlD1+1vWSKZSlAj45QLrmB96kb07sSMQ8H3Ai7ytSLMmyzLP324 MNwAMRgk3WyNUiAAEttu71jzyo6X23Cptfc9GJghyA8BBGANKZRxM5l3rt5oDD0IcDw7f0 qOmdIqrSKmaohUCjMbB0P03KKTm57jsrNudGLTU5NPaIbHKCqmlTWRZpmDCdaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730141909; a=rsa-sha256; cv=none; b=NOXFEurkU9/GATh13u2UIygdNU9OYl3AYhyZWbScre8AxX1A5v39Z9TSODWOZigAD7vqMT xIist/cLbP2Z/uSAMuoxeCUJ7mXoBZWrOiLPUSz79/t1w3WpRH6f7kB5l7vpXl0TedKDDS 0Yv/OjsccsiD5UaQ1uuduix4UhY3g5L7OCpX0nOTbjwtNBtMUIlZYcdomdIcOMz1iX/jEZ h3UJs/ruoNDoduABaMZtVWu00Ahwt8knLwcW7lP3vLA0S4IPj+b/Fk9A1mjO+cB5fWzIws bszSU5MJQZ0TcZNlv0/2z1hilEZkDUEXRYE2BRW/8rxkBXAtwE65G6Lm2tnj7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcjMn47KVzqs0; Mon, 28 Oct 2024 18:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SIwT4K061251; Mon, 28 Oct 2024 18:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SIwTuF061249; Mon, 28 Oct 2024 18:58:29 GMT (envelope-from git) Date: Mon, 28 Oct 2024 18:58:29 GMT Message-Id: <202410281858.49SIwTuF061249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 7937bfbc0ca5 - main - mac_do(4): Enhance GID rule validation to check all groups in cr_groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7937bfbc0ca53fe7cdd0d54414f9296e273a518e Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=7937bfbc0ca53fe7cdd0d54414f9296e273a518e commit 7937bfbc0ca53fe7cdd0d54414f9296e273a518e Author: Li-Wen Hsu AuthorDate: 2024-10-28 18:58:12 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-28 18:58:12 +0000 mac_do(4): Enhance GID rule validation to check all groups in cr_groups Previously, the rule validation only checked the primary GID (cr_gid). This caused issues when applying GID-based rules, as users with matching secondary groups were not considered valid. This patch modifies both functions to iterate through all groups in cr_groups to ensure all group memberships are considered when validating GID-based rules. For example, a user's primary group is staff (20) and they are also in the wheel (0) group, this change allows the rule gid=0:any to enable them to run commands as any user. Reviewed by: delphij (earlier version), bapt Differential Revision: https://reviews.freebsd.org/D47304 --- sys/security/mac_do/mac_do.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 507e64ea0175..1aad37f549bc 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -411,7 +411,7 @@ rule_is_valid(struct ucred *cred, struct rule *r) { if (r->from_type == RULE_UID && r->f_uid == cred->cr_uid) return (true); - if (r->from_type == RULE_GID && r->f_gid == cred->cr_gid) + if (r->from_type == RULE_GID && groupmember(r->f_gid, cred)) return (true); return (false); } @@ -516,7 +516,7 @@ check_setuid(struct ucred *cred, uid_t uid) } } if (r->from_type == RULE_GID) { - if (cred->cr_gid != r->f_gid) + if (!groupmember(r->f_gid, cred)) continue; if (r->to_type == RULE_ANY) { error = 0; From nobody Mon Oct 28 19:51:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XckYW60Czz5bjft; Mon, 28 Oct 2024 19:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XckYW5Ynrz44hS; Mon, 28 Oct 2024 19:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ew9yZw9FJ2fCZPZvEnrUvF7WDgwsuZ5iChuTrnX9hQw=; b=SI8ayndGvthyUPobw24qj9QqJtGUklTajbgJPpdQVGz5U+L0engD9+/Ev9zuQJQ1GVb1cR a17GAPTM/zyTQGkOkBBANw7Ix0i/690IJ48F2CoJZDVIYFGf2tIbsK26+sRnkhtm195rPe pTM2QfZJL6JaShzlWAuAXPDUClu860cNHiKXLsE9cC7AdpFG84dnAwmwtpu5PmlXwBNnWZ mvdr26PQEGy6VnL0JX6iSxW2vYOQdN1fwjld2oYcC+MO6SBQK1nuHlRKnCHOa4h1nj9yRB mPGyWY9bbyngpFZ2tCet/OkeDOg2RvU5bGeJecVN+2GskubphD1tkb/+Ob5fQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ew9yZw9FJ2fCZPZvEnrUvF7WDgwsuZ5iChuTrnX9hQw=; b=wVltTK6DMJovBZlLjHGN3ktYNx6uM7sXk4vWjq+/hC4m98xEKzlkMj2Ru659nK77YlWwmM Qw2hSwGoxv1attagSXWfYp9HhGtA5nNYxON/l9KpzDZG04QNryrWKamcVIvyZAdrIL2BKj vfof6tYJmA/UrqOmqpofIYXzDc39qWz/ijwCBEAJ2XJoeYfB131KxqkUb8kGd3Ft9ddD4u 3PMWE28ll7mu7WIFdwuLrb5VFoPKWQW0iWwBD1h++sosQHnMwXTauAAcKHerHl/s8mrTSA W+P3BW1VMLO0gPkFRLRTDPGEDbSmScsbWH2j3/tPyzQn4K2figMTPIdA89LZqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730145119; a=rsa-sha256; cv=none; b=XSjRcnxs5pFneRD+S3Is1jJYP0yGDw1UjnbfQ9YZGy/08ffPV3pFuWZfeKo4nH73fYk7y+ zxvDioOP4YCGP/gRadgcelQHxIqyj753+GwGNm8aOepNLmJO78Im4bcrtwLgllcYZfQVRV 0bpTBbDdLMQ3H15lGMZoXTHkOwydWC+35tK57w6dQsXs158XRbcnZFeGEWI351wVUCnqkP mGKNy4l1qJmt8SmDjGqV+VcyeEtn+lQbm1azGCkzfqcn7mnjQEVm4ye84W6te+37hrCRVL /S5xq6e25WsgQDcChCPyZbF/e1YWwlugrPrd+6s3MtpVn7yDgrghrHbgtPRY/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XckYW59Q8zsm6; Mon, 28 Oct 2024 19:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SJpxGj070429; Mon, 28 Oct 2024 19:51:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SJpxvp070426; Mon, 28 Oct 2024 19:51:59 GMT (envelope-from git) Date: Mon, 28 Oct 2024 19:51:59 GMT Message-Id: <202410281951.49SJpxvp070426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 10c429016a3c - main - stand: Ugly hack due to default change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10c429016a3c5adf2e04cfd1ac97eb24c0e7074c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=10c429016a3c5adf2e04cfd1ac97eb24c0e7074c commit 10c429016a3c5adf2e04cfd1ac97eb24c0e7074c Author: Warner Losh AuthorDate: 2024-10-28 16:50:29 +0000 Commit: Warner Losh CommitDate: 2024-10-28 19:51:53 +0000 stand: Ugly hack due to default change So this is a gross hack to fix the 'noclean' build since we changed to text-only loader. We have to fix it in a better way, but for the moment, this will fix non-meta no-clean builds. A better hack is to fix this so we build either vidconsole.c or textvidc.c, but some minor refactoring and variable renaming is needed. Fixes: 23dee252daf2 Sponsored by: Netflix --- stand/i386/loader/conf.c | 2 +- stand/i386/loader/gfx_bios.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/i386/loader/conf.c b/stand/i386/loader/conf.c index 622812efbb51..bba33a2707d5 100644 --- a/stand/i386/loader/conf.c +++ b/stand/i386/loader/conf.c @@ -134,7 +134,7 @@ extern struct console nullconsole; extern struct console spinconsole; struct console *consoles[] = { -#ifdef BIOS_TEXT_ONLY +#ifdef BIOS_TEXT_ONLY /* Note: We need a forced commit for this */ &textvidc, #else &vidconsole, diff --git a/stand/i386/loader/gfx_bios.c b/stand/i386/loader/gfx_bios.c index a0b08a7cbcde..1581325a81e0 100644 --- a/stand/i386/loader/gfx_bios.c +++ b/stand/i386/loader/gfx_bios.c @@ -22,7 +22,7 @@ #include #endif -#ifdef BIOS_TEXT_ONLY +#ifdef BIOS_TEXT_ONLY /* Note: likely need a forced commits when this changes */ void autoload_font(bool bios); void From nobody Mon Oct 28 19:56:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xckfz0hQyz5bk7X; Mon, 28 Oct 2024 19:56:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xckfy6bTcz46f9; Mon, 28 Oct 2024 19:56:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5N0TcP0yjuO0Tsoah9cy9dVHEUuHBZt4Mu76IQMt6vM=; b=KvjL8CbU65jILBO8ucG9ctKmfF7ax8dVMOeiLDfJTaCoPWXpGGmmWEuDZB0D3j7AEXvLlq ujBq19fd7WkwC5xjR2FPAU1M1+VBRUAjb5Iy30hUGE7Nk8AxT69JUrf4keJUQEpzF7Uqr3 HFVM86TFOhriyCWll74FqmP8cnaMiXu4mQEA4ahvOmJBUwTRLeRQF0jwp2dEIWbFSSN8I9 6qk3ZhwUaKeaKkkqnCigpFpmgmmc+KBQFQaXsbVHpk3eFJfja77mJOBaN4AM0ZYABp7W/m 9LPjTDBMP4v1ufeu+z0OHMNBcYai+HxHtwgmCN0CYlw+wPSaDIdFC8qIcJJ+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5N0TcP0yjuO0Tsoah9cy9dVHEUuHBZt4Mu76IQMt6vM=; b=Pi1B9XPloxj/yz2FA7W+vijXgawaTjXJ5a6gXxHHt/wG2/8xU5FE50e5rnM30QBgu30YTh zU94qXPCulm4XAXG5H9tUtPbzJS2RbYSCZ0iWqm9OqzfdthFVemvKFeC1iHGtl7pRX4ABY VV8v3CG4FDC38E8mcW8RAnH01RcphP8vcPx6nwRUhsA0PuV+MSolNQbdydTBShapO73fsE BXttUhvzosCfnc2KlNOTKcUz9X00OoxgqRSgHxV30Wm7cMVz19oDLKF2TvHjMG1rg4rc7N InGEYcB6byycNXN/SzDBm+mD4AwcI9UYUPw833xtO+dnKanFMpdzh/VaO0NZKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730145402; a=rsa-sha256; cv=none; b=Sn449bK8aDUFChZPF/7U6L+WTH5uGGeuuDMGyTvRlsSaELLRv3lOIGk4wzEAoHVcAeiDGK MJYSFAtbGF/1Ke7MV1Wo7X1HVGv9PeYhmRUI8rxvAoe609sM118ld3V17sLQ3TtWw++8x8 sIr6/DKSVvfffnBwlylKyfVZPwyvMxcrgUghEWsrHM8RS8++UxRuWj4x6Ax6aa1RPGPN53 7AfqRV7m16nkSJt5OgMUQ/D4L91+PeRU22rBgrFhR/E0/KZoJ7cQl67rqX2MveFBZ/0cYd fFNU8AU7I6zJ6h5BQLb75Q8wcZEuvqB+u/DbvYQ1dEgioe+Lef27r0hTRGGCWw== Received: from [IPV6:2601:5c0:4200:b830:b03a:9ceb:fdcd:de42] (unknown [IPv6:2601:5c0:4200:b830:b03a:9ceb:fdcd:de42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xckfy4mZQzQhm; Mon, 28 Oct 2024 19:56:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <4af71fad-407d-48f2-aec4-f6c50fa72c1f@FreeBSD.org> Date: Mon, 28 Oct 2024 15:56:41 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: bc9e19dce0ab - main - Fix buildworld with gcc 12 after llvm-19 import Content-Language: en-US To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202410251608.49PG8pSI044793@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202410251608.49PG8pSI044793@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/25/24 12:08, Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bc9e19dce0abee80750e6fa04aaf979873bfe0d2 > > commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2 > Author: Dimitry Andric > AuthorDate: 2024-10-25 16:07:59 +0000 > Commit: Dimitry Andric > CommitDate: 2024-10-25 16:08:32 +0000 > > Fix buildworld with gcc 12 after llvm-19 import > > Unfortunately gcc 12's is not yet capable of compiling all of libc++ > 19's C++23 code, which results in errors similar to: > > /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function > 41 | operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) { > | ^~~~~~~~ > /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function > 48 | operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) { > | ^~~~~~~~ > > Until we can get rid of gcc 12, work around this by making it compile > libc++ in C++20 mode instead. > > NOTE: The resulting libc++ library will not be C++23 compatible! Please > try to avoid shipping it, and use gcc 13 instead, if you must use gcc. > > PR: 280562 > MFC after: 3 days In this case I think we probably should drop support for GCC 12 for main. Just let me know when you are thinking of merging libcxx 19 to stable branches so I can ensure they build with GCC 13/14 and get our CI jobs updated before then. -- John Baldwin From nobody Mon Oct 28 20:05:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xckrh4VJYz5bkZg; Mon, 28 Oct 2024 20:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xckrh3dW2z47Sf; Mon, 28 Oct 2024 20:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NKiFel2Rh6ztiEEEp+9R341Th5r8h1MwQF0S+y7rOQI=; b=Z6Vrn/5toVZIjEirehdS/5EvyKb7nLNRG/16esS0+XMtMVKdYAeixqUMafB1IKeWq1XZZd jTWG4l7Sn+MKst+CjcuTk0EVKuWIvKN1wd0T7oM56+ck0TFTBrlfz6QKiufxKR6JCS+M8Q JJaKYOKatytWF1lkdFBkL8MItKbdq1XqKM0xnVGbNP0rAWzqVqq67gD8goglZ8ro2AFvbu plBsFMFdLOC+Vvb9Tm09IzqP2erflnIxCOLQtzs7W9p4oNIoNQy0Y4KC+K4CrPS0LXsojg f2eTeLCI0FNojb80jQxmtvoaQpzjFCvndRWfFQ7ye3rxR0txPBajI0KSRJZb2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730145908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NKiFel2Rh6ztiEEEp+9R341Th5r8h1MwQF0S+y7rOQI=; b=eq0g8xnrUZzJcvbVj8GIZ79A09BpOIF5Vo8U2rJZO3Viv6BODUVPQRjRSxf624CYQVk+YW jIXPhyXro33RHgvJCgP7g5LSi5J/HFsBgCaGKgpbSxKf0moowyo44pSH7LwrmK5OTJklrz he8NuLW6nPsv81+PnxfNSihCi9FOBT8NClGYJUlDgkSrvUpfZ2kD5bcoB4Yq9H/inCC170 M+EsIW3mVwa8iawN+vpyF4Hf802ouyJdiGBGqLxbMhtsnkMM0pTeUv87JQcTi3QH7Q/9s0 5XOcljobImAWrw/CbwXZo+Rq6y+Ei6/PH5qQTwEmvp/tBleK8uENUOhC/GanFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730145908; a=rsa-sha256; cv=none; b=YWNMQWsGRx7UkvBQmFa6MF9Mj81/rC1uJnCnORW6y1JDS9um2tbVW8DcBtbIx+4eUuxGJf V5GemuEk8pfCC2s3LYO0mABkF2qT6u8P+uA8K3AEEu4Fckz0z4p26LVmRB1AYlSOLuMMuE x8vY3S2i8YcUUk6WDfn++2yxJUwS0fKgDxNRLPHQXxN6FBJSr+tmVjCwGqWMe3i+qBbDVM zS3cgs6CuWdezv0ZmTQI5sifiyL+XzjPL4H4jsSu9MGBK7DE9foVlsAGsts4+ILxz0nGP3 dV3D7+1V7b332YUi55NXOsqznMXbZN7AnQ+y+bba9Q+WYNMJN9q1pvx1zfSYcA== Received: from [IPV6:2601:5c0:4200:b830:b03a:9ceb:fdcd:de42] (unknown [IPv6:2601:5c0:4200:b830:b03a:9ceb:fdcd:de42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xckrh1vDjzQvW; Mon, 28 Oct 2024 20:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <23d0c56b-6c53-4a8f-b382-7cb16e8f26f8@FreeBSD.org> Date: Mon, 28 Oct 2024 16:05:07 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 2ac644317e67 - main - iwlwifi,rtw88,rtw89: connect to build again Content-Language: en-US To: "Bjoern A. Zeeb" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202410281449.49SEnn1a099274@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202410281449.49SEnn1a099274@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/28/24 10:49, Bjoern A. Zeeb wrote: > The branch main has been updated by bz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2ac644317e671b001d3fb8fd924a1ae808a0bf32 > > commit 2ac644317e671b001d3fb8fd924a1ae808a0bf32 > Author: Bjoern A. Zeeb > AuthorDate: 2024-10-28 14:09:49 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2024-10-28 14:42:37 +0000 > > iwlwifi,rtw88,rtw89: connect to build again > > Sponsored by: The FreeBSD Foundation > Fixes: f0b989348fe6 (revert) > MFC after: 14 days If the commits are all back to back to update the various components, I think you can skip doing this dance each time. git bisect skip will cope. -- John Baldwin From nobody Mon Oct 28 20:12:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcl181V1Wz5bl4n; Mon, 28 Oct 2024 20:12:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcl1813xGz4BtD; Mon, 28 Oct 2024 20:12:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730146348; 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=6S5xR6iEnbJvaiMKcPkilNoCRvlabLHCEh4lyb11Vgw=; b=NepbS7pIbGblFMIWvlStaCdIBahM54w3sT1ocxJ5WI5I3BcWhIiqLBN/Zu9r7Pa0izGfFn VFnNysG5LFlGFtJXXYpLHh0UgHFxfDPUO9GbIwzNg3mFgmJHgUIJjsVlPbC8W9KRbxkd02 G1XLkY5Yq+LdRSKNshLPbSerlQL4ocaJ24w3hNMD7hDBsBA7BJTipXvst+7tagkLnRKvOq FRBfqAiQcSRm+YTO3NnsYC8rmINiT6e59J6iz6UXtO7v9p3B8YFnw/knXakxla9Lfel3vZ 2WBEanXnBbGioGzQm+WwLlZEbf6VMFe2SoO757V90k5u8vHLhFVfmzX271d9IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730146348; 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=6S5xR6iEnbJvaiMKcPkilNoCRvlabLHCEh4lyb11Vgw=; b=waBBkpcxCJL8lYjE475ghX6xVm30AwKSqtCmnE/4DzLHjV/VYlKtUUpDCbXhVwd5/Q9xr8 d8saURhKxEEHEWQlqTGlkw5c+oFunZuco4uHvs0BZ8Ahzkb7rXif8E2ydevTYsfk1eIHdW 1bMriwWZ33k3cy+p12c0nh/BL3qp3c/jkWnD9JsDoDNM4M64+kpxjSeFWBF7NCcy2+tNH+ VBR0iOq9pHxkp5uAE7RWRpZddt5d34DKeVvxC1rluxCpRR18w5WvfRQ0MgdKse09/LwbXp IGgTVoo6Y7NerB8W3UiKt7O3Bz+M/IUJaPUyzi2ISDa7f+8BZmUkwmdibCGdvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730146348; a=rsa-sha256; cv=none; b=oZjxVFUIlufMtiRhBHWlaeVmU16pZakwjXpiiif0Id/j+DBI9yh2WlCtkLED4S5ZTEcqrW LXIeTsKdr6pn3yU5vBc8LUQZrel0z+yfKBMsbHGw84TMXO46eZPpB34fCivO0PMFAXMz6O 55yoha3cV4zttvH6awpu1HPWWgUNFmeAbs83lr+j7chffaTf09/C1r0XyINkv1D770k454 nXYVFOQRJsp58LfoQDd65sPhcotTegW6zxjR2f7FGHYtS11CX6OWVcg19k55snaImH0YwS 2oDroLgPENQ388ZYQl8km0/Hts9ekwEa5vhRbw5QPVeiE3A+9bBelk5IUefjBw== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R10" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xcl18055fzR8T; Mon, 28 Oct 2024 20:12:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DAE9C66E41; Mon, 28 Oct 2024 21:12:26 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.2\)) Subject: Re: git: bc9e19dce0ab - main - Fix buildworld with gcc 12 after llvm-19 import From: Dimitry Andric In-Reply-To: <4af71fad-407d-48f2-aec4-f6c50fa72c1f@FreeBSD.org> Date: Mon, 28 Oct 2024 21:12:26 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4740E6A9-B104-46C5-AB19-9C5F2BF66AA3@FreeBSD.org> References: <202410251608.49PG8pSI044793@gitrepo.freebsd.org> <4af71fad-407d-48f2-aec4-f6c50fa72c1f@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3731.700.6.1.2) On 28 Oct 2024, at 20:56, John Baldwin wrote: >=20 > On 10/25/24 12:08, Dimitry Andric wrote: >> The branch main has been updated by dim: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dbc9e19dce0abee80750e6fa04aaf9798= 73bfe0d2 >> commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2 >> Author: Dimitry Andric >> AuthorDate: 2024-10-25 16:07:59 +0000 >> Commit: Dimitry Andric >> CommitDate: 2024-10-25 16:08:32 +0000 >> Fix buildworld with gcc 12 after llvm-19 import >> Unfortunately gcc 12's is not yet capable of compiling all = of libc++ >> 19's C++23 code, which results in errors similar to: >> = /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/range= s_contains.h:41:3: error: 'static constexpr bool = std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const = _Type&, _Proj)' must be a non-static member function >> 41 | operator()(_Iter __first, _Sent __last, const _Type& = __value, _Proj __proj =3D {}) { >> | ^~~~~~~~ >> = /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/range= s_contains.h:48:3: error: 'static constexpr bool = std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, = _Proj)' must be a non-static member function >> 48 | operator()(_Range&& __range, const _Type& __value, = _Proj __proj =3D {}) { >> | ^~~~~~~~ >> Until we can get rid of gcc 12, work around this by making = it compile >> libc++ in C++20 mode instead. >> NOTE: The resulting libc++ library will not be C++23 = compatible! Please >> try to avoid shipping it, and use gcc 13 instead, if you must use = gcc. >> PR: 280562 >> MFC after: 3 days >=20 > In this case I think we probably should drop support for GCC 12 for = main. Just let me > know when you are thinking of merging libcxx 19 to stable branches so = I can ensure they > build with GCC 13/14 and get our CI jobs updated before then. It depends a bit on how many ports still need to be fixed, and of course = when 13.5 and 14.2 are done. After those I will probably do the merges. That said, is gcc 13 good for all arches we want to support? In the past = we still kept a few old gcc versions alive because they were the only = one that could build for $OBSOLETE_ARCH. -Dimitry From nobody Mon Oct 28 20:58:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcm2l6f1Sz5bmnS for ; Mon, 28 Oct 2024 20:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcm2l64x9z4H8w; Mon, 28 Oct 2024 20:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730149135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqUJw+WbI9uY4Gpw5/PW8y26AaJNNiQ8NXrxpVRLR+w=; b=K/JCzK/Y8bhy49qjxbpPWl1NqiqcspLVUjcbMONdilCN6HhW9GcKNSA+VQoVrX46qYwH90 lIecp5dFRd/YVlrS7hO46/c+w7doSt7MXVaM71xyZXN9KiUFBWrrAGI090L9o0wTbq/8WL ioBOHF6VNOhmQfZoezmgpnI75ZhmumYr+3N7Bm/pum6q+9Mmf2Ceb8V3x1fngaHds5uZMf 0X6zDn3CRczMJZ4dAPw+/FnAYsJPedorCf+ZKGncvYdJ67PEKKT4U15AKlFZpI4EBtdjmh wRcaQm481mOTc4hTa96x8XBjYevlaxU+CV4Yu76IZ3G+TXAuRVNzkpOP1ZH8XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730149135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqUJw+WbI9uY4Gpw5/PW8y26AaJNNiQ8NXrxpVRLR+w=; b=gaJAhAJf9jhibyOknov2XTYQqjGtpE73y6JK5mZm7qq+VroOsRg5kCZBY09yXo7nayLVY7 cRhb8SgHA4HfWSN7+FTQwEpEggioBQhlj9QEaJBS9s1aC8AH/TmpseRkXg9wVg81WgU8Ap NwTu8dSkIJvXFwNYSHeLR8ev8FoI74GnhXulrUCov9DJdPgPIYWrnU56LPfVpyET4pY5uk hW5j3hSIn+0pKFx+rdWYjBSI7v4/zIsgN3IwSvNc79hvbBZ6d5n5QLKQvodnYOxzU7k4/s t0PofZFqrHPOj9E9+DSAvoVYCbdElIrkseC2n3iKnaFgz2lEHkP+wB23Zkbx5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730149135; a=rsa-sha256; cv=none; b=lQaVAKzmYCCyCyLjYt3TSwPO/D/xrXCnhHm5ImQwOGm4VNlpN2B1B/NWL2FFEJ4NOpL37g VbeL3ciAmtAyC0uKF8j4q2sA28XQV/7QNifQ3GXLdf1F5WBwDNn8psWp4P+esOwjoEXp8l QzX2DNB8JPYDjDXtLrspgK/HtE6r3cptLoghZQnkHusn+XhSZwO7UhL7BWhsJrLGme+A9N bRKdsvkoRxPQDI74wmfPPhiw+4PI9dNLVCsOrRQKlAkUsmlifmSR2MYHUrKrE8iB9zEkaS AGSb5Cp64b7e49XbBXNYyQ/ItOpgOus7/X22pcmEMucsrj+UNXgEQNjhXI0tBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcm2l5hRNzvHN; Mon, 28 Oct 2024 20:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SKwtAI083929; Mon, 28 Oct 2024 20:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SKwt3R083926; Mon, 28 Oct 2024 20:58:55 GMT (envelope-from git) Date: Mon, 28 Oct 2024 20:58:55 GMT Message-Id: <202410282058.49SKwt3R083926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: e5838587aac7 - internal/admin - Welcome Jose Luis Duran as a new src committer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: e5838587aac78f32f51b433136ab040db18240fe Auto-Submitted: auto-generated The branch internal/admin has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e5838587aac78f32f51b433136ab040db18240fe commit e5838587aac78f32f51b433136ab040db18240fe Author: Ed Maste AuthorDate: 2024-10-28 20:51:13 +0000 Commit: Ed Maste CommitDate: 2024-10-28 20:53:29 +0000 Welcome Jose Luis Duran as a new src committer I will mentor. Commit bit was approved by core prior to srcmgr taking over this role. Approved by: core --- access | 1 + mentors | 1 + 2 files changed, 2 insertions(+) diff --git a/access b/access index 9ae30f664a6b..026764edab80 100644 --- a/access +++ b/access @@ -83,6 +83,7 @@ jhibbits jilles jkim jkoshy +jlduran jmg joerg freebsd-devel@uriah.heep.sax.de jrtc27 diff --git a/mentors b/mentors index 4bf28b21b624..0dc824739e1a 100644 --- a/mentors +++ b/mentors @@ -16,6 +16,7 @@ bryanv grehan def oshogbo igoro markj Co-mentor: kp jfree imp Co-mentor: markj +jlduran emaste oh manu olce emaste Co-mentor: markj osamaabb cperciva Co-mentor: akiyano From nobody Mon Oct 28 21:11:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcmKf4GmYz5bnYm; Mon, 28 Oct 2024 21:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcmKf3q09z4Hl4; Mon, 28 Oct 2024 21:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730149910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clFxivi9MDbb9wJLI0nFXJsGpJZsyGVvOKOqKo/rytE=; b=KX5vVJXmxMzR1kOgNYQvasj41onbQ4YcR02E7QTvpm9XTSh7ayv9VbbMwpQ4dlLoDpEGxP qxzSzIcoRiuR802cJu22TTAL4volPoONf783fI2vXa8xZxG5wazfY6J+eBkJzIIwBViNnM anwpjQM9ilHh/Y4+NZ7Uojba0UEMlsDeonro8rjG49yKe4P8BvZB88+/P8LjHLIvOtJQl5 KSX57kIDjvdnn9tA8RjEH3yntYqrkYkWo13lCchUw2+iE7BxULCNmsJCnn+hapWiRVIC9D 5C/5OR8Zfkaoqyrv2t+9MtBrhkxOpr24KPtCKMr9WEBx2uUCagc/P4WasOQPqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730149910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clFxivi9MDbb9wJLI0nFXJsGpJZsyGVvOKOqKo/rytE=; b=aSZcpKs4zZjbdP8bAjGxLP2JM03bhmNcWrb18I5C1ZgcbNoGAU4Rj+G19GCMv1SxfojxQe MCJlgyF9a3bN4VbVX3sQ99Bb4XTonF25mbkrhIAA1GiRbZXn3Ywg/ZrBYN5lVt2HxaUoL6 7qZ+/G1kUhQSESJDW9MG68flyETk1f+O5yqWCiO0tYxwPqlDGXDz2LT4polheJw1aWNZ0n UctwxobuVRe0soBW0blYQ3NpSRpy0TLMF9Dm0iyHAExpX9bD2sFhzFGemVUOgFRdoPHZfw xg0EB/J2qM+9GWLhtGq741xfPGujNvoRcDz5xZNTpbcNygCp05/3zq+gYVtmcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730149910; a=rsa-sha256; cv=none; b=bO6roJZaIbnKKZScQfSSR/JZeBf1in2IoTwrtlq1vCq4Da0KbJFrTV2trmJ7NfMkTGKkqV JemIJBqEjX4abBy254+sJDEeGqdDWI12o8elXGjBIEgOnpnL1LtN1w8hPHmjMC3oOyp6mJ n1XIp1jTSnDQPvW052R9IGbnNnnJk0fq6sQ+9ywAtkgXsGzMZZ2svQ4F0CE6+jKrqkFhsl Z3Z8ejUeGzJHomSVCxRJKMWBZXuKiJrg4NhPh8Dj5teVCff8w8R+ZqT2oTn7mc5b+68VXe pXawa6fhJl7fD3BkllSE0QQVM/6tM+CK2vd7DDlvg00lxB8Gk+X+sukFdGONlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcmKf3QgGzvjx; Mon, 28 Oct 2024 21:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SLBoXH019793; Mon, 28 Oct 2024 21:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SLBo5V019790; Mon, 28 Oct 2024 21:11:50 GMT (envelope-from git) Date: Mon, 28 Oct 2024 21:11:50 GMT Message-Id: <202410282111.49SLBo5V019790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a5ad360ff9b7 - main - rc: Remove rc_fast_and_loose List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5ad360ff9b7fb2ef3f7f31b8c29c332026b0e01 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=a5ad360ff9b7fb2ef3f7f31b8c29c332026b0e01 commit a5ad360ff9b7fb2ef3f7f31b8c29c332026b0e01 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-10-23 12:57:29 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-10-28 21:10:49 +0000 rc: Remove rc_fast_and_loose The rc_fast_and_loose variable allowed rc(8) to start services by sourcing them into rc's own shell environment. Normally, each rc service script is started by being sourced into its own subshell instead. The feature was meant to speed up rc(8) by avoiding the extra forking necessary to spawn subshells. In practice, the feature has been broken for a long time now. One of the reasons is that some rc service scripts call the exit builtin to return non-zero error codes, which not only terminates the service subshell but also rc(8) when rc_fast_and_loose is enabled. For example, a system running any of the supported FreeBSD releases with rc_fast_and_loose=yes would abort rc(8) as early as rc.d/hostid, due to an "exit 0". Fixing rc_fast_and_loose support would require rewriting some rc scripts to support being sourced directly into rc(8) process. This would muddy the code base and also would prove difficult to maintain long term as this is simply not how rc(8) users write scripts. The potential performance benefits are unlikely to be significant even for use cases such as Morello under qemu. Instead, remove support for rc_fast_and_loose completely from rc(8) and inform users about the change. PR: 282255 Reviewed by: brooks, christos, mhorne Approved by: christos (mentor), markj (mentor) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D47264 --- UPDATING | 7 +++++++ libexec/rc/rc.subr | 20 ++------------------ share/man/man8/rc.subr.8 | 36 +++++++++++------------------------- 3 files changed, 20 insertions(+), 43 deletions(-) diff --git a/UPDATING b/UPDATING index c2e7a658c65e..1fb14a96880b 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.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".) +20241025: + The support for the rc_fast_and_loose variable has been removed from + rc.subr(8). Users setting rc_fast_and_loose on their systems are + advised to make sure their customizations to rc service scripts + do not depend on having a single shell environment shared across + all the rc service scripts during booting and shutdown. + 20241013: The ciss driver was updated to cope better with hotplug events that caused it to panic before, and to support more than 48 drives attached diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 58e30c897897..dc2cc06bb806 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1798,9 +1798,6 @@ _run_rc_killcmd() # return value from the script. # If `file' ends with `.sh' and lives in /etc/rc.d, ignore it as it's # an old-style startup file. -# If `file' ends with `.sh' and does not live in /etc/rc.d, it's sourced -# into the current environment if $rc_fast_and_loose is set; otherwise -# it is run as a child process. # If `file' appears to be a backup or scratch file, ignore it. # Otherwise if it is executable run as a child process. # @@ -1836,8 +1833,6 @@ run_rc_script() if [ -n "$rc_boottrace" ]; then boottrace_fn "$_file" "$_arg" - elif [ -n "$rc_fast_and_loose" ]; then - set $_arg; . $_file else ( trap "echo Script $_file interrupted >&2 ; kill -QUIT $$" 3 trap "echo Script $_file interrupted >&2 ; exit 1" 2 @@ -1909,19 +1904,8 @@ boottrace_fn() _file=$1 _arg=$2 - if [ -n "$rc_fast_and_loose" ]; then - boottrace_sysctl "$_file start" - set $_arg; . $_file - boottrace_sysctl "$_file done" - else - _boot="${_boot}" rc_fast="${rc_fast}" autoboot="${autoboot}" \ - $boottrace_cmd "$_file" "$_arg" - fi -} - -boottrace_sysctl() -{ - ${SYSCTL} kern.boottrace.boottrace="$1" + _boot="${_boot}" rc_fast="${rc_fast}" autoboot="${autoboot}" \ + $boottrace_cmd "$_file" "$_arg" } # diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index 36d7d4543e52..1fd5041cecd8 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd September 22, 2024 +.Dd October 23, 2024 .Dt RC.SUBR 8 .Os .Sh NAME @@ -1017,41 +1017,27 @@ and to enable tracing if any of those tags appear in .Va DEBUG_SH . .Pp -The startup behaviour of +.Ic run_rc_script +executes .Ar file -depends upon the following checks: +unless: .Bl -enum .It -If .Ar file ends in -.Pa .sh , -it is sourced into the current shell. +.Pa .sh +and lives in +.Pa /etc/rc.d . .It -If .Ar file appears to be a backup or scratch file -(e.g., with a suffix of -.Pa ~ , # , .OLD , +.Po e.g., with a suffix of +.Pa ~ , # , .OLD , ,v , or -.Pa .orig ) , -ignore it. +.Pa .orig Pc . .It -If .Ar file -is not executable, ignore it. -.It -If the -.Xr rc.conf 5 -variable -.Va rc_fast_and_loose -is empty, -source -.Ar file -in a sub shell, -otherwise source -.Ar file -into the current shell. +is not executable. .El .It Ic run_rc_scripts Oo options Oc file ... Call From nobody Mon Oct 28 21:43:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcn1d4Bbwz5bpym; Mon, 28 Oct 2024 21:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcn1d1km0z4mJX; Mon, 28 Oct 2024 21:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730151781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZyK7CXT6kyn7eO3N27skHtilIUPOfpZECJroIKTBdoc=; b=o+Jj6WbHhiTDYLlnUeWsLPN1Q7wsmR4yBuosctNPJDJWaNFS8xIoVO/ZqKU/6wQoRytm5C V3kr0zl6QN2hkkA1+7zhsEl4pjgyLXvx47hpAp12mP7/SUbWoWR1qEzyoLq5u6wsTQ9NBp FAifOwKIKfDX7pRrzHDrDB2JB6xX4dhLQQrDSieqWFV7edUONiDRxhyCgbyEySTHIxb920 Pn+yinCyS4V2b+tIvFcMwyGDgY1h+fOw8kjnDqHn0Jgokm29AMa12Q9T2fTKSsGHkInF1I 6HkLl50BIUXYSBwVq2SQOTmoMAe+alFjXILTW5N+xqNE89yGaC9S+viW+gQ1Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730151781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZyK7CXT6kyn7eO3N27skHtilIUPOfpZECJroIKTBdoc=; b=Eq6+guzK94Q8OruLqYYMyfHrZu+duRh9yAyRsblM8L9+yPkdNKxGzazvP27q71jIPUCnLh w6rK4lvT+boQUjxXYgwP5F0Fw/EMl/5A3IR8BQFl/0LrKRFYm1aqr3bHxs1/SrMExo3w3s CQeQqXEQ+NZzmuaZdzlrYNk3LlToLf4iKOJ89df+pDOPYItdVDiLgU/SA6ijnLEzfwW2Fx nU/RwIwDemT6UNz1tzeite0dz3ctnDLh0Yj4l5v9fnbMr6Lg1dWg6H5rIUMQ5Ebypv8gKl kizUHb0ZucOEF9zpnjnC8SVDZ863DNXOaosto16ix19KH42tQfveHr1Ky69a2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730151781; a=rsa-sha256; cv=none; b=A1e7+7CFeaJ873JjgYEbdVjgJyaDOUOnv7myB+zOekB9ju4uNlfV5+ObSflcL7QmrE2r3n 1bfPxwNrSMnL0jXfN+CIgdkQyV8WkntQDLc3/TMGQwY7xLIFCPMykw//5r8qoRnymGwUQ/ mNl6lTDi5P9wGhxrL1zHdxkJCnbGiRHNGud6tlcEZy/hxviMLjvwqz4lcv8E/SqKz5u4pO b+gnE93iiC1FZg/3akRe4SBI026bwDRgIgs3sOgzSpiCyjk0ZBMwR3Gq+zPIGZ4nQGty1l 0iadU0BMS5Kopf5Nm1CvecvFiQG525BdDTCT3dWDHPkHaC4IeSx3SvM4EU8cyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcn1d1Ljjzwg6; Mon, 28 Oct 2024 21:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SLh1oc074878; Mon, 28 Oct 2024 21:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SLh1IQ074875; Mon, 28 Oct 2024 21:43:01 GMT (envelope-from git) Date: Mon, 28 Oct 2024 21:43:01 GMT Message-Id: <202410282143.49SLh1IQ074875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b02d6a6b5a07 - main - pctrie: reduce code duplication in PCTRIE_INSERT_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b02d6a6b5a0753ea8be53d6bd6d4f39f046c54f4 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b02d6a6b5a0753ea8be53d6bd6d4f39f046c54f4 commit b02d6a6b5a0753ea8be53d6bd6d4f39f046c54f4 Author: Doug Moore AuthorDate: 2024-10-28 19:00:00 +0000 Commit: Doug Moore CommitDate: 2024-10-28 21:42:47 +0000 pctrie: reduce code duplication in PCTRIE_INSERT_* The four flavors of PCTRIE_INSERT inline functions share a few lines of code. Extract that code into a new function and invoke it from the others to reduce code duplication. No behavior change expected. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D47288 --- sys/sys/pctrie.h | 85 +++++++++++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 209380d805b2..54b7fb401202 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -86,69 +86,67 @@ name##_PCTRIE_PTR2VAL(struct type *ptr) \ } \ \ static __inline __unused int \ -name##_PCTRIE_INSERT(struct pctrie *ptree, struct type *ptr) \ +name##_PCTRIE_INSERT_BASE(struct pctrie *ptree, void *parentp, \ + uint64_t *val, uint64_t *found, struct type **found_out) \ { \ struct pctrie_node *parent; \ + \ + if (__predict_false(found != NULL)) { \ + *found_out = name##_PCTRIE_VAL2PTR(found); \ + return (EEXIST); \ + } \ + if (parentp != NULL) { \ + parent = allocfn(ptree); \ + if (__predict_false(parent == NULL)) { \ + if (found_out != NULL) \ + *found_out = NULL; \ + return (ENOMEM); \ + } \ + pctrie_insert_node(parentp, parent, val); \ + } \ + return (0); \ +} \ + \ +static __inline __unused int \ +name##_PCTRIE_INSERT(struct pctrie *ptree, struct type *ptr) \ +{ \ void *parentp; \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ \ parentp = pctrie_insert_lookup_strict(ptree, val); \ - if (parentp == NULL) \ - return (0); \ - parent = allocfn(ptree); \ - if (__predict_false(parent == NULL)) \ - return (ENOMEM); \ - pctrie_insert_node(parentp, parent, val); \ - return (0); \ + return (name##_PCTRIE_INSERT_BASE(ptree, parentp, val, \ + NULL, NULL)); \ } \ \ static __inline __unused int \ name##_PCTRIE_FIND_OR_INSERT(struct pctrie *ptree, struct type *ptr, \ struct type **found_out_opt) \ { \ - struct pctrie_node *parent; \ void *parentp; \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ uint64_t *found; \ \ parentp = pctrie_insert_lookup(ptree, val, &found); \ - if (found != NULL) { \ - if (found_out_opt != NULL) \ - *found_out_opt = name##_PCTRIE_VAL2PTR(found); \ - return (EEXIST); \ - } \ - if (parentp == NULL) \ - return (0); \ - parent = allocfn(ptree); \ - if (__predict_false(parent == NULL)) \ - return (ENOMEM); \ - pctrie_insert_node(parentp, parent, val); \ - return (0); \ + return (name##_PCTRIE_INSERT_BASE(ptree, parentp, val, \ + found, found_out_opt)); \ } \ \ static __inline __unused int \ name##_PCTRIE_INSERT_LOOKUP_GE(struct pctrie *ptree, struct type *ptr, \ struct type **found_out) \ { \ - struct pctrie_node *parent, *neighbor; \ + struct pctrie_node *neighbor; \ void *parentp; \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ uint64_t *found; \ + int retval; \ \ parentp = pctrie_insert_lookup_gt(ptree, val, &found, \ &neighbor); \ - if (__predict_false(found != NULL)) { \ - *found_out = name##_PCTRIE_VAL2PTR(found); \ - return (EEXIST); \ - } \ - if (parentp != NULL) { \ - parent = allocfn(ptree); \ - if (__predict_false(parent == NULL)) { \ - *found_out = NULL; \ - return (ENOMEM); \ - } \ - pctrie_insert_node(parentp, parent, val); \ - } \ + retval = name##_PCTRIE_INSERT_BASE(ptree, parentp, val, \ + found, found_out); \ + if (retval != 0) \ + return (retval); \ found = pctrie_subtree_lookup_gt(neighbor, *val); \ *found_out = name##_PCTRIE_VAL2PTR(found); \ pctrie_subtree_lookup_gt_assert(neighbor, *val, ptree, found); \ @@ -159,25 +157,18 @@ static __inline __unused int \ name##_PCTRIE_INSERT_LOOKUP_LE(struct pctrie *ptree, struct type *ptr, \ struct type **found_out) \ { \ - struct pctrie_node *parent, *neighbor; \ + struct pctrie_node *neighbor; \ void *parentp; \ uint64_t *val = name##_PCTRIE_PTR2VAL(ptr); \ uint64_t *found; \ + int retval; \ \ parentp = pctrie_insert_lookup_lt(ptree, val, &found, \ &neighbor); \ - if (__predict_false(found != NULL)) { \ - *found_out = name##_PCTRIE_VAL2PTR(found); \ - return (EEXIST); \ - } \ - if (parentp != NULL) { \ - parent = allocfn(ptree); \ - if (__predict_false(parent == NULL)) { \ - *found_out = NULL; \ - return (ENOMEM); \ - } \ - pctrie_insert_node(parentp, parent, val); \ - } \ + retval = name##_PCTRIE_INSERT_BASE(ptree, parentp, val, \ + found, found_out); \ + if (retval != 0) \ + return (retval); \ found = pctrie_subtree_lookup_lt(neighbor, *val); \ *found_out = name##_PCTRIE_VAL2PTR(found); \ pctrie_subtree_lookup_lt_assert(neighbor, *val, ptree, found); \ From nobody Mon Oct 28 22:43:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcpMH2yXYz5bsQw; Mon, 28 Oct 2024 22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcpMH2Skwz55NK; Mon, 28 Oct 2024 22: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=1730155403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHXj7BNoDNemrpJyDbRIY8ogimbcbdOxT4UD3Rzwq7Q=; b=bqgCmBflook4k2p6+TOCnEPVE7b7AtcIX9xd52oJ2ZJfji8LxPfTzSw0o9IIxuxSozU6n8 1GbfPWMaM2s4/x84Qt1ilj53fzSf54T/Bu10ZB7F0nK0xXBX4WSQ+F/TQnnuC66//1x9VL +km+VDPsJ5ky9mq5kBop+j8MvCkGoztnjY+m3yaZ1jz4GwnoWbFkI0xSiz8CTje9Dr31TR ToQoIoaVRbmpst1c3S4qAEpUJDAY9kIL6BCCvfeZOrHsQZ2sETHzkMhS29EyY6KUR23A4Z 1AxAcJ9WpqjD/dlpE5eb0r2FtcLeNrJyT7r8lxaDfSF40o/vI1UjvHDHFI5TUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730155403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHXj7BNoDNemrpJyDbRIY8ogimbcbdOxT4UD3Rzwq7Q=; b=qF9RJ++M8OA5EAzPJx41QQl+8fB26+0Qna4eJOq7vQKllxBS1oG8oS5/qCb9rPx9FnkhIK 0aEh0MAZguPnxNB2pS1L9QHS0YxvnBUCCpk/pRdGqTY9M6sdEi5NwvG7rmpMOaRlo1Vm9+ l/H+vnM6NdbDB4RfB7L+Ico9STdiC+qLs29S2bOESxaRxrYPbSH1GfvXuq0CH2tMltHpYf sgJyADVJ1XbhTJGMNDryGBjyY5duPQv3tadT5JJVQaFsRcD1zgyyWHtyzGztMv8/i/g+6h Y+lRZw5YAXqf3k7nOx39kqqyUXt2tW182VOXRNhheV2ZHZyTC2cNOeTCgDA3Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730155403; a=rsa-sha256; cv=none; b=MCE6wUd+81BGjRlhkdkHRw/i+LFpn+WAh7QrT/NTkn3xF5SMtFlRbkNSHH05hy/H3e0Cco RPndAM0mdFTtf1oOBUSrxfv4/o/l/id7KJvABjuLCwikCakkWVbNHPXlKiqOH0mu60gvHP RMWUcOS5XGAjTV9rqqP2Wb3oFaqwunQFGo7nwXtMRx13wp0RC4kzWpU6s0L1o5IECzt/Ol CxbcYCxYDD0LJWoDlyg5m7kq+jqaAZMkHJei3+eeSlZ2NdfzGhhr9Oo1manOWtWbIpFNm1 cn3bRmZqjdDJ9m7p9qWT3erVwHrCWsyGp++2rgG8w+XRbUW371z6nNFq6qlpPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcpMH247mzyFC; Mon, 28 Oct 2024 22:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SMhNBN085321; Mon, 28 Oct 2024 22:43:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SMhN8W085318; Mon, 28 Oct 2024 22:43:23 GMT (envelope-from git) Date: Mon, 28 Oct 2024 22:43:23 GMT Message-Id: <202410282243.49SMhN8W085318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 73979b7f0bac - main - camcontrol: Bump timeout to get size of drive List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73979b7f0bac44a9b647c872ade17f4f7021a5e4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=73979b7f0bac44a9b647c872ade17f4f7021a5e4 commit 73979b7f0bac44a9b647c872ade17f4f7021a5e4 Author: Warner Losh AuthorDate: 2024-10-28 22:33:07 +0000 Commit: Warner Losh CommitDate: 2024-10-28 22:43:25 +0000 camcontrol: Bump timeout to get size of drive When the system is very busy, and the ATA hard disk drives are overloaded due to reading dodgy sectors, it can take several seconds to drain the NCQ set of commands to send this command to the drive. Up the timeout from 5s to 10s out of an abundance of caution, but also to allow monitioring software that uses camcontrol identify to not fail needlessly. Sponsored by: Netflix --- sbin/camcontrol/camcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index b7ad7f7d4b25..a2e65055fcaa 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -2102,7 +2102,7 @@ ata_read_native_max(struct cam_device *device, int retry_count, /*sector_count*/0, /*data_ptr*/NULL, /*dxfer_len*/0, - timeout ? timeout : 5000, + timeout ? timeout : 10 * 1000, is48bit); if (error) From nobody Mon Oct 28 22:56:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcpfW2Nt3z5bsyx; Mon, 28 Oct 2024 22:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcpfW0W3kz574h; Mon, 28 Oct 2024 22:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730156195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=narTFxtlf5AEQCtVWaCAESeYLKN4LzOXHLZjD98zInA=; b=bO105vViYYPwedFlBHkUDgO4cRAYNcvrMkBnJDt5r3yeg9b+CVneQKO742zZmQSGmyNhaR znXbdL750vFXrIZDrYUK9NEXKKX1OxsZkp7Cr0Punkau9PD61t6qKdUiIgwszRc/2cNcIX 9dwtAl2olH2AuWXMrbt4FZ8kgJosMfMH3XldO+oWzWFtbAAgn5RvrY3tV2a54/ONo44AQ9 SwjixMKJodRRz7xR9QAQPju/QwGOwQ09+MM5vWIA70JXyYSjruPCdr3TLJG6sTC1csYOXR h+8gz64OwOvqYMsisO0SDag9qDPDY1DNsdeP+vkfIQOjP7ttgY/+awcyeGH4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730156195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=narTFxtlf5AEQCtVWaCAESeYLKN4LzOXHLZjD98zInA=; b=Fr/Wpej88jDpdNy5zFTFhQo9AC9yZX4j7ixFftLLDhHf3sklxegMGInozsDvGaEWZwSYGy FD+iRqeBrf5nEwOlGWflCWlA4Z4J1fl/BZM7/QutdZjRVxR0+TSovf53a3Xp9q5Tp8LFFj gjnMblAj2pJPDodHEQspUzrxTvJaWk5Un3uPvknaOzfZxlh8v2KSsBwc4k5n1l+Ru/40l6 KPr7X/kleZiS9gdUEqL7f017SRghQWEnsjozRZHLqY4pQY0luk+AZwkZkvaSKNzLdwO4zF qkp/KUegDYqbXBnVbyz7tqj53N1wiPTUefcimNoCANqzpYjU4hSoCxAF+dhF6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730156195; a=rsa-sha256; cv=none; b=CeOTmU/BLl91ZWX5NardIpN6+n3bsLKaW7OKr5y6mGYpQrpuNu8V0kwH+KRXzVYu4fovcn Pzfp4D4/GKpUP8x4mt14VIU14sedIALwBNrqS5JK1WuZ6ikCmiYkq/u5/Vlahza4i+3bJ7 b8VzqZ+xuSR3o9O5NIoc3cX8+FW6iTF2HZKcyR6kvI6gYO5X565zam/Q5qDxp46QbLKCyU +pPdMFA36fV7Gn+w+q4tdGC6qr4ELzenzlrXadOS5Zi0CPIIHJwFEflhi+w5twJsgw4C2N LnLwr5k3kZ9itAYu9iiOph7EgRRk9Flcxnj8degP71PDL5haG5mCVij6p5ULwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcpfV75XrzxvD; Mon, 28 Oct 2024 22:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SMuYMp005686; Mon, 28 Oct 2024 22:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SMuYtm005683; Mon, 28 Oct 2024 22:56:34 GMT (envelope-from git) Date: Mon, 28 Oct 2024 22:56:34 GMT Message-Id: <202410282256.49SMuYtm005683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: f9a039060e83 - main - ice_ddp: Update to 1.3.41.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9a039060e834e89e0b2de1e8a442d78bd5c083d Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=f9a039060e834e89e0b2de1e8a442d78bd5c083d commit f9a039060e834e89e0b2de1e8a442d78bd5c083d Author: Eric Joyner AuthorDate: 2024-10-28 22:48:47 +0000 Commit: Eric Joyner CommitDate: 2024-10-28 22:55:25 +0000 ice_ddp: Update to 1.3.41.0 Primarily adds support for E830 devices, unlocking all of their functionality. As well, update the README and remove the non-FreeBSD sections from it. Signed-off-by: Eric Joyner MFC after: 2 days Sponsored by: Intel Corporation --- sys/conf/files.amd64 | 6 +- sys/conf/files.arm64 | 6 +- sys/conf/files.powerpc | 6 +- sys/contrib/dev/ice/README | 330 ++++++++------------- .../dev/ice/{ice-1.3.36.0.pkg => ice-1.3.41.0.pkg} | Bin 692776 -> 1352580 bytes sys/modules/ice_ddp/Makefile | 2 +- 6 files changed, 133 insertions(+), 217 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 19a16d42043f..0584fc29d039 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -192,7 +192,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -201,8 +201,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 1ed7b57627b4..a1e73e593a99 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -365,7 +365,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -374,8 +374,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 96e891577917..314931ed0939 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -138,7 +138,7 @@ dev/ice/irdma_di_if.m optional ice pci powerpc64 | ice pci powerpc64le \ dev/ice/ice_ddp_common.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp powerpc64 | ice pci powerpc64le \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ @@ -147,8 +147,8 @@ ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp powerpc64 | ice pci powerpc64le \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ixl/if_ixl.c optional ixl pci powerpc64 \ diff --git a/sys/contrib/dev/ice/README b/sys/contrib/dev/ice/README index e2ce84d72e71..c0840ecb499f 100644 --- a/sys/contrib/dev/ice/README +++ b/sys/contrib/dev/ice/README @@ -1,285 +1,201 @@ OS Default Dynamic Device Personalization (DDP) Package -====================================================================== -May 12, 2022 +******************************************************* +August 09, 2024 -Contents -======== -- Overview -- Supported Operating Systems -- Safe Mode -- Notes -- Installation -- Troubleshooting -- Legal +Contents +^^^^^^^^ -Overview -======== -Devices based on the Intel(R) Ethernet 800 Series require a Dynamic Device -Personalization (DDP) package file to enable advanced features (such as dynamic -tunneling, Intel(R) Ethernet Flow Director, RSS, and ADQ). - -DDP allows you to change the packet processing pipeline of a device by applying -a profile package to the device at runtime. Profiles can be used to, for -example, add support for new protocols, change existing protocols, or change -default settings. DDP profiles can also be rolled back without rebooting the -system. - -The DDP package loads during device initialization or driver runtime, depending -on the operating system. The driver checks to see if the DDP package is present -and compatible. If this file exists, the driver will load it into the device. -If the DDP package file is missing or incompatible with the driver, the driver -will go into Safe Mode where it will use the configuration contained in the -device's NVM. Refer to the Intel(R) Ethernet Adapters and Devices User Guide -for more information on Safe Mode. - -A general-purpose, default DDP package is automatically installed with all -supported Intel Ethernet 800 Series drivers on supported operating systems. -Additional DDP packages are available to address needs for specific market -segments or targeted solutions. - -The default DDP package supports the following: -- MAC -- EtherType -- VLAN -- IPv4 -- IPv6 -- TCP -- ARP -- UDP -- SCTP -- ICMP -- ICMPv6 -- CTRL -- LLDP -- VXLAN-GPE -- VXLAN (non-GPE) -- Geneve -- GRE -- NVGRE -- RoCEv2 -- MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group) +* OS Default Dynamic Device Personalization (DDP) Package + * Overview -Supported Operating Systems -=========================== -This DDP package is supported on the following operating systems: -- Microsoft* Windows Server* -- Linux* -- FreeBSD* -- VMware* ESXi* + * Supported Operating Systems -Refer to the Intel(R) Ethernet Adapters and Devices User Guide for currently -supported versions of these operating systems. + * Contents of This Package + * Related Documentation -Safe Mode -========= -Safe Mode disables advanced and performance features, and supports only basic -traffic and minimal functionality, such as updating the NVM or downloading a -new driver or DDP package. + * Notes -Refer to the Intel(R) Ethernet Adapters and Devices User Guide for more details -on DDP and Safe Mode. + * Installation + * Troubleshooting -Notes -===== -- In Linux, FreeBSD, and Windows, you cannot update the DDP package if any PF -drivers are already loaded. To overwrite a package, unload all PFs and then -reload the driver with the new package. + * Legal / Disclaimers -- In ESXi, use esxcli to load and unload DDP packages for specific market -segments during driver runtime. - -- In FreeBSD and Windows, you can only use one DDP package per driver, even if -you have more than one device installed that uses the driver. -- In Linux, FreeBSD, and Windows, only the first loaded PF per device can -download a package for that device. In ESXi, you can load different DDP -packages for different PFs associated with a device. +Overview +======== -- If you are using DPDK, see the DPDK documentation at https://www.dpdk.org/ -for installation instructions and more information. +Devices based on the Intel(R) Ethernet 800 Series require a Dynamic +Device Personalization (DDP) package file to enable advanced features +(such as dynamic tunneling, Intel(R) Ethernet Flow Director, RSS, and +ADQ). +DDP allows you to change the packet processing pipeline of a device by +applying a profile package to the device at runtime. Profiles can be +used to, for example, add support for new protocols, change existing +protocols, or change default settings. DDP profiles can also be rolled +back without rebooting the system. -Installation -============ +The DDP package loads during device initialization or driver runtime, +depending on the operating system. The driver checks to see if the DDP +package is present and compatible. If this file exists, the driver +will load it into the device. If the DDP package file is missing or +incompatible with the driver, the driver will go into Safe Mode where +it will use the configuration contained in the device's NVM. -Microsoft Windows ------------------ -TO INSTALL THE OS DEFAULT DDP PACKAGE: +Safe Mode disables advanced and performance features, and supports +only basic traffic and minimal functionality, such as updating the NVM +or downloading a new driver or DDP package. -The default DDP package is installed as part of the driver binary. You don't -need to take additional steps to install the DDP package file. +Refer to the Intel(R) Ethernet Adapters and Devices User Guide for +more details on DDP and Safe Mode. +A general-purpose, default DDP package is automatically installed with +all supported Intel Ethernet 800 Series drivers on supported operating +systems. Additional DDP packages are available to address needs for +specific market segments or targeted solutions. -FreeBSD -------- -TO INSTALL THE OS DEFAULT DDP PACKAGE: - -The FreeBSD driver automatically installs the default DDP package file during -driver installation. See the base driver README for general installation and -building instructions. - -The DDP package loads during device initialization. The driver looks for the -ice_ddp module and checks that it contains a valid DDP package file. +The default DDP package supports the following: -NOTE: It's important to do 'make install' during initial ice driver -installation so that the driver loads the DDP package automatically. +* MAC +* EtherType -Linux ------ -TO INSTALL THE OS DEFAULT DDP PACKAGE: +* VLAN -The Linux driver automatically installs the default DDP package file during -driver installation. Read the base driver README for general installation and -building instructions. +* IPv4 -The DDP package loads during device initialization. The driver looks for -intel/ice/ddp/ice.pkg in your firmware root (typically /lib/firmware/ or -/lib/firmware/updates/) and checks that it contains a valid DDP package file. -The ice.pkg file is a symbolic link to the default DDP package file installed -by the linux-firmware software package or the out-of-tree driver installation. +* IPv6 +* TCP -TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: +* ARP -You can install specific DDP package files for different physical devices in -the same system. To install a specific DDP package: +* UDP -1. Download the DDP package file (ice-x.x.x.x.zip) you want for your device. In -addition to licensing information and this README, this zip file contains the -following files: - ice-x.x.x.x.pkg - ice.pkg +* SCTP -NOTE: The ice.pkg file is a Linux symbolic link file pointing to -ice-x.x.x.x.pkg (in the same path). +* ICMP -2. Rename the ice-x.x.x.x.pkg file as ice-xxxxxxxxxxxxxxxx.pkg, where -'xxxxxxxxxxxxxxxx' is the unique 64-bit PCI Express device serial number (in -hex) of the device you want the package downloaded on. The filename must -include the complete serial number (including leading zeros) and be all -lowercase. For example, if the 64-bit serial number is b887a3ffffca0568, then -the file name would be ice-b887a3ffffca0568.pkg. +* ICMPv6 -To find the serial number from the PCI bus address, you can use the following -command: +* CTRL -# lspci -vv -s af:00.0 | grep -i Serial -Capabilities: [150 v1] Device Serial Number b8-87-a3-ff-ff-ca-05-68 +* LLDP -You can use the following command to format the serial number without the -dashes: +* VXLAN-GPE -# lspci -vv -s af:00.0 | grep -i Serial | awk '{print $7}' | sed s/-//g -b887a3ffffca0568 +* VXLAN (non-GPE) -3. Copy the renamed DDP package file to /lib/firmware/updates/intel/ice/ddp/. -If the directory does not yet exist, create it before copying the file. +* Geneve -4. Unload all of the PFs on the device. +* GRE -5. Reload the driver with the new package. +* NVGRE -NOTE: The presence of a device-specific DDP package file overrides the loading -of the default DDP package file. +* RoCEv2 +* MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 + header group) -ESX ---- -TO INSTALL THE OS DEFAULT DDP PACKAGE: -The default DDP package is installed as part of the driver binary. You don't -need to take additional steps to install the DDP package file. +Supported Operating Systems +=========================== -TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: +This DDP package is supported on the following operating systems: -You must first install the Intel(R) ESXCLI Plug-In for Managing Intel(R) -Ethernet Network Adapters to be able to install and load market-specific DDP -packages. Download it from: -https://www.intel.com/content/www/us/en/download/19380/intel-esxcli-plug-in-for- -managing-intel-ethernet-network-adapters.html +* Microsoft* Windows Server* -NOTE: ESXi support for DDP packages for specific market segments requires the -following: -- OS: ESXi 6.7 or higher -- Driver: icen 1.9.1.x or higher -- Tool: intnet 1.8.3.x or higher +* Linux* -To install and load this DDP package: +* FreeBSD* -1. Download and install the esxcli plug-in from the URL above. +* VMware* ESXi* -2. Download the DDP package. +Refer to the Intel(R) Ethernet Adapters and Devices User Guide for +currently supported versions of these operating systems. -3. Copy the DDP package file to the following location: /store/intel/icen/ddp/. - If the directory does not yet exist, create it before copying the file. -4. From the command prompt, run the following command to load the DDP package: +Related Documentation +===================== - # esxcli intnet ddp load -n -p -f +See the "Intel(R) Ethernet Adapters and Devices User Guide" for +additional information on features: - Where: - = the name of the NIC - = the name of the DDP package to load - -f = forces the package to load +* https://cdrdv2.intel.com/v1/dl/getContent/705831/ - NOTE: This operation will cause the driver to reset. +Additionally, a detailed technology guide is available for this DDP +package: -5. Wait for the load result status. +* https://cdrdv2.intel.com/v1/dl/getContent/617015 -To list all active DDP packages for all virtual NICs, run the following: +Notes +===== -# esxcli intnet ddp list +* In Linux, FreeBSD, and Windows, you cannot update the DDP package if + any PF drivers are already loaded. To overwrite a package, unload + all PFs and then reload the driver with the new package. -To unload (roll back) a DDP package, run the following: +* In FreeBSD and Windows, you can only use one DDP package per driver, + even if you have more than one device installed that uses the + driver. -# esxcli intnet ddp rollback -n -f +* In Linux, FreeBSD, and Windows, only the first loaded PF per device + can download a package for that device. In ESXi, you can load + different DDP packages for different PFs associated with a device. -NOTE: This operation will cause the driver to reset. +* If you are using DPDK, see the DPDK documentation at + https://www.dpdk.org/ for installation instructions and more + information. Troubleshooting =============== -Microsoft Windows ------------------ -If you encounter issues with the DDP package file, download the latest driver. FreeBSD ------- -If you encounter issues with the DDP package file, you may need to download an -updated driver or ice_ddp module. See the log messages for more information. -Linux ------ -If you encounter issues with the DDP package file, you may need to download an -updated driver or DDP package file. Refer to the log messages for more -information. - -ESX ---- -If you encounter issues with the DDP package file, download the latest driver. +If you encounter issues with the DDP package file, you may need to +download an updated driver or ice_ddp module. See the log messages for +more information. Legal / Disclaimers =================== -Copyright (c) 2019 - 2022, Intel Corporation. -Intel and the Intel logo are trademarks of Intel Corporation or its -subsidiaries in the U.S. and/or other countries. +Copyright (c) 2019 - 2024, Intel Corporation. + +Intel technologies may require enabled hardware, software or service +activation. + +No product or component can be absolutely secure. + +Your costs and results may vary. + +Intel, the Intel logo, and other Intel marks are trademarks of Intel +Corporation or its subsidiaries. Other names and brands may be +claimed as the property of others. + +Performance varies by use, configuration, and other factors. Learn +more at https://www.Intel.com/PerformanceIndex. + +The products described may contain design defects or errors known as +errata which may cause the product to deviate from published +specifications. Current characterized errata are available on request. -*Other names and brands may be claimed as the property of others. +This software and the related documents are Intel copyrighted +materials, and your use of them is governed by the express license +under which they were provided to you ("License"). Unless the License +provides otherwise, you may not use, modify, copy, publish, +distribute, disclose or transmit this software or the related +documents without Intel's prior written permission. -This software and the related documents are Intel copyrighted materials, and -your use of them is governed by the express license under which they were -provided to you ("License"). Unless the License provides otherwise, you may not -use, modify, copy, publish, distribute, disclose or transmit this software or -the related documents without Intel's prior written permission. -This software and the related documents are provided as is, with no express or -implied warranties, other than those that are expressly stated in the License. +This software and the related documents are provided as is, with no +express or implied warranties, other than those that are expressly +stated in the License. diff --git a/sys/contrib/dev/ice/ice-1.3.36.0.pkg b/sys/contrib/dev/ice/ice-1.3.41.0.pkg similarity index 50% rename from sys/contrib/dev/ice/ice-1.3.36.0.pkg rename to sys/contrib/dev/ice/ice-1.3.41.0.pkg index ce5dbf41f557..71e75a5d7836 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.36.0.pkg and b/sys/contrib/dev/ice/ice-1.3.41.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index bacf95365c82..52cc1c4a2360 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,6 +1,6 @@ .PATH: ${SRCTOP}/sys/contrib/dev/ice KMOD= ice_ddp -FIRMWS= ice-1.3.36.0.pkg:ice_ddp:0x01032400 +FIRMWS= ice-1.3.41.0.pkg:ice_ddp:0x01032900 .include From nobody Mon Oct 28 23:03:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XcppN52ZWz5btbn; Mon, 28 Oct 2024 23:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XcppN45W2z57l6; Mon, 28 Oct 2024 23:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730156604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LIpQa8gdVDoAphPZ/th+GFFNZMaGczSJPGUdQ++19yg=; b=Q2hbQ0tQ8u3VMW+7ZHwRkKweSCZEUW3fegfLbkRJ53UOA4/kVogvc0OudxirakOfDbjk9T 7DQoKGHo/m8GUnOW7tTrGAG7yOekMcYl7/Kh+W+MINif1s7QO367oHZCl7ksQlC8JDw0EY Fil9f8TszTAbrokTLMVTsZVoK9sVxMkCNq/qsaYWZJUOpLp2rwU8LyAQfW9spRPY/kOiMJ 2wcExe4V8yq13N0ERAzUIEO1iSpNQ1K64B2cY1cw3BA7B7S3hdZsGRxI/+GDmuU41h3pxK dBr9VxQwMVvlDAA+sH1Vbc88TcYhGBPOje4q6/ePAd8TXG8F7soZRvvK2f22dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730156604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LIpQa8gdVDoAphPZ/th+GFFNZMaGczSJPGUdQ++19yg=; b=PidvuGsx/UA8PICgFRCZfLnL8Tta/T7Rpfypx7cbYJmWaYiEBtDaW8TgtnUQvP/ZxtAKNP Te5IAcysjm3SuHTd27R8HPNYtSgFlBvq0E3aokuJ6oFi0I+PF+YH5hHUDaqa/q+qX0pRSr cdjImJ6en+x98DHk3QgOjcw7kfEPjzbgrcXKjnuDWug2cROJ29JaLHsgs0f2mk/+DpV7S7 WnQKvE7BHZDgnV/shGsqby+788diaAaBwfy1+P9xMsNH7PILqD1/JF7pJCAixF5eV4PLsy cXEAB9sIaL+jUj/ywmAs72qxw49lZr8mHv7MPMKgTTUDUMqELZVJGq9mjol2Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730156604; a=rsa-sha256; cv=none; b=sJq0rlHNom4CN8PPtoNqWHT2TXnh29eaP1wegmhugtYMvFnrA2X3iUNs0MYMxdNXNAWsML gR0VGwpEQPGhc+geSxlyNYFd1++CdXRlF4MIoiq1o12kMSDExhcDVQWLVORHnYNdJ+UvZi 32SrrV5ZYEKqvpfgKeG57OxpXs4w+cRq8lAaXINDNLSBU91k0tY7rZQ4gmJPsy3WGLMx8a l+ptp+NAbYJSXliANCp0iwJDEIrmOVLInGbpqw1GkXXzgk2Q3C+9Rn3cbbG4Xsmf0/tBt+ MtuZcc8i241wWzRXc7Hn8j7o3XbYKvJQceA9VVT2zL7HAkVGtv+DNPVuonApDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcppN3cJCzxyp; Mon, 28 Oct 2024 23:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SN3Osu024161; Mon, 28 Oct 2024 23:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SN3OnE024158; Mon, 28 Oct 2024 23:03:24 GMT (envelope-from git) Date: Mon, 28 Oct 2024 23:03:24 GMT Message-Id: <202410282303.49SN3OnE024158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Gallatin Subject: git: ee373c1234d3 - stable/14 - acpi_ged: Handle events directly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee373c1234d33d68e91fbe51f846e265cbce9e72 Auto-Submitted: auto-generated The branch stable/14 has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=ee373c1234d33d68e91fbe51f846e265cbce9e72 commit ee373c1234d33d68e91fbe51f846e265cbce9e72 Author: Andrew Gallatin AuthorDate: 2023-10-12 15:15:06 +0000 Commit: Andrew Gallatin CommitDate: 2024-10-28 23:02:24 +0000 acpi_ged: Handle events directly Handle ged interrupts directly from the interrupt handler, while the interrupt source is masked, so as to conform with the acpi spec, and avoid spurious interrupts and lockups on boot. When an acpi ged interrupt is encountered, the spec requires the os (as stated in 5.6.4: General Purpose Event Handling) to leave the interrupt source masked until it runs the EOI handler. This is not a good fit for our method of queuing the work (including the EOI ack of the interrupt), via the AcpiOsExecute() taskqueue mechanism. Note this fixes a bug where an arm64 server could lock up if it encountered a ged interrupt at boot. The lockup was due to running on a single core (due to arm64 not using EARLY_AP_STARTUP), and due to that core encountering a new interrupt each time the interrupt handler unmasked the interrupt source, and having the EOI queued on a taskqueue which never got a chance to run. This is also possible on any platform when using just a single processor. The symptom of this is a lockup at boot, with: "AcpiOsExecute: failed to enqueue task, consider increasing the debug.acpi.max_tasks tunable" scrolling on console. Similarly, spurious interrupts would occur when running with multiple cores, because it was likely that the interrupt would fire again immediately, before the ged task could be run, and before an EOI could be sent to lower the interrupt line. I would typically see 3-5 copies of every ged event due to this issue. This adds a tunable, debug.acpi.ged_defer, which can be set to 1 to restore the old behavior. This was done because acpi is a complex system, and it may be theoretically possible something the ged handler does may sleep (though I cannot easily find anthing by inspection). MFC after: 1 month Reviewed by: andrew, jhb, imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42158 (cherry picked from commit be91b4797e2c8f3440f6fe3aac7e246886f9ebca) --- sys/dev/acpica/acpi_ged.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_ged.c b/sys/dev/acpica/acpi_ged.c index e7dcc1ffb0ac..23e125f277c5 100644 --- a/sys/dev/acpica/acpi_ged.c +++ b/sys/dev/acpica/acpi_ged.c @@ -81,6 +81,11 @@ static driver_t acpi_ged_driver = { DRIVER_MODULE(acpi_ged, acpi, acpi_ged_driver, 0, 0); MODULE_DEPEND(acpi_ged, acpi, 1, 1, 1); +static int acpi_ged_defer; +SYSCTL_INT(_debug_acpi, OID_AUTO, ged_defer, CTLFLAG_RWTUN, + &acpi_ged_defer, 0, + "Handle ACPI GED via a task, rather than in the ISR"); + static void acpi_ged_evt(void *arg) { @@ -92,7 +97,12 @@ acpi_ged_evt(void *arg) static void acpi_ged_intr(void *arg) { - AcpiOsExecute(OSL_GPE_HANDLER, acpi_ged_evt, arg); + struct acpi_ged_event *evt = arg; + + if (acpi_ged_defer) + AcpiOsExecute(OSL_GPE_HANDLER, acpi_ged_evt, arg); + else + AcpiEvaluateObject(evt->ah, NULL, &evt->args, NULL); } static int acpi_ged_probe(device_t dev) From nobody Mon Oct 28 23:12:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcq0W3xD8z5btcY; Mon, 28 Oct 2024 23:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcq0W10s3z58fZ; Mon, 28 Oct 2024 23:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SAaTvvka2tFPUsCSuArnDVw3PCEuadL8rLCHkphEVpU=; b=v8TYyfXVyTdVzWEcVlijRplgiFYfMkDXI2+GD4kaG3kZFYmwWwnJeJI6b/DLGYd6MYYvzc H78szpQjZ6rLnkw3YNv0V5nWfcLPaOGfoqZLrd4yi/6L+qYgTOoWk9644Vhp1yuwKG+/1c cymKsd6nFn9ZPq8axN/nExVI0NEXhZuJo2JWb/iHVYV0vXwMWaE1diQrD/13+C53cySwle f17cTgjCO3L47HSpZFQaHIew03VxXM5peDbOMOMis6DZbm8N0n5fKrn/j8uJNck7Q2Kmk4 QsAJAEeJ+yB+m8DHzCbd6gT+CjF2Fem8wv6aGspZ2FtP8GqeIEhzfG2iBYT53Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SAaTvvka2tFPUsCSuArnDVw3PCEuadL8rLCHkphEVpU=; b=OPGfj1cU3XTvkLPPg4q8hvniUz7hNiwnIKynVwuqFdMdL9tCEMUrxox3+xB9W0WYptOEMQ BNAIE2wKUFnJO7umcik/UviKIqqW8ZjCVT7rSMBbBt8areBDvE6SLtYeOMkmdNrDp3xLf1 17L5ILew3liVKGyVerZNCl5VO7Ugh3353QcjsJMQ4yB91/MyAkrFJQLcqiisQbaROCdYY+ mwEKAZU7aMUi57kx77LZ8D7Tt6t2HbvEmIQk+D8buqaetLLwLzC2Oc/atAaW98hR13U7wT A/mlXMKjGAmIqTxTN5u/LZjZ3iadDh9HUylyK+cnB/MK7DeIBht8xgSgqbcAqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730157131; a=rsa-sha256; cv=none; b=dccsWhzqCfTk0j06YM0EWvD3/BwlatX9VSfdVfVAb3+oD08N8m7ZbuULi6Djq93F3LH6xD 5CPK8MoiVfJhkNcZEk5E1cZE1Qg9UP8nhJKEKzTkn7eUpTEYZARYM2TOJVOyL9Cn/pkfJ+ zChH2AvUmKKTHKCaPecMx7gdFsqTwRsM4UpDKOUTMUHXjwj/QyB0M1PLNeFtoHPHQXvgS+ gTAYD4DPQHayVd6XYmNdVSp8kA+JFhxgNck2pG6oPqWgf3sB3dKISMCWNLIydqnFQznxSw 9Yx5bbItkves2pXCyEaa/Tk6DMb9hF4xeCbDDOhHbKxIWJBECfMurCutU8a9vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcq0W0d9qzywM; Mon, 28 Oct 2024 23:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SNCAvL039887; Mon, 28 Oct 2024 23:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SNCA2J039883; Mon, 28 Oct 2024 23:12:10 GMT (envelope-from git) Date: Mon, 28 Oct 2024 23:12:10 GMT Message-Id: <202410282312.49SNCA2J039883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f2daf89954a4 - main - cxgb(4): Register ifmedia callbacks before ether_ifattach. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2daf89954a45c7eed22990dd4cf2cf879763dc0 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f2daf89954a45c7eed22990dd4cf2cf879763dc0 commit f2daf89954a45c7eed22990dd4cf2cf879763dc0 Author: ScottD AuthorDate: 2024-10-28 20:48:16 +0000 Commit: Navdeep Parhar CommitDate: 2024-10-28 23:10:05 +0000 cxgb(4): Register ifmedia callbacks before ether_ifattach. This prevents a panic that occurs if netlink tries to invoke the driver's media callbacks during ifattach. PR: 282374 Reported by: ScottD MFC after: 3 days --- sys/dev/cxgb/cxgb_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 4d754aa8b1b7..c159849076c5 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1041,6 +1041,11 @@ cxgb_port_attach(device_t dev) if_sethwassistbits(ifp, 0, CSUM_TSO); } + /* Create a list of media supported by this port */ + ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change, + cxgb_media_status); + cxgb_build_medialist(p); + ether_ifattach(ifp, p->hw_addr); /* Attach driver debugnet methods. */ @@ -1055,11 +1060,6 @@ cxgb_port_attach(device_t dev) return (err); } - /* Create a list of media supported by this port */ - ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change, - cxgb_media_status); - cxgb_build_medialist(p); - t3_sge_init_port(p); return (err); From nobody Mon Oct 28 23:17:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcq6t5xMsz5bvKg; Mon, 28 Oct 2024 23:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcq6t5Yflz58sV; Mon, 28 Oct 2024 23: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=1730157462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6BvN9qkkel09vMpaEJXzLfCGDH4y7AwLtxPJVZ+wq4=; b=LYMWUGO2IjKAupjF/n/0B+W0xXREmcrjkg+m/nlhoq5n4yaovLCQNDD7eu5dMq709j03iU E/NCyGX61FpaOR/elDlV8TZyTpQDoyjTcIn5jWzJdQ9yR9h+GXkb/fhJmfWAKkxkQ2UdkU s6dpxV4KVj5aLXw5MYJVnFWRVT5MvMlq/AnBGHyKgseTkBuQydEgx6TrZK6XMvtP8a1c4Q MqclJRqMVLaaZ6twrB40EIVJen7yqgMOHDQzSDMoShxiy4IwKO9gM4+jNf2qtgUBxMiIFE XvZT4uXQ3MwSsG275YClzOk8vMt4+xw/ibTVecIMCLxZUqtld/FijBB19xKRbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k6BvN9qkkel09vMpaEJXzLfCGDH4y7AwLtxPJVZ+wq4=; b=rTAZTP+E6jVSoBpg56HuRWchRA/7okUZWhKLgv0u0foP2qihgsEAabdvvhn+sqUUqN1U0u A9mOl0ACNTNa7ZwcryNWFE9ZNzyb4t/fsGvj0J8sWrfTnAi2FKWBfWxGUkyBh7qVysSHPE JOhTPfSDxvVp207N1br5TWPstJCIsJD/irK4hmi8fQ5cM+Nt1bqHWsa3Mql+pgszDm1FOT LlrEn2qj9i1u8Q5bw/2hSwzVFZTXZp3/f2vUYn6P5ryw8novN6o6VGlBNTNbt8kc+yL2NN 9LgZWIciF/KUsYD84HdA75yCJ7zOzUFLd4/fhS6MFbxQsuyXMAADmECDhPpjBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730157462; a=rsa-sha256; cv=none; b=Snvd7d09uT9rWDYTy+j58BwJ621uZTAcX4FZ28L0OLwseBb7GeqHEI73oyem2rhNPPdpDT yFAeC8nYvSzg8hNXVpirb3x2DMNm2BZ5EXm+iorGw87ojCpbneV4C2Iz/rE1b73hSSwA7w uHAN8Dbg4t3eR9PvPbly+ErKwZWcgIbj5tc3hCFCHoblB4VJBiqe+BV/tDzo/xQDkVDuMW maXmZkLu9Xd0bbKZ2M/1ua+5/38ekoaWnTs/KCR3m5zdAH/jD79ZLiiSiYNgBMZvtOgToR yLvJdRXy3iRldKqC/rB6t5lQQXLEM/XCoJL2W9tLXXQJ9Hd50qKIz0xbyv17kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcq6t53rHz109N; Mon, 28 Oct 2024 23:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SNHgdf043611; Mon, 28 Oct 2024 23:17:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SNHgFj043608; Mon, 28 Oct 2024 23:17:42 GMT (envelope-from git) Date: Mon, 28 Oct 2024 23:17:42 GMT Message-Id: <202410282317.49SNHgFj043608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: f2635e844dd1 - main - ice: Update to 1.42.1-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2635e844dd138ac9dfba676f27d41750049af26 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=f2635e844dd138ac9dfba676f27d41750049af26 commit f2635e844dd138ac9dfba676f27d41750049af26 Author: Eric Joyner AuthorDate: 2024-08-29 22:41:20 +0000 Commit: Eric Joyner CommitDate: 2024-10-28 23:17:18 +0000 ice: Update to 1.42.1-k Summary: - Adds E830 device support - Adds pre-release E825C support (for the Ethernet device included in an upcoming Xeon D platform) - Add sysctl for E810 devices to print out PHY debug statistics (mostly for FEC debugging) - Adds per-TX-queue tso counter sysctl to count how many times a TSO offload was requested for a packet, matching other Intel drivers - Various bug fixes Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper MFC after: 2 days Relnotes: yes Sponsored by: Intel Corporation Differential Revisison: https://reviews.freebsd.org/D46949 --- sys/dev/ice/ice_adminq_cmd.h | 191 ++- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 967 ++++++++++------ sys/dev/ice/ice_common.h | 189 +-- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 143 ++- sys/dev/ice/ice_controlq.h | 24 +- sys/dev/ice/ice_dcb.c | 90 +- sys/dev/ice/ice_dcb.h | 42 +- sys/dev/ice/ice_ddp_common.c | 123 +- sys/dev/ice/ice_ddp_common.h | 19 +- sys/dev/ice/ice_devids.h | 38 +- sys/dev/ice/ice_drv_info.h | 49 +- sys/dev/ice/ice_features.h | 3 + sys/dev/ice/ice_flex_pipe.c | 266 ++--- sys/dev/ice/ice_flex_pipe.h | 38 +- sys/dev/ice/ice_flow.c | 100 +- sys/dev/ice/ice_flow.h | 14 +- sys/dev/ice/ice_fw_logging.c | 4 +- sys/dev/ice/ice_fwlog.c | 39 +- sys/dev/ice/ice_fwlog.h | 12 +- sys/dev/ice/ice_hw_autogen.h | 2557 +++++++++++++++++++++++++++++++++++------ sys/dev/ice/ice_iflib.h | 1 - sys/dev/ice/ice_lan_tx_rx.h | 8 +- sys/dev/ice/ice_lib.c | 1113 +++++++++++++++--- sys/dev/ice/ice_lib.h | 109 +- sys/dev/ice/ice_nvm.c | 374 +++--- sys/dev/ice/ice_nvm.h | 56 +- sys/dev/ice/ice_rdma.c | 2 +- sys/dev/ice/ice_sbq_cmd.h | 120 ++ sys/dev/ice/ice_sched.c | 487 ++++---- sys/dev/ice/ice_sched.h | 102 +- sys/dev/ice/ice_strings.c | 4 +- sys/dev/ice/ice_switch.c | 304 ++--- sys/dev/ice/ice_switch.h | 93 +- sys/dev/ice/ice_type.h | 36 +- sys/dev/ice/ice_vlan_mode.c | 22 +- sys/dev/ice/ice_vlan_mode.h | 2 +- sys/dev/ice/if_ice_iflib.c | 59 +- sys/dev/ice/virtchnl.h | 28 + 40 files changed, 5678 insertions(+), 2156 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 70b56144faf2..6225abc0f38b 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -187,7 +187,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_ROCEV2_LAG 0x0092 #define ICE_AQC_BIT_ROCEV2_LAG 0x01 #define ICE_AQC_BIT_SRIOV_LAG 0x02 - +#define ICE_AQC_CAPS_NEXT_CLUSTER_ID 0x0096 u8 major_ver; u8 minor_ver; /* Number of resources described by this capability */ @@ -320,7 +320,12 @@ struct ice_aqc_set_port_params { (0x3F << ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S) #define ICE_AQC_SET_P_PARAMS_IS_LOGI_PORT BIT(14) #define ICE_AQC_SET_P_PARAMS_SWID_VALID BIT(15) - u8 reserved[10]; + u8 lb_mode; +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID BIT(2) +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL 0x00 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NO 0x01 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_HIGH 0x02 + u8 reserved[9]; }; /* These resource type defines are used for all switch resource @@ -1389,7 +1394,18 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 4 +#define ICE_PHY_TYPE_HIGH_200G_CR4_PAM4 BIT_ULL(5) +#define ICE_PHY_TYPE_HIGH_200G_SR4 BIT_ULL(6) +#define ICE_PHY_TYPE_HIGH_200G_FR4 BIT_ULL(7) +#define ICE_PHY_TYPE_HIGH_200G_LR4 BIT_ULL(8) +#define ICE_PHY_TYPE_HIGH_200G_DR4 BIT_ULL(9) +#define ICE_PHY_TYPE_HIGH_200G_KR4_PAM4 BIT_ULL(10) +#define ICE_PHY_TYPE_HIGH_200G_AUI4_AOC_ACC BIT_ULL(11) +#define ICE_PHY_TYPE_HIGH_200G_AUI4 BIT_ULL(12) +#define ICE_PHY_TYPE_HIGH_200G_AUI8_AOC_ACC BIT_ULL(13) +#define ICE_PHY_TYPE_HIGH_200G_AUI8 BIT_ULL(14) +#define ICE_PHY_TYPE_HIGH_400GBASE_FR8 BIT_ULL(15) +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 15 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1541,11 +1557,14 @@ struct ice_aqc_get_link_status { enum ice_get_link_status_data_version { ICE_GET_LINK_STATUS_DATA_V1 = 1, + ICE_GET_LINK_STATUS_DATA_V2 = 2, }; #define ICE_GET_LINK_STATUS_DATALEN_V1 32 +#define ICE_GET_LINK_STATUS_DATALEN_V2 56 /* Get link status response data structure, also used for Link Status Event */ +#pragma pack(1) struct ice_aqc_get_link_status_data { u8 topo_media_conflict; #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0) @@ -1618,7 +1637,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2 #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3 __le16 link_speed; -#define ICE_AQ_LINK_SPEED_M 0x7FF +#define ICE_AQ_LINK_SPEED_M 0xFFF #define ICE_AQ_LINK_SPEED_10MB BIT(0) #define ICE_AQ_LINK_SPEED_100MB BIT(1) #define ICE_AQ_LINK_SPEED_1000MB BIT(2) @@ -1630,12 +1649,37 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_SPEED_40GB BIT(8) #define ICE_AQ_LINK_SPEED_50GB BIT(9) #define ICE_AQ_LINK_SPEED_100GB BIT(10) +#define ICE_AQ_LINK_SPEED_200GB BIT(11) #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15) - __le32 reserved3; /* Aligns next field to 8-byte boundary */ + __le16 reserved3; /* Aligns next field to 8-byte boundary */ + u8 ext_fec_status; +#define ICE_AQ_LINK_RS_272_FEC_EN BIT(0) /* RS 272 FEC enabled */ + u8 reserved4; __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + /* Get link status version 2 link partner data */ + __le64 lp_phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ + __le64 lp_phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + u8 lp_fec_adv; +#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2) +#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3) +#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4) +#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5) + u8 lp_fec_req; +#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2) +#define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3) + u8 lp_flowcontrol; +#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0) +#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1) + u8 reserved[5]; }; +#pragma pack() + /* Set event mask command (direct 0x0613) */ struct ice_aqc_set_event_mask { u8 lport_num; @@ -1793,14 +1837,46 @@ struct ice_aqc_dnl_call_command { u8 ctx; /* Used in command, reserved in response */ u8 reserved; __le16 activity_id; +#define ICE_AQC_ACT_ID_DNL 0x1129 __le32 reserved1; __le32 addr_high; __le32 addr_low; }; +struct ice_aqc_dnl_equa_param { + __le16 data_in; +#define ICE_AQC_RX_EQU_SHIFT 8 +#define ICE_AQC_RX_EQU_PRE2 (0x10 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_PRE1 (0x11 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_POST1 (0x12 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_BFLF (0x13 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_BFHF (0x14 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_DRATE (0x15 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_TX_EQU_PRE1 0x0 +#define ICE_AQC_TX_EQU_PRE3 0x3 +#define ICE_AQC_TX_EQU_ATTEN 0x4 +#define ICE_AQC_TX_EQU_POST1 0x8 +#define ICE_AQC_TX_EQU_PRE2 0xC + __le16 op_code_serdes_sel; +#define ICE_AQC_OP_CODE_SHIFT 4 +#define ICE_AQC_OP_CODE_RX_EQU (0x9 << ICE_AQC_OP_CODE_SHIFT) +#define ICE_AQC_OP_CODE_TX_EQU (0x10 << ICE_AQC_OP_CODE_SHIFT) + __le32 reserved[3]; +}; + +struct ice_aqc_dnl_equa_resp { + /* Equalization value can be -ve */ + int val; + __le32 reserved[3]; +}; + /* DNL call command/response buffer (indirect 0x0682) */ struct ice_aqc_dnl_call { - __le32 stores[4]; + union { + struct ice_aqc_dnl_equa_param txrx_equa_reqs; + __le32 stores[4]; + struct ice_aqc_dnl_equa_resp txrx_equa_resp; + } sto; }; /* Used for both commands: @@ -1902,8 +1978,8 @@ struct ice_aqc_link_topo_addr { #define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S) /* Used to decode the handle field */ #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ BIT(9) #define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0 /* In case of a Mezzanine type */ #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \ @@ -1919,7 +1995,7 @@ struct ice_aqc_link_topo_addr { struct ice_aqc_get_link_topo { struct ice_aqc_link_topo_addr addr; u8 node_part_num; -#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 u8 rsvd[9]; }; @@ -2054,6 +2130,7 @@ struct ice_aqc_get_port_options_elem { #define ICE_AQC_PORT_OPT_MAX_LANE_25G 5 #define ICE_AQC_PORT_OPT_MAX_LANE_50G 6 #define ICE_AQC_PORT_OPT_MAX_LANE_100G 7 +#define ICE_AQC_PORT_OPT_MAX_LANE_200G 8 u8 global_scid[2]; u8 phy_scid[2]; u8 pf2port_cid[2]; @@ -2201,6 +2278,29 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4 /* In Bits */ #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_OFFSET 0xD8 +#define ICE_AQC_NVM_SDP_CFG_PTR_RD_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_M MAKEMASK(0x7FFF, 0) +#define ICE_AQC_NVM_SDP_CFG_PTR_TYPE_M BIT(15) +#define ICE_AQC_NVM_SDP_CFG_HEADER_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_SEC_LEN_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_DATA_LEN 14 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_MAX_SECTION_SIZE 7 +#define ICE_AQC_NVM_SDP_CFG_PIN_SIZE 10 +#define ICE_AQC_NVM_SDP_CFG_PIN_OFFSET 6 +#define ICE_AQC_NVM_SDP_CFG_PIN_MASK MAKEMASK(0x3FF, \ + ICE_AQC_NVM_SDP_CFG_PIN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET 4 +#define ICE_AQC_NVM_SDP_CFG_CHAN_MASK MAKEMASK(0x3, \ + ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_DIR_OFFSET 3 +#define ICE_AQC_NVM_SDP_CFG_DIR_MASK MAKEMASK(0x1, \ + ICE_AQC_NVM_SDP_CFG_DIR_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET 0 +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_MASK MAKEMASK(0x7, \ + ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_NA_PIN_MASK MAKEMASK(0x1, 15) + #define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 #define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B #define ICE_AQC_NVM_CMPO_MOD_ID 0x153 @@ -2265,6 +2365,29 @@ struct ice_aqc_nvm_checksum { u8 rsvd2[12]; }; +/* Used for NVM Sanitization command - 0x070C */ +struct ice_aqc_nvm_sanitization { + u8 cmd_flags; +#define ICE_AQ_NVM_SANITIZE_REQ_READ 0 +#define ICE_AQ_NVM_SANITIZE_REQ_OPERATE BIT(0) + +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_BITS 0 +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_STATE BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_SUBJECT_CLEAR 0 + u8 values; +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_HOST_CLEAN_SUPPORT BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_BMC_CLEAN_SUPPORT BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_SUCCESS BIT(3) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_SUCCESS BIT(3) + u8 reserved[14]; +}; + /* * Send to PF command (indirect 0x0801) ID is only used by PF * @@ -2560,6 +2683,15 @@ struct ice_aqc_get_set_rss_lut { __le32 addr_low; }; +/* Sideband Control Interface Commands */ +/* Neighbor Device Request (indirect 0x0C00); also used for the response. */ +struct ice_aqc_neigh_dev_req { + __le16 sb_data_len; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + /* Add Tx LAN Queues (indirect 0x0C30) */ struct ice_aqc_add_txqs { u8 num_qgrps; @@ -2812,19 +2944,33 @@ struct ice_aqc_event_lan_overflow { /* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals { __le16 cluster_id; /* Expresses next cluster ID in response */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E810 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E810 1 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E810 2 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E810 3 /* EMP_DRAM only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM 4 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK 5 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM_E810 4 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E810 5 /* AUX_REGS only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS 6 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB 7 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS 22 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS_E810 6 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E810 7 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E810 8 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E810 9 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E810 21 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS_E810 22 + +/* Start cluster to discover first available cluster */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_START_ALL 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E830 100 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E830 101 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E830 102 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E830 103 +/* EMP_DRAM only dumpable in device debug mode */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E830 105 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E830 107 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E830 108 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E830 109 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E830 121 __le16 table_id; /* Used only for non-memory clusters */ __le32 idx; /* In table entries for tables, in bytes for memory */ __le32 addr_high; @@ -3076,6 +3222,7 @@ struct ice_aq_desc { struct ice_aqc_nvm nvm; struct ice_aqc_nvm_cfg nvm_cfg; struct ice_aqc_nvm_checksum nvm_checksum; + struct ice_aqc_nvm_sanitization sanitization; struct ice_aqc_pf_vf_msg virt; struct ice_aqc_read_write_alt_direct read_write_alt_direct; struct ice_aqc_read_write_alt_indirect read_write_alt_indirect; @@ -3095,6 +3242,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; + struct ice_aqc_neigh_dev_req neigh_dev; struct ice_aqc_add_txqs add_txqs; struct ice_aqc_dis_txqs dis_txqs; struct ice_aqc_move_txqs move_txqs; @@ -3330,6 +3478,7 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_update_empr = 0x0709, ice_aqc_opc_nvm_pkg_data = 0x070A, ice_aqc_opc_nvm_pass_component_tbl = 0x070B, + ice_aqc_opc_nvm_sanitization = 0x070C, /* PF/VF mailbox commands */ ice_mbx_opc_send_msg_to_pf = 0x0801, @@ -3360,6 +3509,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_rss_lut = 0x0B03, ice_aqc_opc_get_rss_key = 0x0B04, ice_aqc_opc_get_rss_lut = 0x0B05, + /* Sideband Control Interface commands */ + ice_aqc_opc_neighbour_device_request = 0x0C00, /* Tx queue handling commands/events */ ice_aqc_opc_add_txqs = 0x0C30, diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 499ee41228c3..c480900596f4 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -445,10 +445,10 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) * Note that this function assumes it is operating on a bitmap declared using * ice_declare_bitmap. */ -static inline int +static inline u16 ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) { - int count = 0; + u16 count = 0; u16 bit = 0; while (size > (bit = ice_find_next_bit(bm, size, bit))) { diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index ef487bcfd0f4..ad4ea4c8e7a1 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -32,7 +32,6 @@ #include "ice_common.h" #include "ice_sched.h" #include "ice_adminq_cmd.h" - #include "ice_flow.h" #include "ice_switch.h" @@ -111,6 +110,17 @@ static const char * const ice_link_mode_str_high[] = { ice_arr_elem_idx(2, "100G_CAUI2"), ice_arr_elem_idx(3, "100G_AUI2_AOC_ACC"), ice_arr_elem_idx(4, "100G_AUI2"), + ice_arr_elem_idx(5, "200G_CR4_PAM4"), + ice_arr_elem_idx(6, "200G_SR4"), + ice_arr_elem_idx(7, "200G_FR4"), + ice_arr_elem_idx(8, "200G_LR4"), + ice_arr_elem_idx(9, "200G_DR4"), + ice_arr_elem_idx(10, "200G_KR4_PAM4"), + ice_arr_elem_idx(11, "200G_AUI4_AOC_ACC"), + ice_arr_elem_idx(12, "200G_AUI4"), + ice_arr_elem_idx(13, "200G_AUI8_AOC_ACC"), + ice_arr_elem_idx(14, "200G_AUI8"), + ice_arr_elem_idx(15, "400GBASE_FR8"), }; /** @@ -151,7 +161,7 @@ ice_dump_phy_type(struct ice_hw *hw, u64 low, u64 high, const char *prefix) * This function sets the MAC type of the adapter based on the * vendor ID and device ID stored in the HW structure. */ -enum ice_status ice_set_mac_type(struct ice_hw *hw) +int ice_set_mac_type(struct ice_hw *hw) { ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -188,13 +198,43 @@ enum ice_status ice_set_mac_type(struct ice_hw *hw) case ICE_DEV_ID_E823C_SGMII: hw->mac_type = ICE_MAC_GENERIC; break; + case ICE_DEV_ID_E825C_BACKPLANE: + case ICE_DEV_ID_E825C_QSFP: + case ICE_DEV_ID_E825C_SFP: + case ICE_DEV_ID_E825C_SGMII: + hw->mac_type = ICE_MAC_GENERIC_3K_E825; + break; + case ICE_DEV_ID_E830_BACKPLANE: + case ICE_DEV_ID_E830_QSFP56: + case ICE_DEV_ID_E830_SFP: + case ICE_DEV_ID_E830C_BACKPLANE: + case ICE_DEV_ID_E830_L_BACKPLANE: + case ICE_DEV_ID_E830C_QSFP: + case ICE_DEV_ID_E830_L_QSFP: + case ICE_DEV_ID_E830C_SFP: + case ICE_DEV_ID_E830_L_SFP: + hw->mac_type = ICE_MAC_E830; + break; default: hw->mac_type = ICE_MAC_UNKNOWN; break; } ice_debug(hw, ICE_DBG_INIT, "mac_type: %d\n", hw->mac_type); - return ICE_SUCCESS; + return 0; +} + +/** + * ice_is_generic_mac + * @hw: pointer to the hardware structure + * + * returns true if mac_type is ICE_MAC_GENERIC, false if not + */ +bool ice_is_generic_mac(struct ice_hw *hw) +{ + return (hw->mac_type == ICE_MAC_GENERIC || + hw->mac_type == ICE_MAC_GENERIC_3K || + hw->mac_type == ICE_MAC_GENERIC_3K_E825); } /** @@ -223,7 +263,7 @@ bool ice_is_e810t(struct ice_hw *hw) case ICE_SUBDEV_ID_E810T2: case ICE_SUBDEV_ID_E810T3: case ICE_SUBDEV_ID_E810T4: - case ICE_SUBDEV_ID_E810T5: + case ICE_SUBDEV_ID_E810T6: case ICE_SUBDEV_ID_E810T7: return true; } @@ -231,8 +271,8 @@ bool ice_is_e810t(struct ice_hw *hw) case ICE_DEV_ID_E810C_QSFP: switch (hw->subsystem_device_id) { case ICE_SUBDEV_ID_E810T2: + case ICE_SUBDEV_ID_E810T3: case ICE_SUBDEV_ID_E810T5: - case ICE_SUBDEV_ID_E810T6: return true; } break; @@ -243,6 +283,17 @@ bool ice_is_e810t(struct ice_hw *hw) return false; } +/** + * ice_is_e830 + * @hw: pointer to the hardware structure + * + * returns true if the device is E830 based, false if not. + */ +bool ice_is_e830(struct ice_hw *hw) +{ + return hw->mac_type == ICE_MAC_E830; +} + /** * ice_is_e823 * @hw: pointer to the hardware structure @@ -268,6 +319,25 @@ bool ice_is_e823(struct ice_hw *hw) } } +/** + * ice_is_e825c + * @hw: pointer to the hardware structure + * + * returns true if the device is E825-C based, false if not. + */ +bool ice_is_e825c(struct ice_hw *hw) +{ + switch (hw->device_id) { + case ICE_DEV_ID_E825C_BACKPLANE: + case ICE_DEV_ID_E825C_QSFP: + case ICE_DEV_ID_E825C_SFP: + case ICE_DEV_ID_E825C_SGMII: + return true; + default: + return false; + } +} + /** * ice_clear_pf_cfg - Clear PF configuration * @hw: pointer to the hardware structure @@ -275,7 +345,7 @@ bool ice_is_e823(struct ice_hw *hw) * Clears any existing PF configuration (VSIs, VSI lists, switch rules, port * configuration, flow director filters, etc.). */ -enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) +int ice_clear_pf_cfg(struct ice_hw *hw) { struct ice_aq_desc desc; @@ -299,14 +369,14 @@ enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) * ice_discover_dev_caps is expected to be called before this function is * called. */ -enum ice_status +int ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, struct ice_sq_cd *cd) { struct ice_aqc_manage_mac_read_resp *resp; struct ice_aqc_manage_mac_read *cmd; struct ice_aq_desc desc; - enum ice_status status; + int status; u16 flags; u8 i; @@ -340,7 +410,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, ETH_ALEN, ICE_NONDMA_TO_NONDMA); break; } - return ICE_SUCCESS; + return 0; } /** @@ -401,16 +471,21 @@ static void ice_set_media_type(struct ice_port_info *pi) * type is FIBER */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, - ICE_MEDIA_OPT_PHY_TYPE_LOW_M, 0) || - (phy_type_low & ICE_MEDIA_OPT_PHY_TYPE_LOW_M && - phy_type_low & ICE_MEDIA_C2M_PHY_TYPE_LOW_M)) + ICE_MEDIA_OPT_PHY_TYPE_LOW_M, + ICE_MEDIA_OPT_PHY_TYPE_HIGH_M) || + ((phy_type_low & ICE_MEDIA_OPT_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_OPT_PHY_TYPE_HIGH_M) && + (phy_type_low & ICE_MEDIA_C2M_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) *media_type = ICE_MEDIA_FIBER; /* else if PHY types are only DA, or DA and C2C, then media type DA */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, - ICE_MEDIA_DAC_PHY_TYPE_LOW_M, 0) || - (phy_type_low & ICE_MEDIA_DAC_PHY_TYPE_LOW_M && - (phy_type_low & ICE_MEDIA_C2C_PHY_TYPE_LOW_M || - phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) + ICE_MEDIA_DAC_PHY_TYPE_LOW_M, + ICE_MEDIA_DAC_PHY_TYPE_HIGH_M) || + ((phy_type_low & ICE_MEDIA_DAC_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_DAC_PHY_TYPE_HIGH_M) && + (phy_type_low & ICE_MEDIA_C2C_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) *media_type = ICE_MEDIA_DA; /* else if PHY types are only C2M or only C2C, then media is AUI */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, @@ -435,7 +510,7 @@ static void ice_set_media_type(struct ice_port_info *pi) * * Returns the various PHY capabilities supported on the Port (0x0600) */ -enum ice_status +int ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, struct ice_aqc_get_phy_caps_data *pcaps, struct ice_sq_cd *cd) @@ -443,9 +518,9 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, struct ice_aqc_get_phy_caps *cmd; u16 pcaps_size = sizeof(*pcaps); struct ice_aq_desc desc; - enum ice_status status; const char *prefix; struct ice_hw *hw; + int status; cmd = &desc.params.get_phy; @@ -510,7 +585,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ice_debug(hw, ICE_DBG_LINK, "%s: module_type[2] = 0x%x\n", prefix, pcaps->module_type[2]); - if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { + if (!status && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, @@ -525,81 +600,65 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, } /** - * ice_aq_get_netlist_node - * @hw: pointer to the hw struct - * @cmd: get_link_topo AQ structure - * @node_part_number: output node part number if node found - * @node_handle: output node handle parameter if node found + * ice_aq_get_phy_equalization - function to read serdes equalizer value from + * firmware using admin queue command. + * @hw: pointer to the HW struct + * @data_in: represents the serdes equalization parameter requested + * @op_code: represents the serdes number and flag to represent tx or rx + * @serdes_num: represents the serdes number + * @output: pointer to the caller-supplied buffer to return serdes equalizer + * + * Returns 0 on success, + * non-zero status on error */ -enum ice_status -ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, - u8 *node_part_number, u16 *node_handle) +int ice_aq_get_phy_equalization(struct ice_hw *hw, u16 data_in, u16 op_code, + u8 serdes_num, int *output) { + struct ice_aqc_dnl_call_command *cmd; + struct ice_aqc_dnl_call buf; struct ice_aq_desc desc; + int err = 0; - ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); - desc.params.get_link_topo = *cmd; + if (!hw || !output) + return (ICE_ERR_PARAM); - if (ice_aq_send_cmd(hw, &desc, NULL, 0, NULL)) - return ICE_ERR_NOT_SUPPORTED; + memset(&buf, 0, sizeof(buf)); + buf.sto.txrx_equa_reqs.data_in = CPU_TO_LE16(data_in); + buf.sto.txrx_equa_reqs.op_code_serdes_sel = + CPU_TO_LE16(op_code | (serdes_num & 0xF)); - if (node_handle) - *node_handle = - LE16_TO_CPU(desc.params.get_link_topo.addr.handle); - if (node_part_number) - *node_part_number = desc.params.get_link_topo.node_part_num; + cmd = &desc.params.dnl_call; + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_dnl_call); + desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_BUF | ICE_AQ_FLAG_RD | + ICE_AQ_FLAG_SI); + desc.datalen = CPU_TO_LE16(sizeof(struct ice_aqc_dnl_call)); + cmd->activity_id = CPU_TO_LE16(ICE_AQC_ACT_ID_DNL); + cmd->ctx = 0; - return ICE_SUCCESS; + err = ice_aq_send_cmd(hw, &desc, &buf, + sizeof(struct ice_aqc_dnl_call), NULL); + if (!err) + *output = buf.sto.txrx_equa_resp.val; + + return err; } -#define MAX_NETLIST_SIZE 10 +#define ice_get_link_status_data_ver(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + ICE_GET_LINK_STATUS_DATA_V2 : ICE_GET_LINK_STATUS_DATA_V1) + /** - * ice_find_netlist_node - * @hw: pointer to the hw struct - * @node_type_ctx: type of netlist node to look for - * @node_part_number: node part number to look for - * @node_handle: output parameter if node found - optional + * ice_get_link_status_datalen + * @hw: pointer to the HW struct * - * Find and return the node handle for a given node type and part number in the - * netlist. When found ICE_SUCCESS is returned, ICE_ERR_DOES_NOT_EXIST - * otherwise. If node_handle provided, it would be set to found node handle. + * return Get Link Status datalen */ -enum ice_status -ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, - u16 *node_handle) +static u16 ice_get_link_status_datalen(struct ice_hw *hw) { - struct ice_aqc_get_link_topo cmd; - u8 rec_node_part_number; - u16 rec_node_handle; - u8 idx; - - for (idx = 0; idx < MAX_NETLIST_SIZE; idx++) { - enum ice_status status; - - memset(&cmd, 0, sizeof(cmd)); - - cmd.addr.topo_params.node_type_ctx = - (node_type_ctx << ICE_AQC_LINK_TOPO_NODE_TYPE_S); - cmd.addr.topo_params.index = idx; - - status = ice_aq_get_netlist_node(hw, &cmd, - &rec_node_part_number, - &rec_node_handle); - if (status) - return status; - - if (rec_node_part_number == node_part_number) { - if (node_handle) - *node_handle = rec_node_handle; - return ICE_SUCCESS; - } - } - - return ICE_ERR_DOES_NOT_EXIST; + return (ice_get_link_status_data_ver(hw) == + ICE_GET_LINK_STATUS_DATA_V1) ? ICE_GET_LINK_STATUS_DATALEN_V1 : + ICE_GET_LINK_STATUS_DATALEN_V2; } -#define ice_get_link_status_datalen(hw) ICE_GET_LINK_STATUS_DATALEN_V1 - /** * ice_aq_get_link_info * @pi: port information structure @@ -609,7 +668,7 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, * * Get Link Status (0x607). Returns the link status of the adapter. */ -enum ice_status +int ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, struct ice_link_status *link, struct ice_sq_cd *cd) { @@ -619,9 +678,9 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, struct ice_fc_info *hw_fc_info; bool tx_pause, rx_pause; struct ice_aq_desc desc; - enum ice_status status; struct ice_hw *hw; u16 cmd_flags; + int status; if (!pi) return ICE_ERR_PARAM; @@ -639,7 +698,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, status = ice_aq_send_cmd(hw, &desc, &link_data, ice_get_link_status_datalen(hw), cd); - if (status != ICE_SUCCESS) + if (status) return status; /* save off old link status information */ @@ -696,7 +755,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, /* flag cleared so calling functions don't call AQ again */ pi->phy.get_link_info = false; - return ICE_SUCCESS; + return 0; } /** @@ -721,17 +780,28 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, * Also, because we are operating on transmit timer and fc * threshold of LFC, we don't turn on any bit in tx_tmr_priority */ -#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX +#define E800_IDX_OF_LFC E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX - /* Retrieve the transmit timer */ - val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); - tx_timer_val = val & - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; - cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + if ((hw)->mac_type == ICE_MAC_E830) { + /* Retrieve the transmit timer */ + val = rd32(hw, E830_PRTMAC_CL01_PAUSE_QUANTA); + tx_timer_val = val & E830_PRTMAC_CL01_PAUSE_QUANTA_CL0_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); - /* Retrieve the fc threshold */ - val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); - fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + /* Retrieve the fc threshold */ + val = rd32(hw, E830_PRTMAC_CL01_QUANTA_THRESH); + fc_thres_val = val & E830_PRTMAC_CL01_QUANTA_THRESH_CL0_QUANTA_THRESH_M; + } else { + /* Retrieve the transmit timer */ + val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(E800_IDX_OF_LFC)); + tx_timer_val = val & + E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + + /* Retrieve the fc threshold */ + val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(E800_IDX_OF_LFC)); + fc_thres_val = val & E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + } cmd->fc_refresh_threshold = CPU_TO_LE16(fc_thres_val); } @@ -745,7 +815,7 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, * * Set MAC configuration (0x0603) */ -enum ice_status +int ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, bool auto_drop, struct ice_sq_cd *cd) { @@ -772,10 +842,10 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, bool auto_drop, * ice_init_fltr_mgmt_struct - initializes filter management list and locks * @hw: pointer to the HW struct */ -static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) +int ice_init_fltr_mgmt_struct(struct ice_hw *hw) { struct ice_switch_info *sw; - enum ice_status status; + int status; hw->switch_info = (struct ice_switch_info *) ice_malloc(hw, sizeof(*hw->switch_info)); @@ -793,7 +863,7 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) ice_free(hw, hw->switch_info); return status; } - return ICE_SUCCESS; + return 0; } /** @@ -866,7 +936,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) * ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks * @hw: pointer to the HW struct */ -static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) +void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) { ice_cleanup_fltr_mgmt_single(hw, hw->switch_info); } @@ -911,7 +981,7 @@ void ice_print_rollback_msg(struct ice_hw *hw) orom = &hw->flash.orom; nvm = &hw->flash.nvm; - SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", + (void)SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", nvm->major, nvm->minor, nvm->eetrack, orom->major, orom->build, orom->patch); ice_warn(hw, @@ -934,12 +1004,12 @@ void ice_set_umac_shared(struct ice_hw *hw) * ice_init_hw - main hardware initialization routine * @hw: pointer to the hardware structure */ -enum ice_status ice_init_hw(struct ice_hw *hw) +int ice_init_hw(struct ice_hw *hw) { struct ice_aqc_get_phy_caps_data *pcaps; - enum ice_status status; u16 mac_buf_len; void *mac_buf; + int status; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -957,6 +1027,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) return status; ice_get_itr_intrl_gran(hw); + hw->fw_vsi_num = ICE_DFLT_VSI_INVAL; + status = ice_create_all_ctrlq(hw); if (status) goto err_unroll_cqinit; @@ -987,9 +1059,11 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (ice_get_fw_mode(hw) == ICE_FW_MODE_ROLLBACK) ice_print_rollback_msg(hw); - status = ice_clear_pf_cfg(hw); - if (status) - goto err_unroll_cqinit; + if (!hw->skip_clear_pf) { + status = ice_clear_pf_cfg(hw); + if (status) + goto err_unroll_cqinit; + } ice_clear_pxe_mode(hw); @@ -1005,6 +1079,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) goto err_unroll_cqinit; } + hw->port_info->loopback_mode = ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL; + /* set the back pointer to HW */ hw->port_info->hw = hw; @@ -1088,7 +1164,7 @@ enum ice_status ice_init_hw(struct ice_hw *hw) goto err_unroll_fltr_mgmt_struct; ice_init_lock(&hw->tnl_lock); - return ICE_SUCCESS; + return 0; err_unroll_fltr_mgmt_struct: ice_cleanup_fltr_mgmt_struct(hw); @@ -1135,7 +1211,7 @@ void ice_deinit_hw(struct ice_hw *hw) * ice_check_reset - Check to see if a global reset is complete * @hw: pointer to the hardware structure */ -enum ice_status ice_check_reset(struct ice_hw *hw) +int ice_check_reset(struct ice_hw *hw) { u32 cnt, reg = 0, grst_timeout, uld_mask, reset_wait_cnt; @@ -1187,7 +1263,7 @@ enum ice_status ice_check_reset(struct ice_hw *hw) *** 16782 LINES SKIPPED *** From nobody Mon Oct 28 23:17:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcq6v6z6qz5bvKh; Mon, 28 Oct 2024 23:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcq6v61qZz591P; Mon, 28 Oct 2024 23:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ia7Aoy964MSSY0qBNB97Tl6pu97LFCUxOH4BUj8JWp4=; b=CzmZgDbEk4VKgwM37wuxFUPjU9Aj5cqMTOGKPpYXNsG20yOzPT1axIQTQLAvaHGll4XE9O UQkf2gJy+30ULkjKgVJrU315iLFnuhmqKGWsI83WL8Urrvw3/hJguIdt+7md8GulOej5EN WuznxWZa+LMrVkJu0P7LmYDVi3tK1wSPp3oeQeEy3uvKjIyRq41pClKPkezdyhO2jwlbQQ T847PFT8N6heXO+KyG4GvU1nF+6mEHrxbVctVmYW7Yw8u/FeUQt42QZcO8yF0/zzgRMg6D p5A1KLqRXDNb9TXsliL6gyWTFluYj+6xKC/WgY0fs7FJwn5c7DrEGR5deVvGrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ia7Aoy964MSSY0qBNB97Tl6pu97LFCUxOH4BUj8JWp4=; b=gEBHLSgkxaULQMwBhXkURevZrw9Y5OJTR+dgWkaAhKOjvz7ravyYP3vMAe/Vlthn2E9zbJ +Cgq6lMFEJAfwhzD68OlC5Vy0pdYOjUnHCWExNfCLm/IXg1FwnaNEPxDOzAJzCoBhICXIh wfW+WvHO3jbc8IbveA3dDTO2C1JCtZRi7hjtg8GIZ/3V5Mu/lw5jBxsU+vkTFZ0y6WEgLa oXobOoPC4SBhvpBPcKUNaC9OM2H+GfRIN1ZTNCvnT2iNl1+BZqv2iBwdxbpi1y80ZmwkTR eJFYWHjDNCQDNK3AH8Uv8wvKEl7xpH0U9cK9uPtfu6PKFX3m/B0A8qtC+VqqBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730157463; a=rsa-sha256; cv=none; b=BC2Cpbn56oWiDsnbkhXQchwPPVUVxd40iYH3n+gUrorBb2DZwG6j4Gb3qIii58vyP3aR/J fX9riT1YC8B6d9fDwW0lP3eexKHek2D5XjD/ZJRT4x9LlHBhW8oaAx8mbCoLDJ51U/LOFZ 45T/VqyWTSzrP9xjHeRylXOqdZmKeW8zeOSM5Kmz8B61mnwfawi0MfLTc3lhCOdHIya5ei 3WcQWzx6J66+tGkB3zD5wNSaFqpbttBAg9e7rJFsVmjbn/N5lUUYG7iVgJfUcbnyWkA98t /z+q3ZbE2VMTQ+jJHBMDCchOVnqhmjSb9w9F1CLhlZLPD7a7BrM0W7fgCMCLPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcq6v5Y5nzyyr; Mon, 28 Oct 2024 23:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SNHhi7043657; Mon, 28 Oct 2024 23:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SNHhYA043654; Mon, 28 Oct 2024 23:17:43 GMT (envelope-from git) Date: Mon, 28 Oct 2024 23:17:43 GMT Message-Id: <202410282317.49SNHhYA043654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 440addc64249 - main - ice: Update to 1.42.5-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 440addc642496f8d04fe17af9eb905ac4a5bdbd8 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=440addc642496f8d04fe17af9eb905ac4a5bdbd8 commit 440addc642496f8d04fe17af9eb905ac4a5bdbd8 Author: Eric Joyner AuthorDate: 2024-08-30 00:28:59 +0000 Commit: Eric Joyner CommitDate: 2024-10-28 23:17:18 +0000 ice: Update to 1.42.5-k - Removes duplicate E825C printout - Fixes a package download issue with E830 - Updates mentions of E830-XXV to E830-L - Fix FW logging on load issue by limiting the setting of FW log masks and other global configuration to just the first PF of the controller - Update ice_hw_autogen.h with timesync registers (unused in this driver) - Fix possible overflow condition in NVM access function - Blocks RDMA load on E830 devices Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper MFC after: 2 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46950 --- sys/dev/ice/ice_ddp_common.c | 31 +++++++++++++++++--- sys/dev/ice/ice_ddp_common.h | 5 +++- sys/dev/ice/ice_devids.h | 12 ++++---- sys/dev/ice/ice_drv_info.h | 20 ++++++------- sys/dev/ice/ice_fw_logging.c | 69 +++++++++++++++++++++++--------------------- sys/dev/ice/ice_hw_autogen.h | 14 +++++++++ sys/dev/ice/ice_lib.c | 38 ------------------------ sys/dev/ice/ice_lib.h | 1 - sys/dev/ice/ice_nvm.c | 36 +++++++++++++++-------- sys/dev/ice/if_ice_iflib.c | 9 +++--- 10 files changed, 126 insertions(+), 109 deletions(-) diff --git a/sys/dev/ice/ice_ddp_common.c b/sys/dev/ice/ice_ddp_common.c index 87ecdad5e7bf..dfc50cc1f966 100644 --- a/sys/dev/ice/ice_ddp_common.c +++ b/sys/dev/ice/ice_ddp_common.c @@ -526,12 +526,13 @@ ice_download_pkg_sig_seg(struct ice_hw *hw, struct ice_sign_seg *seg) * @idx: segment index * @start: starting buffer * @count: buffer count + * @last_seg: last segment being downloaded * * Note: idx must reference a ICE segment */ static enum ice_ddp_state ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, - u32 idx, u32 start, u32 count) + u32 idx, u32 start, u32 count, bool last_seg) { struct ice_buf_table *bufs; enum ice_ddp_state state; @@ -549,7 +550,7 @@ ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, return ICE_DDP_PKG_ERR; state = ice_dwnld_cfg_bufs_no_lock(hw, bufs->buf_array, start, count, - true); + last_seg); return state; } @@ -568,9 +569,11 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, { enum ice_ddp_state state; struct ice_sign_seg *seg; + bool last_seg = true; u32 conf_idx; u32 start; u32 count; + u32 flags; seg = (struct ice_sign_seg *)ice_get_pkg_seg_by_idx(pkg_hdr, idx); if (!seg) { @@ -581,6 +584,10 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, conf_idx = LE32_TO_CPU(seg->signed_seg_idx); start = LE32_TO_CPU(seg->signed_buf_start); count = LE32_TO_CPU(seg->signed_buf_count); + flags = LE32_TO_CPU(seg->flags); + + if (flags & ICE_SIGN_SEG_FLAGS_VALID) + last_seg = !!(flags & ICE_SIGN_SEG_FLAGS_LAST); state = ice_download_pkg_sig_seg(hw, seg); if (state) @@ -595,7 +602,7 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, } state = ice_download_pkg_config_seg(hw, pkg_hdr, conf_idx, start, - count); + count, last_seg); exit: return state; @@ -2321,6 +2328,22 @@ void ice_release_change_lock(struct ice_hw *hw) ice_release_res(hw, ICE_CHANGE_LOCK_RES_ID); } +/** + * ice_is_get_tx_sched_new_format + * @hw: pointer to the HW struct + * + * Determines if the new format for the Tx scheduler get api is supported + */ +static bool +ice_is_get_tx_sched_new_format(struct ice_hw *hw) +{ + if (ice_is_e830(hw)) + return true; + if (ice_is_e825c(hw)) + return true; + return false; +} + /** * ice_get_set_tx_topo - get or set tx topology * @hw: pointer to the HW struct @@ -2354,7 +2377,7 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo); cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM; - if (!ice_is_e830(hw)) + if (!ice_is_get_tx_sched_new_format(hw)) desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); } diff --git a/sys/dev/ice/ice_ddp_common.h b/sys/dev/ice/ice_ddp_common.h index b7dae1f526f0..a7b717c3e15e 100644 --- a/sys/dev/ice/ice_ddp_common.h +++ b/sys/dev/ice/ice_ddp_common.h @@ -204,7 +204,10 @@ struct ice_sign_seg { __le32 signed_seg_idx; __le32 signed_buf_start; __le32 signed_buf_count; -#define ICE_SIGN_SEG_RESERVED_COUNT 44 +#define ICE_SIGN_SEG_FLAGS_VALID 0x80000000 +#define ICE_SIGN_SEG_FLAGS_LAST 0x00000001 + __le32 flags; +#define ICE_SIGN_SEG_RESERVED_COUNT 40 u8 reserved[ICE_SIGN_SEG_RESERVED_COUNT]; struct ice_buf_table buf_tbl; }; diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index 396f59b9d6d9..9b142a1110b2 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -52,16 +52,16 @@ #define ICE_DEV_ID_E830_SFP 0x12D3 /* Intel(R) Ethernet Controller E830-C for backplane */ #define ICE_DEV_ID_E830C_BACKPLANE 0x12D5 -/* Intel(R) Ethernet Controller E830-XXV for backplane */ -#define ICE_DEV_ID_E830_XXV_BACKPLANE 0x12DC +/* Intel(R) Ethernet Controller E830-L for backplane */ +#define ICE_DEV_ID_E830_L_BACKPLANE 0x12DC /* Intel(R) Ethernet Controller E830-C for QSFP */ #define ICE_DEV_ID_E830C_QSFP 0x12D8 -/* Intel(R) Ethernet Controller E830-XXV for QSFP */ -#define ICE_DEV_ID_E830_XXV_QSFP 0x12DD +/* Intel(R) Ethernet Controller E830-L for QSFP */ +#define ICE_DEV_ID_E830_L_QSFP 0x12DD /* Intel(R) Ethernet Controller E830-C for SFP */ #define ICE_DEV_ID_E830C_SFP 0x12DA -/* Intel(R) Ethernet Controller E830-XXV for SFP */ -#define ICE_DEV_ID_E830_XXV_SFP 0x12DE +/* Intel(R) Ethernet Controller E830-L for SFP */ +#define ICE_DEV_ID_E830_L_SFP 0x12DE /* Intel(R) Ethernet Controller E810-C for backplane */ #define ICE_DEV_ID_E810C_BACKPLANE 0x1591 /* Intel(R) Ethernet Controller E810-C for QSFP */ diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 6f4d5f05edd0..22e23ee53491 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.42.1-k"; +const char ice_driver_version[] = "1.42.5-k"; const uint8_t ice_major_version = 1; const uint8_t ice_minor_version = 42; -const uint8_t ice_patch_version = 1; +const uint8_t ice_patch_version = 5; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.42.1-k") + PVID(vendor, devid, name " - 1.42.5-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.1-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.5-k") /** * @var ice_vendor_info_array @@ -217,12 +217,12 @@ static const pci_vendor_info_t ice_vendor_info_array[] = { "Intel(R) Ethernet Connection E830-C for QSFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_SFP, "Intel(R) Ethernet Connection E830-C for SFP"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_BACKPLANE, - "Intel(R) Ethernet Connection E830-XXV for backplane"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_QSFP, - "Intel(R) Ethernet Connection E830-XXV for QSFP"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_SFP, - "Intel(R) Ethernet Connection E830-XXV for SFP"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_BACKPLANE, + "Intel(R) Ethernet Connection E830-L for backplane"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_QSFP, + "Intel(R) Ethernet Connection E830-L for QSFP"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_SFP, + "Intel(R) Ethernet Connection E830-L for SFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_BACKPLANE, "Intel(R) Ethernet Connection E825-C for backplane"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_QSFP, diff --git a/sys/dev/ice/ice_fw_logging.c b/sys/dev/ice/ice_fw_logging.c index 8e52e34b2752..0025a65d73fc 100644 --- a/sys/dev/ice/ice_fw_logging.c +++ b/sys/dev/ice/ice_fw_logging.c @@ -359,23 +359,6 @@ ice_add_fw_logging_tunables(struct ice_softc *sc, struct sysctl_oid *parent) "Firmware Logging"); fwlog_list = SYSCTL_CHILDREN(fwlog_node); - cfg->log_resolution = 10; - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "log_resolution", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - 0, ice_sysctl_fwlog_log_resolution, - "CU", ICE_SYSCTL_HELP_FWLOG_LOG_RESOLUTION); - - cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "arq_en", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - ICE_FWLOG_OPTION_ARQ_ENA, ice_sysctl_fwlog_set_cfg_options, - "CU", ICE_SYSCTL_HELP_FWLOG_ARQ_ENA); - - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "uart_en", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - ICE_FWLOG_OPTION_UART_ENA, ice_sysctl_fwlog_set_cfg_options, - "CU", ICE_SYSCTL_HELP_FWLOG_UART_ENA); - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "on_load", ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, ICE_FWLOG_OPTION_REGISTER_ON_INIT, ice_sysctl_fwlog_set_cfg_options, @@ -386,23 +369,43 @@ ice_add_fw_logging_tunables(struct ice_softc *sc, struct sysctl_oid *parent) 0, ice_sysctl_fwlog_register, "CU", ICE_SYSCTL_HELP_FWLOG_REGISTER); - module_node = SYSCTL_ADD_NODE(ctx, fwlog_list, OID_AUTO, "severity", - ICE_CTLFLAG_DEBUG | CTLFLAG_RD, NULL, - "Level of log output"); - - module_list = SYSCTL_CHILDREN(module_node); - - for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { - /* Setup some defaults */ - cfg->module_entries[i].module_id = i; - cfg->module_entries[i].log_level = ICE_FWLOG_LEVEL_NONE; - module = (enum ice_aqc_fw_logging_mod)i; + hw->pf_id = ice_get_pf_id(hw); + if (hw->pf_id == 0) { + module_node = SYSCTL_ADD_NODE(ctx, fwlog_list, OID_AUTO, "severity", + ICE_CTLFLAG_DEBUG | CTLFLAG_RD, NULL, + "Level of log output"); + + module_list = SYSCTL_CHILDREN(module_node); + + for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { + /* Setup some defaults */ + cfg->module_entries[i].module_id = i; + cfg->module_entries[i].log_level = ICE_FWLOG_LEVEL_NONE; + module = (enum ice_aqc_fw_logging_mod)i; + + SYSCTL_ADD_PROC(ctx, module_list, + OID_AUTO, ice_fw_module_str(module), + ICE_CTLFLAG_DEBUG | CTLTYPE_STRING | CTLFLAG_RWTUN, sc, + module, ice_sysctl_fwlog_module_log_severity, + "A", ICE_SYSCTL_HELP_FWLOG_MODULE_SEVERITY); + } - SYSCTL_ADD_PROC(ctx, module_list, - OID_AUTO, ice_fw_module_str(module), - ICE_CTLFLAG_DEBUG | CTLTYPE_STRING | CTLFLAG_RWTUN, sc, - module, ice_sysctl_fwlog_module_log_severity, - "A", ICE_SYSCTL_HELP_FWLOG_MODULE_SEVERITY); + cfg->log_resolution = 10; + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "log_resolution", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + 0, ice_sysctl_fwlog_log_resolution, + "CU", ICE_SYSCTL_HELP_FWLOG_LOG_RESOLUTION); + + cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "arq_en", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + ICE_FWLOG_OPTION_ARQ_ENA, ice_sysctl_fwlog_set_cfg_options, + "CU", ICE_SYSCTL_HELP_FWLOG_ARQ_ENA); + + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "uart_en", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + ICE_FWLOG_OPTION_UART_ENA, ice_sysctl_fwlog_set_cfg_options, + "CU", ICE_SYSCTL_HELP_FWLOG_UART_ENA); } } diff --git a/sys/dev/ice/ice_hw_autogen.h b/sys/dev/ice/ice_hw_autogen.h index 47256263d66c..3f2778d91a4b 100644 --- a/sys/dev/ice/ice_hw_autogen.h +++ b/sys/dev/ice/ice_hw_autogen.h @@ -40,6 +40,20 @@ #define PRTMAC_CTL_RX_PAUSE_ENABLE_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE) #define PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_S_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_S : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE_HSEC_CTL_RX_PAUSE_ENABLE_S) #define PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_M_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_M : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE_HSEC_CTL_RX_PAUSE_ENABLE_M) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE(_i) (0x000FD000 + ((_i) * 64)) /* _i=0...7 */ /* Reset Source: CORER */ +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_MAX_INDEX 7 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_START_S 0 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_START_M MAKEMASK(0x3F, 0) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_END_S 6 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_END_M MAKEMASK(0x3F, 6) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_TYPE_S 12 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_TYPE_M MAKEMASK(0x3, 12) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_NUM_S 14 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_NUM_M MAKEMASK(0x3FF, 14) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_PF_NUM_S 24 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_PF_NUM_M MAKEMASK(0x7, 24) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_ENABLE_S 31 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_ENABLE_M BIT(31) #define GL_HIDA(_i) (0x00082000 + ((_i) * 4)) #define GL_HIBA(_i) (0x00081000 + ((_i) * 4)) #define GL_HICR 0x00082040 diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index ef55df061f3c..d2d13cd2db60 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -11875,44 +11875,6 @@ ice_sysctl_allow_no_fec_mod_in_auto(SYSCTL_HANDLER_ARGS) return (0); } -/** - * ice_print_dual_nac_info - Print NAC status/ID information - * @sc: device softc structure - * - * Prints out information about the NAC mode if the device is capable of - * being part of a system with multiple NACs. - * - * @pre Must be called after ice_init_hw() and ice_init_device_features() - * sometime during driver load. - */ -void -ice_print_dual_nac_info(struct ice_softc *sc) -{ - struct ice_hw *hw = &sc->hw; - device_t dev = sc->dev; - bool is_dual_nac, is_primary_nac; - u8 cpk_id; - - is_dual_nac = (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M); - is_primary_nac = (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M); - cpk_id = hw->dev_caps.nac_topo.id; - - if (ice_is_bit_set(sc->feat_cap, ICE_FEATURE_DUAL_NAC)) { - log(LOG_INFO, "%s: In %s NAC mode\n", - device_get_nameunit(dev), - is_dual_nac ? "Dual" : "Single"); - - if (is_dual_nac) { - ice_set_bit(ICE_FEATURE_DUAL_NAC, sc->feat_en); - log(LOG_INFO, - "%s: PF is configured in %s mode with IP instance ID %u\n", - device_get_nameunit(dev), - is_primary_nac ? "primary" : "secondary", - cpk_id); - } - } -} - /** * ice_sysctl_temperature - Retrieve NIC temp via AQ command * @oidp: sysctl oid structure diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index b524db61403c..afc03ebd3b51 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -1010,7 +1010,6 @@ void ice_init_health_events(struct ice_softc *sc); void ice_cfg_pba_num(struct ice_softc *sc); int ice_handle_debug_dump_ioctl(struct ice_softc *sc, struct ifdrv *ifd); u8 ice_dcb_get_tc_map(const struct ice_dcbx_cfg *dcbcfg); -void ice_print_dual_nac_info(struct ice_softc *sc); void ice_do_dcb_reconfig(struct ice_softc *sc, bool pending_mib); int ice_setup_vsi_mirroring(struct ice_vsi *vsi); diff --git a/sys/dev/ice/ice_nvm.c b/sys/dev/ice/ice_nvm.c index 9a41f30386c0..ff30adfe8fa7 100644 --- a/sys/dev/ice/ice_nvm.c +++ b/sys/dev/ice/ice_nvm.c @@ -711,6 +711,8 @@ int ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data) return status; } +#define check_add_overflow __builtin_add_overflow + /** * ice_get_pfa_module_tlv - Reads sub module TLV from NVM PFA * @hw: pointer to hardware structure @@ -726,8 +728,7 @@ int ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, u16 module_type) { - u16 pfa_len, pfa_ptr; - u32 next_tlv; + u16 pfa_len, pfa_ptr, next_tlv, max_tlv; int status; status = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr); @@ -740,11 +741,23 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, ice_debug(hw, ICE_DBG_INIT, "Failed to read PFA length.\n"); return status; } - /* Starting with first TLV after PFA length, iterate through the list + + if (check_add_overflow(pfa_ptr, (u16)(pfa_len - 1), &max_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "PFA starts at offset %u. PFA length of %u caused 16-bit arithmetic overflow.\n", + pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } + + /* The Preserved Fields Area contains a sequence of TLVs which define + * its contents. The PFA length includes all of the TLVs, plus its + * initial length word itself, *and* one final word at the end of all + * of the TLVs. + * + * Starting with first TLV after PFA length, iterate through the list * of TLVs to find the requested one. */ next_tlv = pfa_ptr + 1; - while (next_tlv < ((u32)pfa_ptr + pfa_len)) { + while (next_tlv < max_tlv) { u16 tlv_sub_module_type; u16 tlv_len; @@ -761,10 +774,6 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV length.\n"); break; } - if (tlv_len > pfa_len) { - ice_debug(hw, ICE_DBG_INIT, "Invalid TLV length.\n"); - return ICE_ERR_INVAL_SIZE; - } if (tlv_sub_module_type == module_type) { if (tlv_len) { *module_tlv = (u16)next_tlv; @@ -773,10 +782,13 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, } return ICE_ERR_INVAL_SIZE; } - /* Check next TLV, i.e. current TLV pointer + length + 2 words - * (for current TLV's type and length) - */ - next_tlv = next_tlv + tlv_len + 2; + + if (check_add_overflow(next_tlv, (u16)2, &next_tlv) || + check_add_overflow(next_tlv, tlv_len, &next_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "TLV of type %u and length 0x%04x caused 16-bit arithmetic overflow. The PFA starts at 0x%04x and has length of 0x%04x\n", + tlv_sub_module_type, tlv_len, pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } } /* Module does not exist */ return ICE_ERR_DOES_NOT_EXIST; diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 65690ea7e429..0fb7faecb2d7 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -539,8 +539,6 @@ reinit_hw: ice_init_device_features(sc); - ice_print_dual_nac_info(sc); - /* Keep flag set by default */ ice_set_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN); @@ -2605,7 +2603,9 @@ ice_rebuild(struct ice_softc *sc) } /* Re-enable FW logging. Keep going even if this fails */ - status = ice_fwlog_set(hw, &hw->fwlog_cfg); + status = ICE_SUCCESS; + if (hw->pf_id == 0) + status = ice_fwlog_set(hw, &hw->fwlog_cfg); if (!status) { /* * We should have the most updated cached copy of the @@ -2901,7 +2901,8 @@ ice_init_device_features(struct ice_softc *sc) /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); - if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma) + if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma || + ice_is_e830(hw)) ice_clear_bit(ICE_FEATURE_RDMA, sc->feat_cap); if (!hw->func_caps.common_cap.dcb) ice_clear_bit(ICE_FEATURE_DCB, sc->feat_cap); From nobody Mon Oct 28 23:17:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcq6x2ZXmz5bvDX; Mon, 28 Oct 2024 23:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcq6x0Nfsz591T; Mon, 28 Oct 2024 23:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSXQdtJk8vKbNu/93xaeLPxG7j/PN9/e+WmOZWJozT4=; b=WJFhnl5ufCTLS6ctO3tjqRKDr2C4aJblSsGj4VokuaebO0yIfknWVkZ6JkBQBa5TWDBzYJ 7AR8dZTKen0QLNCP33Jlb9L4mBLHdwCHlw7Cnr5EQlxvSTogeIf7QqeeavWyK32OeJaunF KIc1coYUNvmvnNfLEfanKZ3VlSI31/acNEog/7umW6dHmzG2oTxpL+tBtFFQmguG3mUtmG AD49OjBxC+wC3jdTnJDkdpB9Qttn2S3nmmyh+ewaVm4QV6QmVqTejBnM5SZkWH+jt3MvRa QfKacBCQdX8ViNv6H20sDhp1Vxi2fBmE1silJ6xXqcarePlCi5nq5oiZgsloPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730157465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kSXQdtJk8vKbNu/93xaeLPxG7j/PN9/e+WmOZWJozT4=; b=LCmW4S/FEv53FTeRQqAAsxUp3wh4rYRPqRid+ZpDaEKT621uhBTgRmGhcRGGXnfncq3XoL oC0iiENjCyS9jtAvaGu+KurDESwkWYIL0ve7SxIhv14KrJAT89AWqoThBNJe1MJxuYpjD9 bD64OGIMtBj6SIcl5gpvEYTxBn8uiUDpOSBkQ7KEJUSBqjTQHu/kKYf7hnftEuIkQbf3Ec UaMqPMScX6cmuh+zZ4iv3FG69l4oLIcDkcDXGMzDV8KBSresDF4zVqK73WdSSelGZjuNtU J1zLvzFHz/zi2Suf/ktE1idhwgAEtcbFuoSOo0bQYlMqEnCUMm8RJUmor6aMTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730157465; a=rsa-sha256; cv=none; b=a5ONGYRUvECD9EWoYefd4LgAZuYAHJ98zBuYqs3APGhELSAdIukteBSvHALcGIGfD2m4f9 Kmh7g/GBhepUjhlZ/4srI6xlPTDi6MYh2Pv+q1ISZkTxRBGT2LmizRuqPacRyEb+V2SMdA QupTkCk1N/BFqqV2w8uiRL8WVkQ7OEZHmfOjukxtPujISZTIcEx1t9edn9yk0kscxWQMgi 7PI62hhvzTQEQh140bjfCy1ZYxypQ7aNFsuv0kTjrmnnles+JE4SfvLjrsq8cRTUCJYPZg Rzn/Cgw4IjG2J2RZ4KzHVccF+3QUYkcdqPYp8xuVHG7CsK14/F1fWV6TV2cmag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcq6w6bdTzySB; Mon, 28 Oct 2024 23:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SNHiLv043696; Mon, 28 Oct 2024 23:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SNHiuS043693; Mon, 28 Oct 2024 23:17:44 GMT (envelope-from git) Date: Mon, 28 Oct 2024 23:17:44 GMT Message-Id: <202410282317.49SNHiuS043693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: f377a0c7dfa9 - main - ice: Update to 1.43.2-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f377a0c7dfa97035844e58c2aec810001bebce17 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=f377a0c7dfa97035844e58c2aec810001bebce17 commit f377a0c7dfa97035844e58c2aec810001bebce17 Author: Eric Joyner AuthorDate: 2024-09-19 22:58:40 +0000 Commit: Eric Joyner CommitDate: 2024-10-28 23:17:19 +0000 ice: Update to 1.43.2-k - Add extra time while waiting for an EMPR to finish on E830 and E825C devices - Fix debug mask sysctl help message - Handle EAGAIN error messages from the Get Link Status AQ command by retrying them several times - Handle the condition where E830 extended temperature SKUs can have the chip initialize without the PHY subsystem being ready due to very low temperatures; the driver will print out a message when this happens - Fix inability to set link speed using the advertise_speed sysctl when link is down and the link_active_on_if_down sysctl is set to 0 - Fix issue where VLANs would not properly be set back up after a hardware reset (e.g. PF reset) (Thanks jacob.e.keller@intel.com) Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper MFC after: 2 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46951 --- sys/dev/ice/ice_controlq.c | 23 ++++++++++++-- sys/dev/ice/ice_drv_info.h | 10 +++--- sys/dev/ice/ice_lib.c | 37 +++++++++++++++------- sys/dev/ice/ice_lib.h | 11 +++++++ sys/dev/ice/ice_strings.c | 2 ++ sys/dev/ice/ice_switch.c | 2 -- sys/dev/ice/if_ice_iflib.c | 79 ++++++++++++++++++++++++++++++++++++---------- 7 files changed, 128 insertions(+), 36 deletions(-) diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index e96c7e230310..e1a6b0fb5662 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -879,16 +879,35 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) struct ice_ctl_q_ring *sq = &cq->sq; u16 ntc = sq->next_to_clean; struct ice_aq_desc *desc; + u32 head; desc = ICE_CTL_Q_DESC(*sq, ntc); - while (rd32(hw, cq->sq.head) != ntc) { - ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head)); + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } + + while (head != ntc) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "ntc %d head %d.\n", + ntc, head); ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM); ntc++; if (ntc == sq->count) ntc = 0; desc = ICE_CTL_Q_DESC(*sq, ntc); + + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } } sq->next_to_clean = ntc; diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 22e23ee53491..80b517bb5b08 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.42.5-k"; +const char ice_driver_version[] = "1.43.2-k"; const uint8_t ice_major_version = 1; -const uint8_t ice_minor_version = 42; -const uint8_t ice_patch_version = 5; +const uint8_t ice_minor_version = 43; +const uint8_t ice_patch_version = 2; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.42.5-k") + PVID(vendor, devid, name " - 1.43.2-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.5-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.43.2-k") /** * @var ice_vendor_info_array diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index d2d13cd2db60..d44ae5f37750 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -3308,7 +3308,8 @@ ice_sysctl_advertise_speed(SYSCTL_HANDLER_ARGS) pi->phy.curr_user_speed_req = sysctl_speeds; - if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) && !sc->link_up) + if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) && + !sc->link_up && !(if_getflags(sc->ifp) & IFF_UP)) return 0; /* Apply settings requested by user */ @@ -6246,11 +6247,12 @@ ice_sysctl_dump_state_flags(SYSCTL_HANDLER_ARGS) "\n\t 0x20000 - Resources" \ "\n\t 0x40000 - ACL" \ "\n\t 0x80000 - PTP" \ -"\n\t 0x100000 - Admin Queue messages" \ -"\n\t 0x200000 - Admin Queue descriptors" \ -"\n\t 0x400000 - Admin Queue descriptor buffers" \ -"\n\t 0x800000 - Admin Queue commands" \ -"\n\t 0x1000000 - Parser" \ +"\n\t ..." \ +"\n\t 0x1000000 - Admin Queue messages" \ +"\n\t 0x2000000 - Admin Queue descriptors" \ +"\n\t 0x4000000 - Admin Queue descriptor buffers" \ +"\n\t 0x8000000 - Admin Queue commands" \ +"\n\t 0x10000000 - Parser" \ "\n\t ..." \ "\n\t 0x80000000 - (Reserved for user)" \ "\n\t" \ @@ -9493,15 +9495,28 @@ ice_init_link_configuration(struct ice_softc *sc) struct ice_port_info *pi = sc->hw.port_info; struct ice_hw *hw = &sc->hw; device_t dev = sc->dev; - int status; + int status, retry_count = 0; +retry: pi->phy.get_link_info = true; status = ice_get_link_status(pi, &sc->link_up); + if (status) { - device_printf(dev, - "%s: ice_get_link_status failed; status %s, aq_err %s\n", - __func__, ice_status_str(status), - ice_aq_str(hw->adminq.sq_last_status)); + if (hw->adminq.sq_last_status == ICE_AQ_RC_EAGAIN) { + retry_count++; + ice_debug(hw, ICE_DBG_LINK, + "%s: ice_get_link_status failed with EAGAIN, attempt %d\n", + __func__, retry_count); + if (retry_count < ICE_LINK_AQ_MAX_RETRIES) { + ice_msec_pause(ICE_LINK_RETRY_DELAY); + goto retry; + } + } else { + device_printf(dev, + "%s: ice_get_link_status failed; status %s, aq_err %s\n", + __func__, ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + } return; } diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index afc03ebd3b51..466cb8701b79 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -395,6 +395,16 @@ enum ice_rx_dtype { */ #define ICE_I2C_MAX_RETRIES 10 +/* + * The Get Link Status AQ command and other link commands can return + * EAGAIN, indicating that the FW Link Management engine is busy. + * Define the number of times that the driver should retry sending these + * commands and the amount of time it should wait between those retries + * (in milliseconds) here. + */ +#define ICE_LINK_AQ_MAX_RETRIES 10 +#define ICE_LINK_RETRY_DELAY 17 + /* * The Start LLDP Agent AQ command will fail if it's sent too soon after * the LLDP agent is stopped. The period between the stop and start @@ -698,6 +708,7 @@ enum ice_state { ICE_STATE_FIRST_INIT_LINK, ICE_STATE_DO_CREATE_MIRR_INTFC, ICE_STATE_DO_DESTROY_MIRR_INTFC, + ICE_STATE_PHY_FW_INIT_PENDING, /* This entry must be last */ ICE_STATE_LAST, }; diff --git a/sys/dev/ice/ice_strings.c b/sys/dev/ice/ice_strings.c index 5b5da737cadb..1b377a1bf518 100644 --- a/sys/dev/ice/ice_strings.c +++ b/sys/dev/ice/ice_strings.c @@ -1052,6 +1052,8 @@ ice_state_to_str(enum ice_state state) return "DO_CREATE_MIRR_INTFC"; case ICE_STATE_DO_DESTROY_MIRR_INTFC: return "DO_DESTROY_MIRR_INTFC"; + case ICE_STATE_PHY_FW_INIT_PENDING: + return "PHY_FW_INIT_PENDING"; case ICE_STATE_LAST: return NULL; } diff --git a/sys/dev/ice/ice_switch.c b/sys/dev/ice/ice_switch.c index 1edd39497ab5..1880d6abdd26 100644 --- a/sys/dev/ice/ice_switch.c +++ b/sys/dev/ice/ice_switch.c @@ -4292,8 +4292,6 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi, if (!itr->vsi_list_info || !ice_is_bit_set(itr->vsi_list_info->vsi_map, vsi_handle)) continue; - /* Clearing it so that the logic can add it back */ - ice_clear_bit(vsi_handle, itr->vsi_list_info->vsi_map); f_entry.fltr_info.vsi_handle = vsi_handle; f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI; /* update the src in case it is VSI num */ diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 0fb7faecb2d7..9b3f38f885b9 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -84,6 +84,7 @@ static int ice_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ice_if_suspend(if_ctx_t ctx); static int ice_if_resume(if_ctx_t ctx); static bool ice_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); +static void ice_init_link(struct ice_softc *sc); static int ice_setup_mirror_vsi(struct ice_mirr_if *mif); static int ice_wire_mirror_intrs(struct ice_mirr_if *mif); static void ice_free_irqvs_subif(struct ice_mirr_if *mif); @@ -833,9 +834,8 @@ ice_if_attach_post(if_ctx_t ctx) /* Get DCBX/LLDP state and start DCBX agent */ ice_init_dcb_setup(sc); - /* Setup link configuration parameters */ - ice_init_link_configuration(sc); - ice_update_link_status(sc, true); + /* Setup link, if PHY FW is ready */ + ice_init_link(sc); /* Configure interrupt causes for the administrative interrupt */ ice_configure_misc_interrupts(sc); @@ -2136,6 +2136,18 @@ ice_poll_for_media_avail(struct ice_softc *sc) struct ice_hw *hw = &sc->hw; struct ice_port_info *pi = hw->port_info; + /* E830 only: There's no interrupt for when the PHY FW has finished loading, + * so poll for the status in the media task here if it's previously + * been detected that it's still loading. + */ + if (ice_is_e830(hw) && + ice_test_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING)) { + if (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M) + ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + else + return; + } + if (ice_test_state(&sc->state, ICE_STATE_NO_MEDIA)) { pi->phy.get_link_info = true; ice_get_link_status(pi, &sc->link_up); @@ -2705,11 +2717,11 @@ ice_rebuild(struct ice_softc *sc) if (hw->port_info->qos_cfg.is_sw_lldp) ice_add_rx_lldp_filter(sc); - /* Refresh link status */ + /* Apply previous link settings and refresh link status, if PHY + * FW is ready. + */ ice_clear_state(&sc->state, ICE_STATE_LINK_STATUS_REPORTED); - sc->hw.port_info->phy.get_link_info = true; - ice_get_link_status(sc->hw.port_info, &sc->link_up); - ice_update_link_status(sc, true); + ice_init_link(sc); /* RDMA interface will be restarted by the stack re-init */ @@ -2795,12 +2807,23 @@ ice_handle_reset_event(struct ice_softc *sc) * resetting. */ IFLIB_CTX_UNLOCK(sc); + +#define ICE_EMPR_ADDL_WAIT_MSEC_SLOW 20000 + if ((ice_is_e830(hw) || ice_is_e825c(hw)) && + (((rd32(hw, GLGEN_RSTAT) & GLGEN_RSTAT_RESET_TYPE_M) >> + GLGEN_RSTAT_RESET_TYPE_S) == ICE_RESET_EMPR)) + ice_msec_pause(ICE_EMPR_ADDL_WAIT_MSEC_SLOW); + status = ice_check_reset(hw); IFLIB_CTX_LOCK(sc); if (status) { device_printf(dev, "Device never came out of reset, err %s\n", ice_status_str(status)); + ice_set_state(&sc->state, ICE_STATE_RESET_FAILED); + ice_clear_state(&sc->state, ICE_STATE_RESET_PFR_REQ); + ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); + device_printf(dev, "Reset failed; please reload the device driver\n"); return; } @@ -2888,16 +2911,8 @@ ice_init_device_features(struct ice_softc *sc) if (ice_is_e810(hw)) ice_set_bit(ICE_FEATURE_PHY_STATISTICS, sc->feat_en); - /* Set capabilities based on device */ - switch (hw->device_id) { - case ICE_DEV_ID_E825C_BACKPLANE: - case ICE_DEV_ID_E825C_QSFP: - case ICE_DEV_ID_E825C_SFP: + if (ice_is_e825c(hw)) ice_set_bit(ICE_FEATURE_DUAL_NAC, sc->feat_cap); - break; - default: - break; - } /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); @@ -3303,6 +3318,38 @@ ice_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event) } } +/** + * ice_init_link - Do link configuration and link status reporting + * @sc: driver private structure + * + * Contains an extra check that skips link config when an E830 device + * does not have the "FW_LOADING"/"PHYBUSY" bit set in GL_MNG_FWSM set. + */ +static void +ice_init_link(struct ice_softc *sc) +{ + struct ice_hw *hw = &sc->hw; + device_t dev = sc->dev; + + /* Check if FW is ready before setting up link; defer setup to the + * admin task if it isn't. + */ + if (ice_is_e830(hw) && + (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M)) { + ice_set_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + device_printf(dev, + "Link initialization is blocked by PHY FW initialization.\n"); + device_printf(dev, + "Link initialization will continue after PHY FW initialization completes.\n"); + /* Do not access PHY config while PHY FW is busy initializing */ + } else { + ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + ice_init_link_configuration(sc); + ice_update_link_status(sc, true); + } + +} + extern struct if_txrx ice_subif_txrx; /** From nobody Tue Oct 29 00:29:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcrjh6XV8z5bxKy; Tue, 29 Oct 2024 00:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcrjh62Gzz426q; Tue, 29 Oct 2024 00:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ny6NXYZXYLVXJSH72Z/tpRqrpHQWcUJJnZxy7AIHUeY=; b=Zoufc9LoZkvyJU49PpXApcM39EpmMbz4mrUOTGkI9YSX7USbiQc0QJH0Xd7PBX3e2f8gKc ICgjQXFJCKj5I3IbAnTXbBgF4aR5IlYb2A1cfvBYmKpRlufFrm9dCK/ZFrJPJSPS16lXzo 1jMxgQeo1nYI9MgEDcqPqzpwZDIrtUvjDxtKofvmex7jT9WrT4v/JQszLXZKcDLmEg/KS+ SG/lE2v8K7iEDPSHcYV2mxFZHG8KKwtD+rz/ILgIfMoe9TU2arx3yXEWVD3zn2DSI5vLY+ 012l1Mfr7q6SAaUZoThveN6WuNOfz++OV7ENKFxjg21z9gmdqt5zecFg3gY7/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ny6NXYZXYLVXJSH72Z/tpRqrpHQWcUJJnZxy7AIHUeY=; b=TfYTxldW9/DjN7Tv86IHt1TNzmAXvZvOjuWo83WTZZDbV2ZjZsSznaLX+OIoCeIj0Vxtp+ VGBCOz0lYGGE7i2EjEzPdz0gqPnn0tY1Bq3dd5fLAsVag9hdxskOizlrx+bVvuj9H5AMQ+ jriZ1vOZN9+hY8KfOYjfG/htlnbveoIX6JelZJAv+x+Pr4VZ5oAydHcSEPAsJn7bVHBdiM 7gqXcH+T4p9c9nhArEPoX96qsTkiDQmkmcCRP8Jl8RaB5gNXXJW0PDDdygNnvGKOdb4zFF LuWYLYgZdnTRqsyGVRoPKlJ7zaO3oSKc77bNZ1YAdhRBVUJJoYsqKJwjJ4NyBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161768; a=rsa-sha256; cv=none; b=vNstcIoMZUAqgunsrifw/gV8hWoNrkQc1NK0mKzOtjybgM4A1Tp10BpJROrKbj0esuq3ru 1rizYhNFrq2T5WYfJt3nMTaR2kJvAgx6jb3ziTIzppunyq0N6hJV4Fv1DxQnSqilB232uP jZ2xNMvf9pbCOxO7Hbbwp6hAWmhH2jhyrNBx8OuAkfnlzTqJ+6PUFl1LCK58qNBHUMIk8A UY9yhbeqR6EJcU6tycctzjerh771Sc7Q844y8XSizRYoYwX6I2O9CTHwKSA5IlACIIh7DL SJ6JR51eNEOSLKOr1cZjyL6VZOheLW/MOZEP+26+6gbEeXdlX6kA6MdxIkwn5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcrjh5dLTz11WG; Tue, 29 Oct 2024 00:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T0TSat073139; Tue, 29 Oct 2024 00:29:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0TS4Q073136; Tue, 29 Oct 2024 00:29:28 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:29:28 GMT Message-Id: <202410290029.49T0TS4Q073136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: a8308a15f48e - stable/14 - ixgbe.4: Add flow director CAVEAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8308a15f48edbb224d3f225121277ef7c2f04b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a8308a15f48edbb224d3f225121277ef7c2f04b8 commit a8308a15f48edbb224d3f225121277ef7c2f04b8 Author: Diego Casati AuthorDate: 2024-10-26 20:34:16 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:28:46 +0000 ixgbe.4: Add flow director CAVEAT Flow-director support is not fully implemented and will cause errors if enabled. Mention this in the ixgbe(4) manual. PR: 202663 Co-authored-by: Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1493 (cherry picked from commit 20b823a59bc7419a6f93ec5097bd5ee524c20981) --- share/man/man4/ixgbe.4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/man/man4/ixgbe.4 b/share/man/man4/ixgbe.4 index b151d3466392..ccdf50cf9674 100644 --- a/share/man/man4/ixgbe.4 +++ b/share/man/man4/ixgbe.4 @@ -124,3 +124,11 @@ The .Nm driver was written by .An Intel Corporation Aq Mt freebsd@intel.com . +.Sh CAVEATS +Intel (R) Flow director support is not fully implemented in +.Fx +at this time and additional work is required +before those features can be supported. +.Pp +Enabling flow director may route traffic to the wrong RX queue of the NIC, +resulting in sub-optimal performance on the receive side. From nobody Tue Oct 29 00:29:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcrjk0lgpz5by7J; Tue, 29 Oct 2024 00:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcrjk07jtz42JT; Tue, 29 Oct 2024 00:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K1ImerrhC14ZhDjnqQfLPaQx52ru1QxGgt0L/4nDilI=; b=vuRhxj4svEObc/Ux1NEZ/fTQx4KjOoiMfaJ41xnbdqr0pFAnCSqT980dS4o1yTb4ge04pG Wu5+qEfYkTDy2aSto8S/XmZgjojKvb8XhQ8UwnFrX3/wsaKhh6OrQTaypcshTMVKuK42+w 5DukNkX9iGylSV4mjxMkN01sncVLoAzjDDZ8DRMA3l88pb0GHNhJbXcdcTpUJt8iOCZo9q 3JwjYE2PHt42bNP48gX2ZaU/tFdp7ryipNlPApOAW5qaMj+uISQka1BL0fzSyeZo+pRiuW KVo+ORs8qIvjxWrMeDI5lU5+ADaWP1WHpCvTZ2hXOndfoYOwTgkSCbBpQEEyIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K1ImerrhC14ZhDjnqQfLPaQx52ru1QxGgt0L/4nDilI=; b=eGn9Cd6P5LDvkZTPtFAsGCVIZGw3F1LS6RPABp8u4p7DVt9TYrzjGQ0Vz3wbwD3yhxbENy mPLLmb6aN/dY0InuXuXJpotjC9wbn+/s26vR/nSvWGYJ6mCUUAzBaPqrUASe6HwmZKZ+WL lwu3FkEPn8fbRqOUsU5W5iSpcanwbXJZPPMlLzlelOl2WvkPtkC7zeLIgl3bkZG0Y84OQ3 BiR7YcOCO81XbswC8oGSChW4e2R1/fwwwmu/exOLuS8gfgDRA+3rwBfLT/YBmS0x9h3dTV Q+RgSfQmAPQHnHRvSQhLwf8ekymt/QCe3mFQ1wSMWm4ehzMRvoodEAvVMrGFmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161770; a=rsa-sha256; cv=none; b=T1x7iI7ST8tQaBbOHaw7O0yBViZLn7cVzjAWpU98LtR5NBgrLHVAH84potbFDiRTQOq63B oEAonsBYbDJf20etXqnZqeIaIwExWD7osuNzDjSTpZDQGPR6RkWUBQC8Gv//5lmMU1c/QX uqkl9zco6xfL5klKtLWAFiWbtigqKdLM/H2BCBR/s5BXw37foayegpm4jXfmTRFU+dXg+I nguT4aYPnp/e/SAW/o6/p7h7btNhtWc5d963LXBAsWwKNikjPSoDrneqdnKZff85+sajRI 29K9aOpsBG+NoWjUgUgkBi8bFA/l+KAwg3M35zUlwzEIhT+WO5UaSW0fQuYWsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcrjj6sH2z11xR; Tue, 29 Oct 2024 00:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T0TTfS073188; Tue, 29 Oct 2024 00:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0TTng073185; Tue, 29 Oct 2024 00:29:29 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:29:29 GMT Message-Id: <202410290029.49T0TTng073185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 9679df8eea14 - stable/14 - ixv: Dynamically size the receive packet size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9679df8eea14a5f707aa870328d9bb211f12c570 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9679df8eea14a5f707aa870328d9bb211f12c570 commit 9679df8eea14a5f707aa870328d9bb211f12c570 Author: Kevin Bowling AuthorDate: 2024-10-26 21:34:30 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:29:03 +0000 ixv: Dynamically size the receive packet size If MTU of the if_ixv VF driver is configured between 1501 and 2030, and if a peer box have bigger MTU and sends a packet bigger than MTU into this guest, kernel could crash. Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4) does. PR: 268092 Reported by: Kumara Babu Sponsored by: BBOX.io (cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1) --- sys/dev/ixgbe/if_ixv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 66a1e4fe2df1..d5fe1a5c6b30 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1363,7 +1363,7 @@ ixv_initialize_rss_mapping(struct ixgbe_softc *sc) IXGBE_WRITE_REG(hw, IXGBE_VFMRQC, mrqc); } /* ixv_initialize_rss_mapping */ - +#define BSIZEPKT_ROUNDUP ((1<rx_queues; u32 bufsz, psrtype; - if (if_getmtu(ifp) > ETHERMTU) - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - else - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + bufsz = (sc->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> + IXGBE_SRRCTL_BSIZEPKT_SHIFT; psrtype = IXGBE_PSRTYPE_TCPHDR | IXGBE_PSRTYPE_UDPHDR From nobody Tue Oct 29 00:31:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcrlw1Jqwz5bxpq; Tue, 29 Oct 2024 00:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcrlw0nW8z43Pg; Tue, 29 Oct 2024 00:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gzOKXgIn4P6elqmmToQgpd8YSmJkG9xius/yjMp8Yp8=; b=Kp3u3fo5Vp5BHTFddXsIBqUacWjssdiKtKyxBG1bcgO/9xLIGJ3BybE4SHFY2aFDq2m4NI LB8KMJ6S3q0PdpQdII8u1yaSA3oHQ5xGZ47ZsGoly1YV+BLpDy4qMaPOwzY7+VP6HNA3vG Jnq1RPT+iPQE5PsWWtbwZeM+/HS45n+5a8/GE1ca6V1EpLV4aTVUFUUiyEoJ4bmKxrY1R9 wKCSX2sPqhvSwkFrn/ufZzx0Pl3imU3z9YbWD6upEpkr/jYswU+DNhdeMeal7WokPKIOWM vVN9DhUV9gyrRhV0SBO3EX+c9MieK2jYt4VAcMqwebEobmE9F6FzliaQSjFGkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gzOKXgIn4P6elqmmToQgpd8YSmJkG9xius/yjMp8Yp8=; b=Wx0eoPAUUfuDtlyiK/2P95lpyGJBN4CL0FCb0wDG39AZne8EyfNK1dihk5DsgJ2jJtKHuo ZsEtac+mfb1zGkkoBo2wvlXRSBjxI2IEWG7+j0lI8RYwg1KtWq9ymOPjSosUrg4SCJ9uUE MpAge65Mm/0SBj2LlV+N/KqAru/DGQ26gHWH1ESuiJPFXdxsvjV+JzmCaUGnC9yUxv+hMc GwNlXt3cHc3MQK4QXRfQwEM+EdVW5bmIZAgvpm1aA0NHdquHNrn2RIg0G/goVzNOO7LDFB ctNH6hUS+iKZTjdadJ/CtoHXmDB1am0+AqlyP/zkYyYzfArFipD/AAESosMtvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161884; a=rsa-sha256; cv=none; b=KZvvWaGRzdpxdQIaVcVjagodM2TPkl0WhFPKpz4QgwWGc0bavB00kTKZdxpWkUS1584FG7 sAAWsd8CG8NThkpHvjSo9nQzeZ6IDZFso+fiHvlnOdFK0C6Ba63WMMv39SgCOYrVufXjyr AcjXoF0rCs/s/6Opy/vCfsA7cwDX+OqwJa0QgC3X3yTckDcGCvx8DkVMHhTIIqNppYajCJ ik9i4UAUeg9Ckli9nqzRrI/pQvKQ2CL5hd7T8DUUGtu+HMTE2wfEfRFZCOf9WHhX+gPCef rPb+D7CO3uPfhdK4Kpi1F4af+DV4MxokfhyHb36UQi9GtYlI/otX/GLuOsZbkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcrlw0HNpz11Wf; Tue, 29 Oct 2024 00:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T0VNV1087014; Tue, 29 Oct 2024 00:31:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0VNae087011; Tue, 29 Oct 2024 00:31:23 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:31:23 GMT Message-Id: <202410290031.49T0VNae087011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 60211fe46a4e - stable/13 - ixgbe.4: Add flow director CAVEAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60211fe46a4ec5e6b72cb656f487297a15a0e373 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=60211fe46a4ec5e6b72cb656f487297a15a0e373 commit 60211fe46a4ec5e6b72cb656f487297a15a0e373 Author: Diego Casati AuthorDate: 2024-10-26 20:34:16 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:29:52 +0000 ixgbe.4: Add flow director CAVEAT Flow-director support is not fully implemented and will cause errors if enabled. Mention this in the ixgbe(4) manual. PR: 202663 Co-authored-by: Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1493 (cherry picked from commit 20b823a59bc7419a6f93ec5097bd5ee524c20981) --- share/man/man4/ixgbe.4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/man/man4/ixgbe.4 b/share/man/man4/ixgbe.4 index b151d3466392..ccdf50cf9674 100644 --- a/share/man/man4/ixgbe.4 +++ b/share/man/man4/ixgbe.4 @@ -124,3 +124,11 @@ The .Nm driver was written by .An Intel Corporation Aq Mt freebsd@intel.com . +.Sh CAVEATS +Intel (R) Flow director support is not fully implemented in +.Fx +at this time and additional work is required +before those features can be supported. +.Pp +Enabling flow director may route traffic to the wrong RX queue of the NIC, +resulting in sub-optimal performance on the receive side. From nobody Tue Oct 29 00:31:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcrlx3rL6z5bxpr; Tue, 29 Oct 2024 00:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcrlx1m0Tz43g8; Tue, 29 Oct 2024 00:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qu6PAGYqPB3P0etkEG7YzIBGc0EuII4DI7DXqo8bJwY=; b=flGVRpcX+sCkIb0UeC2G74848T1TvTxWOiL7R9/uWKKfee+Ph3MNF21F1gcAinMPQucee2 ZVB6xago3rFmzGDpBJrPkUbFtRHTF6IwMbIpMpKLGpFbku89EMBtXuCeZHYtCOgjyKYPVE znb/8l3Ij7RcK/2r8tXMXFXiTpoVg2Zm8BC4lx6XpeQvKLCnnbHz3oZQBqL9arQEi6D5n2 GBgI1KUr9OXV+g8L+LrPD5pyrx/W3mB/wO2bMtCRRzn0m5snpfUyJw4CK6+Et3YCukTqdB kd6CDJBMtiK9S2XknTtES4ZSdtACzzz4RoAxyMQ4Us5sW1awXN2pR44v2sakzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qu6PAGYqPB3P0etkEG7YzIBGc0EuII4DI7DXqo8bJwY=; b=kZ0VpP9sFNZBFkKip1wbwLAzMnm+13VJPdr6GtNX3yCWSbmndS/uqEh+eC/cEA0xea3dJE dLVGfaAd9jEeZzNJGX3Bj1hoJmsGXELeDJmzyBxbsKCFUAZ5b0LrkuwUdXUuPLeaUH63UD DUP/0Lytzr5HjeWA8HYRvsh8jBvV+nRuV70fSOPde6YXZ8e6RPHLKean6VlpoBIFp7h0Kd +cen3z0vUJz/6eVpkrjttFbjpQOHelNwq7IP/Zxoxx7s/iByGdFT/t6RPRYbtbIj+DSFve julxNSf4Y7B3rzXfahvOKMt99ctUcaWNkq4UHiS1vIXvlIQlyaFMH1R132li7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161885; a=rsa-sha256; cv=none; b=KkUoajuQR+9vxLtznxN681uVFJ0zjqQbwQEpdlsJ2xYAV/xBxfvxutMjh6+EjxSNBOSLv4 Efzj0uk+GxCkTDOjxir7pGXcLGE6MArFWfbdttcQ7/9qNj7r/FCeyAUDeyQZm1GmIsCfn/ ygW7gPGF2CWzMWoLMCpttdpjUBtNcJBB+E4b6RwqKHBeHq+xuwTwDgHl6HaAwn8l514z4w xhup39+0JnLesSLVdyhVkqFAJVLYEzsM6KVUQcW1AnVKgncl8CdzXtupyhSI/PdOKQ3vop LhWG3+OEEl2GCT+3W4XFm/e7k6tAs6SgXmRv7qzm8PgOxIUQtICBDqk3gN6HSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcrlx1JRWz10l9; Tue, 29 Oct 2024 00:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T0VPLZ087062; Tue, 29 Oct 2024 00:31:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0VPa8087059; Tue, 29 Oct 2024 00:31:25 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:31:25 GMT Message-Id: <202410290031.49T0VPa8087059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 33557727b593 - stable/13 - ixv: Dynamically size the receive packet size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33557727b5936a235506b500a57ecf8239ffae4d Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=33557727b5936a235506b500a57ecf8239ffae4d commit 33557727b5936a235506b500a57ecf8239ffae4d Author: Kevin Bowling AuthorDate: 2024-10-26 21:34:30 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:31:00 +0000 ixv: Dynamically size the receive packet size If MTU of the if_ixv VF driver is configured between 1501 and 2030, and if a peer box have bigger MTU and sends a packet bigger than MTU into this guest, kernel could crash. Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4) does. PR: 268092 Reported by: Kumara Babu Sponsored by: BBOX.io (cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1) --- sys/dev/ixgbe/if_ixv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index fe23ea226348..7535d8c15204 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1363,7 +1363,7 @@ ixv_initialize_rss_mapping(struct ixgbe_softc *sc) IXGBE_WRITE_REG(hw, IXGBE_VFMRQC, mrqc); } /* ixv_initialize_rss_mapping */ - +#define BSIZEPKT_ROUNDUP ((1<rx_queues; u32 bufsz, psrtype; - if (ifp->if_mtu > ETHERMTU) - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - else - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + bufsz = (sc->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> + IXGBE_SRRCTL_BSIZEPKT_SHIFT; psrtype = IXGBE_PSRTYPE_TCPHDR | IXGBE_PSRTYPE_UDPHDR From nobody Tue Oct 29 05:03:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcynq6vNjz5Zklv; Tue, 29 Oct 2024 05:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcynq6FR4z4S2W; Tue, 29 Oct 2024 05:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730178207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0oZ41lZDhAQ2sjltOEEAD1DeGdZcKPbAh6ELEcfdL8=; b=QoKlzo9Y5rKbE2XO0ZHLvEcRel+ObQ1TxeHSQt4wWBBmWhQ19C5tRa9TwFn592x6Uu67dy v2rgFZ0uQ0MCFLZ93drk6QdOUhwMyo9eoMz56ctgHCdVj24BcnoqwUbo+BXMEqkhSlLYtd 6Z+LWzSMxxIFEfdsvexNhxnFm/KulHoD9mGpauap+keBt5PXf+8mJ/qH/7kv3kdLR2AuGB zaU5yrLSbbcnatvXzRHL7KKcUDwwb9AtVInEqYtQTSPfnVHBI51znb0DHbKJ0BVgrwOS64 N3tnPBkLXJ/TT6/Vl0bcqThH/r437yhnftmttDnkKJKMGC0YpJVtEbuR2NhPow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730178207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0oZ41lZDhAQ2sjltOEEAD1DeGdZcKPbAh6ELEcfdL8=; b=BM0RK/o6LEGX6XU7KfhsSK2PMztUPJS0YipNHviIOlCp/eV5uvMiVnCHx3Q6Z19dFJ+POJ kfEYnLE7LGAyq2kaIOhUGZ2po4O65Yo6PDo1bS84fb18mOMxJH9jc2nawKQb/pDodNIGHx SHGCQDCCrxdLNqnOs4VrOFclqMsccsRza/AwJbYRZ4XC2cn/RbZkKi3M07LisZdElCwz0m NqCtXVj7l96lXM6POWnx0vw8MGM7SN7GD5d+4LJCMGYEfpMC0GHgLJNEKoy5emcq9jJUTK gV5KRQSWF8dUtfyPKd5whplnVfp9S8uqAdw4Zts2PPwEBZADLr5UDXLe8BCNcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730178207; a=rsa-sha256; cv=none; b=SZC4orCZUYcrclcMllYkdjAw6KMsxnWl8GebmWBGJoITrmUUg1WwkDVcDdqSpkAw1/3VbV pXPdKaw0lhy/4SjoJCWg3RH478LzH/73/AlMruoyRqNTe6jwB9uUvisQ1hPpdsGWfszU3q Z1MdvPBfLq7wS/DM67d/C+b0IW7QhOjWEgrRWRG0Nj4v0sjVrywveAIHIqbnFQ0Gv47LIA WKEZjNhi3g89Ri1jJxnJkPlcDrJwePfXhfyjRQSNbkfTnve68B7nLibuBxQRqyel1wI28k 9AsycXCVAklPeVeGz/rXwusrhYiQ+yL7SERWrsrzvKch+mUGY5CDa1aK77atLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xcynq5qV3z18Gc; Tue, 29 Oct 2024 05:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T53RCA090585; Tue, 29 Oct 2024 05:03:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T53RfK090582; Tue, 29 Oct 2024 05:03:27 GMT (envelope-from git) Date: Tue, 29 Oct 2024 05:03:27 GMT Message-Id: <202410290503.49T53RfK090582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 3aedf015d1a3 - stable/14 - if_ixv: fix build without NETMAP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3aedf015d1a304184b48c3fce016dd9083dba790 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=3aedf015d1a304184b48c3fce016dd9083dba790 commit 3aedf015d1a304184b48c3fce016dd9083dba790 Author: Konstantin Belousov AuthorDate: 2024-10-26 23:37:09 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 05:03:00 +0000 if_ixv: fix build without NETMAP Sponsored by: The FreeBSD Foundation (cherry picked from commit b0993e3bcaec60701f3ae56df255433eb4bcd091) --- sys/dev/ixgbe/if_ixv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index d5fe1a5c6b30..467a56e7269f 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1373,7 +1373,9 @@ ixv_initialize_receive_units(if_ctx_t ctx) struct ixgbe_softc *sc = iflib_get_softc(ctx); if_softc_ctx_t scctx; struct ixgbe_hw *hw = &sc->hw; +#ifdef DEV_NETMAP if_t ifp = iflib_get_ifp(ctx); +#endif struct ix_rx_queue *que = sc->rx_queues; u32 bufsz, psrtype; From nobody Tue Oct 29 05:05:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xcyrb23Y0z5ZlQ2; Tue, 29 Oct 2024 05:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcyrb0CHVz4S9f; Tue, 29 Oct 2024 05:05:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730178351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iu7bpERoIrSaCOJJxErLYEiO+dvA2pc5ql7TmMrX8oM=; b=tIlqorQHpuLNnOhH5+koYusRcUIahFZD6pRErMOL2qxvAJT0AsJDyj3ascoR9xMeH9u/ey qlqNLv/m0+nCGKNbsghzroGY/+zyr0vJrQ28Yg2mqfUBPahOvKjR62VdIIs76t4MfcEFRa IwYH0W+yUYc59MpNnf6P8ZteqU87wediAXqVtb1dsF0S/dzmkuJT7MOMzASgtqYrCG20lV JKAn/3U+eWeHlXHDrjGWQ3hcDJtrSB/ln56nSon0GICYg+sXEthGpFQqYb4qgMEgy5ix6u eKiG3/ksl44kLN63cEZIpQbcjAdMbYJqFway6RzIf96gEuRNrloduIkUXRzXRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730178351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iu7bpERoIrSaCOJJxErLYEiO+dvA2pc5ql7TmMrX8oM=; b=AZtdggnFgs6BrbQ2pw0x5SWYeZNZ4lMhHJAAlyhFRmdTGhWy/2erSVH74GNOL0KVlmsTo4 YPYQKTSrM9THZEfx/5y5MsKfLMuQt4t+yYs5eYUtQ/w3+ZHSmkf9MpnVKBPShukK05tzzx NaDk8vkxMc+/CiZulZy5ZgA3KFr6Dbq0eus4aocRX2HAtoWByyFMBynxq1+Jb4z/4P0sJq coX3i6zKSOiZv5sVGcOwl4LYLMkUlPicXPP+apswdXuRWEmRH05QNv5kmXcyGCyd5LuCY8 XJjMecCkoDUhoE5C31OYyryAtsWgUdD792+BqJfcDR4xUefW8SEIPvYATBymuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730178351; a=rsa-sha256; cv=none; b=gR6wiumgr0+8I9H1c3Isb/MwdIfEaiKnDGan7jcR450/TqgVyrn00mUO6UeCNQ2FBOokTX blKaEjIq4DhIHA0v6+O52ItJQM1vZwPBY9qk4nG0bg55pXtYh5y7BG48Mwx2/EDj010Oc2 g/UpwslSRWCQ8niBYD+5l0GODTvN7rE6XQpgJB1/8RuM3ClesPGLUcDAwWVFLlM0m8v5a5 QwoohU6queWiLXUbPZMiH5KKM97YyYLIHT5L8y5sHiHpG5uhQw9rZv0xEBWKVVMSnOQnwK uImheq7v9514eQqOE1lKjx2Qc4v/QHGnLo+2IwuOHKNxpfWGTYntmDHbgKriOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XcyrZ6pKqz18bN; Tue, 29 Oct 2024 05:05:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T55oYv091361; Tue, 29 Oct 2024 05:05:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T55o1M091358; Tue, 29 Oct 2024 05:05:50 GMT (envelope-from git) Date: Tue, 29 Oct 2024 05:05:50 GMT Message-Id: <202410290505.49T55o1M091358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: bbe4a6a3f2b9 - stable/13 - if_ixv: fix build without NETMAP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbe4a6a3f2b9d418ca6833cf9f628096d22bcd85 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=bbe4a6a3f2b9d418ca6833cf9f628096d22bcd85 commit bbe4a6a3f2b9d418ca6833cf9f628096d22bcd85 Author: Konstantin Belousov AuthorDate: 2024-10-26 23:37:09 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 05:04:40 +0000 if_ixv: fix build without NETMAP Sponsored by: The FreeBSD Foundation (cherry picked from commit b0993e3bcaec60701f3ae56df255433eb4bcd091) --- sys/dev/ixgbe/if_ixv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 7535d8c15204..91ed47df429d 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1373,7 +1373,9 @@ ixv_initialize_receive_units(if_ctx_t ctx) struct ixgbe_softc *sc = iflib_get_softc(ctx); if_softc_ctx_t scctx; struct ixgbe_hw *hw = &sc->hw; +#ifdef DEV_NETMAP struct ifnet *ifp = iflib_get_ifp(ctx); +#endif struct ix_rx_queue *que = sc->rx_queues; u32 bufsz, psrtype; From nobody Tue Oct 29 07:00:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd1Nw3gZPz5b5xQ; Tue, 29 Oct 2024 07:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd1Nw3Bwqz4b67; Tue, 29 Oct 2024 07:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730185232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tg3FbKyJIO6+f3xMtQLCh6gJWJ/TLEUGpS8wVt9HzL0=; b=Ehv8EuNVF5TJ9swpNYjMYUrsm7wRy4sExEuDC00ob+jR3ZjEUUimZnUbqAh1CBBC0IltgE SC1qqdhP/11oiIOieNt+6LMu5Vy5MqwU6qbD5HlVMAg15yEiuHFNqN3phJhz6pkbvFOUoz /N1OM9qIAATxbcCp7bSgD6W13CmCX0v8v7nPiO9m/IwWDmKqekRCDFFUegPFodH6o2U4s4 Ou/Pr0V5XBY/TIMpl3w6GAV+1zrhJNeIxqOjJFTNEx8QNuWUKKSoS7ukJt+iZ/uq55/mZd iJJiESav0U2tp/3UHKSQbwNieRFV6jLoRD/W2df+eLNFiR8mxHb+91w6aCiITQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730185232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tg3FbKyJIO6+f3xMtQLCh6gJWJ/TLEUGpS8wVt9HzL0=; b=iZbokOiFwjCiyFGh7K6yKWy5FBJbKYGYIlQZf5NEY5qpe4xfNQ8UMPIyzbX7naADtDsirg Ww0IvFPqsi1TsqT7rW85co/aGgLEyKTs10W23vb3A/J+ywOkOaAlDMEoILdHFfVZD+j1fi o92uPUk0L7bmzUtWE9d2PFpqzPHNhzo/xynJyR2vx7AsGXzUbyubB+Ip9pKYswwBY7H7VM F+9KmB98iES3qsORWe20mcOXmVkTkYbKLS55WwT3itos3vmmuW12M6rTiSkKJBzJux2VGf hmHW80GxWdP/7UdmH9HfVLiqfvRyUCT3nGnINKBPI+8/lxaVKa9s7iI7hOxgOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730185232; a=rsa-sha256; cv=none; b=nLAXfsyTGRf01QUT0nc4teGg93fywwa1W3DQux/k7+pXAo2Vy5ij2W1W/HabAuuvpSTsYC nzkKRrY5s9i+jumVMn+vXGWAAssfASsVgiyQhKyXVCqSjaawetfV+vDdWG3imB2O+ZbUwE PDgl+itrMD2MGqbqXN9Eu7IJ2xDdw6NJUV8x9vhE3iLs0bgfOlH5esYisEkcKOt6aNfff8 zNPAlQW9k7YvPEjgCCEOX+etcC4L2OogpWw7vz+XSv1w5LsrPhkdb+uQxloTKL529B9azg aBHOwTeeR7VD/Ol8LzxsxjVZ00/EU+voWg4J6o/oeXwGF3DJf2fZq6GmmCFESw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd1Nw2nxNz1CKs; Tue, 29 Oct 2024 07:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T70WmK004699; Tue, 29 Oct 2024 07:00:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T70W1a004696; Tue, 29 Oct 2024 07:00:32 GMT (envelope-from git) Date: Tue, 29 Oct 2024 07:00:32 GMT Message-Id: <202410290700.49T70W1a004696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 89d82079c8ac - stable/14 - acpidump: use acpica definitions for devscope types in DMAR decoding List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 89d82079c8ac52a79bfb48ce95bd543ef53ae495 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=89d82079c8ac52a79bfb48ce95bd543ef53ae495 commit 89d82079c8ac52a79bfb48ce95bd543ef53ae495 Author: Konstantin Belousov AuthorDate: 2024-10-20 01:40:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-29 06:59:54 +0000 acpidump: use acpica definitions for devscope types in DMAR decoding (cherry picked from commit 5a6e19cac0c69f55c3b7b56c4489a611f4339a0e) --- usr.sbin/acpi/acpidump/acpi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index af0068649fbb..31c3045ab6ea 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1275,14 +1275,16 @@ devscope_type2str(int type) static char typebuf[16]; switch (type) { - case 1: + case ACPI_DMAR_SCOPE_TYPE_ENDPOINT: return ("PCI Endpoint Device"); - case 2: + case ACPI_DMAR_SCOPE_TYPE_BRIDGE: return ("PCI Sub-Hierarchy"); - case 3: + case ACPI_DMAR_SCOPE_TYPE_IOAPIC: return ("IOAPIC"); - case 4: + case ACPI_DMAR_SCOPE_TYPE_HPET: return ("HPET"); + case ACPI_DMAR_SCOPE_TYPE_NAMESPACE: + return ("ACPI NS DEV"); default: snprintf(typebuf, sizeof(typebuf), "%d", type); return (typebuf); From nobody Tue Oct 29 10:34:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd6834KCGz5bHdC; Tue, 29 Oct 2024 10:34:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd6833pdtz4rtB; Tue, 29 Oct 2024 10:34:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJdmK2LL//VoEDqejU8Y66cU/TLd4ma5gAyAp4f3dqg=; b=Xz3mQeOxUt9O04Toa4ebt5NWVyiRi5VRMPmJuRsoG23xrVxXCRkl/JwHD1seqvYL2ZQKu2 wazXq/23g0XnnY9gJ/r9LYMexyDQNqFbyE2hCkQW33lWL7UnsseD2zvqFHCTRIgIo0SQuS eMh78h1d8AOt2JBdGdpP+J9hXXJ7rOJ0sbIk8jTPRzE+/SX+xTbRpQm2nyIX3xv4zbMhl1 yp8hw/L5cJD2zKalviUcW2hCsLshNbB4O/IyhMYI8x05i+IKAD1YVcBTlJM1bc9wHZY41g mKuigH1GEr0mjEy5Vx/b6zRzHNKlTTViMApap2UNjoIuWyTmHqOYEb7r4uUv4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJdmK2LL//VoEDqejU8Y66cU/TLd4ma5gAyAp4f3dqg=; b=RT3Uc1QyGnSf3wXYtqLcoDm0n36hI+YqPwuMgtM6OM6ezrVfBGPpmampG6BJ1DnNueiJ0p UPVl+Qo1H/5uuculhDxJdDALcB0RXkZRb66YK46vQOgngnO4LUVR+Dyh9qZ/f9FTjkekzb u+w5tMZ9RkIWaVWyuh6rVDd/1vPSxYtJogtdU6DQVGDK5n4KPK+vUATo9srJCKgPdCmzU9 2c11lVZMJ/aqtYUUIE7vu/EdJVpd9l9KsI0OpjUWj7GpGqIxoroTvjgcqs9zECUGRLM9pV 27kL/h15Dd55vLG2wO5IaAUICACJ0nCQ6evAfAq1lG8l4FfCUBYoSIzklSuGBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730198083; a=rsa-sha256; cv=none; b=ZaXA7hPWnuhhav1v7mCJY/mWy3VfFmGA3W6Rteo70zlS2qP6QihP9N0opOBDsb/B69dHA4 oYPT2vpNZz4Yw/paES4lH2pe74cFWsL0XIPWoT4FxyAV3o/8hNMG58KYEEmumGX5b8uZ3B n9yfXvOLpdCJvzZHlA3fcRiVQEVMq7EAaomrEFSdZLOtU/Evuq+CjP4NKR/paEZ49M1l++ lzvAUh3iKUsuqVRimzdksuyrcwwjmiD4Ko0Mheb3clqRiPcb/EBk3Cy9akqvId82mdHA/+ IYkTy1jRXFcjpmgzbR5sjwkg/v2RL0OPunYfPKJYN/C+IYA63sPkUtuNstxarQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd6833QlHzKxX; Tue, 29 Oct 2024 10:34:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TAYhqI001706; Tue, 29 Oct 2024 10:34:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TAYhBH001703; Tue, 29 Oct 2024 10:34:43 GMT (envelope-from git) Date: Tue, 29 Oct 2024 10:34:43 GMT Message-Id: <202410291034.49TAYhBH001703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c85855a72db9 - main - bus: Activate INTRNG interrupts in common code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: c85855a72db9f9d7b4326b676241e1dffabf0fae Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c85855a72db9f9d7b4326b676241e1dffabf0fae commit c85855a72db9f9d7b4326b676241e1dffabf0fae Author: Andrew Turner AuthorDate: 2024-10-29 10:19:45 +0000 Commit: Andrew Turner CommitDate: 2024-10-29 10:31:37 +0000 bus: Activate INTRNG interrupts in common code We need to call into INTRNG to activate all interrupts on platforms that use it. Currently, interrupts are only activated in the nexus drivers for INTRNG platforms, but this does not handle other bus devices such as gpiobus that manage their own IRQ space. Reported by: cperciva Reviewed by: cperciva, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47282 --- sys/kern/subr_bus.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index eeba75ac574a..681971df4307 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -53,6 +53,9 @@ #include #include #include +#ifdef INTRNG +#include +#endif #include @@ -4364,17 +4367,26 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - error = BUS_MAP_RESOURCE(dev, child, r, NULL, &map); - if (error != 0) { - rman_deactivate_resource(r); - return (error); - } + switch (rman_get_type(r)) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, r, NULL, &map); + if (error != 0) + break; - rman_set_mapping(r, &map); + rman_set_mapping(r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + error = intr_activate_irq(child, r); + break; +#endif } - return (0); + if (error != 0) + rman_deactivate_resource(r); + return (error); } /** @@ -4404,10 +4416,19 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - rman_get_mapping(r, &map); - BUS_UNMAP_RESOURCE(dev, child, r, &map); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + intr_deactivate_irq(child, r); + break; +#endif } return (0); } From nobody Tue Oct 29 10:34:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd6846Nw1z5bHcB; Tue, 29 Oct 2024 10:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd6844S93z4sLG; Tue, 29 Oct 2024 10:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRXQBz/PbDoxW1JcC+oby9d81E+psQS5yJDGybgh+bs=; b=J3zmkHHcQcd4u4cKYLJekuyesR0iIXUFGoxN5l3uiJ22HnrumwMM0UvT+49IaHECGX5I9x wbPpDhVUe8ggewSGG/1sandTJvj9lv8xsi67LoolY24NYkxiJr2+NtrrWPkAMO4Lev63rg hvPrdajp/pbgVisRtWxFJZ9kKF2oPBDl+a4lSuFeAdAhIfEeKzDlfPch/8h01VhAsHVJWd RKqS2qs49dMvMH880z6hJvksdokDyveBSjIn6yXqb4BorZCG+2CVhBq9NmAe3+A72k/n+J W1E5jHqFNRNi23cCgWg9btX+s43RWCvklv2ACRkCOIyzCL8S2+vrfrc/LWgMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730198084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRXQBz/PbDoxW1JcC+oby9d81E+psQS5yJDGybgh+bs=; b=S5E+6hB/r08VXLAdBjqX0WiZ+8ATAmpO8o6lYDSZnvinxbEBwirfYqSr4HjZPYJTyo7xIe /vv/PtPT1o5WnKRt4rrG8IMIN5clXK5pBh6yO+5EcvD/lQ4Kwdm6a/2POHoJPcm4RfaBUj 0oxTud53RFg1NcODQPjLzwiEFf2YokPEqTg6ufd9cOqcPLKzSp0U98j4G4c2AoARUNYL9X +k+FBJXtDQ+nX1fL4zxfsekfEVgdYPzsNdZdeN1J3thcR30IQCxjuKhQs/WFbn/7QeAaZr cRa0EGyMhPnD5L0KUmeQprWRVbCyWMRDAbsVFOZfLVHZ/mbtb/blDKA3SqHiFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730198084; a=rsa-sha256; cv=none; b=SM7+YCkuchse2BtKwxdvuDZAAe5QtR4USFF5sEjEHk8xBiEdI0BF64/N554mO8SDezgHM+ CjYTRsHT2lvrnD8T1GidPTCwF1I/KiEZOlURYdmNxI9P+4smbjy4LRWqDzKihx5K7L2XRu ExTGVFu/JnH2tlvN5mcXYekmJ7uEsA9MK2udwJQ0hXlRaSqX7pImOHRynnnWlEmb8caSrN vITfx494flVigSBAmmYd+7XLOeTBzpjhJriD6KfflseHsMB0tpK29+1wRWwNJofnarzeW4 b9O+fn2PCzAED9zOPzDN3rxl0aSI2BJrv/wPrIkBejyqm9rOIlfLMvtF12My5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd68443XwzKFr; Tue, 29 Oct 2024 10:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TAYiPA001757; Tue, 29 Oct 2024 10:34:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TAYiEf001754; Tue, 29 Oct 2024 10:34:44 GMT (envelope-from git) Date: Tue, 29 Oct 2024 10:34:44 GMT Message-Id: <202410291034.49TAYiEf001754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 60344d7e09d5 - main - arm64: Use the common activate function in nexus List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 commit 60344d7e09d51bb7d64a7997e0d9e03de2ca1e86 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:56 +0000 Commit: Andrew Turner CommitDate: 2024-10-29 10:31:37 +0000 arm64: Use the common activate function in nexus For non-memory and non-ioport spaces use the common bus_generic_rman_activate_resource function in the arm64 nexus. We can't currently use it for memory types as it doesn't support non-posted memory. Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47283 --- sys/arm64/arm64/nexus.c | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 3e9399384855..d780c9950e63 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -106,7 +106,6 @@ static bus_print_child_t nexus_print_child; static bus_activate_resource_t nexus_activate_resource; static bus_alloc_resource_t nexus_alloc_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_get_rman_t nexus_get_rman; static bus_map_resource_t nexus_map_resource; @@ -133,7 +132,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_rman_adjust_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_rman_deactivate_resource), DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), @@ -331,15 +330,15 @@ nexus_activate_resource_flags(device_t bus, device_t child, struct resource *r, struct resource_map map; int err, use_np; - if ((err = rman_activate_resource(r)) != 0) - return (err); - /* * If this is a memory resource, map it into the kernel. */ switch (rman_get_type(r)) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: + if ((err = rman_activate_resource(r)) != 0) + return (err); + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { resource_init_map_request(&args); use_np = (flags & BUS_SPACE_MAP_NONPOSTED) != 0 || @@ -359,12 +358,8 @@ nexus_activate_resource_flags(device_t bus, device_t child, struct resource *r, rman_set_mapping(r, &map); } break; - case SYS_RES_IRQ: - err = intr_activate_irq(child, r); - if (err != 0) { - rman_deactivate_resource(r); - return (err); - } + default: + return (bus_generic_rman_activate_resource(bus, child, r)); } return (0); } @@ -383,26 +378,6 @@ nexus_get_reslist(device_t dev, device_t child) return (&ndev->nx_resources); } -static int -nexus_deactivate_resource(device_t bus, device_t child, struct resource *r) -{ - int error; - - switch (rman_get_type(r)) { - case SYS_RES_MEMORY: - case SYS_RES_IOPORT: - return (bus_generic_rman_deactivate_resource(bus, child, r)); - case SYS_RES_IRQ: - error = rman_deactivate_resource(r); - if (error) - return (error); - intr_deactivate_irq(child, r); - return (0); - default: - return (EINVAL); - } -} - static int nexus_map_resource(device_t bus, device_t child, struct resource *r, struct resource_map_request *argsp, struct resource_map *map) From nobody Tue Oct 29 11:14:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd72F6qbLz5bKZf; Tue, 29 Oct 2024 11:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd72F6Hdpz3wtb; Tue, 29 Oct 2024 11:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730200485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNRbhQbqafwltGrqaQ0uY8nXkOrz6CHKkXQM147Irqs=; b=KHtbA1M9d1Tr/a4XdYRmd5n1QO89Cy80TTFEx5FkUf+wXdj0X41uWGdE76YCCtBqe7wiiD CH4pkA7pzfaHo1PsCIZA//4N5IFeeWH8yxIMyHbiE3Y1js4HkapIQvjq5mZJXx6tDaqCMs +cEtFdprdB9isvohn41sKBw+GCfijHzDq5l/POLA2NmlMADML27efBlUtn7tRj6A5J0UfH /ew06Fg2xUJPQFC2KkSg54ij1dL+cqXqOpZN4lA/0OJS2LnfTNYekPf6ijoCPQAIfF9JO9 i0mCmhfP9gYROP/VG9Evz2FNYhHjf8Wb2GbfkfuqLbIHbqpa4M8f1Y5v8y5/Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730200485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNRbhQbqafwltGrqaQ0uY8nXkOrz6CHKkXQM147Irqs=; b=Zby52d2Ay70AlQKsPMqtWpntrcqa70tf5ubhxUMzRp9IOFgkOErRpxcSy8bEEPfwO0XvtZ DcPlwhPDqCxAJQ5c0Rppwl7Cg5uA2naJEAfGSNhvKvqBrSQBUvDbchU9sLXxUQD4kjAjQ3 10aZo1TOCw36sPd9Whd2f6LMhs1DOIOh7FiXhlbpi2yExNPHX5RLTSQCunfl/GtOmySr/J BR3KkzZgmBUsoVt2mLEFjfVNVNW8JTaA0oJckGDOWKQsiDRqNXM6D4mrCfm5/vhoJsfhx2 bi9WJ4h4LJiFRSAYiDK5zToS/PKi/q/vv3g6stayhWdeLs7DnTjWt/CZgDBWfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730200485; a=rsa-sha256; cv=none; b=aK36cF7QhbAMbl35enmcmK3rBW5Iivl3u+Bc7BjTbZXE9REgFvgBJpRl+21zZd2AVZ1bXp TueJkywwPyJ5G1SVlfxGs7RpPIwoPTZqHidi5un+f0pX/wvWxb+epFCX9as/9gbKTFuYMS 7+zwpCV2tyu7DlzgXJA/u2s6mAF2t2IWQc19oo1zLjQJFdt7Kwlz/ns0qBt428kY6/6KmZ 2H9K7ELys9TeKrpz5MU1d93a4Fi+HWZo9dMYdSAgxuuV8f1xHzhxRJJKhEE9xc+oClV8AP aPjZcy6CXi3NvYimduhmOlVtNjc+ObayftT+NcA7c/Q+0LWNWos/SrhwSHDBOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd72F5s9HzLhK; Tue, 29 Oct 2024 11:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TBEjo1075646; Tue, 29 Oct 2024 11:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TBEjic075643; Tue, 29 Oct 2024 11:14:45 GMT (envelope-from git) Date: Tue, 29 Oct 2024 11:14:45 GMT Message-Id: <202410291114.49TBEjic075643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d652801574f7 - main - bus: Fix the non-debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: d652801574f7b1aaf2a9345840861ce5d3768c85 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d652801574f7b1aaf2a9345840861ce5d3768c85 commit d652801574f7b1aaf2a9345840861ce5d3768c85 Author: Andrew Turner AuthorDate: 2024-10-29 11:06:57 +0000 Commit: Andrew Turner CommitDate: 2024-10-29 11:06:57 +0000 bus: Fix the non-debug build We read the rman type twice. Replace the second call to rman_get_type with the value we already have. Reported by: bapt, Herbert J. Skuhra Sponsored by: Arm Ltd --- sys/kern/subr_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 681971df4307..8fec2b3de139 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -4367,7 +4367,7 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, if (error != 0) return (error); - switch (rman_get_type(r)) { + switch (type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { From nobody Tue Oct 29 11:27:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd7KG42Nsz5bL9p; Tue, 29 Oct 2024 11:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd7KG3V61z3xxG; Tue, 29 Oct 2024 11:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730201266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h7gVYldDZHqIL3bLSrhKfoNocnvdAGhyw/inuHA303g=; b=f+T8tFqoZiq76bR+lOZLWr38salDS1dzeSBVn02epHw+iU30JAwWg7vrkmqhcIjcSK1hY7 6/uZq1AjW/7HNuoIRiDaID7+VXOHgdZgWTuhN6HwN/+xneFbXO56nUt+2BrlPi9btr8R2n WlrgYonv/CSBEKSAoAp8Rsp/rcmynbMkzVCNdlG5SHvCQ3uIjm8aO+C7JoNzi6+dHb+4pt 5P3SJsZS9OxvEq2JkvglLh1STEooAuXYoL9S51Gn+vAyoz28bXzxN83cVaDi/vLZMqcDfM 3mPfVaRG/GH20aS7obe3NzpnoE/KOcc0zclbbcStS+/sDWIRRwdITbODIt43Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730201266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h7gVYldDZHqIL3bLSrhKfoNocnvdAGhyw/inuHA303g=; b=FUsJ0l2yL+LB7iD8a5C3uPMn/tMzMYV4TTIBUfUgSgHPeGvR4XkvX4pYCTFQfWcuSQNrBP yWTirjHbQXlV1/yC13FH8HGrbqBPYiEeFx7Zu8vw1bVFQW9JPIcZTHwuf5DykuL8OE+4vg NV+6Gza/fcjmPqo3MWVe2NVic2T9Y5xRDtLLC4V6T9a3UtOv4BBEjyOZui++euy4Ampx6z qbgYLFHoHr6i6qVqVSIPggln011TUZhP6hUPoLHNW//+ATopJLHlPhVI+2dBqx4hvQ2hEc +VbWS6Imnti41r1Ha3wBqEG/7Rm7k638+gruDIfpMY/s6JofVlm0LF1/QgdwQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730201266; a=rsa-sha256; cv=none; b=sHp1ZKLXkVQxftNtKeirQgXUq2R3tJ1MxZ5GtxZ0eyT+c8hkvXIk7BjqtGf4Lp9Lw6Q0xU pUiHP5ft2v7O7+TrIk9G+5QW5SmHUBhSungGKj7lC/oetcnOiBuBElizV/0k0xdeq3rRMJ CaZYAiqxZpf2g6/Ru9M3dpFqRPnNWIQE2EOU8rMmdiLNUhZdp0/Fy5xTlsnSgp0u80og2R OSUo30mfmHA7rBgQOGZmlCpTmTjYzo5q2LWCJceDfTx8F3l4mveiJ1A6DdUSaam1KZe5X9 WxqxQbvLax/UzqiRql0/3cHpPRrEG8ed8xkC+3pXROs7NPmmu6gpySwWTSkaVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd7KG33RWzM5h; Tue, 29 Oct 2024 11:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TBRkt4095014; Tue, 29 Oct 2024 11:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TBRkag095011; Tue, 29 Oct 2024 11:27:46 GMT (envelope-from git) Date: Tue, 29 Oct 2024 11:27:46 GMT Message-Id: <202410291127.49TBRkag095011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5ec83c660aca - main - sysctl: Add flags to filter jail prison and vnet variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac commit 5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac Author: Zhenlei Huang AuthorDate: 2024-10-29 11:26:11 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-29 11:26:11 +0000 sysctl: Add flags to filter jail prison and vnet variables So users do not have to contact the source code to tell whether a variable is a jail prison / vnet one or not. Reviewed by: cy (previous version), markj, jamie (for #jails) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D47107 --- sbin/sysctl/sysctl.8 | 9 +++++++-- sbin/sysctl/sysctl.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index d350b62e67a3..792ebf6c4e9d 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 18, 2023 +.Dd October 29, 2024 .Dt SYSCTL 8 .Os .Sh NAME @@ -111,6 +111,8 @@ The purpose is to make use of .Nm for collecting data from a variety of machines (not all of which are necessarily running exactly the same software) easier. +.It Fl J +Display only jail prision sysctl variables (CTLFLAG_PRISON). .It Fl l Show the length of variables along with their values. This option cannot be combined with the @@ -153,6 +155,8 @@ to standard error. Display only variables that are settable via loader (CTLFLAG_TUN). .It Fl t Print the type of the variable. +.It Fl V +Display only VNET sysctl variables (CTLFLAG_VNET). .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. @@ -325,7 +329,8 @@ option has been deprecated and is silently ignored. .Xr loader.conf 5 , .Xr sysctl.conf 5 , .Xr security 7 , -.Xr loader 8 +.Xr loader 8 , +.Xr jail 8 .Sh HISTORY A .Nm diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 9e81f4480e40..1a9cb0a13254 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -63,7 +63,7 @@ static const char *conffile; static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; -static bool Fflag, lflag; +static bool Fflag, Jflag, lflag, Vflag; static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); @@ -136,7 +136,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:FhilNnoqtTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:FhiJlNnoqtTVwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -169,6 +169,9 @@ main(int argc, char **argv) case 'i': iflag = 1; break; + case 'J': + Jflag = true; + break; case 'l': lflag = true; break; @@ -190,6 +193,9 @@ main(int argc, char **argv) case 'T': Tflag = 1; break; + case 'V': + Vflag = true; + break; case 'w': /* compatibility */ /* ignored */ @@ -1048,10 +1054,18 @@ show_var(int *oid, int nlen, bool honor_skip) if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) return (1); + /* if Jflag then only list sysctls that are prison variables. */ + if (Jflag && (kind & CTLFLAG_PRISON) == 0) + return (1); + /* if Tflag then only list sysctls that are tuneables. */ if (Tflag && (kind & CTLFLAG_TUN) == 0) return (1); + /* if Vflag then only list sysctls that are vnet variables. */ + if (Vflag && (kind & CTLFLAG_VNET) == 0) + return (1); + if (Nflag) { printf("%s", name); return (0); From nobody Tue Oct 29 12:10:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd8G55fSQz5bNjh for ; Tue, 29 Oct 2024 12:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd8G5596gz42Y0; Tue, 29 Oct 2024 12:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730203805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Kt3el7IQjb+lSDBXN9PU5DlJz6j8gYO8plZbid5W3M=; b=TlfhVNKM+6jCw0ge9QpjR4hgjtk/TjH88Ho+qnlr8IkCYeJWNo1EkCvGM0MScax3uW8dHb Bw/W6qrtKuR/zHTHqiyAql0JC2cgtBKazJiB8Nayt9v11+JuU6VzZNhc0lT3kFOyd3L7s4 V1wkpd29+NP6hivVq9LHHq2kRLHD1EaaG8oip8bxvITYyuXODZWEXsoO+1RFLBf1mUp8SM 2Yf0Fa7NK4oDBcCXSGxaVOXq8f3eula9cGWhWpcKlVo6aQS0KQi8GE5/HAGaVaCOcufLlM wTVelkdet3gQmDYMi/PSK0vm1hGGTalHaCl1rbN3nJegs7q5GSKCHkzzOd6brQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730203805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Kt3el7IQjb+lSDBXN9PU5DlJz6j8gYO8plZbid5W3M=; b=GpLLrWvlNbWxAjfEgXTeKeQGnjnKb0Kq1rFkrI1RPs4oRDfqZTc/CMugxaWHTWUGVK85Ys qSyM+074VpIQYqcNonJoLkW8qgpjeG5t0n1JIpm15YXyyK9OOIvcqK6R1NuKOGoIjWwCON FP+ngMcqNdgMNpbnALKrc51JGfGyCjcoQfgJVq1IzIq5KPpBdi6HSZGvgJaml0jrFHt15/ yDgCaAB+DzhwHGMfm8JxYTbmMs7tSEMQcvNvDAHNPjTXbUzxY+nn6mkijl9blBFKHxOLtj yqB1upnNAGbJXHNLkyX9uLyEbaJSo1fVc1/P5+kMo+Bbr8/ZAC4DHgh9sbNFfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730203805; a=rsa-sha256; cv=none; b=tL+sm27uI+Bx79zGtvpuoUal3rDfkbS2bT16GMwoGtVIqoNroVYj1Vi6ENeCVxUtKb4Qj0 8Tzu2jaP7JhNw5idvh/YVp+SS3C5jWO6DNohZEvSuB6fDbNR3k90FD2a9zWxuRJc65dpoX TE+Aa3+MYpJj0o3cmV41O25hlJmDw1WqRcmcVGeCKfBgKGy/XGtFZ0On5NR89L7ojxoOe/ TqoBZbSY7A1X4QSIw5dx+xglI8tx5dp5VC3SgJ7xMsUhMvtQLfMF08yujWcwruCiikcLCZ mM122efwD9wcDZOiQyEdOA5CaUFOHklNVJFpH4p7JTrN94xYBlx5XpTn3H83wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd8G54mp0zMnh; Tue, 29 Oct 2024 12:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TCA5q0073484; Tue, 29 Oct 2024 12:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TCA544073478; Tue, 29 Oct 2024 12:10:05 GMT (envelope-from git) Date: Tue, 29 Oct 2024 12:10:05 GMT Message-Id: <202410291210.49TCA544073478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 38509f5c2683 - internal/admin - Officially release wosch from mentorship List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: 38509f5c2683fcf0422f9be1772922c891f08d5c Auto-Submitted: auto-generated The branch internal/admin has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=38509f5c2683fcf0422f9be1772922c891f08d5c commit 38509f5c2683fcf0422f9be1772922c891f08d5c Author: Ed Maste AuthorDate: 2024-10-29 12:03:37 +0000 Commit: Ed Maste CommitDate: 2024-10-29 12:05:41 +0000 Officially release wosch from mentorship Wolfram came back to committing to FreeBSD in 2017 after an absence, with cem as mentor. It appears that releasing the mentorship was forgotten, and cem's commit bit has now been taken into safekeeping. Approved by: srcmgr --- mentors | 1 - 1 file changed, 1 deletion(-) diff --git a/mentors b/mentors index 0dc824739e1a..9261c10fa519 100644 --- a/mentors +++ b/mentors @@ -24,4 +24,3 @@ ram ken Co-mentor: mav rcm kp ssaxena imp theraven markj -wosch cem From nobody Tue Oct 29 13:01:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd9PN298Pz5bRQq; Tue, 29 Oct 2024 13:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd9PM56fYz46mZ; Tue, 29 Oct 2024 13:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730206887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n9qksRRb7ksWjF1W2m6nOjNnhk6x6LSzganzp/+Kf2g=; b=AJag68l+Ncpwu7ODqNgjo4ueFyJVBvH4Kta7E1tU7Na8cJ2Y5Jle5tR2rrPQxTamscYv74 78nvo4sZdQclzK2vcmleuxWLw93sL9hJmnPGgrDlLLuUM+Axi7p6hlUdGfr3gwQc/7u6tZ rUgsU/D1u5jWrtb9E8u7C4EULh2R63khKu4sQsUNdn0iNHfBNNTELUmF2+JSHT9CmuqjQH 3w4YHUqZ3R5yBTCqUDi5eb/w0W3txIF4cwJnrt9mIg3AUI4EMJi+LcBt9DtS/jJAYViN29 HRJ0I+4U/XM8NVRrRM6qlzNeB06Sr44ItDLtR9e17eOD+dmbD8npqSDVJqXlsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730206887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n9qksRRb7ksWjF1W2m6nOjNnhk6x6LSzganzp/+Kf2g=; b=lkDPcM7nbHg5Qq46Op2kiGKH/w/lPy6bZDyW6yblkys5dHzqkjzIOllAAoSBiVHp5J2LWi t919knW2gjOSZPaKwfYTaKBJuPqEQWm4TR9v++uYaOQrhPBBSj0Wx39xZ0O55Nu+KrxvPX 8dL6qT/CUXmORI7w5ltsMZRQWoPBqTGg6Z10etXsfTZq8CEFD6nVUFJKowlQ9Vz180fQ/1 GMcqRZLJRqbq46LbckOSLn/cOcAG+M16JT7mnl8Rqnn/sihXaQBXQR/qiaQDdto7WoSNO9 tJUoqSnZeS9oTaRGpJD/Kzd0wjU5cuP+BWWX36Wr4WeEWkLs9XmUT3xFY/SQRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730206887; a=rsa-sha256; cv=none; b=exQFEBavVtqKGJfd0/vuinlWahVXXlfDHeKoJoeRnXxWxF90xjIQHeZdcXidj//Z8fjFst q+8pe1R5wok7VkJgYhiTI7pAO7z/xbnc2zJmFh8b1Rxg7xkwYptaoRFrdlTazyGqxudkEx D5V/Im+PhkH9agzv8+6yuXEGxqwxYVwAm3XfrQWCOdJW4wK+YjkMjlCDJ4MsYCHNcnKV1D Q6UOfa7ZI5Wo6K/KKKh10lMKU+mD1xOtzbNvmhu5UxiJ6SQ6zskU5mhP6ni3O/7Z5PUJPg N+4itc4tm4eJEMbeqbe551Jrt3IRfrypuempoTv4oJXfFu1gJtk6x4XOdTNqIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd9PM4kmXzNqk; Tue, 29 Oct 2024 13:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TD1RMM076443; Tue, 29 Oct 2024 13:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TD1R3V076440; Tue, 29 Oct 2024 13:01:27 GMT (envelope-from git) Date: Tue, 29 Oct 2024 13:01:27 GMT Message-Id: <202410291301.49TD1R3V076440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 207ab5f4f1eb - main - rc.d/opensm: Only install when MK_OFED_EXTRA is set List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 207ab5f4f1ebcbfd6f3f2ab619baf08862d0d08d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=207ab5f4f1ebcbfd6f3f2ab619baf08862d0d08d commit 207ab5f4f1ebcbfd6f3f2ab619baf08862d0d08d Author: Mark Johnston AuthorDate: 2024-10-29 13:01:00 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:01:00 +0000 rc.d/opensm: Only install when MK_OFED_EXTRA is set opensm itself is only installed when MK_OFED_EXTRA is set, so it only makes sense for the same to be true of the rc script. PR: 257646 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47313 --- libexec/rc/rc.d/Makefile | 2 +- tools/build/mk/OptionalObsoleteFiles.inc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 69a643a248ef..6e2e9d30ef79 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -286,7 +286,7 @@ NTP+= ntpd \ NTPPACKAGE= ntp .endif -.if ${MK_OFED} != "no" +.if ${MK_OFED_EXTRA} != "no" _opensm= opensm .endif diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5fd46135da0f..da2f0c15d11e 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6540,6 +6540,7 @@ OLD_FILES+=usr/share/man/man8/ibstat.8.gz .endif .if ${MK_OFED_EXTRA} == no +OLD_FILES+=etc/rc.d/opensm OLD_FILES+=usr/bin/dump_fts OLD_FILES+=usr/bin/ibaddr OLD_FILES+=usr/bin/ibcacheedit From nobody Tue Oct 29 13:24:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd9wP5VPsz5bSg6; Tue, 29 Oct 2024 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd9wP4hhNz4CNK; Tue, 29 Oct 2024 13: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=1730208293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CycGij8Y8VzqNfoftdfNDu9+S+Q0LMvXLTIBtBrYSMU=; b=heGG3lw/o/fNLrAeAQxWuvtBsDLWRz/U8waATEa9ZkCciPmluoBGQmg4QDb+wo4fWkBCtv yZWNUTcGqNnyB/HQAubI5h+Ct8ewrR8pMEbBlqrTxnb8gNBAdsVAxRDSc7pf9z07/Pvs8o kqeAtoTeS6oRjHKJAUN2LYqSgDQbUqySjNBrCS3covOHTfGTG1NyOr6rgeQ5Si1X54YogL U/Potf647gqgv0lWASUq9gOa10rL6g9ycckgDQKehho9YoNRui/Px/bMwutItPgvK02Gha 0/Drwwrlv4l3NzwxdXOKLO/K2xKDrloq8H4YBJOjrC67cQIe3eKqS9vJJ/c7LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CycGij8Y8VzqNfoftdfNDu9+S+Q0LMvXLTIBtBrYSMU=; b=NS6OogKp+RPEMBgEqb0K8+Uu9/u8fUVGbeH09hg42111KrHCRkdGOOlbMChIT0FYoqModU c4b4GpMM8Y1YFpW8jmtoHCMdWPyksxA8DekG71otwR8rz+7l6tseaT74bYKhg05/aEYTh0 tQZRNUQn/TyTfz6ysRaGsF2kAohLPrHrXz7gflIQeVveB0o83Ynn8HjoiEslRuEb4auxDx BsUFtA3WsQ/Q+gWT9pt84jj6RPToUv+no0nv8CQO6Jiali7iztHL5e3G8zLDMMVsLyr8SK VbR8y+I59v6MjOIy+XYIXhHEN0i6c00y4heuj9wQMDwX5aRShQNJxtWlSQ9tfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730208293; a=rsa-sha256; cv=none; b=epIf64wtm0BPrUj/xX6CLoAYz9emxdvPcuoiDXGrIkNb7WqQxZIpWFyaI7ggpA7o8Y4ZNh iJxMNBdl+EtNXcr6SxblQU1//UivfhB+YWKOJUS6MdyUuLYijD6q3EKAvNb7th1OTtWJ3O 0H9efN1sAMNqbS0VyY+lT0j7DC1hSJXAn5lQBoNPvtAKSOBozqYelc/B+/M0xxUheB7OVO aLaiSH31Cm0UZMT1AVkEDjfWVqL495lYjGpE1IhB8ZKpaPQdncrF096TkjiO7gcW2yOimy RHiVVLeiZQrOx8+dzb8XzTD3SG9yYo8akBT5ZAzfTehHAmHp+OoyLcDH4ct2ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd9wP4BjtzQKW; Tue, 29 Oct 2024 13:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TDOr50017554; Tue, 29 Oct 2024 13:24:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TDOrqu017551; Tue, 29 Oct 2024 13:24:53 GMT (envelope-from git) Date: Tue, 29 Oct 2024 13:24:53 GMT Message-Id: <202410291324.49TDOrqu017551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 2775b9b0bcc2 - main - nuageinit: add support for OpenStack network config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2775b9b0bcc278dd4183b57784953c26a3fcdc89 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2775b9b0bcc278dd4183b57784953c26a3fcdc89 commit 2775b9b0bcc278dd4183b57784953c26a3fcdc89 Author: Baptiste Daroussin AuthorDate: 2024-10-29 13:17:39 +0000 Commit: Baptiste Daroussin CommitDate: 2024-10-29 13:23:47 +0000 nuageinit: add support for OpenStack network config Add naive support for openstack network config. if no config driver have been found, try to detect that we are running a VM on openstack via the smbios information, use the first iface available and temporary activate dhcp on it, to be able to fetch the necessary informations for cloudinit. While here make the rc script execute after devmatch, some ethernet device might be attached via devmatch and may be needed for cloudinit. Tested on OVHCloud Public Cloud. MFC after: 3 weeks Sponsored by: OVHCloud --- libexec/rc/rc.d/nuageinit | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index a44761ea1d9e..54e5b1fbec07 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -2,7 +2,7 @@ # # PROVIDE: nuageinit -# REQUIRE: mountcritlocal zfs +# REQUIRE: mountcritlocal zfs devmatch # BEFORE: NETWORKING # KEYWORD: firstboot @@ -14,6 +14,18 @@ start_cmd="nuageinit_start" stop_cmd=":" rcvar="nuageinit_enable" +fetch_openstack() +{ + cd /media/nuageinit/openstack/latest + for file in meta_data.json network_data.json user_data; do + fetch http://169.254.169.254/openstack/latest/$file || : + done + if [ -f user_data ]; then + chmod 755 user_data + fi + cd - +} + nuageinit_start() { local citype @@ -34,13 +46,28 @@ nuageinit_start() fi unset drive done - if [ -z "$drive" ]; then - # try to detect networked based instance - err 1 "Impossible to find a cloud init provider" + if [ -n "$drive" ]; then + mkdir -p /media/nuageinit + fs=$(fstyp $drive 2> /dev/null) + mount -t $fs $drive /media/nuageinit + else + product=$(kenv smbios.system.product) + case "$product" in + OpenStack*) + mkdir -p /media/nuageinit/openstack/latest + ifaces=$(ifconfig -l ether) + set -- $ifaces + dhclient -p /tmp/ephemeraldhcp.pid $1 + fetch_openstack + pkill -F /tmp/ephemeraldhcp.pid + citype=config-2 + ;; + *) + # try to detect networked based instance + err 1 "Impossible to find a cloud init provider" + ;; + esac fi - mkdir -p /media/nuageinit - fs=$(fstyp $drive 2> /dev/null) - mount -t $fs $drive /media/nuageinit # according to the specification, the content is either # in the openstack or ec2 directory case "$citype" in @@ -59,8 +86,10 @@ nuageinit_start() esac if [ -n "$drive" ]; then umount /media/nuageinit + rmdir /media/nuageinit + else + rm -rf /media/nuageinit fi - rmdir /media/nuageinit } load_rc_config $name From nobody Tue Oct 29 13:34:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdB7D2SwSz5bT8Z; Tue, 29 Oct 2024 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdB7D1xkLz4CxY; Tue, 29 Oct 2024 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W63SIOg5hLf6t46JHaqC0x+5HoByWlHphn1WBiTl3h0=; b=G3mU539SBLghL8gIIte88xvcq+FsrXo3RxidXNpKZmWlRX2qXIbQZvxqQwD3Jjh9Mx+lCr 5qnyBYNBM/6ehOT90o8qPc15Uvvm4RgbZ3jYiUtThQGF3fNLORAZ4ikNA4Rp6+mvUoc2aK YxFYJGYRxDICAT1+ySdjx0GrdFEMRXBNIbKJtAxTB2I6kehcCRAoMFNL8lROX8nktIT72W qI6WSf/HpwTiYPorm1aB+hIB3sKkWfsxjS4sgUCxNWFVulUwvZ7cgr0DQYIE8QE7CZSX6r JcpFRt0uBQ5nQAO9zK1yAQNFcB/zpC+PvA78v2qv4d/hpq8cHFaR0RrkSAF8+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W63SIOg5hLf6t46JHaqC0x+5HoByWlHphn1WBiTl3h0=; b=ULlpwxHa2g1z2ByL/jU7g6/ou3pbJoHf+dUovNalLRsPrrrA++y3j6tV41CwRt5l5ti1oJ 75HQF3u6S+1KrTlJ9JZeX2HUkIrpckDNSkqKYuzXiXj7B+/yOX9I6DG16+WBmAYzsQXcWz ucMHPKRFmtVa0/+nOyZjyLhv4ZlJ7sh8Qx6qn/okS1EKNcGJ6MfDp70aYDf04ugJEOPivM 7u2lcNHbG0KtLpfdFGcD6DS2FFh2DYKQivn+OJVC4PO8WshgIhaEqzpr4QRRngNbvhMXJ9 b2SQ7lNNhvrgdGvOAhm6ac1lqSlbQ/u3XzkqdWqiiAXo+kz4j0h3Rncfst/XzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730208856; a=rsa-sha256; cv=none; b=F3UxmrNw78KxsW/ECu2VgdhwQTk6Z69KHdmOFvolKwBsrtoHORAyXfdlIbJJ/eYBlQHDYN 71+bsSJtC//EdtoLfNqtWXU+dZfKJVuP+56BNv/YQyevP3oCH4jAsww2PInxP5APqqqXJ4 SdI8/2AvBumD1SRnYBxa5m54Y3Pk89RAZo2yKMpHqd92z8pjxQLEv440G1yoNhHFjKKmH6 F3DuOlnIuAfZ/spJd3kxh26grvQE1OtNeJ2xBNrG840hhac0sZjub5L7wqPMf8Xiu0+TrP Ta6nkcjdiHWfS46Qa0M2FU+Iiida58n4eVfo0Xncj/YAaE+zOg52NMfdjRiAZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdB7D1XFdzQVg; Tue, 29 Oct 2024 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TDYGYh035717; Tue, 29 Oct 2024 13:34:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TDYGRO035714; Tue, 29 Oct 2024 13:34:16 GMT (envelope-from git) Date: Tue, 29 Oct 2024 13:34:16 GMT Message-Id: <202410291334.49TDYGRO035714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9b42b9863808 - stable/14 - vm_object: Report laundry pages in kinfo_vmobject List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9b42b9863808791a24ed77e80c5d64ab47211019 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9b42b9863808791a24ed77e80c5d64ab47211019 commit 9b42b9863808791a24ed77e80c5d64ab47211019 Author: Mark Johnston AuthorDate: 2024-10-22 12:47:52 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:04:25 +0000 vm_object: Report laundry pages in kinfo_vmobject Reviewed by: bnovkov, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47214 (cherry picked from commit a86373bc93ee1c850943e8585d0d426479378145) --- sys/sys/user.h | 3 ++- sys/vm/vm_object.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/sys/user.h b/sys/sys/user.h index 945a51f6c3de..7e4ab5bd914f 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -607,7 +607,8 @@ struct kinfo_vmobject { uint64_t _kvo_backing_obj; /* Handle for the backing obj */ } kvo_type_spec; /* Type-specific union */ uint64_t kvo_me; /* Uniq handle for anon obj */ - uint64_t _kvo_qspare[6]; + uint64_t kvo_laundry; /* Number of laundry pages. */ + uint64_t _kvo_qspare[5]; uint32_t kvo_swapped; /* Number of swapped pages */ uint32_t kvo_flags; uint32_t _kvo_ispare[6]; diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index d2ac8f696634..06dae7de3baa 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2583,10 +2583,12 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->a.queue == PQ_ACTIVE) + if (vm_page_active(m)) kvo->kvo_active++; - else if (m->a.queue == PQ_INACTIVE) + else if (vm_page_inactive(m)) kvo->kvo_inactive++; + else if (vm_page_in_laundry(m)) + kvo->kvo_laundry++; } } From nobody Tue Oct 29 13:34:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdB7F3RT9z5bTSt; Tue, 29 Oct 2024 13:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdB7F318Dz4DBV; Tue, 29 Oct 2024 13:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXfZ8D9dIHuF7eVyJN0U69r7OV2FQdizFpZjsi3ZNLc=; b=Yvi5c6bS+OE0HKQMfgUTBNsR7CpqHfk2b6lu9ZXxVKtgm3XdN7Fd9Dl0pU3KWyuShHrW2B 2gvNKaUup7/A/IGXO1v3ZGHj+EIqo54cuSXqlDabcimJyhp8ruLYXr0bHZlqB0ZjVloF7z hw01SXn25AtHMmwwo1++wiaknge5MNVJiHW/Mc5uC74g6GQm7fCx2z7wZqVCO/bTdMyzU9 2zEOVLsHZwQaOlf7J3jmve0O68Po1fzpwmo47Z23zxkr8mpjZLwVaFv70GYgk07hZRQb5b htSaW++/oHEmFs2+SbWGysdrmNpsRLtt7ki/2eRUmIP/Cz06ix3rDpKiA1+84g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXfZ8D9dIHuF7eVyJN0U69r7OV2FQdizFpZjsi3ZNLc=; b=U9nK5kdlunfjZ44qzXxtgRmV7MZQ0RzlmoIuSJ9r6wA1CGLCmHwnyeaeYjfaY7fmVZRmEn bN1sjAKtqPNJRdJszVPcQ4qwJf8xHbXEvU8jk2nQ4dbyPILUmDATgGBubRC+nhVt5gbgxr 7sUAVSOtptEaHlFwX3z8iB/l7lBlHEO6AaEk2CqlFnmW8KaMh3edpH+5E2irEtkO7g49ID Lu6vxc+9GiJGikVdo0oVD6JCsKQkWXVR8IMowqDkRLlhMkm46YSMeCMKqBwVQ0XjwS5qIe fi5fpfuIVUSsrayziUe74fYyHwZmaIYqQjhmOTqTq1Be7UNxvXjFUP+j6nK/bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730208857; a=rsa-sha256; cv=none; b=cTU9LyQBchFoHRWbTGO0w13BKb89T0SykrBX6sUR0Gw8dEYgHxrn2u6XJJQ3A1g2ndX1WD maqow7KhE5hAKtfYMWU+JPpZdACOBcrTfDXEFAxkwbpAKzBDKoy3Om9N/yQ6yql6q82KDx D1Wisi2x8Cu9lspoIsQZCKdBZ2lVdoxEweLPmuR1KBPf7tn3nkhA5ttRbLUmU5SSi6hS8G q7wuzZ/fLL7Dc5suk7IZ3W5vp1ESQOE2xpqGCAuXCxvpEfr+/hGkuiq/VP8cp5ryyW3LhC itEzHpiNaHw997YA6sLv7JYuS7Q2n1VPVZRow+s4M0XN1PcB3s3wXT0q0DwKKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdB7F2b0YzPmP; Tue, 29 Oct 2024 13:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TDYHjv035777; Tue, 29 Oct 2024 13:34:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TDYHGX035774; Tue, 29 Oct 2024 13:34:17 GMT (envelope-from git) Date: Tue, 29 Oct 2024 13:34:17 GMT Message-Id: <202410291334.49TDYHGX035774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6feb4f363cdb - stable/14 - vmstat: Add a column to vmstat -o output for laundry pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6feb4f363cdbe6a41ca631b37d1451cd5f1191e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6feb4f363cdbe6a41ca631b37d1451cd5f1191e0 commit 6feb4f363cdbe6a41ca631b37d1451cd5f1191e0 Author: Mark Johnston AuthorDate: 2024-10-22 12:48:04 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:04:25 +0000 vmstat: Add a column to vmstat -o output for laundry pages Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47215 (cherry picked from commit 1249ee57e96b84e84015b433d0a3bfdef0c108bf) --- usr.bin/vmstat/vmstat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 0fee2395071f..3ae34c0219c6 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1470,6 +1470,7 @@ display_object(struct kinfo_vmobject *kvo) xo_emit("{:resident/%5ju} ", (uintmax_t)kvo->kvo_resident); xo_emit("{:active/%5ju} ", (uintmax_t)kvo->kvo_active); xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive); + xo_emit("{:laundry/%5ju} ", (uintmax_t)kvo->kvo_laundry); xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count); xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count); @@ -1572,8 +1573,8 @@ doobjstat(void) xo_warn("Failed to fetch VM object list"); return; } - xo_emit("{T:RES/%5s} {T:ACT/%5s} {T:INACT/%5s} {T:REF/%3s} {T:SHD/%3s} " - "{T:CM/%2s} {T:TP/%3s} {T:PATH/%s}\n"); + xo_emit("{T:RES/%5s} {T:ACT/%5s} {T:INACT/%5s} {T:LAUND/%5s} " + "{T:REF/%3s} {T:SHD/%3s} {T:CM/%2s} {T:TP/%3s} {T:PATH/%s}\n"); xo_open_list("object"); for (i = 0; i < cnt; i++) display_object(&kvo[i]); From nobody Tue Oct 29 13:34:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdB7H0bZWz5bTBm; Tue, 29 Oct 2024 13:34:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdB7G3jNPz4DF9; Tue, 29 Oct 2024 13:34:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmaH/0OF0+HNHRlBMDGuejU9sy8Uo1tAYErquEb/lpA=; b=YUIThd0vxklaaDdoU93ueXCv9O+JbzQ8Ew2SVqILYVijV2gU6/V98RspYStatx6YLxm2mW ioUgauDLLNpdpNRSmGFbN0SPLfBI2fJ53SzlmCyFQee3u+gv/G6IkmbEmuUoHRbeDIJp93 RyBxPM7iCtfdOF/HQbcOh86QjHHVBZC8JEaXlnq3M9wNIQP1phcRctQkz1rY3oIkOicViD E/GKH3firBGxmjT6aneY+3jRrNohs8APY5tsmBN8d+SMbiUx8MgbSPSh1ebgv0gxsZ1HR7 vPQ/3BG8641wRV8R50l/+C/XyNwNng9wA46qEdofNRg066FrdzbSAsI/TJNRjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730208858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmaH/0OF0+HNHRlBMDGuejU9sy8Uo1tAYErquEb/lpA=; b=DAT7Iq4AK6UBbUGrJICYlUlp4Z85LDcZ6RWsum6DGApmvVR/IfWtUBEzqArRNqQS3Qv6PF PgVh6BKsl95iOWEyoOsufrFpKlojMYtLUjiVtQCmPUY9LasXruacwoqAEHSAgga179n83J MOwsrJqa7+WyODTal+2rfqIn8kYS6+P4MCTRFFgcpDIioddeCF0x9+c69ALeIg8J+18Wv2 j8xXZPP+rbS6oGfRenV/JkD5n0RZa93Cu8n4L7KduLlhLoOUIksWzUhA1TpOgDA5387wuB 9oqsyY4s0N00WPkBSPLVl94WoG3QWvqfGts5ow2mVPMqx+UWuQ3Au1mn3zBG6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730208858; a=rsa-sha256; cv=none; b=aby/B29OrsvM+hVbqoN/biW+2vBeym8JjJLLK9zHuYDwzevF9PzbiwyjHAdn+R2SLLkcbs zpVUQIwXwSDGxLxC/IXjsUi6UqmKG0MuyXkDvQ4VCfnh4Me8V01t7lpmtm7RVuiI4JL3YA RoZlVVIRdZHmgVl9WX92DBDv1iHXaQZ1vRWvopxsX0Gf2G/ML4Ty8+zNvZq1kgGh3gUPQl Q/yrEoXIWjzvbAmtjS3wcugfgcEZWTPCEPwx6P/3LjYP7bd1tUz1otbI2Hvsr3UH9t0dDu wTJP7ZpmY8fjlGxRE3jLeMu9qLvnXd7FpK27+pR+SBz2OJU3vq1A6fSG3gcCig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdB7G3FhgzQWg; Tue, 29 Oct 2024 13:34:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TDYI7n035816; Tue, 29 Oct 2024 13:34:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TDYICb035813; Tue, 29 Oct 2024 13:34:18 GMT (envelope-from git) Date: Tue, 29 Oct 2024 13:34:18 GMT Message-Id: <202410291334.49TDYICb035813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1d271ba05fce - stable/14 - vm_meter: Fix laundry accounting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d271ba05fceb1ef6246e8079bc19e3b6416a833 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d271ba05fceb1ef6246e8079bc19e3b6416a833 commit 1d271ba05fceb1ef6246e8079bc19e3b6416a833 Author: Mark Johnston AuthorDate: 2024-10-22 12:48:43 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:04:25 +0000 vm_meter: Fix laundry accounting Pages in PQ_UNSWAPPABLE should be considered part of the laundry. Otherwise, on systems with no swap, the total amount of memory visible to tools like top(1) decreases. It doesn't seem very useful to have a dedicated counter for unswappable pages, and updating applications accordingly would be painful, so just lump them in with laundry for now. PR: 280846 Reviewed by: bnovkov, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47216 (cherry picked from commit 6a07e67fb7a8b5687a492d9d70a10651d5933ff5) --- sys/vm/vm_meter.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index aaea39486baa..75395f69c1db 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -458,7 +458,8 @@ u_int vm_laundry_count(void) { - return (vm_pagequeue_count(PQ_LAUNDRY)); + return (vm_pagequeue_count(PQ_LAUNDRY) + + vm_pagequeue_count(PQ_UNSWAPPABLE)); } static int @@ -480,6 +481,18 @@ SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_vm_pdpages, "QU", "Pages analyzed by pagedaemon"); +static int +sysctl_vm_laundry_pages(SYSCTL_HANDLER_ARGS) +{ + struct vm_domain *vmd; + u_int ret; + + vmd = arg1; + ret = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt + + vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_cnt; + return (SYSCTL_OUT(req, &ret, sizeof(ret))); +} + static void vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid *parent) { @@ -506,8 +519,9 @@ vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid *parent) "inactpdpgs", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_pdpages, 0, "Inactive pages scanned by the page daemon"); - SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, - "laundry", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt, 0, + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "laundry", CTLFLAG_RD | CTLTYPE_UINT, vmd, 0, + sysctl_vm_laundry_pages, "IU", "laundry pages"); SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "laundpdpgs", CTLFLAG_RD, From nobody Tue Oct 29 14:08:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdBtX4kjtz5bW3V; Tue, 29 Oct 2024 14:08:20 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 4XdBtX2yVRz4JNf; Tue, 29 Oct 2024 14:08:20 +0000 (UTC) (envelope-from mpp302@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a99f629a7aaso875103166b.1; Tue, 29 Oct 2024 07:08:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730210899; x=1730815699; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xr4bVzGhn48Vy7jGvwyYeQpcb7k6BFi2bhpZDoF0ZkM=; b=pD8CxcEXLh3+NzcjdcgIeD/aq1Ja2EqLOIzurtE8JooUGUbgAWQhYxxlxNGQpOFp3L x0JSaXEvmcmlOdMqqqQxphcQwBOf0xpImGHBC8faCs8KsWb/v0W167zBiNY2wirWgz6U 1ulgsxnZ4Rl3HDIpd/UKGRqgTWeelOM9ufBP5NUR18OX2mzsalUKSXC7ZwjVriABXvZ/ wBLlU0pLeiIZq0ECJiwhn2LZ/pA4cDE1c5lErrfGaICUOkmpQfgzIX6xNOCW+mzYOQkk +cGCNZLESHwFuMVwFenXAdDRo7rEyH9i5Q51QU8IxHi/obCGc+PyRqZ8IuAFnX2kwVA7 4YZg== X-Forwarded-Encrypted: i=1; AJvYcCVB+xyXrGM8ghkk1TpqZOtTOwQgZdakoufxgQ+6hzVTb0ZR70tlfPXvwoSvGYj266YB812S+rhNbpZqmPElVwS7ECF29U8=@freebsd.org, AJvYcCX7wnDwdU4dVaRFMMZ3tSi1E7xvd79Za3y2Knq6UZsWAA2U1t19Gb9zEPppwyQIdAIVX8DbV6JcXnyMZjKntzqfk+aF@freebsd.org X-Gm-Message-State: AOJu0Yy8nO4nQOBEDVS238oZmaD6I0Cy95gIYvYTMRhdXj56CgwVgtB0 DXP6C68wy5LDTGnbZdV7pYCag1jqxuiLd0BnLzSYngQxj8lcVRgepWSU0Z8gSfg= X-Google-Smtp-Source: AGHT+IG9U++mE+wd4ALVzjrlDXb8hqQ4TYZhiuTG0S5GUsNFjBbQAdWEJpxj4xGLDb3/H1RJhzhF2Q== X-Received: by 2002:a17:907:7f89:b0:a99:3db2:eb00 with SMTP id a640c23a62f3a-a9e2b0138bbmr224557666b.28.1730210898616; Tue, 29 Oct 2024 07:08:18 -0700 (PDT) Received: from smtpclient.apple (ip5f5af7ea.dynamic.kabel-deutschland.de. [95.90.247.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b2fe2af87sm485132766b.143.2024.10.29.07.08.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2024 07:08:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: 2775b9b0bcc2 - main - nuageinit: add support for OpenStack network config From: Mateusz Piotrowski <0mp@FreeBSD.org> In-Reply-To: <202410291324.49TDOrqu017551@gitrepo.freebsd.org> Date: Tue, 29 Oct 2024 15:08:06 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0458B366-0255-4E68-BC03-62680CF5C2F2@FreeBSD.org> References: <202410291324.49TDOrqu017551@gitrepo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3776.700.51) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4XdBtX2yVRz4JNf X-Spamd-Bar: ---- Hey Baptiste, > On 29. Oct 2024, at 14:24, Baptiste Daroussin = wrote: =E2=80=A6 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2775b9b0bcc278dd4183b57784953c26= a3fcdc89 =E2=80=A6 > nuageinit: add support for OpenStack network config >=20 > Add naive support for openstack network config. > if no config driver have been found, try to detect that we are = running a > VM on openstack via the smbios information, use the first iface > available and temporary activate dhcp on it, to be able to fetch = the > necessary informations for cloudinit. >=20 > While here make the rc script execute after devmatch, some ethernet > device might be attached via devmatch and may be needed for = cloudinit. =E2=80=A6 > diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit =E2=80=A6 > @@ -14,6 +14,18 @@ start_cmd=3D"nuageinit_start" > stop_cmd=3D":" > rcvar=3D"nuageinit_enable" >=20 > +fetch_openstack() > +{ > + cd /media/nuageinit/openstack/latest > + for file in meta_data.json network_data.json user_data; do > + fetch http://169.254.169.254/openstack/latest/$file || : Is it intended to fetch over HTTP? Best, Mateusz= From nobody Tue Oct 29 14:15:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdC2n2DMsz5bW47; Tue, 29 Oct 2024 14:15:29 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdC2n1h3cz4KGG; Tue, 29 Oct 2024 14:15:29 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211329; 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=Odcsk52qxPDTxSAchOwEsnFruJ2gMFrYMvOD/c0GHD4=; b=R2vIhnxApYX9yYZb6CrSf4guQ7hy5cUEDgkJGVYdV+R9TmWfljsFE2pu8pE8bs8772Q90T XQEqs5pTDSBPcDge1otMQi4KDraj0QE/Jb9L83JJ1PpphtqsU0cXQmhOhOPZoNWi1o0mU9 hruZ9NZORo4BDoBFa+JH3ZXz+XozIS/hMF6IHbOViqoFnZTnQ2j8vP/NCxPOx4N9Eeo3Is aC88PL5FO008A3RzgniE2FYLloA07biPL2FxLpWN/nySkKfMn7VJQl/8KFsJQS2vJXLKNl SgsGyZdRmIE2ADz0mt7B93qlf59LzWYL9ZOrFRtNtZw9G3fSlV34Pghxdp1J/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211329; 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=Odcsk52qxPDTxSAchOwEsnFruJ2gMFrYMvOD/c0GHD4=; b=vaxF5ycm3J59XMt0PPpUOvyoRHuDoVDNlp+k+uW6PN2ALt0Pvp/CzzorN4JrnbUqRIYZoj Cdm34YcK/r0//HQUPKUE90GLs1M164jQHgLj2JRlMEnv+05ojctJU3L91fgk8WdD02JnVO ZSDJ7nZW8Fs4QM+AjDPzbxeM2UyDhMFvPgoM5QKNHMQMi1nMd40btwMP+qoqDzEfogQ/PB AZk3znZxgs7DTBANaWj4UxAXdk0Td8Qm/Bu/ZVSPVl7C65Dhn3dhaHJaz9SxMdmq/SP4fv rhZjr3DTaHT0tya/KR0v8QReuRfhv0iPxUr+/5MTiYGYmbeVHCynleSyv17S4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730211329; a=rsa-sha256; cv=none; b=qDSykMp9z87N7EBmBoxBNVIEpvznUn6F+57vCKMt/OS5tRiXBOY24K7qXYOecVT2ErEnVy xafmOjgA9oTtpuAcB2OF02fORHyHGG2w/3QDVKgfLTLflZHC4U5HHi5IbBJRH2cZiiDtci seV8AtoaFTyyec97bt5SdSaGKZiD2BD4q0fmguswEs4/0HwhMcYD5glHw9Meyx0DPiHpsI hvEBiZxTLquLhHnUmKukpwP3h+J22J0iRLWw8RrgjBlyRIvTVkLjbmiwGyAJzDNwHZEG+j ymZelPV3N+l3JsJ6SCCUj35jIT0vI1D9gEVMmZMo/0KO7+pSPDMCZ7hvuDrgsA== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::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) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XdC2n0b7Lz13mK; Tue, 29 Oct 2024 14:15:29 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 26ECC1D2F43; Tue, 29 Oct 2024 15:15:27 +0100 (CET) Date: Tue, 29 Oct 2024 15:15:27 +0100 From: Baptiste Daroussin To: Mateusz Piotrowski <0mp@freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 2775b9b0bcc2 - main - nuageinit: add support for OpenStack network config Message-ID: References: <202410291324.49TDOrqu017551@gitrepo.freebsd.org> <0458B366-0255-4E68-BC03-62680CF5C2F2@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0458B366-0255-4E68-BC03-62680CF5C2F2@FreeBSD.org> On Tue 29 Oct 15:08, Mateusz Piotrowski wrote: > Hey Baptiste, > > > On 29. Oct 2024, at 14:24, Baptiste Daroussin wrote: > … > > URL: https://cgit.FreeBSD.org/src/commit/?id=2775b9b0bcc278dd4183b57784953c26a3fcdc89 > … > > nuageinit: add support for OpenStack network config > > > > Add naive support for openstack network config. > > if no config driver have been found, try to detect that we are running a > > VM on openstack via the smbios information, use the first iface > > available and temporary activate dhcp on it, to be able to fetch the > > necessary informations for cloudinit. > > > > While here make the rc script execute after devmatch, some ethernet > > device might be attached via devmatch and may be needed for cloudinit. > … > > diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit > … > > @@ -14,6 +14,18 @@ start_cmd="nuageinit_start" > > stop_cmd=":" > > rcvar="nuageinit_enable" > > > > +fetch_openstack() > > +{ > > + cd /media/nuageinit/openstack/latest > > + for file in meta_data.json network_data.json user_data; do > > + fetch http://169.254.169.254/openstack/latest/$file || : > > Is it intended to fetch over HTTP? > > > Best, > > Mateusz Yes why ? https://github.com/canonical/cloud-init/blob/96a07fb75341b8c774351f1e8508b97cfe60de1a/cloudinit/sources/DataSourceOpenStack.py#L75 Cloud init does the same. Bapt From nobody Tue Oct 29 14:20:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdC884Wx4z5bWDL; Tue, 29 Oct 2024 14:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdC884179z4LHQ; Tue, 29 Oct 2024 14:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0y1/k9XbTguP8goRNgjddNVmotyblSTf5GLUYeQRoE=; b=L3BOz+Ae5dFdk3EU4YHkPi7TkeHIxalnoGJ4ea99c1hXnKqnOy0+NsYlJVhvpnEny4yTKE qDwB1S9V5nTBEg55oFr8FP2q45XuonwTVBmz9GYTxyyOEZBHknPN51YcAGAvYItmSHOGHw FdIFRsjtP8N31DzxryHQTCyyLBmR6juOpIlu/3k5bBw/fT4TUIyB7umE0XiNgCkwXOiJgj QBmEtkbpUsk+KyZjsNNB+0e4aBS+7HngijwcUBpobliOmCQUaF5iKUBYa/8EjXFTOUYUyx HE+3PRSOz0txbcsi+K4fUdmuRU9kvE426gB9yt5KZS8ey3btUEzx06MONp2tKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0y1/k9XbTguP8goRNgjddNVmotyblSTf5GLUYeQRoE=; b=jBtBnNj5iNaF3MlHnxH3TF0YS/oQSU3m90ottFpser6B7SnYDcgAI44FGwu9dl3sy6Uonz gFMID+FLeszNeGutinzQL8nVT5pQC3lbUA9BJKyR4ugYQhDM3vtOVHO3HlG/wXlC9iFq9A 6QbeGm8sC4OQMIOpjrUKUKLsLdYr0Sq7Kh7bP7w0f3eBm8Maus4MT3il/jZquoZ35o2c1E qcJQctkXGzovKLEcuLIAVJZ2aTho8mL3nTWx/8jv+eHXSdEUUSHGKLD7Ya9HI4Hd7tDALZ jBkVroUYXId1DZeJS+AcoxnREBkX/v/JzXEnX4mAfxV1QZ/W7tJU0OCKV0OTdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730211608; a=rsa-sha256; cv=none; b=EhLQtW57xihDr+376PQqmpDB7H6xJe0wYcIHlP+0efG/CB6joKPHoccVsUiP+qlzVeJ7c2 /taOF05gJTO7CC4u4o3yxvomnm8WRPsxLv8q8BbtlaFqjHTsjh+gAME0zeAa4La31TY0O9 LzZ4j3NKQQ6Y2o8rPqjwJvFfJo4HORd8INSC4JUMjr57DnSQyXfNa4qdSVYnOhmoJjYpL4 iYylckTzyhft52RsGzy8eFm+XEtj9htYS83TDYt6NuiEOwcvT4uhgMIV/MlTaHa2oFbi+Q E4Z+SZtFdHplb7AVN5/rsgVC+fkBwMqQkicS/o/faZFRw8e6YusbM/KLi81P/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdC883TnJzRMr; Tue, 29 Oct 2024 14:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TEK8a4014674; Tue, 29 Oct 2024 14:20:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TEK8E9014670; Tue, 29 Oct 2024 14:20:08 GMT (envelope-from git) Date: Tue, 29 Oct 2024 14:20:08 GMT Message-Id: <202410291420.49TEK8E9014670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9c139dd5bf40 - stable/13 - vm_object: Report laundry pages in kinfo_vmobject List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c139dd5bf40968f1e84ef607927acee4b80e7fd Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9c139dd5bf40968f1e84ef607927acee4b80e7fd commit 9c139dd5bf40968f1e84ef607927acee4b80e7fd Author: Mark Johnston AuthorDate: 2024-10-22 12:47:52 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:34:33 +0000 vm_object: Report laundry pages in kinfo_vmobject Reviewed by: bnovkov, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47214 (cherry picked from commit a86373bc93ee1c850943e8585d0d426479378145) --- sys/sys/user.h | 3 ++- sys/vm/vm_object.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/sys/user.h b/sys/sys/user.h index c6894c527143..13062d67a69d 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -593,7 +593,8 @@ struct kinfo_vmobject { uint64_t _kvo_backing_obj; /* Handle for the backing obj */ } kvo_type_spec; /* Type-specific union */ uint64_t kvo_me; /* Uniq handle for anon obj */ - uint64_t _kvo_qspare[6]; + uint64_t kvo_laundry; /* Number of laundry pages. */ + uint64_t _kvo_qspare[5]; uint32_t kvo_swapped; /* Number of swapped pages */ uint32_t _kvo_ispare[7]; char kvo_path[PATH_MAX]; /* Pathname, if any. */ diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 6da30800896e..8ae9fe50833d 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2618,10 +2618,12 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->a.queue == PQ_ACTIVE) + if (vm_page_active(m)) kvo->kvo_active++; - else if (m->a.queue == PQ_INACTIVE) + else if (vm_page_inactive(m)) kvo->kvo_inactive++; + else if (vm_page_in_laundry(m)) + kvo->kvo_laundry++; } } From nobody Tue Oct 29 14:20:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdC895x9mz5bW9T; Tue, 29 Oct 2024 14:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdC8946Z7z4L6k; Tue, 29 Oct 2024 14:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+7vQJXgMeyp/SnfaGX9StWxpXYs+4cv0sMGm87Cpl8=; b=IxPPCjo6KTkzCJoLqYbChjpllrqZhZfJVm44LpKCe2UVINR+dA5GocRCsJuaMuJJF20oX5 JRZgg8ec1qMrEYWbVcZyQsXT1Ko71Mu58dnmytQGVc6rCe75csT9MFznq1PHSqmsyvDXCI Phtz5RbDm+ube5Pz4R+HSvOSAaPH+lUIVvLmZE67CdgHHZ/IFuhVFMB0Qw0tzEU8jed9SV SNz8eKd6oZnhA1CW0UKCHLA5d9nqDRHkOv6Jx76nhK1XOSAqVGEmSY5B7PI85iEnSYKy3h gS9aoDXgTihSDHRo0AH7Ie0pRQkkDKAeh/FKRwtDtzzi50KTvFPrKDVFiqrIfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730211609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+7vQJXgMeyp/SnfaGX9StWxpXYs+4cv0sMGm87Cpl8=; b=KOrYem7P/9t6nEfNQ4L2mitiV/rrwdvTJ24r+YDQIvNR2pXHdLV924qmyO+PlBJdYah0Ry huKqMZgMXaUotWxoJpvFgl1vfjo4AFyNomEEMC+F+EEaTxbfIdROPFVss/Y4vjJlAYl8mw UzqQ0MGKJTl0Gx9bqg976grKYNEhJwNK4KguKaSOAdVIdBHG6J0//xtOE2Rdi3QQGjb5vk 1fZMPV409if2kgwmXgtxt4Dz9QiGVA3NMRwutq7FTqnnrU3z2BmKJwsq0yK9MtDgMK66Oa 7g02ztXxaNqcT8uQTEv9qDbSz096J7b6QaovsjQw3lEUcnWisUgJvPAVW4HExA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730211609; a=rsa-sha256; cv=none; b=aPiVQgcbEkaaUwnItIZgiwESO0QDD1BbsxVtZj5cUw3Y/gyf2ztC9T1GxrqKwb1qVwBwWp HuuF7vB2T3wCtPMdq1mp/Vwdmid0Yqbr+xuQ8V9ZLbiDCuG0lge6pa5mb/wo71flS04J7O 6Jd9or1CwZWivgQtImD16OFWCxUFPLc1Nwl2znkPdITQWAcosZ4NuvfVNMExXYCEGzkzgK G54QayfNEFO945jK+y297ATVEly5dMcITMIcZo9SDnHyPWQ157bp8jcN0AnRY7I8zIa8lJ JynhIEQIzxy9lA2/11X0u8jouK1ErOwL/9nd3jzxUgS1YjfbbKgbORkSekoLmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdC893kjJzRMs; Tue, 29 Oct 2024 14:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TEK98g015113; Tue, 29 Oct 2024 14:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TEK951015103; Tue, 29 Oct 2024 14:20:09 GMT (envelope-from git) Date: Tue, 29 Oct 2024 14:20:09 GMT Message-Id: <202410291420.49TEK951015103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: df515b2e22c7 - stable/13 - vm_meter: Fix laundry accounting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df515b2e22c79d857189f3ad7389b546c3428868 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df515b2e22c79d857189f3ad7389b546c3428868 commit df515b2e22c79d857189f3ad7389b546c3428868 Author: Mark Johnston AuthorDate: 2024-10-22 12:48:43 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 13:34:45 +0000 vm_meter: Fix laundry accounting Pages in PQ_UNSWAPPABLE should be considered part of the laundry. Otherwise, on systems with no swap, the total amount of memory visible to tools like top(1) decreases. It doesn't seem very useful to have a dedicated counter for unswappable pages, and updating applications accordingly would be painful, so just lump them in with laundry for now. PR: 280846 Reviewed by: bnovkov, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47216 (cherry picked from commit 6a07e67fb7a8b5687a492d9d70a10651d5933ff5) --- sys/vm/vm_meter.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 9170581eaec1..caa6b6aa4769 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -458,7 +458,8 @@ u_int vm_laundry_count(void) { - return (vm_pagequeue_count(PQ_LAUNDRY)); + return (vm_pagequeue_count(PQ_LAUNDRY) + + vm_pagequeue_count(PQ_UNSWAPPABLE)); } static int @@ -480,6 +481,18 @@ SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_vm_pdpages, "QU", "Pages analyzed by pagedaemon"); +static int +sysctl_vm_laundry_pages(SYSCTL_HANDLER_ARGS) +{ + struct vm_domain *vmd; + u_int ret; + + vmd = arg1; + ret = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt + + vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_cnt; + return (SYSCTL_OUT(req, &ret, sizeof(ret))); +} + static void vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid *parent) { @@ -506,8 +519,9 @@ vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid *parent) "inactpdpgs", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_pdpages, 0, "Inactive pages scanned by the page daemon"); - SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, - "laundry", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt, 0, + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "laundry", CTLFLAG_RD | CTLTYPE_UINT, vmd, 0, + sysctl_vm_laundry_pages, "IU", "laundry pages"); SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "laundpdpgs", CTLFLAG_RD, From nobody Tue Oct 29 15:46:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdF3Q6j0Bz5bcbt; Tue, 29 Oct 2024 15:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdF3Q69NWz4dnv; Tue, 29 Oct 2024 15:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730216770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DKYMc20f27jLBXwbO1R+mmoDPsYnX4V2ZpwpGm3zOHU=; b=kwHy4o+OqoXFD5OVUOUqmU4E6RzEWIpBDKR1JSnB2fxr0HzdUjwl935dVRm+h4j1HmpnXm SKIaLoJinweplUL4PKg/mPx2C649ct6B03X66YGObazfRIDvjagkf588dMKI0WGcC0VM51 Uq4aenT3hco1q/BVtExotVD12yWZxZq2F9OaXkpnMdpYolmJ8HkhbH+64Fi6RefGIMcC97 th2lAH6grdzhU/ZgmHomWOFyrK/agi4ADt0BTacAP3CgssKWQhnkTm8CbLodCshrxrrAET rm6Ei8e5E9hAKH/tDF8TzTOOZ4v65tmku6YH0j653iUpqXdfDkUmGjpcbU4C5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730216770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DKYMc20f27jLBXwbO1R+mmoDPsYnX4V2ZpwpGm3zOHU=; b=MZ4Yf3s+G2tUNAW3c+iIBMM+Nm0E3aj6QZLYBKTXsQK0EfJKrJ2swsYzhy467dZBSxYQ9j lwWtVCY+NfMF/JAK9VPtzrc2oBTF70x39vA9iz9M2yZHNcE6oKVO/gw7MDzs7YQg0tBZ0X PXxN3p1XQ3NgPAiO26kMzxI9RsRCH5iy4oEjFeaJixU6g/xi8XRsE8gukkasJsTxCHWz3h od3YWOYSButXFHU4NBgfl3m36h4RdxihU4PMHKw8k8H45q26GzvxECXUkdlb0LjM9vHr5H dItwJ1QTRXgjTkvTqkZXDebKOmqiBMMOLN8YOTj3vNtH6eT0FVWlaYp8u4sHtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730216770; a=rsa-sha256; cv=none; b=E+3mD6RxmF08eyiV4NCAagc1pC0Npp0Nq9EEhLOzR1FC/ET1+sY99S2hibRegVuYK1nwMR k9lnQ8fKsspi9gy/pkpKnkJdTt9y9+Ms4KrJuhAD4pWIN6iDkYLctu4tEO5TtvuZm3Cgr3 vu1WUVWQL3wxJFDqlGM7Pa5wOoCJfN50j9iVShdVNO+86ZtDCo96V40EOScp7Xl805M396 E76B02Ew1PgrKhdHjwLivwFP6uIHIThI6L/9zidPq7Nw0eZJwIdQxW/63Zkon/fyQ+8chs 2uYRKXjdfGXS6DIEoE2LQX+VuV6NurUwjI4p5w27hL5ZvJyFNymL22A0SzYNXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdF3Q5lwczV3F; Tue, 29 Oct 2024 15:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TFkAD4082554; Tue, 29 Oct 2024 15:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TFkA8Y082551; Tue, 29 Oct 2024 15:46:10 GMT (envelope-from git) Date: Tue, 29 Oct 2024 15:46:10 GMT Message-Id: <202410291546.49TFkA8Y082551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 1af027e583ec - stable/14 - lib/libcrypt: use explicit_bzero() to clear sensitive buffers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1af027e583ec725ae772a4cc0b128652553fa7ec Auto-Submitted: auto-generated The branch stable/14 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=1af027e583ec725ae772a4cc0b128652553fa7ec commit 1af027e583ec725ae772a4cc0b128652553fa7ec Author: Robert Clausecker AuthorDate: 2024-10-10 09:08:35 +0000 Commit: Robert Clausecker CommitDate: 2024-10-29 15:45:31 +0000 lib/libcrypt: use explicit_bzero() to clear sensitive buffers Prevent a potentially sufficiently smart compiler from optimising away our attempts to clear sensitive buffers. A related change was discussed and rejected in D16059, but I don't believe the reasoning there applies: the code clearly documents its intent that the `memset` calls clear sensitive buffers so they don't hang around. `explicit_bzero` is the appropriate function for this purpose. A potential performance disadvantage seems less important: the functions in crypt are specifically designed to be slow, so a few extra calls to guarantee that sensitive buffers are cleared does not significantly affect runtime. See also: D16059 Reviewed by: delphij, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47037 (cherry picked from commit a2c0d2026fb422ade2171da4bc6d5d2773b268a6) --- lib/libcrypt/crypt-md5.c | 5 +++-- lib/libcrypt/crypt-sha256.c | 7 ++++--- lib/libcrypt/crypt-sha512.c | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/libcrypt/crypt-md5.c b/lib/libcrypt/crypt-md5.c index 3fb80c1ba540..5313f59a4098 100644 --- a/lib/libcrypt/crypt-md5.c +++ b/lib/libcrypt/crypt-md5.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "crypt.h" @@ -85,7 +86,7 @@ crypt_md5(const char *pw, const char *salt, char *buffer) (u_int)(pl > MD5_SIZE ? MD5_SIZE : pl)); /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); + explicit_bzero(final, sizeof(final)); /* Then something really weird... */ for (i = strlen(pw); i; i >>= 1) @@ -141,7 +142,7 @@ crypt_md5(const char *pw, const char *salt, char *buffer) *buffer = '\0'; /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); + explicit_bzero(final, sizeof(final)); return (0); } diff --git a/lib/libcrypt/crypt-sha256.c b/lib/libcrypt/crypt-sha256.c index 35c36bf93f3d..6da1d518b12d 100644 --- a/lib/libcrypt/crypt-sha256.c +++ b/lib/libcrypt/crypt-sha256.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "crypt.h" @@ -234,9 +235,9 @@ crypt_sha256(const char *key, const char *salt, char *buffer) * the SHA256 implementation as well. */ SHA256_Init(&ctx); SHA256_Final(alt_result, &ctx); - memset(temp_result, '\0', sizeof(temp_result)); - memset(p_bytes, '\0', key_len); - memset(s_bytes, '\0', salt_len); + explicit_bzero(temp_result, sizeof(temp_result)); + explicit_bzero(p_bytes, key_len); + explicit_bzero(s_bytes, salt_len); return (0); } diff --git a/lib/libcrypt/crypt-sha512.c b/lib/libcrypt/crypt-sha512.c index 640398afadc4..b760623b5d8d 100644 --- a/lib/libcrypt/crypt-sha512.c +++ b/lib/libcrypt/crypt-sha512.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "crypt.h" @@ -246,9 +247,9 @@ crypt_sha512(const char *key, const char *salt, char *buffer) * the SHA512 implementation as well. */ SHA512_Init(&ctx); SHA512_Final(alt_result, &ctx); - memset(temp_result, '\0', sizeof(temp_result)); - memset(p_bytes, '\0', key_len); - memset(s_bytes, '\0', salt_len); + explicit_bzero(temp_result, sizeof(temp_result)); + explicit_bzero(p_bytes, key_len); + explicit_bzero(s_bytes, salt_len); return (0); } From nobody Tue Oct 29 15:50:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdF800Lcnz5bcTy; Tue, 29 Oct 2024 15:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdF7z6bG0z4g0f; Tue, 29 Oct 2024 15:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QX85nyBOTGjF2l++00fvca7TW0LoqW3fOH9NOijnXFw=; b=pf2bqsaLbjWRySeFX5a47CGAKSKG9PrlKzamQFlZum+0fhdMNFnQMeE6kNe0fEirQsUf70 y4pFTrfaeJoebh8mg6B4Yo+RNM8i+ULSsgup9A9KF5tewj8s9GuyuGrWOwFA8jWH4/JMGF YJCrXduP2oAjyyE09x3LTYtMm4IKYpGnjB9lYhIvEPA3t+OsMVJNZW76859DeJDx1ytyUt CWcAH+O66RFMB2P9QJE3ZL7JUCXnmfnC3K6gD1xw4dvNBzSyzEKFgvIywqpA89NUdtxjKN XsNNDCer14uOeKmGdSxRGmrIDnogAJX5fSIVY8yHdHtC2FCngSrUuaxaBE6gtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QX85nyBOTGjF2l++00fvca7TW0LoqW3fOH9NOijnXFw=; b=cbScmmS1UxIbszQwaybZZ2C009aIVq2/R1v69ISatEQgRIU3FA9wasgEgND7LVGa2Ha1T2 uyf7vzJO65uKMoUK6tr//laRu72wabH0LigMFh485TN3GBDgeks6oftkjwb3Ce1OJrle83 wQSQkJC9F+UYcS0e2S3rUmiRzJuDHgBj8nvE2oarCIXj/oaIJJMPa6YgYeraMu3w7sRUjF amX4W5EcRPmWdKRWlmd7CgsXHPCKL0cdpJCu4aMf+v7Hz0nvGaCAaTLRSIs7pyHHtui9WS RmvSTCYCagbvUf6iz5k7A7Tw6YKev2eHCJ4Tqc+Ndpb6JCXwvrhkA+7dGtRx0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730217007; a=rsa-sha256; cv=none; b=Eq0wjP3eEs0FPfR3zTtenhBUhN+duOamMnXtJqiz/52Qr9nYtVujpNEJkTFoJYxEaBhEPL QmNcOXeqIHr+Sn1qTeSgENru+WwMyj5E/UvCtzfXhfT07dbZlq8N9WlD8dMMrF/0JM8DIp kb04sWe3nviHXxuRmG/Tc+GRzM3XOot3jVUA+18BQgpo5eWnGPBMMbi3AMYkCgtllw6zML Vxs7X6JBDOVasSwkWh/+u0tL2BafQlQk6TNcz6Asc7vAOoV7G2H/IwEk2BtOCkkDQEypyJ 76amj2A0S136zMBswH3oWSbvsmcYxIMC7sM3T9NIMs1ZGx8KYdi21nO+/+5slg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdF7z6BgYzTHb; Tue, 29 Oct 2024 15:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TFo7g0087973; Tue, 29 Oct 2024 15:50:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TFo7NW087966; Tue, 29 Oct 2024 15:50:07 GMT (envelope-from git) Date: Tue, 29 Oct 2024 15:50:07 GMT Message-Id: <202410291550.49TFo7NW087966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4a7c6d6206cf - main - pf: Fix handling of v6 loopback connections with pf syncookies enabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a7c6d6206cf0851e11ecd38ab5c618f67892dab Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4a7c6d6206cf0851e11ecd38ab5c618f67892dab commit 4a7c6d6206cf0851e11ecd38ab5c618f67892dab Author: Mark Johnston AuthorDate: 2024-10-29 14:59:15 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 15:01:20 +0000 pf: Fix handling of v6 loopback connections with pf syncookies enabled The SYN|ACK generated by pf needs to inherit M_LOOP from the original SYN, otherwise it gets dropped by ip6_input(). Fix this by adding an mbuf_flags argument to pf_build_tcp() that can be used to set both M_SKIP_FIREWALL and M_LOOP as needed. Set M_LOOP on the output mbuf if it was generated in response to an mbuf with M_LOOP set. Add a regression test case. The v4 case had no problems, but the v6 case fails without this change. Reviewed by: kp MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Zenarmor Differential Revision: https://reviews.freebsd.org/D47257 --- sys/net/pfvar.h | 4 +- sys/netpfil/pf/pf.c | 44 ++++++++++++-------- sys/netpfil/pf/pf_syncookies.c | 8 ++-- tests/sys/netpfil/pf/syncookie.sh | 86 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 23 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 30be1128d4d3..0dc5d4363867 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2491,12 +2491,12 @@ u_int8_t pf_get_wscale(struct pf_pdesc *); struct mbuf *pf_build_tcp(const struct pf_krule *, sa_family_t, const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, - u_int8_t, u_int16_t, u_int16_t, u_int8_t, bool, + u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, u_int16_t, u_int16_t, int); void pf_send_tcp(const struct pf_krule *, sa_family_t, const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, - u_int8_t, u_int16_t, u_int16_t, u_int8_t, bool, + u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, u_int16_t, u_int16_t, int); void pf_syncookies_init(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index bd8b709e396e..a98baeb4bdec 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2207,6 +2207,9 @@ pf_intr(void *v) #ifdef INET case PFSE_IP: { if (pf_isforlocal(pfse->pfse_m, AF_INET)) { + KASSERT(pfse->pfse_m->m_pkthdr.rcvif == V_loif, + ("%s: rcvif != loif", __func__)); + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; pfse->pfse_m->m_pkthdr.csum_flags |= CSUM_IP_VALID | CSUM_IP_CHECKED; @@ -2225,7 +2228,11 @@ pf_intr(void *v) #ifdef INET6 case PFSE_IP6: if (pf_isforlocal(pfse->pfse_m, AF_INET6)) { - pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + KASSERT(pfse->pfse_m->m_pkthdr.rcvif == V_loif, + ("%s: rcvif != loif", __func__)); + + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL | + M_LOOP; ip6_input(pfse->pfse_m); } else { ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, @@ -2574,7 +2581,8 @@ pf_unlink_state(struct pf_kstate *s) s->key[PF_SK_WIRE]->port[1], s->key[PF_SK_WIRE]->port[0], s->src.seqhi, s->src.seqlo + 1, - TH_RST|TH_ACK, 0, 0, 0, true, s->tag, 0, s->act.rtableid); + TH_RST|TH_ACK, 0, 0, 0, M_SKIP_FIREWALL, s->tag, 0, + s->act.rtableid); } LIST_REMOVE(s, entry); @@ -3334,7 +3342,7 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t tcp_flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, - bool skip_firewall, u_int16_t mtag_tag, u_int16_t mtag_flags, int rtableid) + int mbuf_flags, u_int16_t mtag_tag, u_int16_t mtag_flags, int rtableid) { struct mbuf *m; int len, tlen; @@ -3380,8 +3388,7 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, m_freem(m); return (NULL); } - if (skip_firewall) - m->m_flags |= M_SKIP_FIREWALL; + m->m_flags |= mbuf_flags; pf_mtag->tag = mtag_tag; pf_mtag->flags = mtag_flags; @@ -3598,13 +3605,13 @@ pf_send_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t tcp_flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, - bool skip_firewall, u_int16_t mtag_tag, u_int16_t mtag_flags, int rtableid) + int mbuf_flags, u_int16_t mtag_tag, u_int16_t mtag_flags, int rtableid) { struct pf_send_entry *pfse; struct mbuf *m; m = pf_build_tcp(r, af, saddr, daddr, sport, dport, seq, ack, tcp_flags, - win, mss, ttl, skip_firewall, mtag_tag, mtag_flags, rtableid); + win, mss, ttl, mbuf_flags, mtag_tag, mtag_flags, rtableid); if (m == NULL) return; @@ -3672,7 +3679,7 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, - r->return_ttl, true, 0, 0, rtableid); + r->return_ttl, M_SKIP_FIREWALL, 0, 0, rtableid); } } else if (pd->proto == IPPROTO_SCTP && (r->rule_flag & PFRULE_RETURN)) { @@ -5537,7 +5544,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->src.mss = mss; pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, s->src.mss, 0, true, 0, 0, + TH_SYN|TH_ACK, 0, s->src.mss, 0, M_SKIP_FIREWALL, 0, 0, pd->act.rtableid); REASON_SET(&reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); @@ -5898,8 +5905,8 @@ pf_tcp_track_full(struct pf_kstate **state, struct pf_pdesc *pd, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), 0, TH_RST, 0, 0, - (*state)->rule->return_ttl, true, 0, 0, - (*state)->act.rtableid); + (*state)->rule->return_ttl, M_SKIP_FIREWALL, + 0, 0, (*state)->act.rtableid); src->seqlo = 0; src->seqhi = 1; src->max_win = 1; @@ -6035,8 +6042,8 @@ pf_synproxy(struct pf_pdesc *pd, struct pf_kstate **state, u_short *reason) pf_send_tcp((*state)->rule, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, (*state)->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, true, 0, 0, - (*state)->act.rtableid); + TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, + M_SKIP_FIREWALL, 0, 0, (*state)->act.rtableid); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || @@ -6067,8 +6074,9 @@ pf_synproxy(struct pf_pdesc *pd, struct pf_kstate **state, u_short *reason) &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->dst.seqhi, 0, TH_SYN, 0, - (*state)->src.mss, 0, false, (*state)->tag, 0, - (*state)->act.rtableid); + (*state)->src.mss, 0, + (*state)->orig_kif->pfik_ifp == V_loif ? M_LOOP : 0, + (*state)->tag, 0, (*state)->act.rtableid); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if (((th->th_flags & (TH_SYN|TH_ACK)) != @@ -6082,14 +6090,14 @@ pf_synproxy(struct pf_pdesc *pd, struct pf_kstate **state, u_short *reason) pf_send_tcp((*state)->rule, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ntohl(th->th_seq) + 1, - TH_ACK, (*state)->src.max_win, 0, 0, false, + TH_ACK, (*state)->src.max_win, 0, 0, 0, (*state)->tag, 0, (*state)->act.rtableid); pf_send_tcp((*state)->rule, pd->af, &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, - TH_ACK, (*state)->dst.max_win, 0, 0, true, 0, 0, - (*state)->act.rtableid); + TH_ACK, (*state)->dst.max_win, 0, 0, + M_SKIP_FIREWALL, 0, 0, (*state)->act.rtableid); (*state)->src.seqdiff = (*state)->dst.seqhi - (*state)->src.seqlo; (*state)->dst.seqdiff = (*state)->src.seqhi - diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index da25ac47fe3c..3a0e23100f7c 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -298,7 +298,8 @@ pf_syncookie_send(struct pf_pdesc *pd) iss = pf_syncookie_generate(pd, mss); pf_send_tcp(NULL, pd->af, pd->dst, pd->src, *pd->dport, *pd->sport, iss, ntohl(pd->hdr.tcp.th_seq) + 1, TH_SYN|TH_ACK, 0, mss, - 0, true, 0, 0, pd->act.rtableid); + 0, M_SKIP_FIREWALL | (pd->m->m_flags & M_LOOP), 0, 0, + pd->act.rtableid); counter_u64_add(V_pf_status.lcounters[KLCNT_SYNCOOKIES_SENT], 1); /* XXX Maybe only in adaptive mode? */ atomic_add_64(&V_pf_status.syncookies_inflight[V_pf_syncookie_status.oddeven], @@ -515,6 +516,7 @@ pf_syncookie_recreate_syn(struct pf_pdesc *pd) wscale = pf_syncookie_wstab[cookie.flags.wscale_idx]; return (pf_build_tcp(NULL, pd->af, pd->src, pd->dst, *pd->sport, - *pd->dport, seq, 0, TH_SYN, wscale, mss, pd->ttl, false, 0, - PF_MTAG_FLAG_SYNCOOKIE_RECREATED, pd->act.rtableid)); + *pd->dport, seq, 0, TH_SYN, wscale, mss, pd->ttl, + (pd->m->m_flags & M_LOOP), 0, PF_MTAG_FLAG_SYNCOOKIE_RECREATED, + pd->act.rtableid)); } diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index ac7483bc258b..6741ad28adf0 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -233,6 +233,90 @@ forward_v6_cleanup() pft_cleanup } +loopback_test() +{ + local addr port + + addr=$1 + port=$2 + + # syncookies don't work without state tracking enabled. + atf_check -e ignore pfctl -e + atf_check pfctl -f - <<__EOF__ +set syncookies always +pass all keep state +__EOF__ + + # Try to transmit data over a loopback connection. + cat <<__EOF__ >in +Creativity, no. +__EOF__ + nc -l $addr $port >out & + + atf_check nc -N $addr $port < in + + atf_check -o file:in cat out + + atf_check -e ignore pfctl -d +} + +atf_test_case "loopback" "cleanup" +loopback_head() +{ + atf_set descr 'Make sure that loopback v4 TCP connections work with syncookies on' + atf_set require.user root +} + +loopback_body() +{ + local epair + + pft_init + + atf_check ifconfig lo0 127.0.0.1/8 + atf_check ifconfig lo0 up + + loopback_test 127.0.0.1 8080 + + epair=$(vnet_mkepair) + atf_check ifconfig ${epair}a inet 192.0.2.1/24 + + loopback_test 192.0.2.1 8081 +} + +loopback_cleanup() +{ + pft_cleanup +} + +atf_test_case "loopback_v6" "cleanup" +loopback_v6_head() +{ + atf_set descr 'Make sure that loopback v6 TCP connections work with syncookies on' + atf_set require.user root +} + +loopback_v6_body() +{ + local epair + + pft_init + + atf_check ifconfig lo0 up + + loopback_test ::1 8080 + + epair=$(vnet_mkepair) + atf_check ifconfig ${epair}a inet6 2001:db8::1/64 + + loopback_test 2001:db8::1 8081 +} + +loopback_v6_cleanup() +{ + pft_cleanup +} + atf_test_case "nostate" "cleanup" nostate_head() { @@ -483,6 +567,8 @@ atf_init_test_cases() atf_add_test_case "basic_v6" atf_add_test_case "forward" atf_add_test_case "forward_v6" + atf_add_test_case "loopback" + atf_add_test_case "loopback_v6" atf_add_test_case "nostate" atf_add_test_case "nostate_v6" atf_add_test_case "adaptive" From nobody Tue Oct 29 15:50:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdF811373z5bcZW; Tue, 29 Oct 2024 15:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdF810JFXz4g6y; Tue, 29 Oct 2024 15:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GVfWCUwwYyCWto0/XvIuKHqd27Ft3ytoTXxLJfifWRA=; b=rI/2ygkdHCsHgHwU5dhD8UqVW4K+MdbxiAuk9UYs4s3EVm6UsUfg645aEny3+Rl+MaQKSz olHuYQgVZOBRKtmF/yx4dIVwDM6bxRWgmxDZTDM8zWTinMC8B8XbjJ2DOJsd0bYsFQQYL0 AvI5XByvi5oa80ONMWkEJmZe+aUV4QSdN2E7Kzoiyncm6X6yST2vgjE8et/bxomfW9VH94 HyaTp60m2MMJFWsqkpAPjBcR8NsSBFHdJPezQthJsHBpcx4n6v+PHWZEjaJbNaPqhYsiQT rzv6mH2wOrUSOLd0Sp7dxGl7ANbNIjVvf+tpb9XxXK19WthpYXhlvU0/tTnYIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GVfWCUwwYyCWto0/XvIuKHqd27Ft3ytoTXxLJfifWRA=; b=qYln2Cji7kJ+UrHT2uKIG0PNRK4hcmeTkAJd07mTrTMSqFea81kEEock7a5qBPB1lJ/oFI OGv08ToePDBOrHRkufyxdbNA/RKme6C6B9KjhXL1D4CyRygyNWvYCTv3OkSke20YK+v1CH ZmGYCVK/qtppfQHM6KJ/m5doK6Y4zf8A0CMNG+JQLXHgiEoInPNN4XPDWTuNoIX4D6rf9w oUPChgOUA3+kNysDiQGf8h28WlnsuigYfSRLZWf/S6ctIdZ9Yd5StDBWbR8ryYljuBMFyK jMBo1+70brzteGst0Qkq6GcOZqCt2lXfV61MsWVim98invQ15tHk942qpDE1SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730217009; a=rsa-sha256; cv=none; b=C8+KcrAmPN32mfLQnRXqxvbgDxfOdNFtH++B77J9q2jjCmsyVH/RzlzTSpDxgOd6rbGfg8 XE8O0BG+KzD5KvjmWnVOGUsI7XoAHmGz0BngdoDu3tHw6pPdnhZTf1oQYRg4AzxA141vyz Zbe3F3XEoffJso5Z3NjMtEiAiTRkX6cpBYpvN7fACDEho2P4PAqYatSMJcQo7h11QNq3Bu 48iIvALjiDq0T47kpMiw3rssgyL2FW5p0m/8qLrAk75KyeHhzlmtUlNsBbSHq6sxDarieI cg3WY7xuWHzEaLJ9K+J6jjN+OsoLHVsbxu2MM265AUzg+u+8ajLPqGKssBhDWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdF8071kxzVSM; Tue, 29 Oct 2024 15:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TFo8ah088406; Tue, 29 Oct 2024 15:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TFo8Yx088402; Tue, 29 Oct 2024 15:50:08 GMT (envelope-from git) Date: Tue, 29 Oct 2024 15:50:08 GMT Message-Id: <202410291550.49TFo8Yx088402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2352336ad9b2 - main - geom_flashmap: Rename the kernel module List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2352336ad9b26fd21d9b0013e195e41d6d02b914 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2352336ad9b26fd21d9b0013e195e41d6d02b914 commit 2352336ad9b26fd21d9b0013e195e41d6d02b914 Author: Mark Johnston AuthorDate: 2024-10-29 15:11:12 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 15:11:12 +0000 geom_flashmap: Rename the kernel module Absent a linker.hints, if a module dependency exists on disk, the loader will automatically load it. That is, if something depends on module foo, and foo.ko exists, we'll load foo.ko even though the linker hints file is missing. It's a bit of a hack but it's handy. This breaks with geom_flashmap though, since it's geom_flashmap.ko on disk but the module is called g_flashmap. However, pretty much every other GEOM module is given a "geom_" prefix, so for consistency's sake alone, it seems nice to rename the module. PR: 274388 Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47311 --- sys/dev/fdt/fdt_slicer.c | 2 +- sys/dev/mmc/mmcsd.c | 2 +- sys/geom/geom_flashmap.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/fdt/fdt_slicer.c b/sys/dev/fdt/fdt_slicer.c index 92aa0af90542..5c1d11cfdcf5 100644 --- a/sys/dev/fdt/fdt_slicer.c +++ b/sys/dev/fdt/fdt_slicer.c @@ -179,5 +179,5 @@ static moduledata_t fdt_slicer_mod = { }; DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); -MODULE_DEPEND(fdt_slicer, g_flashmap, 0, 0, 0); +MODULE_DEPEND(fdt_slicer, geom_flashmap, 0, 0, 0); MODULE_VERSION(fdt_slicer, 1); diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index cd973e53802c..5b9cb93c7b31 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -1563,5 +1563,5 @@ mmcsd_handler(module_t mod __unused, int what, void *arg __unused) } DRIVER_MODULE(mmcsd, mmc, mmcsd_driver, mmcsd_handler, NULL); -MODULE_DEPEND(mmcsd, g_flashmap, 0, 0, 0); +MODULE_DEPEND(mmcsd, geom_flashmap, 0, 0, 0); MMC_DEPEND(mmcsd); diff --git a/sys/geom/geom_flashmap.c b/sys/geom/geom_flashmap.c index cef488d8b9b7..37fc7a36ecff 100644 --- a/sys/geom/geom_flashmap.c +++ b/sys/geom/geom_flashmap.c @@ -222,4 +222,4 @@ static struct g_class g_flashmap_class = { }; DECLARE_GEOM_CLASS(g_flashmap_class, g_flashmap); -MODULE_VERSION(g_flashmap, 0); +MODULE_VERSION(geom_flashmap, 0); From nobody Tue Oct 29 15:50:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdF823Swmz5bccX; Tue, 29 Oct 2024 15:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdF820tL7z4g74; Tue, 29 Oct 2024 15:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yb62y7LkPGG+E0JuEsA733JhLOUYFE/hqCVs5LAV1e0=; b=UEHOJ8g7dg4dgt5sVnKwvuqjXfh/amapxNfFnEK+UniGuhgEnu9CSfZiWn5iP+iLERWYxM BjEMddnNHYy848zeBQuLdtisGp+VdVi19jLA+ybBG04ksFEUNzJl+s1YVlKP4/ldlD8IhN OPFEDtwWpwdEEmGPihQqTCcVgJi0u/VDNDqMmpvt5+OdIsOzGBCGQbg931uMMudOmq3Y/Y VrnYSuQfZfhmodM8R1aQ5hrRQyYlqPGmsNxtqfGlpPwQF6qzJAEUkv1kYTXAOt1PJM6nAp bKojT6L2TdjvhKFjcrBj149520Hd1UBN4ZBxo0+coLfq/CYKsi4yOM5tHGZOtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730217010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yb62y7LkPGG+E0JuEsA733JhLOUYFE/hqCVs5LAV1e0=; b=fs2zC64VN8r+zlmPHm/d5Ob3lVojCsYJbLU5H/Q9dFwW7/ADAIVRfCDB3mph1Rq0JIQcH3 7cFCoUsbW5ay6TpYb5QgIdpXxh1LYyctDAd71ReiPCyvVfTXy6zJt1d5eMggkI0e4NLIWB /xZIGASsjjo8f5hGk0nVk1k6aSevfN6LRIEPzAkmqTmNYfQXCRwLugmX7JjAn9x/WAK1X2 uo3YZCdDLFzl/bvEw6YLThMeVsArg5tL5VS45ZOb+IuogTeUKlZlR4cBC4O97wPEgYq/2S 6aMkRhODIq1UbaFuTx/wLbS152lrGrJM6+VIhq02x5yMbd60wWMl0ZqzcswmkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730217010; a=rsa-sha256; cv=none; b=pNqV21lsDi/cbUJvOHxG7qVYpKhUi/tTeyQJLCnyS87EIW1mbjILmXga3YwosOKYbijbw+ vLnGwhwJXlqwOMZQz8RUAR+5h4vxITol4ynd30Gvqp5RE4enEEs0FzJSXiN7GbrbXDzdAo AaL7k+ny5sLFKuAOSFjCTPb/9A+wh2FZbW1HGVkXiuVAj+HnirrmALz+EXoqw5U8+CCZdB QpsSbY11A3czhxDy260TXYm/25n6+FCssO9dYqWoXgQ2psmn/2cap7t3zW4e/vGTlJSLbA qi+SwckRHDUKRZPLKl2HGMmbLOH76ZxOIMlv84gZy0RR4gbnlpP6uvZ8td5e+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdF820RxSzVNp; Tue, 29 Oct 2024 15:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TFo90Q089078; Tue, 29 Oct 2024 15:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TFo9tO089070; Tue, 29 Oct 2024 15:50:09 GMT (envelope-from git) Date: Tue, 29 Oct 2024 15:50:09 GMT Message-Id: <202410291550.49TFo9tO089070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 218f80226b82 - main - libarchive tests: Re-enable a broken test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 218f80226b82763c3cbd48de560959ad546b5e26 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=218f80226b82763c3cbd48de560959ad546b5e26 commit 218f80226b82763c3cbd48de560959ad546b5e26 Author: Mark Johnston AuthorDate: 2024-10-29 15:11:28 +0000 Commit: Mark Johnston CommitDate: 2024-10-29 15:11:28 +0000 libarchive tests: Re-enable a broken test It passes and so appears to have been silently fixed at some point. PR: 240683 MFC after: 1 week --- lib/libarchive/tests/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index 2684d1661e57..0562197e6936 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -335,9 +335,6 @@ ${PACKAGE}FILES+= test_fuzz_1.iso.Z.uu BROKEN_TESTS+= test_fuzz_rar .endif -# https://bugs.freebsd.org/240683 -BROKEN_TESTS+= test_write_filter_zstd - # Build the test program. SRCS.libarchive_test= \ ${TESTS_SRCS} \ From nobody Tue Oct 29 16:18:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdFmP06J6z5bf3w; Tue, 29 Oct 2024 16:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdFmN6bW7z4kQY; Tue, 29 Oct 2024 16:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730218692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/nAxxnfeW+FMluK4g0XhFhN1pUn0fT2E7eZSPmvc8I=; b=C+Qu2pQOHJg0KWp/4ztlDOFg5FV4NZpEWLzdDRWzvkoSyXvKsdB1PT3kBT+GQ//1tO4927 S/DS3nqAKiC3dE46RRpQiBnrAAdWp2Y1JptqK1rcnVtru/aAe6tSCc6P2PBvCMd41H81BV cuyPgBr2G5IDpRoPAsBHge4jMWjeerXGrJIOwpNokuXLdi5Ax5ixB56D5iIZPC8UC5dcLx gjszEvpbmfiHsH/5oYvg7HrWn6nqOPQSK7lznRW08ZsF7cLm1laix/k4tCWc5iNd8eXCsr EwFY2GSE/i5Z7TsT2RdAqDmKOrDQpqe2pCnYeoWw7UuYnCVtn8PcjhlBHjYqeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730218692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/nAxxnfeW+FMluK4g0XhFhN1pUn0fT2E7eZSPmvc8I=; b=k7Rf/roMjfX+9uNvhFxynzcrceZkze98ffVMooz/My0ca4mXA3Dn3cK59ZNEOndr5dGyqS DAQ9ZD9jbBezxLPO+fUVz2TKszw5QD9MTwB760FuaFnwO9wx2TScQ19WrfmD6hz7ly+yEz tVOmLXCHYsBJBbKu8bLhBUOgX3T/uVM0NxILfOwDSC9pY/ff3w41XAVfucKhRrJav1Ib9C vusAvK5YE0oWpGh0jIc6mY30FbgT7urErvCkFiYzuqk0AxUGJ4PubWNWSvGWO5MvS1zgYa T6vYEYlsKujVoZ1KQtD+Nc1TI2jGgajCEpLE2E8jGaKjzBLOsiHS6kW3qMeaZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730218692; a=rsa-sha256; cv=none; b=D6vWpBi8StL/KrOPsR7N6pOazecmt03VY27zngVyum5qu9pzlGCzIRCHotypAuJPrUzvI6 TFOaP0V9iBx1jS1dWDmMLElIpVYlezc26cv6UYWUPPqOd78yW4ioNSMStKvj2O0sjDcMB1 cXFUkTe2nOHvzZ+Ett1BbcOq5U5De5QfoBFkVWHNejVNiU2btDXJG9y6+LtRVXcSo+XPg8 X0Ifxz3/APlZHYxWIRGvh5VZnaW54so3Rs/3vi2Oc4lQY164xCZTh1T54JjLlc9qfrp4aF eFOmJtH+VwFl6zTWdlJwRPJOSA00XgbyV2UmpsUUa8o9KR1zwEMxRx5k1ga+Tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdFmN6BrqzW77; Tue, 29 Oct 2024 16:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TGIC8W040728; Tue, 29 Oct 2024 16:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TGICCZ040725; Tue, 29 Oct 2024 16:18:12 GMT (envelope-from git) Date: Tue, 29 Oct 2024 16:18:12 GMT Message-Id: <202410291618.49TGICCZ040725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 14457cf7d6fe - main - snd_hdsp(4): Add sysctls to select analog signal levels. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14457cf7d6fe2b2a7e23c349f6bfb41a09eec993 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=14457cf7d6fe2b2a7e23c349f6bfb41a09eec993 commit 14457cf7d6fe2b2a7e23c349f6bfb41a09eec993 Author: Florian Walpen AuthorDate: 2024-10-29 16:12:29 +0000 Commit: Ruslan Bukin CommitDate: 2024-10-29 16:15:58 +0000 snd_hdsp(4): Add sysctls to select analog signal levels. RME HDSP 9632 sound cards support different sensitivity levels at the analog input, and different gain levels for the analog line and phones outputs. Expose these settings as sysctl tunables. Tested on hardware: - Phones output volume changes according to sysctl setting (caution, still extremely loud). - Create loop to feedback the line output to line input. - Iterate through input signal levels and observe volume changes in recorded audio. - Iterate through output signal levels and observe volume changes in recorded audio. Reviewed by: br, christos Differential Revision: https://reviews.freebsd.org/D47330 --- share/man/man4/snd_hdsp.4 | 24 ++++- sys/dev/sound/pci/hdsp.c | 220 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/sound/pci/hdsp.h | 56 +++++++----- 3 files changed, 275 insertions(+), 25 deletions(-) diff --git a/share/man/man4/snd_hdsp.4 b/share/man/man4/snd_hdsp.4 index d6661c80b2ea..ca24bcf22cd0 100644 --- a/share/man/man4/snd_hdsp.4 +++ b/share/man/man4/snd_hdsp.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 28, 2024 +.Dd October 28, 2024 .Dt SND_HDSP 4 .Os .Sh NAME @@ -134,6 +134,28 @@ for accurately synchronized signals (required for recording digital audio). .El .Pp +The following tunables are applicable to HDSP 9632 devices only: +.Bl -tag -width indent +.It Va dev.hdsp.0.input_level +Select the sensitivity of the analog line input. +Available reference levels for the input signal are +.Ql LowGain , +.Ql +4dBu +and +.Ql -10dBV . +.It Va dev.hdsp.0.output_level +Select the gain level of the analog line output. +Available reference levels for the output signal are +.Ql HighGain , +.Ql +4dBu +and +.Ql -10dBV . +.It Va dev.hdsp.0.phones_level +Adjust the gain level of the phones output, separately from the analog line +output. +The signal can be lowered by 6 or 12 dB. +.El +.Pp Where appropriate these sysctl values are modeled after official RME software on other platforms, and adopt their terminology. Consult the RME user manuals for additional information. diff --git a/sys/dev/sound/pci/hdsp.c b/sys/dev/sound/pci/hdsp.c index cf251a5636a1..03e885df63aa 100644 --- a/sys/dev/sound/pci/hdsp.c +++ b/sys/dev/sound/pci/hdsp.c @@ -231,6 +231,198 @@ hdsp_map_dmabuf(struct sc_info *sc) hdsp_write_4(sc, HDSP_PAGE_ADDR_BUF_IN, raddr); } +static const char * +hdsp_control_input_level(uint32_t control) +{ + switch (control & HDSP_INPUT_LEVEL_MASK) { + case HDSP_INPUT_LEVEL_LOWGAIN: + return ("LowGain"); + case HDSP_INPUT_LEVEL_PLUS4DBU: + return ("+4dBu"); + case HDSP_INPUT_LEVEL_MINUS10DBV: + return ("-10dBV"); + default: + return (NULL); + } +} + +static int +hdsp_sysctl_input_level(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + const char *label; + char buf[16] = "invalid"; + int error; + uint32_t control; + + sc = oidp->oid_arg1; + + /* Only available on HDSP 9632. */ + if (sc->type != HDSP_9632) + return (ENXIO); + + /* Extract current input level from control register. */ + control = sc->ctrl_register & HDSP_INPUT_LEVEL_MASK; + label = hdsp_control_input_level(control); + if (label != NULL) + strlcpy(buf, label, sizeof(buf)); + + /* Process sysctl string request. */ + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* Find input level matching the sysctl string. */ + label = hdsp_control_input_level(HDSP_INPUT_LEVEL_LOWGAIN); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_INPUT_LEVEL_LOWGAIN; + label = hdsp_control_input_level(HDSP_INPUT_LEVEL_PLUS4DBU); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_INPUT_LEVEL_PLUS4DBU; + label = hdsp_control_input_level(HDSP_INPUT_LEVEL_MINUS10DBV); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_INPUT_LEVEL_MINUS10DBV; + + /* Set input level in control register. */ + control &= HDSP_INPUT_LEVEL_MASK; + if (control != (sc->ctrl_register & HDSP_INPUT_LEVEL_MASK)) { + snd_mtxlock(sc->lock); + sc->ctrl_register &= ~HDSP_INPUT_LEVEL_MASK; + sc->ctrl_register |= control; + hdsp_write_4(sc, HDSP_CONTROL_REG, sc->ctrl_register); + snd_mtxunlock(sc->lock); + } + return (0); +} + +static const char * +hdsp_control_output_level(uint32_t control) +{ + switch (control & HDSP_OUTPUT_LEVEL_MASK) { + case HDSP_OUTPUT_LEVEL_MINUS10DBV: + return ("-10dBV"); + case HDSP_OUTPUT_LEVEL_PLUS4DBU: + return ("+4dBu"); + case HDSP_OUTPUT_LEVEL_HIGHGAIN: + return ("HighGain"); + default: + return (NULL); + } +} + +static int +hdsp_sysctl_output_level(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + const char *label; + char buf[16] = "invalid"; + int error; + uint32_t control; + + sc = oidp->oid_arg1; + + /* Only available on HDSP 9632. */ + if (sc->type != HDSP_9632) + return (ENXIO); + + /* Extract current output level from control register. */ + control = sc->ctrl_register & HDSP_OUTPUT_LEVEL_MASK; + label = hdsp_control_output_level(control); + if (label != NULL) + strlcpy(buf, label, sizeof(buf)); + + /* Process sysctl string request. */ + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* Find output level matching the sysctl string. */ + label = hdsp_control_output_level(HDSP_OUTPUT_LEVEL_MINUS10DBV); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_OUTPUT_LEVEL_MINUS10DBV; + label = hdsp_control_output_level(HDSP_OUTPUT_LEVEL_PLUS4DBU); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_OUTPUT_LEVEL_PLUS4DBU; + label = hdsp_control_output_level(HDSP_OUTPUT_LEVEL_HIGHGAIN); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_OUTPUT_LEVEL_HIGHGAIN; + + /* Set output level in control register. */ + control &= HDSP_OUTPUT_LEVEL_MASK; + if (control != (sc->ctrl_register & HDSP_OUTPUT_LEVEL_MASK)) { + snd_mtxlock(sc->lock); + sc->ctrl_register &= ~HDSP_OUTPUT_LEVEL_MASK; + sc->ctrl_register |= control; + hdsp_write_4(sc, HDSP_CONTROL_REG, sc->ctrl_register); + snd_mtxunlock(sc->lock); + } + return (0); +} + +static const char * +hdsp_control_phones_level(uint32_t control) +{ + switch (control & HDSP_PHONES_LEVEL_MASK) { + case HDSP_PHONES_LEVEL_MINUS12DB: + return ("-12dB"); + case HDSP_PHONES_LEVEL_MINUS6DB: + return ("-6dB"); + case HDSP_PHONES_LEVEL_0DB: + return ("0dB"); + default: + return (NULL); + } +} + +static int +hdsp_sysctl_phones_level(SYSCTL_HANDLER_ARGS) +{ + struct sc_info *sc; + const char *label; + char buf[16] = "invalid"; + int error; + uint32_t control; + + sc = oidp->oid_arg1; + + /* Only available on HDSP 9632. */ + if (sc->type != HDSP_9632) + return (ENXIO); + + /* Extract current phones level from control register. */ + control = sc->ctrl_register & HDSP_PHONES_LEVEL_MASK; + label = hdsp_control_phones_level(control); + if (label != NULL) + strlcpy(buf, label, sizeof(buf)); + + /* Process sysctl string request. */ + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* Find phones level matching the sysctl string. */ + label = hdsp_control_phones_level(HDSP_PHONES_LEVEL_MINUS12DB); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_PHONES_LEVEL_MINUS12DB; + label = hdsp_control_phones_level(HDSP_PHONES_LEVEL_MINUS6DB); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_PHONES_LEVEL_MINUS6DB; + label = hdsp_control_phones_level(HDSP_PHONES_LEVEL_0DB); + if (strncasecmp(buf, label, sizeof(buf)) == 0) + control = HDSP_PHONES_LEVEL_0DB; + + /* Set phones level in control register. */ + control &= HDSP_PHONES_LEVEL_MASK; + if (control != (sc->ctrl_register & HDSP_PHONES_LEVEL_MASK)) { + snd_mtxlock(sc->lock); + sc->ctrl_register &= ~HDSP_PHONES_LEVEL_MASK; + sc->ctrl_register |= control; + hdsp_write_4(sc, HDSP_CONTROL_REG, sc->ctrl_register); + snd_mtxunlock(sc->lock); + } + return (0); +} + static int hdsp_sysctl_sample_rate(SYSCTL_HANDLER_ARGS) { @@ -606,6 +798,14 @@ hdsp_init(struct sc_info *sc) sc->ctrl_register &= ~HDSP_CONTROL_LINE_OUT; sc->ctrl_register |= HDSP_CONTROL_LINE_OUT; + /* Default gain levels. */ + sc->ctrl_register &= ~HDSP_INPUT_LEVEL_MASK; + sc->ctrl_register |= HDSP_INPUT_LEVEL_LOWGAIN; + sc->ctrl_register &= ~HDSP_OUTPUT_LEVEL_MASK; + sc->ctrl_register |= HDSP_OUTPUT_LEVEL_MINUS10DBV; + sc->ctrl_register &= ~HDSP_PHONES_LEVEL_MASK; + sc->ctrl_register |= HDSP_PHONES_LEVEL_MINUS12DB; + hdsp_write_4(sc, HDSP_CONTROL_REG, sc->ctrl_register); if (sc->type == HDSP_9652) @@ -732,6 +932,26 @@ hdsp_attach(device_t dev) sc, 0, hdsp_sysctl_sample_rate, "A", "Force sample rate (32000, 44100, 48000, ... 192000)"); + if (sc->type == HDSP_9632) { + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "phones_level", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + sc, 0, hdsp_sysctl_phones_level, "A", + "Phones output level ('0dB', '-6dB', '-12dB')"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "output_level", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + sc, 0, hdsp_sysctl_output_level, "A", + "Analog output level ('HighGain', '+4dBU', '-10dBV')"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "input_level", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + sc, 0, hdsp_sysctl_input_level, "A", + "Analog input level ('LowGain', '+4dBU', '-10dBV')"); + } + return (bus_generic_attach(dev)); } diff --git a/sys/dev/sound/pci/hdsp.h b/sys/dev/sound/pci/hdsp.h index 981188ad8aff..8ac438cd79f9 100644 --- a/sys/dev/sound/pci/hdsp.h +++ b/sys/dev/sound/pci/hdsp.h @@ -80,39 +80,47 @@ #define HDSP_LAT_BYTES_MIN (32 * 4) #define hdsp_encode_latency(x) (((x)<<1) & HDSP_LAT_MASK) -/* Gain */ -#define HDSP_ADGain0 (1 << 25) -#define HDSP_ADGain1 (1 << 26) -#define HDSP_DAGain0 (1 << 27) -#define HDSP_DAGain1 (1 << 28) -#define HDSP_PhoneGain0 (1 << 29) -#define HDSP_PhoneGain1 (1 << 30) - -#define HDSP_ADGainMask (HDSP_ADGain0 | HDSP_ADGain1) -#define HDSP_ADGainMinus10dBV (HDSP_ADGainMask) -#define HDSP_ADGainPlus4dBu (HDSP_ADGain0) -#define HDSP_ADGainLowGain 0 - -#define HDSP_DAGainMask (HDSP_DAGain0 | HDSP_DAGain1) -#define HDSP_DAGainHighGain (HDSP_DAGainMask) -#define HDSP_DAGainPlus4dBu (HDSP_DAGain0) -#define HDSP_DAGainMinus10dBV 0 - -#define HDSP_PhoneGainMask (HDSP_PhoneGain0|HDSP_PhoneGain1) -#define HDSP_PhoneGain0dB HDSP_PhoneGainMask -#define HDSP_PhoneGainMinus6dB (HDSP_PhoneGain0) -#define HDSP_PhoneGainMinus12dB 0 - -/* Settings */ +/* Register addresses */ #define HDSP_RESET_POINTER 0 #define HDSP_CONTROL_REG 64 #define HDSP_CONTROL2_REG 256 #define HDSP_STATUS_REG 0 #define HDSP_STATUS2_REG 192 +/* Control register flags */ #define HDSP_ENABLE (1 << 0) #define HDSP_CONTROL_SPDIF_COAX (1 << 14) #define HDSP_CONTROL_LINE_OUT (1 << 24) +#define HDSP_CONTROL_INPUT_GAIN0 (1 << 25) +#define HDSP_CONTROL_INPUT_GAIN1 (1 << 26) +#define HDSP_CONTROL_OUTPUT_GAIN0 (1 << 27) +#define HDSP_CONTROL_OUTPUT_GAIN1 (1 << 28) +#define HDSP_CONTROL_PHONES_GAIN0 (1 << 29) +#define HDSP_CONTROL_PHONES_GAIN1 (1 << 30) + +/* Analog input gain level */ +#define HDSP_INPUT_LEVEL_MASK (HDSP_CONTROL_INPUT_GAIN0 | \ + HDSP_CONTROL_INPUT_GAIN1) +#define HDSP_INPUT_LEVEL_LOWGAIN 0 +#define HDSP_INPUT_LEVEL_PLUS4DBU (HDSP_CONTROL_INPUT_GAIN0) +#define HDSP_INPUT_LEVEL_MINUS10DBV (HDSP_CONTROL_INPUT_GAIN0 | \ + HDSP_CONTROL_INPUT_GAIN1) + +/* Analog output gain level */ +#define HDSP_OUTPUT_LEVEL_MASK (HDSP_CONTROL_OUTPUT_GAIN0 | \ + HDSP_CONTROL_OUTPUT_GAIN1) +#define HDSP_OUTPUT_LEVEL_MINUS10DBV 0 +#define HDSP_OUTPUT_LEVEL_PLUS4DBU (HDSP_CONTROL_OUTPUT_GAIN0) +#define HDSP_OUTPUT_LEVEL_HIGHGAIN (HDSP_CONTROL_OUTPUT_GAIN0 | \ + HDSP_CONTROL_OUTPUT_GAIN1) + +/* Phones output gain level */ +#define HDSP_PHONES_LEVEL_MASK (HDSP_CONTROL_PHONES_GAIN0 | \ + HDSP_CONTROL_PHONES_GAIN1) +#define HDSP_PHONES_LEVEL_MINUS12DB 0 +#define HDSP_PHONES_LEVEL_MINUS6DB (HDSP_CONTROL_PHONES_GAIN0) +#define HDSP_PHONES_LEVEL_0DB (HDSP_CONTROL_PHONES_GAIN0 | \ + HDSP_CONTROL_PHONES_GAIN1) /* Interrupts */ #define HDSP_AUDIO_IRQ_PENDING (1 << 0) From nobody Tue Oct 29 16:22:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdFsr1VBnz5bdyq; Tue, 29 Oct 2024 16:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdFsr0yf3z4kkT; Tue, 29 Oct 2024 16:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730218976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wABG17vmEAo0ToFsP9NEdoX3NHSJjoJdS34hOlRmKAQ=; b=k4sjxApR9X+z9w1SRRbJCI9lFE+aQZs0sVA0fYruPTqLDjZlI1sysjamccq3d23vHIyzSx 7+wavVM1vtqN0uQJOZJwQWTXWLZlrNfxZeL3kUZ64v9SDwNNmpIgNZfCYoAVXkwTqtxGBo eh+3O1w+XHYNf1AaYVnKH7dkkdbquZMGi1mw6ZIJVzrMfKY4ejAqmOEY0MJntA8Frtxj8t HCDEOQ7sKifq3zDl7ZKnp8nm3349CG8K4BLI6EjDfykFOn+FUJGdSRvEk94u9uPcCAo4Sd 8A0PCD+KTQHjWwMdsM/Jqde7dzByRw0Bcxfnq8hPvbXGmaVp+jasDiViv+3vEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730218976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wABG17vmEAo0ToFsP9NEdoX3NHSJjoJdS34hOlRmKAQ=; b=gVp/z4LvlvpXJR8A7O7ttgsJRu9TZ+83tSXBtse4slZgO9d8GwwKhCDASKXn3z5f8z0/A+ VjBwLjKV/FvQ6gge+7xAQaCqiScghVNeM7tVvfKsXJrDZA54QSS4qGWhY8z/QI6qxn/QJb uq1JSgjZ9YZhwY3QHzdg/eRYBzMt9A/yvv6bclajVWX/vzWPua5WS9EIIFbA/yIk3C/84h AlyVGlrsSq3gn7foDewrUix6PxZGype0Lf7pL//eSAi/I14VNiZx8wF8oU01Jr4vp4LoPL 9fiD4jcNU0cei/DvCYg6r9EpurWut3nOiigtjVI4Uz2MFlGogrgnz3pwiKGp7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730218976; a=rsa-sha256; cv=none; b=TxFaDIBNR1yFuPGsHWbh8Ua8rXavWTPXfDuyrjuCfBN65lEtBeYMSuRh/yTdf/dIUNXBem ZWcQVYX+E/RdHOBb2P5vN+NxNKON3zZO2XZii9yWwFqfrE/ke9xGF4lJJLdFVP9jyFch6X G2JkXrG3Zcp5OQ5yBO2F3PpSWQzjUu46xERAj2kea14g9t5upekikysjovmMu0tmC3OnDq eulbQvjLcsUqc3zK4Uvj7RbpTz1nEBTIM5h+SRhitjyiXgYCfPAymm2UYcNrWiY8eFxHTp zLKYqTcSkRqm3aXcPwOPTvj5i4O/GgA8YmjPf5Ome8hIV8ELlkG93O9Yeac6hA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdFsr0YrNzX0R; Tue, 29 Oct 2024 16:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TGMtP5057143; Tue, 29 Oct 2024 16:22:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TGMtrE057140; Tue, 29 Oct 2024 16:22:55 GMT (envelope-from git) Date: Tue, 29 Oct 2024 16:22:55 GMT Message-Id: <202410291622.49TGMtrE057140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 72ae04c73347 - main - vmm: fix vcpu atomic load List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ae04c7334743c0fec2e8c99ac13fd8ca63f51b Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=72ae04c7334743c0fec2e8c99ac13fd8ca63f51b commit 72ae04c7334743c0fec2e8c99ac13fd8ca63f51b Author: Ruslan Bukin AuthorDate: 2024-10-29 16:19:03 +0000 Commit: Ruslan Bukin CommitDate: 2024-10-29 16:19:49 +0000 vmm: fix vcpu atomic load Load vcpu with acquire semantics as we are making a critical code section between creating vcpu and using it. Tested on risc-v only. Pointed out by: markj Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D47306 --- sys/amd64/vmm/vmm.c | 3 ++- sys/arm64/vmm/vmm.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 12ebc1671641..07d3f74b8365 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -559,7 +559,8 @@ vm_alloc_vcpu(struct vm *vm, int vcpuid) if (vcpuid < 0 || vcpuid >= vm_get_maxcpus(vm)) return (NULL); - vcpu = atomic_load_ptr(&vm->vcpu[vcpuid]); + vcpu = (struct vcpu *) + atomic_load_acq_ptr((uintptr_t *)&vm->vcpu[vcpuid]); if (__predict_true(vcpu != NULL)) return (vcpu); diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index fe5f43495262..4127fad5cd59 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -443,7 +443,8 @@ vm_alloc_vcpu(struct vm *vm, int vcpuid) if (vcpuid >= vgic_max_cpu_count(vm->cookie)) return (NULL); - vcpu = atomic_load_ptr(&vm->vcpu[vcpuid]); + vcpu = (struct vcpu *) + atomic_load_acq_ptr((uintptr_t *)&vm->vcpu[vcpuid]); if (__predict_true(vcpu != NULL)) return (vcpu); From nobody Tue Oct 29 18:09:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdJF50dckz5bl5k; Tue, 29 Oct 2024 18:09:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdJF501c7z3wgG; Tue, 29 Oct 2024 18:09:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730225385; 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=jtQFPYGWbTL2B5rF50PHnQGsb8TZZ9EnZcwyRw7qENQ=; b=ItfoE5xea1dxoebethmjNt938lYBvut09+ccbZjDPR1xWefJIP2BqhqO3j1IjpCRDdYeNr W0WzDtJun1VvWuE69kNDiDE34KjwtT35MW/4ISX4QM8h26zi4d2Z6kgp4qHj0YeYLkFHpu m93V9V47LdVlpxDt8na5b/LykFCe8sbnQKYVZx8L/owUeeSggxVLPjH1PfSMDsGCdUx87p 7q/UkcXnt6zZk6oyAzTEHftS6Z/VKgs3vfQJ9spkPyXT5p9Vsp2xAOncKLARA2s7I3zIVt dy1kzwRjfSkKbcaWjwu/BNIeBuvHWtu40VVx6umU4mCOfTlfAhwcJVzwq/Qjdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730225385; 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=jtQFPYGWbTL2B5rF50PHnQGsb8TZZ9EnZcwyRw7qENQ=; b=JAUGANsQxzRdSODhHYSIXU5XIIaRCD+uN21hWCtvuvv0obsBrs7nnwdSFXdaGiNADvtMUa 6ZvF3fho7YCswKXbPR9ybP/YrW1dVsnGipAczvXv5khVwcCfORmDiQsOp/avZ8tP/nG8QT OaYoROi4bsMc+1YOlM5u3xVmK5mq8PVJaW2xQDRSDviT/7C1Ii4Ps8nX3l1y/UOkmJs+sO kfeKM4T3r6EAqSEZN7/ZDTwA4zGINsLzVJx0lB3p9zGb/bM6/587nrWKbB8OyNlOi2secE XPt0AQSOnXtuf6lTNTVtuhZ4T/fxipdfhlGvE7bZiYjGA2MVvcRQEk+36ou2VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730225385; a=rsa-sha256; cv=none; b=YSRRrFXTlTWkSqcyz23xxmLLWl83yiaWNbJkF7RRJpN5xkxqzjReweetawp9YSe0mBWuxn lky4akeR0zVndwwLuRJXfaUXXR0Ko55Ne0gywxKLnx4t+TmugqM/PeqtBIy7vud54nDkzz xdmoGRASQGTiS2+/1dmvGSxI4sdPUn7c5YNx2IQZ2Ae/+M4E/1hB25HJo6PQcDUuPa5/+6 GfQJJD6WcOtK1qOJz1EV2X7GahJG5npbOziG3/1EZQxIhfURJRmjmLCKiuKsF1opR8n8kl N/pA/T6ozuVY091URo0xAX4AD4u8WYPO2zoElatLqzmmJqdRkbm7DXgjlmMuZw== Received: from [IPV6:2601:5c0:4200:b830:41c2:e465:68f5:36e1] (unknown [IPv6:2601:5c0:4200:b830:41c2:e465:68f5:36e1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XdJF45LRdz17qK; Tue, 29 Oct 2024 18:09:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 29 Oct 2024 14:09:43 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: bc9e19dce0ab - main - Fix buildworld with gcc 12 after llvm-19 import Content-Language: en-US To: Dimitry Andric Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202410251608.49PG8pSI044793@gitrepo.freebsd.org> <4af71fad-407d-48f2-aec4-f6c50fa72c1f@FreeBSD.org> <4740E6A9-B104-46C5-AB19-9C5F2BF66AA3@FreeBSD.org> From: John Baldwin In-Reply-To: <4740E6A9-B104-46C5-AB19-9C5F2BF66AA3@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/28/24 16:12, Dimitry Andric wrote: > On 28 Oct 2024, at 20:56, John Baldwin wrote: >> >> On 10/25/24 12:08, Dimitry Andric wrote: >>> The branch main has been updated by dim: >>> URL: https://cgit.FreeBSD.org/src/commit/?id=bc9e19dce0abee80750e6fa04aaf979873bfe0d2 >>> commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2 >>> Author: Dimitry Andric >>> AuthorDate: 2024-10-25 16:07:59 +0000 >>> Commit: Dimitry Andric >>> CommitDate: 2024-10-25 16:08:32 +0000 >>> Fix buildworld with gcc 12 after llvm-19 import >>> Unfortunately gcc 12's is not yet capable of compiling all of libc++ >>> 19's C++23 code, which results in errors similar to: >>> /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function >>> 41 | operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) { >>> | ^~~~~~~~ >>> /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function >>> 48 | operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) { >>> | ^~~~~~~~ >>> Until we can get rid of gcc 12, work around this by making it compile >>> libc++ in C++20 mode instead. >>> NOTE: The resulting libc++ library will not be C++23 compatible! Please >>> try to avoid shipping it, and use gcc 13 instead, if you must use gcc. >>> PR: 280562 >>> MFC after: 3 days >> >> In this case I think we probably should drop support for GCC 12 for main. Just let me >> know when you are thinking of merging libcxx 19 to stable branches so I can ensure they >> build with GCC 13/14 and get our CI jobs updated before then. > > It depends a bit on how many ports still need to be fixed, and of course when 13.5 and 14.2 are done. After those I will probably do the merges. > > That said, is gcc 13 good for all arches we want to support? In the past we still kept a few old gcc versions alive because they were the only one that could build for $OBSOLETE_ARCH. I am only aware that GCC 12+ can build amd64 world + GENERIC currently. I believe aarch64 is close. i386 is also pretty close (but I care less about it). riscv64 needs a libatomic since GCC doesn't inline atomics as much as clang. I haven't really tried powerpc much. -- John Baldwin From nobody Tue Oct 29 18:12:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdJJS3llwz5blPb for ; Tue, 29 Oct 2024 18:12:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdJJS1kD9z3x84 for ; Tue, 29 Oct 2024 18:12:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4315e9e9642so52748055e9.0 for ; Tue, 29 Oct 2024 11:12:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730225559; x=1730830359; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LnLlvZCVSY10lagHOe7+NPIwXleyzwnJSlRznw2xXz4=; b=UGLIC8djVyDLkiEcz3vtCbqAIf15LFvdHUxAKE/M1jBiZDN7DX8Wo7OgwivpyQfxJ3 lfjcH/0PCwHhynEv0fNezi+PhSH2aHyILJqjlRwkvuq7nEUSojAcm9toO7jIDUzigTIU 6ojUf5XVRjma1esdb4GIJ0a3SP1VxKl2jK0ztYLjWSzaP8Rb4mF0HhXDQzuvaFIoYD/S 0lz2/h12eFJ4zs8GQ+5d+BpA3c5hbZ6+JCMuahW5+PzWKqbPtHGU+y6X8moox3MxJKxp bFpSFInNotylLXdY6BW9h/+WK9PMHi7SJfbaObhxSQ90VzFu+tReRN6iGdht66TDOHmp wtvg== X-Forwarded-Encrypted: i=1; AJvYcCXD9wO6vqsfQftoLchtlglxvGIAbjwqYAuE8dba9mizZON44hHt9IuicXr2+oauSyyc6q+6Ga9tIQlza2WVON6qXgeb@freebsd.org X-Gm-Message-State: AOJu0YyiexCsoVghUkx0bs251y31wVuY9y6icrQDlzctkPc65pHtvsjz mOTrPkFZP33NW4J/wrlmpENlEm/31JRZ76+kBoF+Qgh0jzrAWfk4h5eYazZ0U88= X-Google-Smtp-Source: AGHT+IFJwA6SXiZo62BmCFr8Pf/TfqYH/y8q2JVDv8az6BOFELjD6Ve0jCJqJ+lJsFg2irYp/tOZDw== X-Received: by 2002:a5d:4d43:0:b0:37d:2d45:b3d4 with SMTP id ffacd0b85a97d-38061222606mr9756701f8f.52.1730225558535; Tue, 29 Oct 2024 11:12:38 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38058b71221sm13140052f8f.68.2024.10.29.11.12.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2024 11:12:38 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: git: bc9e19dce0ab - main - Fix buildworld with gcc 12 after llvm-19 import From: Jessica Clarke In-Reply-To: Date: Tue, 29 Oct 2024 18:12:27 +0000 Cc: Dimitry Andric , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202410251608.49PG8pSI044793@gitrepo.freebsd.org> <4af71fad-407d-48f2-aec4-f6c50fa72c1f@FreeBSD.org> <4740E6A9-B104-46C5-AB19-9C5F2BF66AA3@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3818.100.11.1.3) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4XdJJS1kD9z3x84 X-Spamd-Bar: ---- On 29 Oct 2024, at 18:09, John Baldwin wrote: > On 10/28/24 16:12, Dimitry Andric wrote: >> On 28 Oct 2024, at 20:56, John Baldwin wrote: >>>=20 >>> On 10/25/24 12:08, Dimitry Andric wrote: >>>> The branch main has been updated by dim: >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dbc9e19dce0abee80750e6fa04aaf9798= 73bfe0d2 >>>> commit bc9e19dce0abee80750e6fa04aaf979873bfe0d2 >>>> Author: Dimitry Andric >>>> AuthorDate: 2024-10-25 16:07:59 +0000 >>>> Commit: Dimitry Andric >>>> CommitDate: 2024-10-25 16:08:32 +0000 >>>> Fix buildworld with gcc 12 after llvm-19 import >>>> Unfortunately gcc 12's is not yet capable of compiling all = of libc++ >>>> 19's C++23 code, which results in errors similar to: >>>> = /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/range= s_contains.h:41:3: error: 'static constexpr bool = std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const = _Type&, _Proj)' must be a non-static member function >>>> 41 | operator()(_Iter __first, _Sent __last, const = _Type& __value, _Proj __proj =3D {}) { >>>> | ^~~~~~~~ >>>> = /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/range= s_contains.h:48:3: error: 'static constexpr bool = std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, = _Proj)' must be a non-static member function >>>> 48 | operator()(_Range&& __range, const _Type& __value, = _Proj __proj =3D {}) { >>>> | ^~~~~~~~ >>>> Until we can get rid of gcc 12, work around this by making = it compile >>>> libc++ in C++20 mode instead. >>>> NOTE: The resulting libc++ library will not be C++23 = compatible! Please >>>> try to avoid shipping it, and use gcc 13 instead, if you must = use gcc. >>>> PR: 280562 >>>> MFC after: 3 days >>>=20 >>> In this case I think we probably should drop support for GCC 12 for = main. Just let me >>> know when you are thinking of merging libcxx 19 to stable branches = so I can ensure they >>> build with GCC 13/14 and get our CI jobs updated before then. >> It depends a bit on how many ports still need to be fixed, and of = course when 13.5 and 14.2 are done. After those I will probably do the = merges. >> That said, is gcc 13 good for all arches we want to support? In the = past we still kept a few old gcc versions alive because they were the = only one that could build for $OBSOLETE_ARCH. >=20 > I am only aware that GCC 12+ can build amd64 world + GENERIC = currently. I believe > aarch64 is close. i386 is also pretty close (but I care less about = it). riscv64 > needs a libatomic since GCC doesn't inline atomics as much as clang. = I haven't > really tried powerpc much. GCC 13 did finally fix that for RISC-V. Jess From nobody Tue Oct 29 18:45:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK2N3xhzz5bmwK; Tue, 29 Oct 2024 18:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK2N2zm7z41LK; Tue, 29 Oct 2024 18:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ps6PEnHGyOz7ZAnx2fMW15xpYizi9dWgLTWMGBUd79M=; b=L1FHWdUfGgJtWASKzH529lKv/idyaVdbHeDa4wwsMcZNED9CfZJpkdjLV2MVvXk/UAs1kX A1IYq2l5vdgS8SXH8GjRz7pktZMbMGZqfe4aIyB+ysP7jgFnQnkhd2LMPJ/oDxxqdUh+Vj tS2QJAx2EGhzfm4pgN3QSHCgNfXgqb+pCnVieFPUWuTIrlbhGHp2mZIHkMl89fkg1nZr03 0ZrRRkaNQdD0WnuItX1r14ZfigziQhj5S5sIMOLJSABC9fBZdWppiXVMPXkXtnMcINJAxz fFxFbdkli70QXSSUxAJXCeDUNyy31RlsCIQDIH2A9y5+2uatR/DyApvDSr8r+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ps6PEnHGyOz7ZAnx2fMW15xpYizi9dWgLTWMGBUd79M=; b=F6IuUg7c+kMb/iy+O2i5XnpRiYN7Aeypcwz0ekik5l7ts0uIuT5cqLccWoUqmvBrFmfhO/ 1aHj4UqZB8HLZEqi4PhoBIdQfYZysDWGRCOljO/x8ehItmjzIJ12ikbtodPS7Lf6LAhncf fDBcL9jgjNeCyojkM+3G3eQpqZYMyRVExNabRzugL5EV4noVQxx3kc59TflNkTVpFZM2wU yzXI3h3jSUQkJkQWHfJ+b//UHbjC01UDJGxWUWsMIRZG56gZKj0JeVNd/yh1Gab68FudC0 CUSGt55IbRRD/SrIl7xDQQ/IqJ7O6VPUDlp7Czc6h4DidCh65X41OUz0z7654A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227532; a=rsa-sha256; cv=none; b=XR6v5jNLaMBCKVI1aKCgMJpJGD04U5BwjEM7QV3HVQFPGNP+a6RWK8pJhdReoCDhuD6lqZ DCj3D8HJM8f5bMroZSfoJiPfUZuUf8p0fLo9xym/C/oWY3qGb9uNdoZ19rFkWGy9gqp8Pm 4NjFB50ThBDItXrKFOwrKpDJUh11X58K5E+D0Bi6UEBiYS6YImlNn8IPsCI5WSTEf85wLL 5a10ouhn2woNriDNiR4HhHW7+Gt+HJmR/N58GwOn/+YN3NIyDjp661CzI9NqXsAoIydPJe ZykL4+jELhBZkMj8YqLKSybz7GJCN74dcM2e34QGe5Z1Q5Y1ebn2Ipm8JQ2qaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK2N2bBszbZn; Tue, 29 Oct 2024 18:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIjWab016869; Tue, 29 Oct 2024 18:45:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIjWvh016866; Tue, 29 Oct 2024 18:45:32 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:45:32 GMT Message-Id: <202410291845.49TIjWvh016866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 97a933932e96 - releng/14.1 - bhyve/nvme: Fix out-of-bounds read in NVMe log page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 97a933932e96b5ea500b73477c5761f1943b8d1c Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=97a933932e96b5ea500b73477c5761f1943b8d1c commit 97a933932e96b5ea500b73477c5761f1943b8d1c Author: Chuck Tuffli AuthorDate: 2024-09-19 15:11:30 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:41:42 +0000 bhyve/nvme: Fix out-of-bounds read in NVMe log page The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c is vulnerable to buffer over-read. The value logoff is user controlled but never checked against the value of logsize. Thus the difference: logsize - logoff can underflow. Due to the sc structure layout, an attacker can dump internals fields of sc and the content of next heap allocation. Reported by: Synacktiv Reviewed by: emaste, jhb Security: HYP-07 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46021 (cherry picked from commit b0a24be007d83f7929de5b3fc320a29e6868067d) (cherry picked from commit a5be19efbb7c6b07d574ef048b2ebade00440873) --- usr.sbin/bhyve/pci_nvme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2fd49a84c768..a2e52ece7675 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1402,7 +1402,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, logsize *= sizeof(uint32_t); logoff = ((uint64_t)(command->cdw13) << 32) | command->cdw12; - DPRINTF("%s log page %u len %u", __func__, logpage, logsize); + DPRINTF("%s log page %u offset %lu len %u", __func__, logpage, logoff, logsize); switch (logpage) { case NVME_LOG_ERROR: @@ -1414,7 +1414,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->err_log + logoff, - MIN(logsize - logoff, sizeof(sc->err_log)), + MIN(logsize, sizeof(sc->err_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: @@ -1437,7 +1437,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log + logoff, - MIN(logsize - logoff, sizeof(sc->health_log)), + MIN(logsize, sizeof(sc->health_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: @@ -1449,7 +1449,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->fw_log + logoff, - MIN(logsize - logoff, sizeof(sc->fw_log)), + MIN(logsize, sizeof(sc->fw_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_CHANGED_NAMESPACE: @@ -1461,7 +1461,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->ns_log + logoff, - MIN(logsize - logoff, sizeof(sc->ns_log)), + MIN(logsize, sizeof(sc->ns_log) - logoff), NVME_COPY_TO_PRP); memset(&sc->ns_log, 0, sizeof(sc->ns_log)); break; From nobody Tue Oct 29 18:45:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK2Q60RPz5bmwP; Tue, 29 Oct 2024 18:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK2Q4zKHz41Q8; Tue, 29 Oct 2024 18:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZ0SUDTQq30xJ0ZiRrTY1BK8QXUrKnftvfSvu0XN6Uw=; b=OpCWKWF4MJ8B/G2UpoOZAK7Bc091y7Ol6bOkuDHfb2ODqqh8HqTz6sJAN2wJj1caN6QWPS evqpkY+bgR/4JUQxgRomT63DU/8T3swANJqFqWg5JiSZew7aOAeC3jQdIuVSvQTlsLi6wi pYqFqdguVZ2uKUABTLbGXksZw0Kgialul6RY37MyuiBQr+sta/w6o6+qmbSxJQboVv71jg YeTiiaMUClmpGhW2De7wonKriedywKFOpaQamFgq4iAJfgYhr6ghdt1ADRzJTn+cp19TNq GC6+sUGEFSiyK3b+nODuuPajHXf9IapGo0KXi0QTOWnqy28WnjYiDXZPp12Iew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZ0SUDTQq30xJ0ZiRrTY1BK8QXUrKnftvfSvu0XN6Uw=; b=E6UjAlNbnkp+nlL8ID48F8fES3zy4V7pp6qx9M3E+iDGCWlpHx5yH2o5DOlXCQsS/M1gSg 1bWqbYc1s1AM7bEgCsAIzAhSQaAyDJdamqeVSdoGKJ0R66v1SrWvFWWCez1bWzKTlwrove VtMYdAtXZG8dX9Eg4slf7Xt1drt9FukFgd3Vpa8/D8W9f8/jmHVDycpMgmfZk6fokt0VUg Q30/kKeccC8GtiDl55Wf32kx2qMkZVQsz82ghKzPVpEmHNjzTm9ASmfa5Y5cTuCYUOi/yy N3nk0VF5ZKuj5y4IFiD9o3SWTmjnAhyMiAnGnfpzD6WA2OfAFil87IaRtvQE9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227534; a=rsa-sha256; cv=none; b=oXd81HGZBdZfHYfSDoK0/NEtkFALS72sLf4TOwR5qH5wI+ndMrH2Uo8aMSK+FizCa0VjAv v5TOCOaO+ThD/4OSaQZfGiz720MuauO9q/t+5Fb7M2mivLsYmx/LGFZ9DC8haHchHh+PBU nm5IXAkCPJeEs8wut6loN5yLDOQ0mp631ET53NcR3nrZaJTK5uyXYKmJ0NVGZ0eXV+bzkA K2x4jdnwCznGOBgCG9Al84TA7jKe0buSsO6LOeMfFgPP/SPvQFo/g7mhBt0AQhiRCksvMK 28HpGiAgh2cElHU0kPME2cIK4S50DszeczSbz0pKf0uKlVWE14so+pRnKIopJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK2Q4ZvZzb7C; Tue, 29 Oct 2024 18:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIjYKo016965; Tue, 29 Oct 2024 18:45:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIjYaQ016962; Tue, 29 Oct 2024 18:45:34 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:45:34 GMT Message-Id: <202410291845.49TIjYaQ016962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6acac2ca9aa1 - releng/14.1 - bhyve: validate corb->wp to avoid infinite loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 6acac2ca9aa19cb20426c1a8bbb02df30e5ddb5c Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6acac2ca9aa19cb20426c1a8bbb02df30e5ddb5c commit 6acac2ca9aa19cb20426c1a8bbb02df30e5ddb5c Author: Ed Maste AuthorDate: 2024-09-19 18:57:42 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:43:34 +0000 bhyve: validate corb->wp to avoid infinite loop Guests must set HDAC_CORBWP less than corb->size. Treat invalid values as an error rather than entering an infinite loop. Reported by: Synacktiv Reviewed by: markj Security: HYP-12 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46134 (cherry picked from commit a305f44d1404fbf386bb2b50ab7233ce9eabe0bb) (cherry picked from commit 6a645bb3535cb73b1f20db652c9e3893f26a986e) --- usr.sbin/bhyve/pci_hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 6f0c1b6cfba9..58481af71a4c 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -789,6 +789,11 @@ hda_corb_run(struct hda_softc *sc) int err; corb->wp = hda_get_reg_by_offset(sc, HDAC_CORBWP); + if (corb->wp >= corb->size) { + DPRINTF("Invalid HDAC_CORBWP %u >= size %u", corb->wp, + corb->size); + return (-1); + } while (corb->rp != corb->wp && corb->run) { corb->rp++; From nobody Tue Oct 29 18:45:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK2S04RTz5bmYp; Tue, 29 Oct 2024 18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK2R65Vpz41HP; Tue, 29 Oct 2024 18:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ci2FS2veAmoHaCbURbgvXhaLGkf89XCrKpsQ4PCutUs=; b=wQ/OvG6b+zAGHEhbxureXEF/H85O9FLBuLJ7k+XCMioSGAKq9fgQuopEyT57ev2dV0L+8a 5Ey1HiERm+2Tq1BhMSHoD6eJ2Bgux+FKmz6ZTNY9AG5tgooMdvlrFxMCUthqyovxXjbEV1 bplKqWPUe7kxZ1EF39QhwJIQ9KsdjPBv6j5/hzMkvc7lNHAuC6E3/bvKYVxCaeSxPye2py 2apMPd9rJ3PB+XAxm+0CsDx/sbfi1sHeueLqPuqKf4xBT7K4lf8jfy+ZAz65YFOBjKgRWo 7QTM2xNdoPupmH+ZpLlVsXyxSJpSusQMV9P8GrmlQXRT/YudbXwlcAwJgxYAew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ci2FS2veAmoHaCbURbgvXhaLGkf89XCrKpsQ4PCutUs=; b=oWxahbImNgUZLc8zNZmG6xzHt7Nkeno9P2mLQ2lbjZBql/RL4hLur6qMaPz413wiR2X4ox rNSjuYuZ3CmCCm1f9kmDvBpd/J9QtnSRgG9q2LUb4v2QEw6QPB1KPq6XYj3c3k78DMHHRi bhinP2UOsISCHz6xx5II8Vs6sLnzTiCiFGSJgEJNDL6WQkPX2Natte01SEI1DLaKGomIWs ioNyY+ZiLvOqfcV0RuTJy58wBGo1mHLZnmO5XCyhob32c4uCzzbY8ZpNX0M/TIKFpeT+y4 OXl+0G6wTK6ZE5Ys3qvccjLUGedsSlC8Usw/FvC7bF7GWyuwPOQNwnSQ1WTWgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227535; a=rsa-sha256; cv=none; b=IT2LVVMb/34xVuUAU8NiMr/qDCjLVuVqtSc41YBMdBF244EkaSienTYOR35O7BTVIatTht zMRkhRtWuRZ/P9yVVqD+2O8RqS0gKTnYd3+/4QBEWBNOCINRCjc47pv8hwfeeRCZdi7Q5C PKdoZe9ZnFnZfCRegEfxOtFdAOaZ3KbIRwvsldzIXVB7iCsx0B+FtC+0OotgRIqkaxjPai KKCCyjRXgieb0xI4CX9VVYmPACG9do0/osiF3rYLn2nMhwlp4dN2JlUXEUPg5vm8TBuJpe Jwo6tzFvAjOR+4zhNTdOt3gGiFcf8NEVnYSgNLWr39Gd/t3zWW7FpSWhog9tFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK2R5QRlzb7D; Tue, 29 Oct 2024 18:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIjZ1g017017; Tue, 29 Oct 2024 18:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIjZxj017014; Tue, 29 Oct 2024 18:45:35 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:45:35 GMT Message-Id: <202410291845.49TIjZxj017014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 538cb37f512a - releng/14.1 - bhyve: improve bounds checks in hda_codec List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 538cb37f512aea39c9eacd8bd393bbad9f913e1f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=538cb37f512aea39c9eacd8bd393bbad9f913e1f commit 538cb37f512aea39c9eacd8bd393bbad9f913e1f Author: Pierre Pronchery AuthorDate: 2024-07-24 14:56:54 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:43:47 +0000 bhyve: improve bounds checks in hda_codec The function hda_codec_command is vulnerable to buffer over-read, the payload value is extracted from the command and used as an array index without any validation. Fortunately, the payload value is capped at 255, so the information disclosure is limited and only a small part of .rodata of bhyve binary can be disclosed. The risk is low because the leaked information is not sensitive. An attacker may be able to validate the version of the bhyve binary using this information disclosure (layout of .rodata information, ex: jmp_tables) before executing an exploit. Reported by: Synacktiv Reviewed by: christos, emaste Security: HYP-13 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46098 (cherry picked from commit e94a1d6a7f2eb932850e1db418bf34d5c6991ce8) (cherry picked from commit 757bbf484c0bab2c4c7b504017079cceb833f7ae) --- usr.sbin/bhyve/hda_codec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/hda_codec.c b/usr.sbin/bhyve/hda_codec.c index 1866149c020a..b7d6ec043675 100644 --- a/usr.sbin/bhyve/hda_codec.c +++ b/usr.sbin/bhyve/hda_codec.c @@ -521,7 +521,6 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) payload = cmd_data & 0xffff; } - assert(cad == hci->cad); assert(hci); hops = hci->hops; @@ -530,7 +529,10 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) sc = (struct hda_codec_softc *)hci->priv; assert(sc); - assert(nid < sc->no_nodes); + if (cad != hci->cad || nid >= sc->no_nodes) { + DPRINTF("Invalid command data"); + return (-1); + } if (!hops->response) { DPRINTF("The controller ops does not implement \ @@ -540,7 +542,8 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) switch (verb) { case HDA_CMD_VERB_GET_PARAMETER: - res = sc->get_parameters[nid][payload]; + if (payload < HDA_CODEC_PARAMS_COUNT) + res = sc->get_parameters[nid][payload]; break; case HDA_CMD_VERB_GET_CONN_LIST_ENTRY: res = sc->conn_list[nid][0]; From nobody Tue Oct 29 18:45:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK2T2lcsz5bmwV; Tue, 29 Oct 2024 18:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK2S6W5Vz41Vy; Tue, 29 Oct 2024 18: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=1730227536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjwlfE7sZjcrLdjlibknX8627uSEybI887a2u/AYBh4=; b=W4ZITpKHvDr1u9C93ikTHI7Dzm8nFX7i+vWh9oBRlZcK5t8plJgYNEgQ0pJ5VPgcUnelpj e5K5A8c65OaVH+Apav154P+Wl9cNPGcikFiFUKzEoXrcvuzLv0Dr1UDhOKWu2pyjMA+DP2 FlCJf5TFLMiKf/vurSDUu/HXhLIYDSdAftnh01FLQyuwZsG3ynPj31++9NYshDb4mQ9GMp 6KDVTJYeJF2ixXpFNYM/SH4DbqpsYqzXeUrWHlVZwdJ/UmVX19leHUu1RnZ6XRLAzrOccz hZ16iZ5fFikJpfZJHqpFHcXvNrlkWFmMxVh0kXYNdYUrMI5am2pk6wGn0gGhSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjwlfE7sZjcrLdjlibknX8627uSEybI887a2u/AYBh4=; b=vgWgHAn6YIln/UhTR3BirbJ+NWUoR/SJjxPsoD2LWGpUuXh4ThfyD/2Czt9l8Sh6xsh4rz 9j4WVwYeD6AuQ90CRqWj2z3zh83XzU6O8CoY8HXKP0k3emYxOfDQ7I1Qm7P1Cz7bxEo90B g0xW/o0PoqrMBhcsZIBIRKhKgeOwMuN6b8rHRE17dsOIctU63MsnSAAqEjudXIcDA8+cx6 P2iKyhWGG8XtBC/LXgzbPlwtMpm7ZctDD1YK+BGCVoZyC1xBbzHs8CxVfQDilDL7KyytZt wjxyqwC1c90NHA0EsEFUuQYwFGk/E0FNSakDwqJwf2vBEVuKM3GMA1mAcWFEXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227536; a=rsa-sha256; cv=none; b=qqnGJU7GIdP/xo2aAxCX32JVwjHA8xdxLqS2YtHa6MgWi9fv0ayFBTL9PYue43XiMFgVA+ 8p9VmA7XZsNtr9Mi9Cml16zxIA0YVkYNmkdeE2KhzmF3Dhc22wdZMzdn2L6G2PEuowcjGS H0OcTVdaVdUDuv0f+5oWvl5BMqqOay/G9/TVpzkvFpWSrwrX+aaXuc0nyC17rTFA+Nq++s jkn/I/Gl1UxdM6JyUdo40c0mNmr/yHy95qQdJ3BV0xb+SbhxPg3kTznf5PGvprnR9oseRs mpBzZMaCEUEO/+o0Bi1ubjb2H9+H1Kj87tVPJMd5/FVzlti156agxwyKcxOefg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK2S64zXzbLX; Tue, 29 Oct 2024 18:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIjaTN017068; Tue, 29 Oct 2024 18:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIja2c017065; Tue, 29 Oct 2024 18:45:36 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:45:36 GMT Message-Id: <202410291845.49TIja2c017065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fcd9a2d8a5bd - releng/14.1 - bhyve/nvme: Fix Infinite loop in queue processing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fcd9a2d8a5bd6a76a70ea49fee8af8a73e2ce85a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fcd9a2d8a5bd6a76a70ea49fee8af8a73e2ce85a commit fcd9a2d8a5bd6a76a70ea49fee8af8a73e2ce85a Author: Chuck Tuffli AuthorDate: 2024-10-13 13:58:48 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:44:00 +0000 bhyve/nvme: Fix Infinite loop in queue processing In the functions pci_nvme_handle_admin_cmd and pci_nvme_handle_io_cmd infinite loops are possible in the bhyve process if the sq->tail value is greater than sq->size. An attacker could overload the host CPU. Fix is to validate that doorbell values: - Are for a valid (i.e., created) queue - Are not the same as the previous value - Fit within the available capacity The emulation will generate an Asynchronous Event Notification (Invalid Doorbell or Invalid Doorbell Value) if enabled and ignore the doorbell update. While in the neighborhood, remove a redundant bounds check. Reported by: Synacktiv MFC after: 1 week Security: HYP-14 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46064 (cherry picked from commit 5374b9e146811757540e35553a7712c5b9b29239) (cherry picked from commit 86ba5941b132c73476a2a1b76ae53902a027b81c) --- usr.sbin/bhyve/pci_nvme.c | 81 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index a2e52ece7675..362ed09523fd 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -265,6 +265,17 @@ struct pci_nvme_aer { uint16_t cid; /* Command ID of the submitted AER */ }; +/** Asynchronous Event Information - Error */ +typedef enum { + PCI_NVME_AEI_ERROR_INVALID_DB, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE, + PCI_NVME_AEI_ERROR_DIAG_FAILURE, + PCI_NVME_AEI_ERROR_PERSISTANT_ERR, + PCI_NVME_AEI_ERROR_TRANSIENT_ERR, + PCI_NVME_AEI_ERROR_FIRMWARE_LOAD_ERR, + PCI_NVME_AEI_ERROR_MAX, +} pci_nvme_async_event_info_error; + /** Asynchronous Event Information - Notice */ typedef enum { PCI_NVME_AEI_NOTICE_NS_ATTR_CHANGED = 0, @@ -2789,6 +2800,38 @@ complete: pthread_mutex_unlock(&sq->mtx); } +/* + * Check for invalid doorbell write values + * See NVM Express Base Specification, revision 2.0 + * "Asynchronous Event Information - Error Status" for details + */ +static bool +pci_nvme_sq_doorbell_valid(struct nvme_submission_queue *sq, uint64_t value) +{ + uint64_t capacity; + + /* + * Queue empty : head == tail + * Queue full : head is one more than tail accounting for wrap + * Therefore, can never have more than (size - 1) entries + */ + if (sq->head == sq->tail) + capacity = sq->size - 1; + else if (sq->head > sq->tail) + capacity = sq->size - (sq->head - sq->tail) - 1; + else + capacity = sq->tail - sq->head - 1; + + if ((value == sq->tail) || /* same as previous */ + (value > capacity)) { /* exceeds queue capacity */ + EPRINTLN("%s: SQ size=%u head=%u tail=%u capacity=%lu value=%lu", + __func__, sq->size, sq->head, sq->tail, capacity, value); + return false; + } + + return true; +} + static void pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, uint64_t idx, int is_sq, uint64_t value) @@ -2801,22 +2844,34 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_squeues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->submit_queues[idx].qbase == NULL) { + WPRINTF("%s write to SQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (!pci_nvme_sq_doorbell_valid(&sc->submit_queues[idx], value)) { + EPRINTLN("%s write to SQ %lu of %lu invalid", __func__, + idx, value); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE); return; } atomic_store_short(&sc->submit_queues[idx].tail, (uint16_t)value); - if (idx == 0) { + if (idx == 0) pci_nvme_handle_admin_cmd(sc, value); - } else { + else { /* submission queue; handle new entries in SQ */ - if (idx > sc->num_squeues) { - WPRINTF("%s SQ index %lu overflow from " - "guest (max %u)", - __func__, idx, sc->num_squeues); - return; - } pci_nvme_handle_io_cmd(sc, (uint16_t)idx); } } else { @@ -2824,6 +2879,16 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_cqueues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->compl_queues[idx].qbase == NULL) { + WPRINTF("%s write to CQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); return; } From nobody Tue Oct 29 18:45:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK2V2L68z5bmhP; Tue, 29 Oct 2024 18:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK2V06Yhz41Hh; Tue, 29 Oct 2024 18:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhuT8tzMLw5yz6Sg9g+mUd61lvBmE4nX1PY+4NRzpjE=; b=N0YO1+aCGA3ykfdupTtRjCnS7RA8A5BFY3P+AlFdqIGfbwdTjrda6z4KriT9gMQmYQ/Hsz 1mL8YHLvDr7GNY0n8mn63emqyIc8lE6NjjkQ85G6ULKSeCg8GxuCSwGtztGrswkN2PLXUK ZWk2sR78Glou1nH516ePLvgFkxfC/+weOP33GS6F8b3/7E6n+CQS0z+11N8suvDejdNydA 93q06zRMDiHkCeiH7ETHlyLfRW5vDEA0uvBjW0KFVRARQtGY63Q0dyIRsWrh3R0TMDFjCt igDWKfUoZzQzPQ4g7NgaHSIAUsHPhIGUQ0rVMC1EzNuYmfwUNUBaWMNlWhxklw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhuT8tzMLw5yz6Sg9g+mUd61lvBmE4nX1PY+4NRzpjE=; b=Qnf+V1cmdkb8pZpXieFx2lMth9Lw99JaTR2IY/0mzUHs8P22wAJNB7I71AAPnSpXU4b3fQ XUbH9aTHw3c1uXqwExgIowU02NGhhmXJR31Ka26WaxCFPNmaZeC7/zEH9YJviig3zbkJut Rp6h9glKMRLzk/KsU3pB58vBtVlXQK0Dx44dCGE/uRwENIy9ebA4aTgmKwtfQYwbVn5OEP 2wZSghASKlSfAEI0VJ8UGdK72qpS2cuwb/QRL8PmpHhMm6jYUUcVIG4wFDGiEp7mGKjj2b uGKZ0DdBIGWEg5zrPJgn17qa03XLkGnEB+itNzd9WbIYegrnWOMciN0j2o/pag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227538; a=rsa-sha256; cv=none; b=Qx5vs7v3AoVA1/JzegBDsos7bAhEvXqCLP0ntar+hSmX31LQfG7t8gusgu9oaXCaGKsmpa bdduOdT1RhjR2gGiAIv/4zQG3Is08Xtnm6nmlNdgnGIvQBfxYxxDfCcFGtnYeHs6BkGf2E w+4h9fJZTI1ZaNKSI6D8450zzoUBPYdn2YMEzlU7c4w25eeymjo2yuklClgO++uGwoT9Zf NfXxn3ZQquW5mspbZIutoJFbkZoM+6dxIRFdcTCyjZOJWIpyTfJ96O2RIbJpyGZkaquDEJ lpoxzoLnH/qQoUIg8cgUiBvHjYrUn8ZRFEs3f4Y2vtxt66vXVzWmt6BMIuXXSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK2T6rL2zbXc; Tue, 29 Oct 2024 18:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIjbH4017118; Tue, 29 Oct 2024 18:45:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIjbE2017115; Tue, 29 Oct 2024 18:45:37 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:45:37 GMT Message-Id: <202410291845.49TIjbE2017115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a8df23541444 - releng/14.1 - ctl: limit memory allocation in pci_virtio_scsi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: a8df23541444f6630a572bcce90ba26327ba25df Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a8df23541444f6630a572bcce90ba26327ba25df commit a8df23541444f6630a572bcce90ba26327ba25df Author: Pierre Pronchery AuthorDate: 2024-07-19 17:32:27 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:44:17 +0000 ctl: limit memory allocation in pci_virtio_scsi The virtio_scsi device allows a VM guest to directly send SCSI commands (ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl (ctl.ko). All kernel commands accessible from the guest are defined by ctl_cmd_table. The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows the caller to call malloc() with an arbitrary size (uint32_t). This can be used by the guest to overload the kernel memory (DOS attack). Reported by: Synacktiv Reviewed by: asomers Security: HYP-08 Security: FreeBSD-SA-24:18.ctl Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46044 (cherry picked from commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47) (cherry picked from commit 2e7f4728fa738a7a7b6c4e4c46eb68952386efce) --- sys/cam/ctl/ctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 0e0d79d15d8f..420d9088c27b 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8320,6 +8320,18 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) param_len = scsi_4btoul(cdb->length); + /* validate the parameter length */ + if (param_len != 24) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 5, + /*bit_valid*/ 1, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; From nobody Tue Oct 29 18:49:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7M0tVdz5bn1p; Tue, 29 Oct 2024 18:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7M027Yz43w9; Tue, 29 Oct 2024 18:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PCb/CMyBsutBqZe411AVWugeQf7di5nbKgWc9sGl2dQ=; b=q+bD7mvvd19lnCTy47bOV4WnAOcmNsxChlRLVqJZhPmxxu+zQ+xKxgRH79O+9uTNqHGwKD U68kSNBXiNnqIsSglMXWl5S2ZlpSua2rZajYFCu0D0hjffyfhaMHiyaSHkKxecLfjkMXkj wi+JOw+2aAa7JhMRmjH4s/KuLpbRokfSQiprAmLg11vhJD/nMmZaImjN8uYFXLd+GAe8g2 Ndssn5/UGSlPEHlqppTQdbb2cZP59wQOZ4r5YWjfq0URxCmBkZOMU071VcpvbZRRNs9EHW W3Ue3WazA5/7Sjxy4lwlWwEcH2CQzNL+FaVTB9qxi5NaGeYq9RAf9btATmorHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PCb/CMyBsutBqZe411AVWugeQf7di5nbKgWc9sGl2dQ=; b=ZGS+i4FvhdhtM5gZ7flS4P0eZPirge6OSn1aSLLsh9Ib6XFS26z3YVe+OYuwA1rRDrrZlH QD3PsXJ7zIvI2+NY8s/42oTMlnGYLklsDPxPoCoStRb95FTIOSbiqs19YDwJgjQkso1dk3 IowXmd53AoseFqfT2fBoaWFd/arM5fLec9d+qaPMk/nNH4xZRJSFlNWFaeJNGGnuurxsFM xCvBtVDEqZDQTuC1qFTCcB/gP6sYd2mGxprkFJrxPAeMpxPnFfVCIJl1tLQ8VQCGqnIGmG cwcx1ZpNqoBo6o/DhI4VfL5+HvEw/2ALqgKqkdo7gwS977Bh2CimtB+PnACDeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227791; a=rsa-sha256; cv=none; b=sUTVmg9SopstQZsgz6WPV9x/dBmgDH+egyGnJH8qIDRDQgxZzfHJkTevYOd8w86Pl3434r hSGEmHMQJQ/NOmfDFJ+qkBYnggRDyEZRWdLUHC2grN365qX2VD9IDopTXPk5bM70ss/wTa /QhcoomXLnNIJJ/TITUcrS2qsYaV84dJtjFB4BAP0YAsyv7OCbMJFV/wQZFNP2E9UCf0o8 XIoeUsChRoIG3SrXBnbBfc0kGEoDFAZkH69ySqsyPN5cxxm3c9gO7ExklBriwYTw4R5vc+ rmCrmTXPMYEW6CMq7tq26cJ8VYFy/M33HC8tWX8qVTfgq6Ip1yvtWi6mYFdGyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7L6kS8zbLb; Tue, 29 Oct 2024 18:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInoLU018492; Tue, 29 Oct 2024 18:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInoLH018489; Tue, 29 Oct 2024 18:49:50 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:50 GMT Message-Id: <202410291849.49TInoLH018489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 088b759baab5 - releng/13.4 - bhyve/nvme: Fix out-of-bounds read in NVMe log page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 088b759baab52e65eb13eb171e810d9bdda41bed Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=088b759baab52e65eb13eb171e810d9bdda41bed commit 088b759baab52e65eb13eb171e810d9bdda41bed Author: Chuck Tuffli AuthorDate: 2024-09-19 15:11:30 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:46:00 +0000 bhyve/nvme: Fix out-of-bounds read in NVMe log page The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c is vulnerable to buffer over-read. The value logoff is user controlled but never checked against the value of logsize. Thus the difference: logsize - logoff can underflow. Due to the sc structure layout, an attacker can dump internals fields of sc and the content of next heap allocation. Reported by: Synacktiv Reviewed by: emaste, jhb Security: HYP-07 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46021 (cherry picked from commit b0a24be007d83f7929de5b3fc320a29e6868067d) (cherry picked from commit a5be19efbb7c6b07d574ef048b2ebade00440873) (cherry picked from commit c8f75686adc6bc2078ade279d838cbc5b1745e71) --- usr.sbin/bhyve/pci_nvme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 3db306a19119..cbe4d87b6f60 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1454,7 +1454,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, logsize *= sizeof(uint32_t); logoff = ((uint64_t)(command->cdw13) << 32) | command->cdw12; - DPRINTF("%s log page %u len %u", __func__, logpage, logsize); + DPRINTF("%s log page %u offset %lu len %u", __func__, logpage, logoff, logsize); switch (logpage) { case NVME_LOG_ERROR: @@ -1466,7 +1466,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->err_log + logoff, - MIN(logsize - logoff, sizeof(sc->err_log)), + MIN(logsize, sizeof(sc->err_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: @@ -1489,7 +1489,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log + logoff, - MIN(logsize - logoff, sizeof(sc->health_log)), + MIN(logsize, sizeof(sc->health_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: @@ -1501,7 +1501,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->fw_log + logoff, - MIN(logsize - logoff, sizeof(sc->fw_log)), + MIN(logsize, sizeof(sc->fw_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_CHANGED_NAMESPACE: @@ -1513,7 +1513,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->ns_log + logoff, - MIN(logsize - logoff, sizeof(sc->ns_log)), + MIN(logsize, sizeof(sc->ns_log) - logoff), NVME_COPY_TO_PRP); memset(&sc->ns_log, 0, sizeof(sc->ns_log)); break; From nobody Tue Oct 29 18:49:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7N2HQCz5bn9Z; Tue, 29 Oct 2024 18:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7N11Q6z43mw; Tue, 29 Oct 2024 18:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYa5v1Csjzm7nT36qlednuoHmZigDwhz16ePD6UcWUI=; b=fizRN/nwQ7dbhBcGBBJR3NXFFobQfUiqJ0djlcWBGKfFuS1g6et0qz1pkDuEAfj4H7TC/1 BX/337xC3qrdjXMXzVH+uu+ohnqeEeqDfAAkjekPe4pYfX48DmwE/h4GSfnbzQ3npLRerE a9FlmMeUXidvd2w+H1Y9+3bXHzsm5aS7FyGGkxlrOniEiIIMBHP+IDhiTanw659T7Tu4tf ZsJJHtM5AI5K7L0NzdqKVJwN/8eA5DjlCUsdtdDY5fm6fKA2xuTppmQ4GgM7kt7Ab0UZ+C i1BYKOrrODahL0BKwPVLD1ow5Kvxv389Eub86v9bog3G47PUICZ9dbyiPK9AWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYa5v1Csjzm7nT36qlednuoHmZigDwhz16ePD6UcWUI=; b=slmEZizKKbNCKyiisNjyEdHjxPP0r8462RYOuDf3/u873oeEYpHylrXlzpn+EHqcFux68t aqL/j8IpeYT7vrUG2TaIXfHfYYs//7KK/nnidiXCA81Zv5atbNIoLSRQHTGSZerFDG+pVf zhvvPurZC51FX1C/weA1M5fZDzQ0q8xIJ9mqbGyXJWIHreZXI0uBADEJyKA6C2GaSAHlnQ W1ztUqbGdO3Q5kbs25U8HO5L/+xHiX0Q2PmxFMPv+bQprNxh0v+oOeSsFkuwm34i78vz3s 2rK1/Nf8xXDAbXG8lg0LsMS2PKDwcKsBWecw01uDNcygq8zzX9AdciEaFXl9Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227792; a=rsa-sha256; cv=none; b=dRLSWHpdb91Lxs49li/SjSmUZ7cIWle1SYY3aKEm/49xuM8fFFSJC5PxJGUEN/H60UKynh FuPaTNrD9gfRwJWzkpAGvhXBQ857TqgruNuXCQUb97x3Y/E7A8LYpD3CwMQBdZzJvliV3P YOMmAq8ADfMXwNxiPOuwSlN+WGc7oqBjBFsnOrv+CDzHNQkXm9zYpIS0ndJy8kQUWf8I4y V0vxJP/Lph/QSO1mv6SLaUUPoL68QlRE3bqcTtUCsfMr9wGhMJXv9S/JFcMez/TlmXhKPK pJXjYjYufMri19oGRrRm1JYS+MmCj3Mw2MDbaYRok+Rzh8bLWu0uhA5yJ17k/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7N0d5yzb7F; Tue, 29 Oct 2024 18:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInqg2018551; Tue, 29 Oct 2024 18:49:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInq6T018548; Tue, 29 Oct 2024 18:49:52 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:52 GMT Message-Id: <202410291849.49TInq6T018548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1c48a9b47821 - releng/13.4 - bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 1c48a9b47821de7c4d0dbe28de112b525470e209 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c48a9b47821de7c4d0dbe28de112b525470e209 commit 1c48a9b47821de7c4d0dbe28de112b525470e209 Author: Pierre Pronchery AuthorDate: 2024-08-27 13:57:32 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:46:43 +0000 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() Avoid a race condition when accessing guest memory, by reading memory contents only once. This has also been applied to _vq_record() in sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion. Reported by: Synacktiv Reviewed by: markj Security: HYP-10 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45735 (cherry picked from commit 869d760cb9d7a307faa2fbe8c1c2b238a81b74d4) (cherry picked from commit ed03c309908687bdb9f71dc6d9c9c8a92c54fc20) (cherry picked from commit 6eb7879f426129aa38f4e8b0d57ab7456e4eb351) --- sys/dev/beri/virtio/virtio.c | 11 ++++++++--- usr.sbin/bhyve/virtio.c | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/dev/beri/virtio/virtio.c b/sys/dev/beri/virtio/virtio.c index c249d1c9d37b..7302bc39d799 100644 --- a/sys/dev/beri/virtio/virtio.c +++ b/sys/dev/beri/virtio/virtio.c @@ -107,12 +107,17 @@ paddr_unmap(void *phys, uint32_t size) static inline void _vq_record(uint32_t offs, int i, volatile struct vring_desc *vd, struct iovec *iov, int n_iov, uint16_t *flags) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_map(offs, be64toh(vd->addr), - be32toh(vd->len)); - iov[i].iov_len = be32toh(vd->len); + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_base = paddr_map(offs, be64toh(addr), + be32toh(len)); + iov[i].iov_len = be32toh(len); if (flags != NULL) flags[i] = be16toh(vd->flags); } diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c index 5294da670677..d11f5683e7b7 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -215,10 +215,15 @@ static inline void _vq_record(int i, struct vring_desc *vd, struct vmctx *ctx, struct iovec *iov, int n_iov, struct vi_req *reqp) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_guest2host(ctx, vd->addr, vd->len); - iov[i].iov_len = vd->len; + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_len = len; + iov[i].iov_base = paddr_guest2host(ctx, addr, len); if ((vd->flags & VRING_DESC_F_WRITE) == 0) reqp->readable++; else From nobody Tue Oct 29 18:49:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7P49jhz5bmvP; Tue, 29 Oct 2024 18:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7P2F1xz43ky; Tue, 29 Oct 2024 18:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqEuZqjjOxLba3rt62WmQKFPDQkvGzt9yeo7UlUales=; b=lWxh2QkA0VuNDWz5UrQLxVWs2rVWyZyl3VzcBQDJtiVf7REki7zzjiYTkbnaKEgcJQUe59 wmy3o6CJm6KjcpxL73vpL72ce0WLYQ/7xjzMP4gjsXQq7TnyyqyrIeCXaxISL354/bUTDJ EBv2rE8Te3pzLK4iRbYYaUjvtv0bYkiPmPRNth4H7oYWDtbyh4Wz1pWgYQYBtmDj32Un60 LJEdeB1Q70fJqTjLCPKqWvvysU/EoAOtf/FSfz0Bm6FJIrOli4O0BKUL+5H4QduoORXmnM OydJIetXfnT1c0zTqPtgjNwHNyO375jxHuFLGb/oaipHPQm1f7t3SDWwzSIw7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqEuZqjjOxLba3rt62WmQKFPDQkvGzt9yeo7UlUales=; b=ddML6SFi0PqvyXjs9ZwuBXQIF4UbLu2mkO56d5YSp4mNft7os0kSomwujQQisiM6nZy91d ah2Afc7JE4HXMdafrGgFrMLiOvB/dHyr/3oYoyM5xkCcUMJWB+WfGUfsEc48H0gWKtFhrp 5nosVoWzamBNFblWJTLLAvE19MZcw+dJmVK7K/aW95pBWd8Nc4FXzbNeXth5UvaHwkT8zt mSt08UJ9vZMXinQQ2fS3DSTx3hrlF/9fRBtcN46P5Mvxbs4sXDi/ojoA6b3pJ2B3vVwrew kvR8qHzdr6lkWkhs1sp3ty+XaEVoFx5MbqQKzAPt4J7R8AYUAv26nEnjICgKBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227793; a=rsa-sha256; cv=none; b=EZu8RnuQgiMOlYwhCZlB/OpLM54Dnf0Pja/Z90warXhWmanBf/OW/qHVYmsPFoqF2g4rHH apeMODBB6qK/Qjxpt1qasLsRpRGneBxlqC1WioixewAXV0OG3PFhqEEW7h31szHAX4y7Mn zD3IEEJBnrWjOJXQyRLnw7d3irZZ75PN9E5pUwklJ8UYOrHul+Cp5iT7IFNWSFIi8Cue+J b/3q5FFfOPEy5qXymkkDMkWgaKfgcCX4BIegdnVss3yGaW65hYOwgbO+RuEYQNlYJr923N Wa1CHH6AmwAPUw3cnHqOfYjNEBhW4FztZanalqkWyd377QANq9gFofRFjQVrYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7P1fmXzZwM; Tue, 29 Oct 2024 18:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInrBV018605; Tue, 29 Oct 2024 18:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInrCN018602; Tue, 29 Oct 2024 18:49:53 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:53 GMT Message-Id: <202410291849.49TInrCN018602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 798030a4e8d0 - releng/13.4 - bhyve: validate corb->wp to avoid infinite loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 798030a4e8d05da9f190531bff675a713c762372 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=798030a4e8d05da9f190531bff675a713c762372 commit 798030a4e8d05da9f190531bff675a713c762372 Author: Ed Maste AuthorDate: 2024-09-19 18:57:42 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:46:54 +0000 bhyve: validate corb->wp to avoid infinite loop Guests must set HDAC_CORBWP less than corb->size. Treat invalid values as an error rather than entering an infinite loop. Reported by: Synacktiv Reviewed by: markj Security: HYP-12 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46134 (cherry picked from commit a305f44d1404fbf386bb2b50ab7233ce9eabe0bb) (cherry picked from commit 6a645bb3535cb73b1f20db652c9e3893f26a986e) (cherry picked from commit 867aaad5c2bfdd8326fc805964e711ccfbb18d1e) --- usr.sbin/bhyve/pci_hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 7d824d7a1fd8..fd47abebaa42 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -787,6 +787,11 @@ hda_corb_run(struct hda_softc *sc) int err; corb->wp = hda_get_reg_by_offset(sc, HDAC_CORBWP); + if (corb->wp >= corb->size) { + DPRINTF("Invalid HDAC_CORBWP %u >= size %u", corb->wp, + corb->size); + return (-1); + } while (corb->rp != corb->wp && corb->run) { corb->rp++; From nobody Tue Oct 29 18:49:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7Q5Mcjz5bn9d; Tue, 29 Oct 2024 18:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7Q3ZXrz43tB; Tue, 29 Oct 2024 18:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uLl0he2ek8lyXqGcEZoEVgU9PLTekiTxjDylJ9Nl0zQ=; b=VIdlqWx9Ir85zjyDmtjiSNuH2zwIySH6UzdXKF+/QqU3Mnw3pzo33L+mosp8KMZ1p8dM5a ZwhZNkbsSQ/1IfLCZ/l4ZX344rvG4wi+gP1qMj0gd5MpJUnaNJPZNZqso2Inr/7FqEhdId ahWEx6Qvo70UyVxNC7Xz1s/T4F1aBpNPUYtzI/pgYG4Z2FsdSIyJmxEBRShaj0CIczDUBf fBBTOVoOevD4lgPC/JJ5X3JU173aZ0KjanAHy06ppmlh+CNG87v9MpVb9LIAoUbDpEXK5D IgNgtS0abliWtkHRsGEOC/In2BQ9UwNRwh1les6lHbV4Jr3fM/syAjTu7QUakw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uLl0he2ek8lyXqGcEZoEVgU9PLTekiTxjDylJ9Nl0zQ=; b=vGFQprh0DHNYF5v0NPbrI9Mqwyt3DfQ/42JOmdBLJwOTaJHTftoPd3gENEkyHT0lH0f9K6 Rh4Vf5o39ozFbmYfv1k4DR4UPEVWOFVV3kuN2R46US7TNR5hcZ3wAqGaJp7Fgffsx+dsAF /sf1DPQ7NJYfDjlz6v5K6Umkik5ui89DDgGlJuaHibyNWRQDf6LTY893u4+4mu8Y41EPNH rm7flTG04LW7t8yHp0G5vF51NBNskCTpJy34whmPBQsd23EfT0IDziy0GBo6rGFL7nJZFA RUGTfDogPmVkIsewLGgQz0P7w5dNWqhLiljqlGJsD7jQlyIpC2QBTIUnAcZxkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227794; a=rsa-sha256; cv=none; b=xKaxdea2bOF31jKM2olf/tsu4vrB2ir3MPCFcpkNUcJITnn60Le7Ybf1tfMHiBOafEyViN Nl8RwSa/bxgzAvQqj2MTiyWd0osBndxvYuDBOniOrbTByONWIGDnBSrNIs6UkFfpJZ8v4W HbFdspne07nwkwdRv0VnnGzxnZ1fdN43CT73cZ/U0QV+Urhzqyl9HWrV2J1ARAFewNgpAk CfYfY27L5MszOfDvTGKl9lW9UPypP5wE1dxgYIzYNgILjyOtMzww2xdhynS5n+qwBtWpAx QN5cNvb7aJmn+hKRDvWoroDJHJEV2ch2i5f/7u9pbHB2CCewlNg1+EkprfCWmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7Q2vZNzZwN; Tue, 29 Oct 2024 18:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInsN2018666; Tue, 29 Oct 2024 18:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInsBP018663; Tue, 29 Oct 2024 18:49:54 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:54 GMT Message-Id: <202410291849.49TInsBP018663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: cfcbeed4c7d5 - releng/13.4 - bhyve: improve bounds checks in hda_codec List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: cfcbeed4c7d533fba817b38cf29e51206ea956ff Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cfcbeed4c7d533fba817b38cf29e51206ea956ff commit cfcbeed4c7d533fba817b38cf29e51206ea956ff Author: Pierre Pronchery AuthorDate: 2024-07-24 14:56:54 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:49:15 +0000 bhyve: improve bounds checks in hda_codec The function hda_codec_command is vulnerable to buffer over-read, the payload value is extracted from the command and used as an array index without any validation. Fortunately, the payload value is capped at 255, so the information disclosure is limited and only a small part of .rodata of bhyve binary can be disclosed. The risk is low because the leaked information is not sensitive. An attacker may be able to validate the version of the bhyve binary using this information disclosure (layout of .rodata information, ex: jmp_tables) before executing an exploit. Reported by: Synacktiv Reviewed by: christos, emaste Security: HYP-13 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46098 (cherry picked from commit e94a1d6a7f2eb932850e1db418bf34d5c6991ce8) (cherry picked from commit 757bbf484c0bab2c4c7b504017079cceb833f7ae) (cherry picked from commit 6cb1995a66aec98261256bc4da3eedfe840e1ab9) --- usr.sbin/bhyve/hda_codec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/hda_codec.c b/usr.sbin/bhyve/hda_codec.c index 1866149c020a..b7d6ec043675 100644 --- a/usr.sbin/bhyve/hda_codec.c +++ b/usr.sbin/bhyve/hda_codec.c @@ -521,7 +521,6 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) payload = cmd_data & 0xffff; } - assert(cad == hci->cad); assert(hci); hops = hci->hops; @@ -530,7 +529,10 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) sc = (struct hda_codec_softc *)hci->priv; assert(sc); - assert(nid < sc->no_nodes); + if (cad != hci->cad || nid >= sc->no_nodes) { + DPRINTF("Invalid command data"); + return (-1); + } if (!hops->response) { DPRINTF("The controller ops does not implement \ @@ -540,7 +542,8 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) switch (verb) { case HDA_CMD_VERB_GET_PARAMETER: - res = sc->get_parameters[nid][payload]; + if (payload < HDA_CODEC_PARAMS_COUNT) + res = sc->get_parameters[nid][payload]; break; case HDA_CMD_VERB_GET_CONN_LIST_ENTRY: res = sc->conn_list[nid][0]; From nobody Tue Oct 29 18:49:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7R4zPlz5bnD1; Tue, 29 Oct 2024 18:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7R4JNZz446Q; Tue, 29 Oct 2024 18:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTO/0CbQKx+G1dfH+n0w0RyYed77mpjUuwkKpLAiWUY=; b=gCnDRF8KHEiSoazTaaXz2I/FwM+Wvhx+YSgVw2+OMxJ7N1LMU15p5+QEJUiyVsb6OcU2c0 OmBgY8jOKREfr1SVVOy+CnPR+sXlP4yNQHgFl+I0wYU9bknQPK3bmTfTTnDO82jEMadzlL fSYbSnBLuvJyrqdHwmNrgI8gfgs35qCG2XwIPKhcKv9bWlNxV/eFvkAAurkObjiHTrrGvP 0GAiXUh9JZfGdmwKkscbpGGmasdy1p2kWWloJIsNd1FgWSF62ef+8qt1xr0tUbaqu26rdg zKgQgEYMu30OOScA2Gy8KjkVsekYBXOBsf5dF1yKspQ94bQqOmv3jS/Pdd++SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mTO/0CbQKx+G1dfH+n0w0RyYed77mpjUuwkKpLAiWUY=; b=Z4wzR/PB/YZIfpLkgSlUmPfBdXczaKyV6RhwPp4gGfu0ypqQZZAT+www5hBDlcSyokiecI Y/GRIG+1E310nfTqF0Fmf55IjCXsA8401wY/V4lyQ8FMIF0AHUGX0Lk1HxCPDnB2SOLZhu AH5ztdpGi3C+Zag6MFDxdstV7p19SURSKmOU+Jo+GqKn6WKeE3ArcCISm0r4g1Y9TTr66X rFkQNM6QTMdhC1nolGQL39l/N4460ZcZvpHZPiStxUt4/xf20216mbb4YW8LQDMxZBnO4H GHfIWA2jR5OTvNLaWiKZqztFZK9SdqCStFXgCfQC81s3zI9GcCi31yHV/wlbCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227795; a=rsa-sha256; cv=none; b=FqjsUEf8GXklJHeeAyutXRQwaqc4cwvq7Id0Kj7SgpOLwhm2B8r3h5PyrP7jE06gKz4n8g La5JbQcEkZ4Ho4Dbdy/q5n1yjD9TvJw2lR9G6PgSP22DpH4FW3MNf4sv28YQbI0K6gbfKQ F3vzNsP/hZEykn/fQjbOaOjPKAeqKXc4aQA3DaivshjOvoicqI+iuqNz+F7wRl6bqARRBw gdYxqZGnwssdKpcxBxmHGTrKTQw71PxJf9rpYWdqTlZknr1fMfgTz61nIVJ78yS6o8JBok xI3Fw4S7npSn43Ol2xbXn3F9p7vVhUIp0iJJdlScBNaVdydf3FLnHw1Xbalk1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7R3ttyzb98; Tue, 29 Oct 2024 18:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInttG018716; Tue, 29 Oct 2024 18:49:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInttv018713; Tue, 29 Oct 2024 18:49:55 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:55 GMT Message-Id: <202410291849.49TInttv018713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5d07a7e902fa - releng/13.4 - bhyve/nvme: Fix Infinite loop in queue processing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 5d07a7e902fa225b9aee635b0073491d54bcc307 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5d07a7e902fa225b9aee635b0073491d54bcc307 commit 5d07a7e902fa225b9aee635b0073491d54bcc307 Author: Chuck Tuffli AuthorDate: 2024-10-13 13:58:48 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:49:18 +0000 bhyve/nvme: Fix Infinite loop in queue processing In the functions pci_nvme_handle_admin_cmd and pci_nvme_handle_io_cmd infinite loops are possible in the bhyve process if the sq->tail value is greater than sq->size. An attacker could overload the host CPU. Fix is to validate that doorbell values: - Are for a valid (i.e., created) queue - Are not the same as the previous value - Fit within the available capacity The emulation will generate an Asynchronous Event Notification (Invalid Doorbell or Invalid Doorbell Value) if enabled and ignore the doorbell update. While in the neighborhood, remove a redundant bounds check. Reported by: Synacktiv MFC after: 1 week Security: HYP-14 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46064 (cherry picked from commit 5374b9e146811757540e35553a7712c5b9b29239) (cherry picked from commit 86ba5941b132c73476a2a1b76ae53902a027b81c) (cherry picked from commit df1a36fdfae603ce298b8396ae3388d337c3c5b3) --- usr.sbin/bhyve/pci_nvme.c | 81 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index cbe4d87b6f60..536f34ddb3ee 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -267,6 +267,17 @@ struct pci_nvme_aer { uint16_t cid; /* Command ID of the submitted AER */ }; +/** Asynchronous Event Information - Error */ +typedef enum { + PCI_NVME_AEI_ERROR_INVALID_DB, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE, + PCI_NVME_AEI_ERROR_DIAG_FAILURE, + PCI_NVME_AEI_ERROR_PERSISTANT_ERR, + PCI_NVME_AEI_ERROR_TRANSIENT_ERR, + PCI_NVME_AEI_ERROR_FIRMWARE_LOAD_ERR, + PCI_NVME_AEI_ERROR_MAX, +} pci_nvme_async_event_info_error; + /** Asynchronous Event Information - Notice */ typedef enum { PCI_NVME_AEI_NOTICE_NS_ATTR_CHANGED = 0, @@ -2841,6 +2852,38 @@ complete: pthread_mutex_unlock(&sq->mtx); } +/* + * Check for invalid doorbell write values + * See NVM Express Base Specification, revision 2.0 + * "Asynchronous Event Information - Error Status" for details + */ +static bool +pci_nvme_sq_doorbell_valid(struct nvme_submission_queue *sq, uint64_t value) +{ + uint64_t capacity; + + /* + * Queue empty : head == tail + * Queue full : head is one more than tail accounting for wrap + * Therefore, can never have more than (size - 1) entries + */ + if (sq->head == sq->tail) + capacity = sq->size - 1; + else if (sq->head > sq->tail) + capacity = sq->size - (sq->head - sq->tail) - 1; + else + capacity = sq->tail - sq->head - 1; + + if ((value == sq->tail) || /* same as previous */ + (value > capacity)) { /* exceeds queue capacity */ + EPRINTLN("%s: SQ size=%u head=%u tail=%u capacity=%lu value=%lu", + __func__, sq->size, sq->head, sq->tail, capacity, value); + return false; + } + + return true; +} + static void pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, uint64_t idx, int is_sq, uint64_t value) @@ -2853,22 +2896,34 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_squeues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->submit_queues[idx].qbase == NULL) { + WPRINTF("%s write to SQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (!pci_nvme_sq_doorbell_valid(&sc->submit_queues[idx], value)) { + EPRINTLN("%s write to SQ %lu of %lu invalid", __func__, + idx, value); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE); return; } atomic_store_short(&sc->submit_queues[idx].tail, (uint16_t)value); - if (idx == 0) { + if (idx == 0) pci_nvme_handle_admin_cmd(sc, value); - } else { + else { /* submission queue; handle new entries in SQ */ - if (idx > sc->num_squeues) { - WPRINTF("%s SQ index %lu overflow from " - "guest (max %u)", - __func__, idx, sc->num_squeues); - return; - } pci_nvme_handle_io_cmd(sc, (uint16_t)idx); } } else { @@ -2876,6 +2931,16 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_cqueues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->compl_queues[idx].qbase == NULL) { + WPRINTF("%s write to CQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); return; } From nobody Tue Oct 29 18:49:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdK7T0s4Vz5bn7G; Tue, 29 Oct 2024 18:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdK7S57jvz43wy; Tue, 29 Oct 2024 18:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQK8BwbsjUqVFQckbhuA326j74Udm/L1nReCKnOTIvM=; b=wF5go3ZiKZwqQf79jdOjYWM/HDxFb8K3SpkuVADYctShYi+BAWsXHMgxsoUyVmp/lkD7ED M/UZXV+esNMRzNhmvcnHM3iGaBPmIjsQucy1mOBhWnRuTVPGa5JR3J+FUIA83/7QyKIDhv jlGUgnyhy1IBzVVV16etWznab8fVN0s3H5hvqXNUwuimEeGCGtfhCBiLXgrF1D3FiiE+Rk pBBjLySFJG5gsLzuavW9PVqEDRSTFlt/S62agie4JoP51F2CyIi3F6Qy4fxeo2J+KyQAk+ aQjpituvn8+zeBEsEfsy7RKt4yIwQw0dW2KINOLKTiCaR/fmdwhRtRXi3EwgGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730227796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQK8BwbsjUqVFQckbhuA326j74Udm/L1nReCKnOTIvM=; b=HvPxYSCA1kwmWY2JO3xHctthrAZRYQaWlJHdxPeWuAnUl2V2MUwyGp8EsZ44hEgJ/Ai+BX LkJvs6EE3/G3wlD0oht1bwJdWwrL0yisRWIA16JRr00SFhFAVw0QCaISYzaFziKQi8gLi+ rtnjSAJfsyQpl3H5FjTmRcUezkt1bPcEQaumbH8CRsqhp8hKZvZ4PaIn01QFlhtvkkK64j syr79kML571xzfoamyMsV6z+ybewm4XVOgGwF4BHuQLkeSeU1RaW6u/Jug90Ba2D0pzGD/ MVPb69NAdtRylY5ro8i7P6z40AA5b8QVx9txK5sbn8kudrUh62thczHi7VCMIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730227796; a=rsa-sha256; cv=none; b=I2ZTZAfiTfVAdspFLW3TX1hUVooobdh5NgjEpxt0aWQMAhdEtBmqCF2Iy5AyK5pk94hdL+ 9wNUwp8qieN+ielf98wqJ5GLGHmrpki4Q+VY8wHSJv39QFuKeMPEYd6Hz3pG/BDeHIhqiM NOdnSyaAeAL0SMGV1KPITJzJNUyA9DCqOT2kwsmyk1VFiNPaLTVTLwD4QkJRTHlSn6gIPJ o/7Klqd7HFQ6thoPrUwcJRYexg9w0LjhciCUKzDrEapn5+GFlclp1oi//xCyzQmovvdURd NYPTY7cyQkblRMRFM8DPutGsr3QRgZgN65uVQ3+YvEJ93/7MSsKHCTATpYsM+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdK7S4h9KzbZp; Tue, 29 Oct 2024 18:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TInuFZ018761; Tue, 29 Oct 2024 18:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TInu1A018758; Tue, 29 Oct 2024 18:49:56 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:49:56 GMT Message-Id: <202410291849.49TInu1A018758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e389eb99fb63 - releng/13.4 - ctl: limit memory allocation in pci_virtio_scsi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: e389eb99fb630627155879acab03373889848857 Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e389eb99fb630627155879acab03373889848857 commit e389eb99fb630627155879acab03373889848857 Author: Pierre Pronchery AuthorDate: 2024-07-19 17:32:27 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:49:18 +0000 ctl: limit memory allocation in pci_virtio_scsi The virtio_scsi device allows a VM guest to directly send SCSI commands (ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl (ctl.ko). All kernel commands accessible from the guest are defined by ctl_cmd_table. The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows the caller to call malloc() with an arbitrary size (uint32_t). This can be used by the guest to overload the kernel memory (DOS attack). Reported by: Synacktiv Reviewed by: asomers Security: HYP-08 Security: FreeBSD-SA-24:18.ctl Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46044 (cherry picked from commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47) (cherry picked from commit 2e7f4728fa738a7a7b6c4e4c46eb68952386efce) (cherry picked from commit 367d8c86a182813d88f728fdb2c3ef1a4679a852) --- sys/cam/ctl/ctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index b0f34cafac80..f94ab17c8ba0 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8319,6 +8319,18 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) param_len = scsi_4btoul(cdb->length); + /* validate the parameter length */ + if (param_len != 24) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 5, + /*bit_valid*/ 1, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; From nobody Tue Oct 29 18:53:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCh63Nzz5bmy2; Tue, 29 Oct 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCh57bVz45Y5; Tue, 29 Oct 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c77f5SYgELE48BASr7vE7XA8hC/of+7hlJ360/URj8s=; b=MfgLKIqJBOaHrIhAOTVMkxXnQ6/bHQltTpD/Oq+gZ3goV3toegbOPEJlGakRG2mIhZjk3u tUJvA0+dAA4Q/I5vjcqD8+1fBjsdtCN77+H36bZc0H9agZOXw8odaDFx+l0Fw7XqwNSrrq m+lcJxzpb4kQS5jq007pLno+yvDvaYKBtj3wf85FvMN+50JohPO1tfInH/Rwubj/8uxZ2D hr5QArkzecA3w9asi+GNeqn1ppvrm45RQ1nCgy8ScpSViB4i5BRmoMqgSQhKyCfl1DM+Mh 6vqvFCOHOvV5LZhHqvNzmvvPK5wxjzLiskA5NHEyTg+QjdAWzy2zLiFPnvBDZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c77f5SYgELE48BASr7vE7XA8hC/of+7hlJ360/URj8s=; b=T7BtEvvFIC0GWVGaQkAIDKv2U57xw4a7D/JlT2uFcXqvh32buarPQhYVGMkYkP+zFYPrMb YxuxwQ1R5JMzOHjka88nY+hMHt3Kod5Q/68mDKPgOcs3EP4RTD8s84cmeqmfZ/FGRuJZeR kjHUrZldN4vk974j/XWs+b3jOT57i4EMBxU1eTjHERe66tK4UZx3T9124622wkUuU1WwsS 8KwGV//OD/tmrxpH/7jtF36IOoErTaBkF2UKrkqte92R1KbKkdiJsmMnxRW8Qm/vt5j3Xn KLAMc9LLDeFaRiGFkJtoYZLMoHOQXVPgUJNFQsNKB8+SIPeO+FkWEddn2rhepA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228016; a=rsa-sha256; cv=none; b=ciRWCUx/lezVZyCz4EhxyBSs7z+xOANgm7oHp9/KGAu5S45t8HNpSdawGb+I1Dyoiezp2Z LXIz6FFJ3xNj8csDQBi9qzvl4sR0L0EBohHEabgyA0u8H7iERJMmWProVnPPqn9qxdNxXY jbhX066HL8MGGv1meG4nkeTA10geCu0ml0wApPqBkvOw91gghxQCPTxnvJDeF/jyV0n4mC 9nyQaGemMvogj59phhn/Hs/b2ueqTw2zpg2B25Ny/Wb1qdRMlGxbyQdkD/WlZVti24xdXS JZJGVlJZW2414Pi7nOOiipRmFDctXW23B0kJJ9togDQE8MHI8DuKfZ0SZQzXoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCh4kkYzbYg; Tue, 29 Oct 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIra7m035020; Tue, 29 Oct 2024 18:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIraJ5035017; Tue, 29 Oct 2024 18:53:36 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:36 GMT Message-Id: <202410291853.49TIraJ5035017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 50ca525bfe96 - releng/13.3 - bhyve/nvme: Fix out-of-bounds read in NVMe log page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 50ca525bfe9633c887029b8aaeafc605a5414831 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=50ca525bfe9633c887029b8aaeafc605a5414831 commit 50ca525bfe9633c887029b8aaeafc605a5414831 Author: Chuck Tuffli AuthorDate: 2024-09-19 15:11:30 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:52:43 +0000 bhyve/nvme: Fix out-of-bounds read in NVMe log page The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c is vulnerable to buffer over-read. The value logoff is user controlled but never checked against the value of logsize. Thus the difference: logsize - logoff can underflow. Due to the sc structure layout, an attacker can dump internals fields of sc and the content of next heap allocation. Reported by: Synacktiv Reviewed by: emaste, jhb Security: HYP-07 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46021 (cherry picked from commit b0a24be007d83f7929de5b3fc320a29e6868067d) (cherry picked from commit a5be19efbb7c6b07d574ef048b2ebade00440873) (cherry picked from commit c8f75686adc6bc2078ade279d838cbc5b1745e71) --- usr.sbin/bhyve/pci_nvme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 3db306a19119..cbe4d87b6f60 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1454,7 +1454,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, logsize *= sizeof(uint32_t); logoff = ((uint64_t)(command->cdw13) << 32) | command->cdw12; - DPRINTF("%s log page %u len %u", __func__, logpage, logsize); + DPRINTF("%s log page %u offset %lu len %u", __func__, logpage, logoff, logsize); switch (logpage) { case NVME_LOG_ERROR: @@ -1466,7 +1466,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->err_log + logoff, - MIN(logsize - logoff, sizeof(sc->err_log)), + MIN(logsize, sizeof(sc->err_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: @@ -1489,7 +1489,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log + logoff, - MIN(logsize - logoff, sizeof(sc->health_log)), + MIN(logsize, sizeof(sc->health_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: @@ -1501,7 +1501,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->fw_log + logoff, - MIN(logsize - logoff, sizeof(sc->fw_log)), + MIN(logsize, sizeof(sc->fw_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_CHANGED_NAMESPACE: @@ -1513,7 +1513,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->ns_log + logoff, - MIN(logsize - logoff, sizeof(sc->ns_log)), + MIN(logsize, sizeof(sc->ns_log) - logoff), NVME_COPY_TO_PRP); memset(&sc->ns_log, 0, sizeof(sc->ns_log)); break; From nobody Tue Oct 29 18:53:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCj71jpz5bnQQ; Tue, 29 Oct 2024 18:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCj6Rfkz45kx; Tue, 29 Oct 2024 18:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgdJtlik4ryKbn/oLyfAeQTv15O0nB3u6MKPxwX3ga0=; b=Gq/ytOA62Ai0QnilmyEXzJIn/5n90hCpOKBGO2mjjjPo+s5GQJEj/bbK+QKMb0xjKRWdpw cP9+rroTzNs1v35ABN3qqR06n7az5EyVRhL1sForuFUM1WzJc4HCSSzyHWJtx4pYdW6Xqw T7GAkw6I7FK5IXdG15aVddJMS6h2i1+k5RYWkv3ocTHa0z+zwivx3v+kCQ6QGXiTizFLiE T3UI4RhayqItxSdTthrlFqtDGGw4q4cmOwOkO7bdVIf1BcAIeJzO2TvAreBevvNY4jYksc AQHL6K8sP24ObnOgMpZeQUZsJ18taeTHLQM+zoArcy1OSL39/GSHcIGBnob/0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgdJtlik4ryKbn/oLyfAeQTv15O0nB3u6MKPxwX3ga0=; b=jg+zWKTBqlck40WPvUrj1dv1MveNnP9Z1P3kjgDC+xx9TLZhZZ+VcWxe1J5AETwVEao3R2 FGEmeSqjFo6dFxz/QXIl4ymyxCVjAGVUHSRpy7a+lt4SADUhO1LF3FN6ybJZZNSnOHEs2i WGjLg1U6ZSR1rgzAXWh6a2YZBWIjwzQPE5qSDaC9Ua7UPDVLJ8UzfUsGqgWI4JY8nNAk3o zHgMesPdPYwyh4zVOD6kU8urH8pFqV+Au4n06A/z2nfwQq/nWo4RzFZNzCUd/1752xAvFN OG0x1UfIEG99CWPviMrtw9MsmMZGD0r5+8lpyTplH9apYB+tTCN9cHygOHIDSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228017; a=rsa-sha256; cv=none; b=xG6ItCRe4nbXp4laiZ+i0vpQlJQEJzJXqaPtO2I4AyhuzAZSKHg20hTfZBLrlF0AmdsGbP N82gAryy8PHOOnZ2EbjhjOGbfJ3hvXBFfjtF0YkTxgB9vqpSoa759QdCKBYPk5RIXbP9VT 1dckqlOVdA/UeSlid2tE3P7jjH5egRvi8ZXSLYSfs93G9GpGuo47u+oZKkxcsJgGHxkfZN 09fSc2Z5WusYkhCkXU5WzlnFb+NATiM9SLZo7OcXzrEfAAepi79IwIetGuTPu2qS9gvE06 4IwTmCkQbhNqzm2ac1I+zfSkPlKE+JuC2MD6W/LTb1XzL26s6JmuNNjVT0QY2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCj62xCzbk9; Tue, 29 Oct 2024 18:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIrbws035068; Tue, 29 Oct 2024 18:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIrbjO035065; Tue, 29 Oct 2024 18:53:37 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:37 GMT Message-Id: <202410291853.49TIrbjO035065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 296083d6bdb3 - releng/13.3 - bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 296083d6bdb31c5a7720540f2c44644f87245590 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=296083d6bdb31c5a7720540f2c44644f87245590 commit 296083d6bdb31c5a7720540f2c44644f87245590 Author: Pierre Pronchery AuthorDate: 2024-08-27 13:57:32 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:52:46 +0000 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon() Avoid a race condition when accessing guest memory, by reading memory contents only once. This has also been applied to _vq_record() in sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion. Reported by: Synacktiv Reviewed by: markj Security: HYP-10 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45735 (cherry picked from commit 869d760cb9d7a307faa2fbe8c1c2b238a81b74d4) (cherry picked from commit ed03c309908687bdb9f71dc6d9c9c8a92c54fc20) (cherry picked from commit 6eb7879f426129aa38f4e8b0d57ab7456e4eb351) --- sys/dev/beri/virtio/virtio.c | 11 ++++++++--- usr.sbin/bhyve/virtio.c | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/dev/beri/virtio/virtio.c b/sys/dev/beri/virtio/virtio.c index c249d1c9d37b..7302bc39d799 100644 --- a/sys/dev/beri/virtio/virtio.c +++ b/sys/dev/beri/virtio/virtio.c @@ -107,12 +107,17 @@ paddr_unmap(void *phys, uint32_t size) static inline void _vq_record(uint32_t offs, int i, volatile struct vring_desc *vd, struct iovec *iov, int n_iov, uint16_t *flags) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_map(offs, be64toh(vd->addr), - be32toh(vd->len)); - iov[i].iov_len = be32toh(vd->len); + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_base = paddr_map(offs, be64toh(addr), + be32toh(len)); + iov[i].iov_len = be32toh(len); if (flags != NULL) flags[i] = be16toh(vd->flags); } diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c index 5294da670677..d11f5683e7b7 100644 --- a/usr.sbin/bhyve/virtio.c +++ b/usr.sbin/bhyve/virtio.c @@ -215,10 +215,15 @@ static inline void _vq_record(int i, struct vring_desc *vd, struct vmctx *ctx, struct iovec *iov, int n_iov, struct vi_req *reqp) { + uint32_t len; + uint64_t addr; + if (i >= n_iov) return; - iov[i].iov_base = paddr_guest2host(ctx, vd->addr, vd->len); - iov[i].iov_len = vd->len; + len = atomic_load_32(&vd->len); + addr = atomic_load_64(&vd->addr); + iov[i].iov_len = len; + iov[i].iov_base = paddr_guest2host(ctx, addr, len); if ((vd->flags & VRING_DESC_F_WRITE) == 0) reqp->readable++; else From nobody Tue Oct 29 18:53:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCl46zBz5bnQR; Tue, 29 Oct 2024 18:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCl049zz45Qc; Tue, 29 Oct 2024 18:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8lPiC7U1LqU+a1ETuqEH9930Pw0VgvxqkZ8zAYjEGE=; b=EGB7/PaodnenLs0CTc0w6D2TaGVYhpLxvynF7Q8FAcpk0PKhtW0TNXOuEEgT1Tqd/QljpZ h6Tc4TSl5sO7fyAM4mqaUAa9KUwOh0NOX4NQGMJjXDIrHuLvOtxezn90jLsCpMXk4Hcbsz naI/U1cNY+jolUPE4qa3oKiZv2WTryYOpJsjBse4uUYfcaf4MqQ61/SUcA1DujCCrkmpgX cnMCloPUXv+GdMrADBnXnf38S6qVx6kboSC1TJyg62TvgIgxBjfvaxy6I5sVlAV4xq5NJW wzhfkJws9vriOZtm3m5l4D9YpLPOfHRsfgmLcwiQOKfmzcVTDNX9G9eWOD7J4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8lPiC7U1LqU+a1ETuqEH9930Pw0VgvxqkZ8zAYjEGE=; b=Nq7CYxKyOi/4keoIkT7itjcUDLFmc4BLh997NEtgd4trfEaYAYXxFc535k6/Gk3sQ98I3G hWpUlUGCbz2Km7K9nS5vf05hpa6kWPxSPRSG7CJ8a68kQ1fqvCtkeqH66i9/hWZR5SczmY rU2Sr1BTLn4ZQ5xwJjaiARfv1mGApwnbk4+629yj7xd+tTWXs+9VQSMKQvdeETyGMlwbA2 TrKIDzL7ah+Brf6uwu0ukArGq1jRgnXqbCi0AKSYb0ZgA2nVacDZGgfThjnbeeF9SzaSxD GeJRZZmKMmPnKAtsSbovrqhNlFRU7ujmg/ikKBFMaEB5ehWbfli7qS3wFr/7SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228019; a=rsa-sha256; cv=none; b=paCOfGQDCwPhWceb/6DnGizcxZFXMwan/dTxo+xcQiJfITH9TEqpcJz9IyzcfTI7xRelLw 2QOdKk6rYCXkWLMdHmbDiiSYQHOV1h0wmdWrPndK7IsJJK5aehI3TEXYAh71lSYFlQJRRW tU+C3jSbHsoMlmdMSdMPNvW8F1XCtO8c//uiUac9i3MSXam3TVmXqlV8UQve6ScdM8jtOU 9wSvs/5KVK/+zSohE1X6RD7Bt5s7KKDfD0FdWXQkvlbQK5Ek27SDXNdjOfLUPfpryALqfO pjXsOIn3+FFV5yhM0p9Mj1CPvCY0VIJPbN53yVegmwYWxjQ0vUfj456vR2Yxvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCk6kcGzbYh; Tue, 29 Oct 2024 18:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIrcf2035128; Tue, 29 Oct 2024 18:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIrcQQ035125; Tue, 29 Oct 2024 18:53:38 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:38 GMT Message-Id: <202410291853.49TIrcQQ035125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 127f37c9b32d - releng/13.3 - bhyve: validate corb->wp to avoid infinite loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 127f37c9b32da806539ccab71347e2dfc30b50f2 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=127f37c9b32da806539ccab71347e2dfc30b50f2 commit 127f37c9b32da806539ccab71347e2dfc30b50f2 Author: Ed Maste AuthorDate: 2024-09-19 18:57:42 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:52:48 +0000 bhyve: validate corb->wp to avoid infinite loop Guests must set HDAC_CORBWP less than corb->size. Treat invalid values as an error rather than entering an infinite loop. Reported by: Synacktiv Reviewed by: markj Security: HYP-12 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46134 (cherry picked from commit a305f44d1404fbf386bb2b50ab7233ce9eabe0bb) (cherry picked from commit 6a645bb3535cb73b1f20db652c9e3893f26a986e) (cherry picked from commit 867aaad5c2bfdd8326fc805964e711ccfbb18d1e) --- usr.sbin/bhyve/pci_hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 7d824d7a1fd8..fd47abebaa42 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -787,6 +787,11 @@ hda_corb_run(struct hda_softc *sc) int err; corb->wp = hda_get_reg_by_offset(sc, HDAC_CORBWP); + if (corb->wp >= corb->size) { + DPRINTF("Invalid HDAC_CORBWP %u >= size %u", corb->wp, + corb->size); + return (-1); + } while (corb->rp != corb->wp && corb->run) { corb->rp++; From nobody Tue Oct 29 18:53:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCm2fp4z5bnQS; Tue, 29 Oct 2024 18:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCm0vvDz461q; Tue, 29 Oct 2024 18:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z8WjprbWyHn1IwvlS0LACmkqAqyxnjWW0mpbFsr/VnA=; b=kjAjqYi5dnDkX9jbuxMCYNp8iMWaYF5QFZyTqpDIg10paTm89rMrprw26DsxVOY/tVgWao IttuJAQA7xyHX9epO/oaWL/v0ySnXfamF7AZ1m2yKHESpcVF+30UyM6PKbY98lWRViSmtU Dep0fsvV+cZPpYozON6ynKcftJDdd2+lNKs03D2qybP/wo8RlALOxEzmSF3mvo29uS+bjn W819kBwyJe51qN6YTS1pn5xQHL90kpO88Orey24Mvx6LSdjs9xVy9jJx8rBvb0jfbuw5y6 zf2kWS9u5ytA71sExmS4mIDlzVxuQxmd5eTIJge37wPtovf+VT+XCaxzjPRmRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z8WjprbWyHn1IwvlS0LACmkqAqyxnjWW0mpbFsr/VnA=; b=H8oaBzjqlTFLOUloDbXAiH4OzSlxV3Tvhl3VVpEPk0Tk/xjVOD0TtneaXacy+Sj7siNrRB jq7P4rfwSASsFAvxC+Fv0PCFWKXa5/kKtsa72FHPpKUtN0pMOQZwziw/ig96KX0aeG1ZT3 MfS8nohPaZFawX0UmP+LsBgO85Pe0Hx8YyBKb9UyZ6LIIxDo21PZ3V/4uCkIE+RHFpGLmJ BUjjy47beQD5RwUjGoshSJ0kqE9TKYP1pCcu9BuZjYuMuNZHGwhBxwTlvN7u5MoQjPoRmb G1Yn8UlnmNS6Hq2uMxbQVV7IJFNMT0naWOWOKvROQ/IkLXqO/GQmMnup8hOZ5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228020; a=rsa-sha256; cv=none; b=QRIVjnpXsPlLjB89WKV8CYFR7s7Gg0rk84HJI9VevWnAqJ5urH7gXF/KK52zeAsrcY11Lh drOsds5/6W46lR6Rx9a/TUdE5uFZexEZqnQwsG7ruRRDRrk831mjc4pmDv7u5y3MthuA82 tA/1D24yl+HbL3engjjwMaA5+mQF3ye6o4ikcnVOd5kG7Smn+kcgFuHmJm2rp/ldeYizeL 5CbMx1+zI0/l1B+Dll9R8nvFW9JONNvSrpKd3lJ9vvHiShE8CvwjS+x1Jsk3Ero+cExKO6 yh8HkZtviyfLAx2a8MyFDA1IWf58sAXprD5sTEp22pACgv/RCYlAIGkbJ3zwHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCm0Fw4zbfh; Tue, 29 Oct 2024 18:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIrdAx035173; Tue, 29 Oct 2024 18:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIrdbo035170; Tue, 29 Oct 2024 18:53:39 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:39 GMT Message-Id: <202410291853.49TIrdbo035170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7d1d641efeda - releng/13.3 - bhyve: improve bounds checks in hda_codec List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 7d1d641efeda7914acb892787b3ae2afcdb78c4f Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7d1d641efeda7914acb892787b3ae2afcdb78c4f commit 7d1d641efeda7914acb892787b3ae2afcdb78c4f Author: Pierre Pronchery AuthorDate: 2024-07-24 14:56:54 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:52:51 +0000 bhyve: improve bounds checks in hda_codec The function hda_codec_command is vulnerable to buffer over-read, the payload value is extracted from the command and used as an array index without any validation. Fortunately, the payload value is capped at 255, so the information disclosure is limited and only a small part of .rodata of bhyve binary can be disclosed. The risk is low because the leaked information is not sensitive. An attacker may be able to validate the version of the bhyve binary using this information disclosure (layout of .rodata information, ex: jmp_tables) before executing an exploit. Reported by: Synacktiv Reviewed by: christos, emaste Security: HYP-13 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46098 (cherry picked from commit e94a1d6a7f2eb932850e1db418bf34d5c6991ce8) (cherry picked from commit 757bbf484c0bab2c4c7b504017079cceb833f7ae) (cherry picked from commit 6cb1995a66aec98261256bc4da3eedfe840e1ab9) --- usr.sbin/bhyve/hda_codec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/hda_codec.c b/usr.sbin/bhyve/hda_codec.c index 1866149c020a..b7d6ec043675 100644 --- a/usr.sbin/bhyve/hda_codec.c +++ b/usr.sbin/bhyve/hda_codec.c @@ -521,7 +521,6 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) payload = cmd_data & 0xffff; } - assert(cad == hci->cad); assert(hci); hops = hci->hops; @@ -530,7 +529,10 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) sc = (struct hda_codec_softc *)hci->priv; assert(sc); - assert(nid < sc->no_nodes); + if (cad != hci->cad || nid >= sc->no_nodes) { + DPRINTF("Invalid command data"); + return (-1); + } if (!hops->response) { DPRINTF("The controller ops does not implement \ @@ -540,7 +542,8 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t cmd_data) switch (verb) { case HDA_CMD_VERB_GET_PARAMETER: - res = sc->get_parameters[nid][payload]; + if (payload < HDA_CODEC_PARAMS_COUNT) + res = sc->get_parameters[nid][payload]; break; case HDA_CMD_VERB_GET_CONN_LIST_ENTRY: res = sc->conn_list[nid][0]; From nobody Tue Oct 29 18:53:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCn3M5Dz5bn5k; Tue, 29 Oct 2024 18:53: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCn1YX8z45r0; Tue, 29 Oct 2024 18:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jLOk3Mi9AroQdpQatCgk37zL3XX/bAhSw8Fedgy2wWw=; b=C+5nAv6+UVrLoEHGDBByecUrx8FLn4YigdFhVnnVXpblXVyUiz8SkTFnGXDiZ9STIMBefg vgCuSeBltS1H5ma4o64MsBWdDjTsJhtMNzg55CsM/6zBERl7YkgvLHNxJaWBX+rjjbSS81 YSHglg+mcIaGZXulO9kybl1vt5rWXcJ/PF0rmYAFvnigSLhyBsV0i0SGvp1QflYr7ZXMUJ KeRpS0Q7v3Z+qXcrMxPd0U9UVQKsC2jzj+gaURp6+50NEX8gYoo7SM8DJQVtaQRIgLUAwW 3LA74jA+PJAJYs3cuta6w/e7Ru8MCkfknpjdG+33IS6AqlXwBoJz7NJvuYeWgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jLOk3Mi9AroQdpQatCgk37zL3XX/bAhSw8Fedgy2wWw=; b=i9EsV3+7DB/Eu6coo1L6fHGLBPZs9IsZ8n9NpbGXRk69+rhHDnHIDLeadHhw62rmYrH/hG 0AxoC6nR4NK5Q2QXgrrbg9YtqjU+7jiiX4MnClD7pl0LitUeE2VbF3gWGDP7mqINEOY70Q nNKabQ9oAHh2OI5bAQ2XybPCGe4g1ES6URNOlFSbRusDik/82v8hKy8TDL1oODWzR19Sy/ 1apaxbXXvmc9Pcq1vA4+k975nSQvi4+0SA041mKyTMj+iLqqoaI1cspxGc5vjuO8Kdylhs lFUjhRvHTBRVhRI8SWIck0SN5IpMiWPDBztBkHmGpABd/IaINCcdU+cCT8WbuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228021; a=rsa-sha256; cv=none; b=a/7liDirbJ9hXt0qcPbFwqtH7Djp/IFftLXtvCx+B9lpXcnx8FGw1QDLSJXbZJl94ifN4x xVYVfBk49xosXV2w+mfDd9T08ZA1XL3z+LzeuYl2GpJnR9CmHcj7ThLqScAlo8e8fKxnGh 5shq9oMmgoi6w6hzW6cBq+uMTmOjEZPQdwiepk4l/n0E+hXtumiXbGXJrFOlLX8k5wuiY/ x7Lb/mSr0d1Gvrht5cjcG/g6Fb45ApKUTKrUiIo+B9B4l2bD0LytP8n1Zc3g7yrLAfDPpZ ZqGPRTUxNICRYs+X65/KZGVwQnuN3iO7drtgQHGit5xLEBKogx71qO9ecwEolQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCn0xXPzbfj; Tue, 29 Oct 2024 18:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIrf1i035221; Tue, 29 Oct 2024 18:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIrfwO035218; Tue, 29 Oct 2024 18:53:41 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:41 GMT Message-Id: <202410291853.49TIrfwO035218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: adb7b541aea1 - releng/13.3 - bhyve/nvme: Fix Infinite loop in queue processing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: adb7b541aea13de4a53096966354b1c14a196bba Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=adb7b541aea13de4a53096966354b1c14a196bba commit adb7b541aea13de4a53096966354b1c14a196bba Author: Chuck Tuffli AuthorDate: 2024-10-13 13:58:48 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:52:54 +0000 bhyve/nvme: Fix Infinite loop in queue processing In the functions pci_nvme_handle_admin_cmd and pci_nvme_handle_io_cmd infinite loops are possible in the bhyve process if the sq->tail value is greater than sq->size. An attacker could overload the host CPU. Fix is to validate that doorbell values: - Are for a valid (i.e., created) queue - Are not the same as the previous value - Fit within the available capacity The emulation will generate an Asynchronous Event Notification (Invalid Doorbell or Invalid Doorbell Value) if enabled and ignore the doorbell update. While in the neighborhood, remove a redundant bounds check. Reported by: Synacktiv MFC after: 1 week Security: HYP-14 Security: FreeBSD-SA-24:17.bhyve Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46064 (cherry picked from commit 5374b9e146811757540e35553a7712c5b9b29239) (cherry picked from commit 86ba5941b132c73476a2a1b76ae53902a027b81c) (cherry picked from commit df1a36fdfae603ce298b8396ae3388d337c3c5b3) --- usr.sbin/bhyve/pci_nvme.c | 81 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index cbe4d87b6f60..536f34ddb3ee 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -267,6 +267,17 @@ struct pci_nvme_aer { uint16_t cid; /* Command ID of the submitted AER */ }; +/** Asynchronous Event Information - Error */ +typedef enum { + PCI_NVME_AEI_ERROR_INVALID_DB, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE, + PCI_NVME_AEI_ERROR_DIAG_FAILURE, + PCI_NVME_AEI_ERROR_PERSISTANT_ERR, + PCI_NVME_AEI_ERROR_TRANSIENT_ERR, + PCI_NVME_AEI_ERROR_FIRMWARE_LOAD_ERR, + PCI_NVME_AEI_ERROR_MAX, +} pci_nvme_async_event_info_error; + /** Asynchronous Event Information - Notice */ typedef enum { PCI_NVME_AEI_NOTICE_NS_ATTR_CHANGED = 0, @@ -2841,6 +2852,38 @@ complete: pthread_mutex_unlock(&sq->mtx); } +/* + * Check for invalid doorbell write values + * See NVM Express Base Specification, revision 2.0 + * "Asynchronous Event Information - Error Status" for details + */ +static bool +pci_nvme_sq_doorbell_valid(struct nvme_submission_queue *sq, uint64_t value) +{ + uint64_t capacity; + + /* + * Queue empty : head == tail + * Queue full : head is one more than tail accounting for wrap + * Therefore, can never have more than (size - 1) entries + */ + if (sq->head == sq->tail) + capacity = sq->size - 1; + else if (sq->head > sq->tail) + capacity = sq->size - (sq->head - sq->tail) - 1; + else + capacity = sq->tail - sq->head - 1; + + if ((value == sq->tail) || /* same as previous */ + (value > capacity)) { /* exceeds queue capacity */ + EPRINTLN("%s: SQ size=%u head=%u tail=%u capacity=%lu value=%lu", + __func__, sq->size, sq->head, sq->tail, capacity, value); + return false; + } + + return true; +} + static void pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, uint64_t idx, int is_sq, uint64_t value) @@ -2853,22 +2896,34 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_squeues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->submit_queues[idx].qbase == NULL) { + WPRINTF("%s write to SQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (!pci_nvme_sq_doorbell_valid(&sc->submit_queues[idx], value)) { + EPRINTLN("%s write to SQ %lu of %lu invalid", __func__, + idx, value); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB_VALUE); return; } atomic_store_short(&sc->submit_queues[idx].tail, (uint16_t)value); - if (idx == 0) { + if (idx == 0) pci_nvme_handle_admin_cmd(sc, value); - } else { + else { /* submission queue; handle new entries in SQ */ - if (idx > sc->num_squeues) { - WPRINTF("%s SQ index %lu overflow from " - "guest (max %u)", - __func__, idx, sc->num_squeues); - return; - } pci_nvme_handle_io_cmd(sc, (uint16_t)idx); } } else { @@ -2876,6 +2931,16 @@ pci_nvme_handle_doorbell(struct pci_nvme_softc* sc, WPRINTF("%s queue index %lu overflow from " "guest (max %u)", __func__, idx, sc->num_cqueues); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); + return; + } + + if (sc->compl_queues[idx].qbase == NULL) { + WPRINTF("%s write to CQ %lu before created", __func__, + idx); + pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_ERROR, + PCI_NVME_AEI_ERROR_INVALID_DB); return; } From nobody Tue Oct 29 18:53:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKCp3yP4z5bn5l; Tue, 29 Oct 2024 18:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKCp2xnKz45x5; Tue, 29 Oct 2024 18:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMuaIl3FSUl2gen8JLNe/kCHuxNBlqrgOJgx3MLLvbs=; b=K6cI4c6q7EfzWaTXrDzxcY36abzEkz4vVp9J5wnonmF/RJd3OpdLjI33lp4wirGawXTbcJ oP23TCm0T37BcifIewCK4DCOfY+9hWw9D8g//kU3v6w75LKPKrCJvepxkpXuEYCUBckjln 4iiUM1T2uI1LFiSt5TTsIpUqbtFuSfIaKOpVNeatBOCNygc0JBcskLOVccZa5T6OxpPRdq D9HHRHccoy5StTgJXA3x1Ft1N4izJ7vZxlBKnt9hsgtfeqAhto+0dnjW6FUa6zUeTxT8Zn oa5IHKt1AaDgdzQ/Bo4TjjbIQR2smL5lew8zQkl2SCRR0YG8o54l8soCQyFVRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMuaIl3FSUl2gen8JLNe/kCHuxNBlqrgOJgx3MLLvbs=; b=ey5DvZpganueF2aq+5+VZMOFNcN/lIkLEOS3b+lnPV6kM4KclPFiML7Ahu/kYV411eIP26 88qt7UadxLIUIFW+gTTaXQL7IFVmQMrmnZZfoCVKiUZ02EwbUQAI6kBf/y8f7fLGUlqoE0 e1TuTbuY0R6CVhrVTcuBqNfHDH1p4Fa5gMOGvGjN/hJqKX9lFrX0KPvHqgIuPIxPFRjFm9 JPKWPDBhz3B01AD5hUTH2G0Ow3sZ5/lgz1GYiHCcQ0iljixjY46BiFZKbs0poSZFRfkfqL GbP7EJvrjlBs4Xitmb3XtWH9mFQkAlEZd6D+UPWR3BEKQWy8L6FN0VmoyK49XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228022; a=rsa-sha256; cv=none; b=anFlE4hny/CaPJ3wi4f47lHM7jmIgkEv48fHsWMLTX7lXUJWKsWXdVKymnSpMOr4d7cjq9 kr8BcYziPeWc3M+pnES6p2FNZtotDIsIU2xFZ8yjl8f06BnC6GrmS6tC89o2CyDj2XV6nu XYi2zEoE0ze2/2uLinZ47GKdpWW45ILDQEKnx5VTcPZEwcAQQuXZFs5MPtw6NsttNYzetv QhSa4zbAn/K4/4PW0nZOgs9s3RoLsoYH90tD5L0Z+g91MCpQE0WYYRgl1IloHqGtEOvoaz d1/S5O1C5b78LbUJOTc9VjbRstTzt/M/SrA/T0C238tCs69bNwocnAhICj8grA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKCp2HdqzbYj; Tue, 29 Oct 2024 18:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIrgCb035274; Tue, 29 Oct 2024 18:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIrgCZ035271; Tue, 29 Oct 2024 18:53:42 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:53:42 GMT Message-Id: <202410291853.49TIrgCZ035271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9867aebc1d04 - releng/13.3 - ctl: limit memory allocation in pci_virtio_scsi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 9867aebc1d042c93635134199b5d5feed2354fe9 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9867aebc1d042c93635134199b5d5feed2354fe9 commit 9867aebc1d042c93635134199b5d5feed2354fe9 Author: Pierre Pronchery AuthorDate: 2024-07-19 17:32:27 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:53:00 +0000 ctl: limit memory allocation in pci_virtio_scsi The virtio_scsi device allows a VM guest to directly send SCSI commands (ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl (ctl.ko). All kernel commands accessible from the guest are defined by ctl_cmd_table. The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows the caller to call malloc() with an arbitrary size (uint32_t). This can be used by the guest to overload the kernel memory (DOS attack). Reported by: Synacktiv Reviewed by: asomers Security: HYP-08 Security: FreeBSD-SA-24:18.ctl Approved by: so Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46044 (cherry picked from commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47) (cherry picked from commit 2e7f4728fa738a7a7b6c4e4c46eb68952386efce) (cherry picked from commit 367d8c86a182813d88f728fdb2c3ef1a4679a852) --- sys/cam/ctl/ctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index b0f34cafac80..f94ab17c8ba0 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8319,6 +8319,18 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) param_len = scsi_4btoul(cdb->length); + /* validate the parameter length */ + if (param_len != 24) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 5, + /*bit_valid*/ 1, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; From nobody Tue Oct 29 18:57:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKHd13wfz5bn8c; Tue, 29 Oct 2024 18:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKHc6H5Gz47HK; Tue, 29 Oct 2024 18:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtmYg/1JVda0g2/2PSESqYxVWvf+ExsARpeY33cI06s=; b=xRofNt1gv1fqz0aGFFWH+WW8top2dGV25fGA/Yn0q5MggnyYVpN8AH6epvc9jdmw7FDRdH TEMelMey1ZwaOB5vVxSum0qKMGLAPMpqOXWc82AV7yW0ubhJ9pztj31ToP1N/0rdWu5Am2 AS25e/ks9tQlBwqZkj0nQs+Y5mcaaRIdj19b7w3udMXpuZooocyzBjAPyyQwg0L2oJhTAd ZuT3iGyrL4MLlTVMxUnt8SYISG6keEQKDtm8WWe3fFa+MVo/3kAxsb61gcyArNpMKLVRVA vNbsEV6+HH/NcnfA+gzsGe/bd1VAdNWMBtNEUd6LEVhJ9ymHyU+I244oTCU6Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtmYg/1JVda0g2/2PSESqYxVWvf+ExsARpeY33cI06s=; b=kGhdGLGr1YBjxoKABZNq2GLEbqeQZ0dPP29vpoOKEP1846Hs8a1jUAB1pu/MoKXt/+arYi H4yPQYnJjNPULC1K3PVb9tCgKPA7tkJ68DzvWXPO5tF7/fRUAbFwUqpKScSmoMrgoadfrn c73odnR3yOMGaMqTOzKtEAdMNyu1zjgVpCFm2BGYWs8qq9oO53h7Rv8eRZhliCAUru3cAk gIMhrlp0ahv0SFJxSxOKq67vO6E+6F0cegJsyUggsfvVOcwPD5PXmUPFMskVgPXtburmB8 bWWfTagfVkMeaTOepC2KMv+isNGrIzOOo10n7bIzWEIFcHdaj1l8Fq/7o9862w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228220; a=rsa-sha256; cv=none; b=U17x7BEBE7x1dwshqfezz1QC0I6mD8zVmwDujuqPGaUArVATnecwdMBrPZsJOd5TXVbUrv cK3rABDx9djeby385iU7aVVBz6BTQztzUTk/SzlmCiWUXuQ96wdrs5Cld/x2UJ/8pEe9Oe mPNbDVef7iBkY1OYsclQr6dQ2DFbvmcxbmSI2pMhNhD61wH+zJwMlcQIA0MAwI2Y2Q1kRO D5e0/gntGIKZ5cu7TdIcICMcCgE8nyJ3Xq4w9WxxIJEgL/dlKH8xHUneZXBOI78M68WSOB 1lq3Lag0dfQi4ls492Q3gNqKMVabej6DNkfZbsSESnidDrHIf8/bVNAhK8tjjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKHc5twLzbh8; Tue, 29 Oct 2024 18:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIv0uA036521; Tue, 29 Oct 2024 18:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIv0JU036518; Tue, 29 Oct 2024 18:57:00 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:57:00 GMT Message-Id: <202410291857.49TIv0JU036518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0e8bf366e6c5 - releng/14.1 - fetch: correct env var name for --crl option to work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0e8bf366e6c545fc8cf430687e94f7465bd23355 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0e8bf366e6c545fc8cf430687e94f7465bd23355 commit 0e8bf366e6c545fc8cf430687e94f7465bd23355 Author: Franco Fichtner AuthorDate: 2024-10-07 09:36:19 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:54:17 +0000 fetch: correct env var name for --crl option to work Reviewed by: grembo MFC after: 3 days Security: FreeBSD-SA-24:19.fetch Approved by: so Differential Revision: https://reviews.freebsd.org/D46973 (cherry picked from commit 1d7a33888e09f86feb4c2c9f9640d936be07ce9d) (cherry picked from commit 51676e0a3bd38ab6deae27f72fb6fb6dd648825f) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 8be5742386e7..6cf6a31eed2e 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1059,7 +1059,7 @@ main(int argc, char *argv[]) setenv("SSL_CLIENT_KEY_FILE", optarg, 1); break; case OPTION_SSL_CRL_FILE: - setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + setenv("SSL_CRL_FILE", optarg, 1); break; case OPTION_SSL_NO_SSL3: setenv("SSL_NO_SSL3", "", 1); From nobody Tue Oct 29 18:57:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKHf19S6z5bn8g; Tue, 29 Oct 2024 18:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKHd6xWyz47Q3; Tue, 29 Oct 2024 18:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EIJI00Kf6VCMeffTWJNB86c2LeXWG6snXuajcVa2HuY=; b=GhS7dHMi7zX7cmt38ks6WJfOvuVbvoZFshxzdPw9zuxqBhzbkiignqC0neo6jXquvku8to HnyFbRA1jSmLQx7EmuGlhGZqY8Co0YXvMyuMBaUMHHDYUdYZRcXFlpNRSN+wGSBDy3khCr xcjwgRBe9W7ACw3qHP2ZNGC3eb+1tH2LtF+JEn8akJ4AxVFo6EDTuxYE3WBR6SCqr6OLFX KX23p2uPAJZXUg4mGeKPzZQDcO7f6IiFemfoaX3GhlDEyNgtB69sPCqdfQ1uPQQ51znelI liFH+/yy9em42pMF88SRTH4wTGzC1S1FBCUzeTg2bqJGz1Qc3MLLpqp6HSTRiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EIJI00Kf6VCMeffTWJNB86c2LeXWG6snXuajcVa2HuY=; b=Gi+eK7CFIUdt5GTArObQFLXQCjdl4YygJxfP8kiWQZ7RTINnn1kO8nMY7ea9nvZk84OhmQ 8OSR8r5vb34YeTLg1IdkQy3Zy6rNoM24xC0vEDSXg6M8PUdkJVkzrbmgp5x6cw2s2KlcTC FYWVEA+YaJhA5GLJumnFBC6LagdPecFTiBpiU7Yg6Np36cYqPywT+OzY79Rzo9+wl8aom0 VvR4hMkaX5HYA7zOjd74gXnZKlEXqMW54NiG6R6+GwUyIGIi/tlb+JcQTuOvD8JQRteCAh fxKn3bzQgVsiItFLHVjOH2+i7kB2ah9t7nrirzQgytGpzgORSOFJ3ed5AKVFIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228222; a=rsa-sha256; cv=none; b=Umu/qZ70tER8T6YXoKLkTXhnLVQxMe84+BnrisX3h1vCuWcBaWlkWMN2lW7vyL00kVF0gL xxBEHK13WvIv7P3SZmLYFm7EkRgD9gtinPLAreJ0vnBVFk+q99V1BP55hzPTaUxJ0b4PAi DQ0a7ft6kId5upno0YlBXZah/FRKx5Hxav0kcyANf2valmjc1zlR3z5lMFePkAxZ0Y+H6h 0XdQXWGOte+c42Yhz+ECe4kXBBZMAww9aO2VkYpv50oc5yiCGqSYoVlFVWFMJIcaeH+/FU fG0CWOfXRLhN4txDxcqApIx9ERYaQBv77cCkI7imvAnYIn35nyGtw0nvXZ19MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKHd6Xz9zbh9; Tue, 29 Oct 2024 18:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIv1si036572; Tue, 29 Oct 2024 18:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIv16v036569; Tue, 29 Oct 2024 18:57:01 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:57:01 GMT Message-Id: <202410291857.49TIv16v036569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: accf8cee6dd0 - releng/14.1 - pam_xdg: Fix user xdg runtime directory's descriptor leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: accf8cee6dd09bc2d0a02cf45ec4386ec42970bf Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=accf8cee6dd09bc2d0a02cf45ec4386ec42970bf commit accf8cee6dd09bc2d0a02cf45ec4386ec42970bf Author: Olivier Certner AuthorDate: 2024-08-13 21:04:09 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:56:03 +0000 pam_xdg: Fix user xdg runtime directory's descriptor leak Approved by: emaste (mentor) Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") MFC after: 3 days Security: FreeBSD-EN-17.pam_xdg Approved by: so Sponsored by: The FreeBSD Foundation (cherry picked from commit 06986e899972ac3a127ab2ab46196672d0e1e5b2) (cherry picked from commit 9e8d504bb5a1e7ede55814069e213d4702172b81) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 4d586a21566a..1ad7c56dddb5 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -108,6 +108,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, goto out; } } else { + close(rt_dir); /* Check that the already create dir is correctly owned */ rv = fstatat(rt_dir_prefix, user, &sb, 0); if (rv == -1) { From nobody Tue Oct 29 18:57:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKHs5k33z5bnZL; Tue, 29 Oct 2024 18:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKHs5DV7z47vD; Tue, 29 Oct 2024 18:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gLMVZjvZ88s8neJuDKlO63JVvJN3JFhEjRQ6K2POXgI=; b=sN3VhvKM6OXHsTrQyDrHh1m2RY56wGe1z0IGojUdQ/0KgPdOghLKeXx5z2xP+WcSWJQUMS q0x5ZurwNaL/IuCiwxdZINI0NStqmCIOVwHN7mue2Ek3MDv8Hhx8sUwvhvcZ1iChDgEu4g zheInT4QMeNByiXiucxwjLfiW9Tcx8J6W0PEVfidMqyYeiFpQfGNKHamNO93/wH9IBd3Ke EK/3eJMqGS86L2qVy2BGkIGcZx7Pk3vtqMvkPfOq3CQibIwTai5uyk0yfn4J88tGy2IcoZ saaHAun8BQASGSt0A4z4EtU0A9QZlEa0LNyEs8LIZ5fWNDWRFvIkXXXUwoyojw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gLMVZjvZ88s8neJuDKlO63JVvJN3JFhEjRQ6K2POXgI=; b=Xm3/Gpnh0UuoDmrI0gVPjIYmngRei5FP9387m10eFfRidm2jzMHQshmIr0EE/DqNRpFogq fjOPQ+YtvXkzBpcZ+UAZ3XqGieYS/1kMPKWueOQ1Reph5cwROES5Nl4hZkKtsfPVku3sgX TOSl3EJDw19B9RfhM6JYzbM8oh63cKmAExnOIzfNCdHcHuStmFoqJFTkhfxHl1z/UjBePF rXlA/hpPtFKXIqxzuqQsejDsJKqL+tIYd7/GKZaGkxx8u9yNsYQx4f0ukPImaXWmP1nwo9 g6GA/9rgNaiXzk5Syz4wYMzLSLNrTkmV246aKHX2AS35t1E6xKYssakiD/WpvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228233; a=rsa-sha256; cv=none; b=YaGSyO28KMf2ou96aeO3Q/h7ldSTEv8oJ09yonb8f4EP59pjf7kBRQIQlcCHQzza2AAxMG X3oUbpt9PcXPTsGVyFDLV7VFZ+eKqOkJI6EAa6fOW8VbrB1byVSOewmMwIhnLnH0MUCptB T6U19vlQ8KQoDJhmOk1WZwCCVR5ckrpTCqHMOdUy0/OlMyfozf4xTlb1UQE3GmNzAZeS+E fv9H4GUS4Aguvj7M/DccfAwcu1lAq78r37+Z6TEW9S9f3+HcMtRMFSYgIi5eWtAY98o5Nz nvSbPDpk7vyu7mXw83Tbp1IAkH3x+ECyVoyyG7N7AqhA2dN5t6bNfVyjTAvwcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKHs4rkYzbYl; Tue, 29 Oct 2024 18:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIvD6l036814; Tue, 29 Oct 2024 18:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIvDER036811; Tue, 29 Oct 2024 18:57:13 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:57:13 GMT Message-Id: <202410291857.49TIvDER036811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 51f6c450d991 - releng/13.4 - fetch: correct env var name for --crl option to work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 51f6c450d9917eab224bce7303f3ce25bb97474c Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=51f6c450d9917eab224bce7303f3ce25bb97474c commit 51f6c450d9917eab224bce7303f3ce25bb97474c Author: Franco Fichtner AuthorDate: 2024-10-07 09:36:19 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:55:15 +0000 fetch: correct env var name for --crl option to work Reviewed by: grembo MFC after: 3 days Security: FreeBSD-SA-24:19.fetch Approved by: so Differential Revision: https://reviews.freebsd.org/D46973 (cherry picked from commit 1d7a33888e09f86feb4c2c9f9640d936be07ce9d) (cherry picked from commit 48472457842226eb3445fd70dd995954020f0cb8) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 8be5742386e7..6cf6a31eed2e 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1059,7 +1059,7 @@ main(int argc, char *argv[]) setenv("SSL_CLIENT_KEY_FILE", optarg, 1); break; case OPTION_SSL_CRL_FILE: - setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + setenv("SSL_CRL_FILE", optarg, 1); break; case OPTION_SSL_NO_SSL3: setenv("SSL_NO_SSL3", "", 1); From nobody Tue Oct 29 18:57:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKJB72QVz5bnBc; Tue, 29 Oct 2024 18:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKJB6Y0pz47yF; Tue, 29 Oct 2024 18:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+8CI3/YgvIdnUXt5dDt7ImuN6ApYr3BbW8/TVu107IY=; b=BuWLrl73CcdMe/0KqUinxqEJo+800WDSATqyuRCu0Y0X4s0kbhgH3U81V/A7vA6mECZKO5 vwXzAljO9MPGjp9qHpH8y9MKR/NRWReOmbUzAiDLguE2PDjB/4rXCCE71/5R5/Kw8QLslC cGa8aqqtom6I052KjHYZ0emgs+M3ckjMHhCgSqi0IZ0YhOuCHmqbvsW7uTJIAznXAgKKdQ VWU34wcSHh4O3Tu0RLgcI1k9TA2kMoRgZ+kwrX7qbULDwoXJA9Frnl1UJAWfc8+6H03tCG hXRYdCnCeFKMirI8F+ljuhgNbWNnjLpZhuKxr8UkmmfbeumKLdYEMK70HpRPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+8CI3/YgvIdnUXt5dDt7ImuN6ApYr3BbW8/TVu107IY=; b=ZxIHX8WQiLuTsf/nwjN44Wn0vniZSZh6zDvR4GTd53Sazhv/c4R3JU5qxrPI1YMVA5ORgu loAfG91LYPPhi/wZRhGw5VHsOp2mZcFS2ZX08wVb9F27RrEHgqA44Jw5FSAcwa4Kh3QUUv w+/Nn2O0eH1PNHAG5+/URYeCfHRliDvUurD0e75WV5ZuGsn26nzXEylHIbKJgJCd1Smvjh 3uTmGtiq7eHsoyK9+zTku6BG2aA1NfvPFdlDsn0NjGcUiMzwegKq1JW2VKWaJaZSBe2q5e GUCp4Pii2SvQMG+Gxnflq3sG6ATDeHMyLY7LCe1JUmKtc0rL0dVVyEwAJqBb3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228250; a=rsa-sha256; cv=none; b=LBziG8vmMBY+umok/ilZpX1odLFU4tFnfWUDlKhQFj65kd8LM2aXIiCdSEN2JpNVhPDoIb fAPGODbHvq5FLfe46Xb0DyaQ0u0cGJOoI30ruKIpV1A2NpMNf593M1r5RT4NRwhKzOFOUK 6MfdL3KLxaMl+Slxn0z/EC20einlvCjtB8tq+wxu/Q1AmJdLv5ypBpsFr5WNGs1uEW0JJK Fj3qvAaUjGyxkavKFdPteJyfh0MWzFRwfb0FuieLks9IKIS0RT6oYceWZ0TvxE8ThOTxwU 8wmuwfibxrDSBhRmlbGbVvsBJvcUv/2YSYDOYdTB72AV5hAH6eZ05WX0yNn3aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKJB69LSzbYm; Tue, 29 Oct 2024 18:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIvUjg037033; Tue, 29 Oct 2024 18:57:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIvUok037030; Tue, 29 Oct 2024 18:57:30 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:57:30 GMT Message-Id: <202410291857.49TIvUok037030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9f1314a30b4a - releng/13.3 - fetch: correct env var name for --crl option to work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 9f1314a30b4a6f5bcc2c149b8555fce539cc0f11 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9f1314a30b4a6f5bcc2c149b8555fce539cc0f11 commit 9f1314a30b4a6f5bcc2c149b8555fce539cc0f11 Author: Franco Fichtner AuthorDate: 2024-10-07 09:36:19 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:54:58 +0000 fetch: correct env var name for --crl option to work Reviewed by: grembo MFC after: 3 days Security: FreeBSD-SA-24:19.fetch Approved by: so Differential Revision: https://reviews.freebsd.org/D46973 (cherry picked from commit 1d7a33888e09f86feb4c2c9f9640d936be07ce9d) (cherry picked from commit 48472457842226eb3445fd70dd995954020f0cb8) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 8be5742386e7..6cf6a31eed2e 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1059,7 +1059,7 @@ main(int argc, char *argv[]) setenv("SSL_CLIENT_KEY_FILE", optarg, 1); break; case OPTION_SSL_CRL_FILE: - setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + setenv("SSL_CRL_FILE", optarg, 1); break; case OPTION_SSL_NO_SSL3: setenv("SSL_NO_SSL3", "", 1); From nobody Tue Oct 29 19:07:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKWx29kZz5bpH5; Tue, 29 Oct 2024 19:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKWx1K1Dz4CWK; Tue, 29 Oct 2024 19:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r2NjSC7JT5KrgkSIQSZLEVEt6iXNDI48Tnw9lawhvBY=; b=tBj2iwfWYooA67lFkfRYl6MAF5SLEXL+e7nQx/66Lks0X53+6q2sl5Ra50gxQjpGj+lUvH E/KxWe9Pmsp5YESAgqKCMKwF0YfFA5VRur/kyIHljH13jFA/3uUxLroC/tp8fJED0O1Ve3 aP25nrJFsfTebPQk8Y2ps5EQM+uH51AC4IKjKLSpKRrtLTY4COADMP9H1/Hy0Gs/nGeMwx 5ymHIdMRaNpZILt5Gtte2yqB47QLNMzK4hF4mMkqWa2bxCErhJJpZpRV4XB3mCJcBrd521 XHkCzluN66Sz3mLQNZQJXyXkp0D/mNpzjutWL3vvpwVELtl62kIxSoffLNHpKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r2NjSC7JT5KrgkSIQSZLEVEt6iXNDI48Tnw9lawhvBY=; b=tDxQXatZRocksa7FBK4x9x0lVjsTBCHX5u10GFsnCkvyMuAwn7ki0rmd9lFFemVmyw5A37 e472fXQQy3J83SR/PrHRCvfMBoEIPjwqgYf9j7UHkzZDB2lQR3CP+toOaAbO2AhjLwz1Q+ T+/j9a5XUfgv4CjpO8ML/myPH6c4BnOhR9zUzDIgTbXMXAN1bTUMClx5Nu8zWfzVExxp8G gEh5hMW5inZc2TbLRImVwkPgYE4uQcK7NR/iseKSebSSzzTMB0A/h9JVUWMHKXmOjFcj/H 2vIZ0VeaFbUTQdEv44hPdqGKOBwiijebEbGsY4emk/chmdFLpd+GrodNxtqBSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228861; a=rsa-sha256; cv=none; b=grtSGt+yWInjbSOVXLU6Z91MIUWMx3TWIE6GjjnyZIwc+ucKvzqsFAbAJRZFRiwLBD6v/l fa6gza8qQGmNiMubBuYh71b3G7PhmV6oyRYzAzoJTN6xfApfxWwJib0KB/92aiI2EFR7Ie 4vKRA6mxvi2Wq+DMSRDQVWgkxcXTHsIzqOhe0dw+PdfSYB8yfgWGjh3D9Oi6PlhMYqYGf/ JobLesaHzMY3yiD4sfEjRlzfR89Kzh762lRZi49QQFOwXF05tDH3ah6TxYtnkjyah1S30J mNxxwPViT6llDlH1nDMKblU7fDzkKvKe0suDTkk9mt35rzwzcvCIdmzLRa2yPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKWx0wGrzc5y; Tue, 29 Oct 2024 19:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJ7f7i056323; Tue, 29 Oct 2024 19:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJ7fY1056320; Tue, 29 Oct 2024 19:07:41 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:07:41 GMT Message-Id: <202410291907.49TJ7fY1056320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 74b6c983723c - releng/14.1 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 74b6c983723cf3d3e277f10780ad081e32c80e80 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=74b6c983723cf3d3e277f10780ad081e32c80e80 commit 74b6c983723cf3d3e277f10780ad081e32c80e80 Author: Ed Maste AuthorDate: 2024-10-29 19:04:42 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:04:42 +0000 Add UPDATING entries and bump revision EN-24:17.pam_xdg SA-24:17.bhyve SA-24:18.ctl SA-24:19.fetch Approved by: so --- UPDATING | 14 ++++++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index c77a09fdf81b..7db8d96d692e 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,20 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20241029: + 14.1-RELEASE-p6 EN-24:17.pam_xdg + SA-24:17.bhyve + SA-24:18.ctl + SA-24.19.fetch + + XDG runtime directory's file descriptor leak at login [EN-24:17.pam_xdg] + + Multiple issues in the bhyve hypervisor [SA-24:17.bhyve] + + Unbounded allocation in ctl(4) CAM Target Layer [SA-24:18.ctl] + + Certificate revocation list fetch(1) option fails [SA-24:19.fetch] + 20240919: 14.1-RELEASE-p5 EN-24:16.pf SA-24:15.bhyve diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index f611c7d0229d..c8fcd643c0b9 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Oct 29 19:07:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKX73CzVz5bpBG; Tue, 29 Oct 2024 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKX72kSMz4Cwp; Tue, 29 Oct 2024 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLcGUMPryb5pj/5RJgIEnV9rByagh7DIkHlSqVmzVVU=; b=sxZABW5cmLhHOYAqTijXmn5ggCT3Zs/B0EkVHZJSp96jqYznxgv8XhTB9bJ+Uhp0gqkUar HC7Ilh/gECIf0ry941oe/ILLgTVkQnC6o43ZHBiXPlLZbQc7tLdzenvajIH4q/6XPuRfke Z/FZjfJaSsfZ76EMQBXlPSlGDCecPXRUnP14L+qblcwa8sGrboo8dIeIzattzwyBQ5SMf3 NnFkuEsZuc9Be7YM0DRZEK0Re+0hdP+HLytwBzs7Vz3y5nHshmxwvc2dz4kUBQxyU9eN4H HstX0o4o5WhVzwXhiFMJet8OyxW9n0mnqh9fJNQdwZDoYsZZWkk83IbJRd7BBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLcGUMPryb5pj/5RJgIEnV9rByagh7DIkHlSqVmzVVU=; b=XSw73zDSXHteQm27wMgYL1VqOXDt9otzjnUIDv16emJK0VZN3PQIzh7iUw/67pPyed/dvR TmPeU37Htlsp9oo9uHSUCg76ss6Dhsnd0MQ5FzKDSkJiSdtfhBEOQAsxKSmOhcjODQCy++ qpgtr9OrmYO++2TriIkBnixhDd0kNYALYEEO+BgnZKPr+3BFux9Pxf6+aw8OCmmu+oCG3T fR39BaR9msN6XBgGQu8289l4pZfX6Pyo/nC7uiQz/OxjD4sthZzf2EUMfcfyRSiWaIyOFa BHih8sJq0HkHDmWAk5eI43gstZHmfRUpTT1FlQYo4gp7CfYBq7XL63Ugyx35AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228871; a=rsa-sha256; cv=none; b=bN6jZliaNV+lfo4k+G6bXEDv5t8VXNJt/l4z+4Gp2FCk6IDjcvlqseraWMrGGIOR2dlgrr SqBAlA9JfYf62ViO56zfHc/Y9dtOoXsrKSsgM5TsivONA2eO7lXfEanipoyJ9r6FOQGqPC uz32Tpg6OzdPCncY917TYLGNxR6euKj5riWpr2KCw7HEWkzycybEeYWgcJVMUuzI9J/OYH TV+zh26WdRVe3kTOp41bKvVU3ZKTcA+gvqE531pY8qan2T2fQKHiCUBEIx/ZJXi1I3nqm1 dI2sQ7gXvtNr0eQs30Q/NVKm7Sha8PMxrc0Bz+dZqiazs8Lg3MPi7dQLURKHKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKX72HR8zc60; Tue, 29 Oct 2024 19:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJ7pFg056501; Tue, 29 Oct 2024 19:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJ7pXY056498; Tue, 29 Oct 2024 19:07:51 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:07:51 GMT Message-Id: <202410291907.49TJ7pXY056498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3f40d5821eca - releng/13.4 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.4 X-Git-Reftype: branch X-Git-Commit: 3f40d5821ecad3fefb79700d01ce387adc29663e Auto-Submitted: auto-generated The branch releng/13.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3f40d5821ecad3fefb79700d01ce387adc29663e commit 3f40d5821ecad3fefb79700d01ce387adc29663e Author: Ed Maste AuthorDate: 2024-10-29 19:06:08 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:06:08 +0000 Add UPDATING entries and bump revision SA-24:17.bhyve SA-24:18.ctl SA-24:19.fetch Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index df70c7ce5904..2951c149d61e 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,17 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20241029: + 13.4-RELEASE-p2 SA-24:17.bhyve + SA-24:18.ctl + SA-24.19.fetch + + Multiple issues in the bhyve hypervisor [SA-24:17.bhyve] + + Unbounded allocation in ctl(4) CAM Target Layer [SA-24:18.ctl] + + Certificate revocation list fetch(1) option fails [SA-24:19.fetch] + 20240919: 13.4-RELEASE-p1 SA-24:15.bhyve SA-24:16.libnv diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 5d096d99c9aa..a59fe0f17d4b 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Oct 29 19:08:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKXk4n83z5bpBH; Tue, 29 Oct 2024 19: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKXk3sfhz4DFS; Tue, 29 Oct 2024 19: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=1730228902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D2H/x5Im83leQhuTJxREbAjiE0hcQV/xxR/Nk96tpi0=; b=TNLJVxDgcpsq8nLaDiSZ78lNxzMkAsQBmgicVVlnjESf3VuJXK/pVLymaL9s1Kkiy7q7HZ aEYaAmjMwJW211JUCip/UX8t8Eyye6/O/Q2RozyTPs+h8CwgL4AiHd5MFKQWqiqsMUxkAT OJfB3dpp0aabdj9K8QT2BPhnGw2f8s6WHe4cDEvq3zQ4t88ku91Gh+JassUPhKL6X3GKP1 Vb22YfiSfEu1pYrBZO24I5AGZUEGw59x9oGcfCvvD3rustNlaWMaBciChvyKRFcI+ac44P kWN4FKxWRm01Kk26ekwOW6fjQ+rIW9kqjZLm0ygvP1EYgZEWXVnLNVmR1QGnEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D2H/x5Im83leQhuTJxREbAjiE0hcQV/xxR/Nk96tpi0=; b=BYxZdIlZP/nkq9ZcPx2WtuwiIubA3zCOgr9EgBVoxv8951hzzp/6tY+Ep0I1V7Q3qVSzZh PZTDXWYypiWfOGu2HHJ76HHQtkqZ+nffqA9h2pw+lNjBmSOOa2gFlOdgqiKoh2OfoCeaf6 PNdXJjuxr/VpJN9TeOCtiZhHyz0xfaqTpHUzXt1qR6dn8fUP5084wHkQPbVrSwICWaDyDu NBC9dEyMtI/2GUFjSGSMsMiD+XQ9GlxvENR0kiDyJpQspYty9bY725QDhY94AlrxtWiWC8 M0z0A9CrmoBGzWocQsrOIYyWHWX8jmB28XSrVBLbadMMPCIcnjVENoQYKC8PFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228902; a=rsa-sha256; cv=none; b=nwHxKEsinUC0S6n3MQq2L0KFbvBIg1AwH1w+s7fxudoO06GB9+zj6KELWiJniKM7WdZ2Zm KXC2bZLjK1Mtr9XWHd8eRYWiNpTQorcH/V4HqMtApd2AdcmAs5Id1ugY3BI8DicDWegmGP tOkBld7luCaA3KZi09/d1Qz4VH6USEXDg6So1M4kDYpN9USaFMX7RpAB29s1+qe6FZHTAo 8+IIxft27kFZVZ7KLtlDSBlQTKmlIHDPerwVj6rNK6WmQdcV5hBRXClz2gJizBqxqFogRR Mx/U+fvmo2KI2/eZSm8bgyu/ob23SiGyXFP5etZ8kZqzRM8DNwNc9C3vXKG+Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKXk31qkzc7H; Tue, 29 Oct 2024 19:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJ8MoK056817; Tue, 29 Oct 2024 19:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJ8M6v056814; Tue, 29 Oct 2024 19:08:22 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:08:22 GMT Message-Id: <202410291908.49TJ8M6v056814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 72aa3d55e9ff - releng/13.3 - Add UPDATING entries and bump revision List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 72aa3d55e9ff8634edf8a28162470969133ea7ca Auto-Submitted: auto-generated The branch releng/13.3 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=72aa3d55e9ff8634edf8a28162470969133ea7ca commit 72aa3d55e9ff8634edf8a28162470969133ea7ca Author: Ed Maste AuthorDate: 2024-10-29 19:07:08 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:07:08 +0000 Add UPDATING entries and bump revision SA-24:17.bhyve SA-24:18.ctl SA-24:19.fetch Approved by: so --- UPDATING | 11 +++++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 56a2afbd487a..12b35e5409a4 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,17 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20241029: + 13.3-RELEASE-p8 SA-24:17.bhyve + SA-24:18.ctl + SA-24.19.fetch + + Multiple issues in the bhyve hypervisor [SA-24:17.bhyve] + + Unbounded allocation in ctl(4) CAM Target Layer [SA-24:18.ctl] + + Certificate revocation list fetch(1) option fails [SA-24:19.fetch] + 20240919: 13.3-RELEASE-p7 EN-24:16.pf SA-24:15.bhyve diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 6985018b0afe..7ebd439805fa 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Oct 29 19:11:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKcs4xBqz5bpF1; Tue, 29 Oct 2024 19:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKcs4VSLz4DXg; Tue, 29 Oct 2024 19:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730229117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5gFyGF+F3aHsiBwgZf+JjF0Uo3QQ0oRBzDD0O60Mi6s=; b=CkdDwrA6HXGoTfjeOtcH7WnCppavw653zQKa1bVqcy1884c3CbFHeiK+B5MrVTzy0LygwR yCuyVsyYRzt2KU9xlnJm/4J5UAbV4nNv7in/U1DkYit9lWanZKM/bTT5juJzE0OS55gimi WeTDcBSpVpwqwNCPHGv4OdLyCRmVSXRzZ6x7eX7Plxs1r/WPxFiN7LAy7Vf1rloMGaNi4v I6WL6x9zJ1f6totPV0cdbh7+65mjxgOIocL52qxT8USQg0xnQuKui5DylHmuWFFhpLzGBl skMavSI09wag7FxIKT0oqTIS8Gdy/Lri6yGweymPO7UCGOevA2RSIlJclzMBeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730229117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5gFyGF+F3aHsiBwgZf+JjF0Uo3QQ0oRBzDD0O60Mi6s=; b=wEREoSaOsOrnp1VSwAP80DTree6CRLrvUL7mQONcLcqxrtss3JVzYTz1wjzASXcpV14q88 R94B98M9Hze1xJx7kcShw9rZT6pnS0GpxUlXifIPXf0im5nHRQfA/n21eAGUBW+XlBZSnB 1F9ul9KLybW1ojlm1I8/8xAUlXokJSeMuEi0zChFWjkgzBkGwNLO+HGtf+PsiqqqrmvrGj k8Y1rqOe1/Tg4gLv1K7SYonforE4tqgYwdiRGifDMnfDRuO0wSqfyEu/QSo5VrWdT/yV0+ slgynVIv1+cTXOVJduLlYL0o9pJ6u0QNs7Fw1OMLqAxeFc/0UjqJXk4gQm6BdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730229117; a=rsa-sha256; cv=none; b=mC8EoMyHxzK2ZjLcgGQIPnHbjg0l7lO/6NXVzQq33LxGLTAWeR0xOdaePLfL3Hj/au9mN/ SMc/nozIMvdWLCHaNONks7ow5r642lLLgq7w9+mQ/RtL32Nxy8LI1zqd1EopVxAoLW4H5V 2hGg0ocYOtHs2SAZ8//YGgbep3yLgn0t2MmvcqiXSvYFjqTViCIkOtRyAwaQmG84f3Up7v 51dv8HM5fAwznHw+IhcxpzLN9QUz9sGPvVS/iEpOxMd5yx/C2Kz7XHbfx86Ox2UCoQVlmU qUDqgAf7+2Zqouce+xVFaBJXE4/hlXwgUxDKfRKIW0OJMcV5MFmF58mCK2Ryrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKcs45K5zbls; Tue, 29 Oct 2024 19:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJBvg2070983; Tue, 29 Oct 2024 19:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJBvam070968; Tue, 29 Oct 2024 19:11:57 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:11:57 GMT Message-Id: <202410291911.49TJBvam070968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 4fbd6e0e3ca8 - stable/14 - libc: fix access mode tests in fmemopen(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4fbd6e0e3ca8e69d2d3789ecda6e4dd76c34e06a Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4fbd6e0e3ca8e69d2d3789ecda6e4dd76c34e06a commit 4fbd6e0e3ca8e69d2d3789ecda6e4dd76c34e06a Author: Ed Maste AuthorDate: 2024-10-23 13:41:51 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:11:38 +0000 libc: fix access mode tests in fmemopen(3) Previously a stream opened as read-only could be written to. Add a test case for the fix. Also correct another incorrect access mode check that worked by accident, and improve the tests for that. PR: 281953 Reported by: Erkki Moorits, fuz Reviewed by: fuz, khng (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47265 (cherry picked from commit 0953460ce149e6f384aafbcb1e6213dfbf8f6a16) (cherry picked from commit 6b9f7133aba44189d9625c352bc2c2a59baf18ef) --- lib/libc/stdio/fmemopen.c | 10 +++++----- lib/libc/tests/stdio/fmemopen2_test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lib/libc/stdio/fmemopen.c b/lib/libc/stdio/fmemopen.c index 2f835a34951b..dc323921d93a 100644 --- a/lib/libc/stdio/fmemopen.c +++ b/lib/libc/stdio/fmemopen.c @@ -74,10 +74,9 @@ fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) } /* - * There's no point in requiring an automatically allocated buffer - * in write-only mode. + * An automatically allocated buffer is only allowed in read-write mode. */ - if (!(flags & O_RDWR) && buf == NULL) { + if ((flags & O_ACCMODE) != O_RDWR && buf == NULL) { errno = EINVAL; return (NULL); } @@ -136,9 +135,10 @@ fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) break; } + /* Disable read in O_WRONLY mode, and write in O_RDONLY mode. */ f = funopen(ck, - flags & O_WRONLY ? NULL : fmemopen_read, - flags & O_RDONLY ? NULL : fmemopen_write, + (flags & O_ACCMODE) == O_WRONLY ? NULL : fmemopen_read, + (flags & O_ACCMODE) == O_RDONLY ? NULL : fmemopen_write, fmemopen_seek, fmemopen_close); if (f == NULL) { diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c index 2e1b9ea917a5..a558ff3515e9 100644 --- a/lib/libc/tests/stdio/fmemopen2_test.c +++ b/lib/libc/tests/stdio/fmemopen2_test.c @@ -132,9 +132,11 @@ ATF_TC_BODY(test_autoalloc, tc) /* Open a FILE * using a wrong mode */ fp = fmemopen(NULL, 512, "r"); ATF_REQUIRE(fp == NULL); + ATF_REQUIRE(errno == EINVAL); fp = fmemopen(NULL, 512, "w"); ATF_REQUIRE(fp == NULL); + ATF_REQUIRE(errno == EINVAL); } ATF_TC_WITHOUT_HEAD(test_data_length); @@ -271,6 +273,36 @@ ATF_TC_BODY(test_size_0, tc) ATF_REQUIRE(errno == EINVAL); } +/* + * PR281953 - ensure we cannot write in read-only only mode, and cannot read in + * write-only mode. + */ +ATF_TC_WITHOUT_HEAD(test_rdonly_wronly); +ATF_TC_BODY(test_rdonly_wronly, tc) +{ + FILE *fp; + char buf[16]; + char buf_orig[16] = "input data"; + char buf_write[16] = "write"; + size_t sz; + + memcpy(buf, buf_orig, sizeof(buf)); + fp = fmemopen(buf, sizeof(buf), "r"); + ATF_REQUIRE(fp != NULL); + sz = fwrite(buf_write, 1, strlen(buf_write), fp); + ATF_REQUIRE(sz == 0); + ATF_REQUIRE(errno == EBADF); + ATF_REQUIRE(memcmp(buf, buf_orig, sizeof(buf)) == 0); + fclose(fp); + + fp = fmemopen(buf_orig, sizeof(buf), "w"); + ATF_REQUIRE(fp != NULL); + sz = fread(buf, sizeof(buf), 1, fp); + ATF_REQUIRE(sz == 0); + ATF_REQUIRE(errno == EBADF); + fclose(fp); +} + ATF_TP_ADD_TCS(tp) { @@ -280,6 +312,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, test_binary); ATF_TP_ADD_TC(tp, test_append_binary_pos); ATF_TP_ADD_TC(tp, test_size_0); + ATF_TP_ADD_TC(tp, test_rdonly_wronly); return (atf_no_error()); } From nobody Tue Oct 29 19:13:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKf54VSZz5bpKm; Tue, 29 Oct 2024 19:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKf52cPbz4F75; Tue, 29 Oct 2024 19:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730229181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbEFEpHLR3mpzdGFfIoBhIP/EdISrooUG+zSPIeH9JY=; b=YbQLX4X5VR6fE4DctKECF9yYR2tughnf66wR8TKzaeBm/3//ebdtJknF/6zCv1muyTq8Cf 9ebFrF5UISRVFWaGCDIHqtGZPNbMdr+4fdCyB3KywWmwC67xfHwbGC1pLWDU9Kkv68oiCF J7lVFsiNzPII1yjQ6ItGkp49YRe3Gtr0wourLOul/RI5jcu5cU4ENPNh9lU4tDfLlxEBWn ESQCZRcDTuudxwRxbseFE/mViuJ8MUIZ8599vgWUFL+81S879Mq1xPcd74OWj1SIcetZo4 wsQRyXC4wc/BdjkF3FlYzpDEmOxHmaxRnI/Sql2RP/alZIvjer+6OWYJg7zWDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730229181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbEFEpHLR3mpzdGFfIoBhIP/EdISrooUG+zSPIeH9JY=; b=HA7KTU7LsO/1J5vsN8Q4yexHClVjltpZFkrrDT7tb8UOn2fXS+n+j0/L3XJ9fMlTK4MynQ B0GPk8kvn3mFs0Nj1e7h0Mq11Uv1vz15ZAa46ldjRoKQoPVu2eF3AVlKlGCz8G+Aa4o7DK qs/semw8fyf82uoyCl4n9n5LPGuFw+ye5LzCN2VOhZ6XFvOYwO+uuoH+Tltn5P+vY5tJhn dLwR0I1I6E9TzGZKniYCsPq651ikZKHLxh5sfqqJhkoALOeKOyTfL1+x2gZ8/6HXHFYhog UKuGh1UrF/yWUbk6QJQGlyF2vxh5qpISQ+9ZFwOwLo1trh2anQiQFLqZPMpRhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730229181; a=rsa-sha256; cv=none; b=SvmQ26cTnNLMN11XOd8zip9J2kudM5mAofxOALTVr9LFPezrH2QUdGZA78EjWjvNiWJRrB fRaLitszoKnqpXokcRiiDDxFreZDrs5hZjqRy/iDtgni/HHhYL5TGx3fBnnboB37dwkACg 3K8cg37cClynL49ViE6HDZd0F+TGbdFNqGPbCHLIVhYAIiHnx2PwN0uw4Jzm+Z1zHfcswa +JBjJS8XUWKPoB1YftkXMhudvo1HSms2zfr5UF7c03/wy1rg+VT5vDj0U8Bq59HeaMHPPh RnJ/hsUOoVqWRU/G/INW+4hVhFdu5wyKokJ5V9XPiin+jgOyICps0+mEXsJk+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKf52DRGzc6Q; Tue, 29 Oct 2024 19:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJD1CR074450; Tue, 29 Oct 2024 19:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJD1Dv074447; Tue, 29 Oct 2024 19:13:01 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:13:01 GMT Message-Id: <202410291913.49TJD1Dv074447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2b9e6e090a13 - stable/13 - libc: fix access mode tests in fmemopen(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b9e6e090a13ecba890fc4ad318a46ed23e25bad Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2b9e6e090a13ecba890fc4ad318a46ed23e25bad commit 2b9e6e090a13ecba890fc4ad318a46ed23e25bad Author: Ed Maste AuthorDate: 2024-10-23 13:41:51 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:12:17 +0000 libc: fix access mode tests in fmemopen(3) Previously a stream opened as read-only could be written to. Add a test case for the fix. Also correct another incorrect access mode check that worked by accident, and improve the tests for that. PR: 281953 Reported by: Erkki Moorits, fuz Reviewed by: fuz, khng (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47265 (cherry picked from commit 0953460ce149e6f384aafbcb1e6213dfbf8f6a16) (cherry picked from commit 6b9f7133aba44189d9625c352bc2c2a59baf18ef) (cherry picked from commit 4fbd6e0e3ca8e69d2d3789ecda6e4dd76c34e06a) --- lib/libc/stdio/fmemopen.c | 10 +++++----- lib/libc/tests/stdio/fmemopen2_test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lib/libc/stdio/fmemopen.c b/lib/libc/stdio/fmemopen.c index 295592ac896f..d6f83722bb6f 100644 --- a/lib/libc/stdio/fmemopen.c +++ b/lib/libc/stdio/fmemopen.c @@ -75,10 +75,9 @@ fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) } /* - * There's no point in requiring an automatically allocated buffer - * in write-only mode. + * An automatically allocated buffer is only allowed in read-write mode. */ - if (!(flags & O_RDWR) && buf == NULL) { + if ((flags & O_ACCMODE) != O_RDWR && buf == NULL) { errno = EINVAL; return (NULL); } @@ -137,9 +136,10 @@ fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) break; } + /* Disable read in O_WRONLY mode, and write in O_RDONLY mode. */ f = funopen(ck, - flags & O_WRONLY ? NULL : fmemopen_read, - flags & O_RDONLY ? NULL : fmemopen_write, + (flags & O_ACCMODE) == O_WRONLY ? NULL : fmemopen_read, + (flags & O_ACCMODE) == O_RDONLY ? NULL : fmemopen_write, fmemopen_seek, fmemopen_close); if (f == NULL) { diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c index d68150d19594..2839ee04bb52 100644 --- a/lib/libc/tests/stdio/fmemopen2_test.c +++ b/lib/libc/tests/stdio/fmemopen2_test.c @@ -133,9 +133,11 @@ ATF_TC_BODY(test_autoalloc, tc) /* Open a FILE * using a wrong mode */ fp = fmemopen(NULL, 512, "r"); ATF_REQUIRE(fp == NULL); + ATF_REQUIRE(errno == EINVAL); fp = fmemopen(NULL, 512, "w"); ATF_REQUIRE(fp == NULL); + ATF_REQUIRE(errno == EINVAL); } ATF_TC_WITHOUT_HEAD(test_data_length); @@ -272,6 +274,36 @@ ATF_TC_BODY(test_size_0, tc) ATF_REQUIRE(errno == EINVAL); } +/* + * PR281953 - ensure we cannot write in read-only only mode, and cannot read in + * write-only mode. + */ +ATF_TC_WITHOUT_HEAD(test_rdonly_wronly); +ATF_TC_BODY(test_rdonly_wronly, tc) +{ + FILE *fp; + char buf[16]; + char buf_orig[16] = "input data"; + char buf_write[16] = "write"; + size_t sz; + + memcpy(buf, buf_orig, sizeof(buf)); + fp = fmemopen(buf, sizeof(buf), "r"); + ATF_REQUIRE(fp != NULL); + sz = fwrite(buf_write, 1, strlen(buf_write), fp); + ATF_REQUIRE(sz == 0); + ATF_REQUIRE(errno == EBADF); + ATF_REQUIRE(memcmp(buf, buf_orig, sizeof(buf)) == 0); + fclose(fp); + + fp = fmemopen(buf_orig, sizeof(buf), "w"); + ATF_REQUIRE(fp != NULL); + sz = fread(buf, sizeof(buf), 1, fp); + ATF_REQUIRE(sz == 0); + ATF_REQUIRE(errno == EBADF); + fclose(fp); +} + ATF_TP_ADD_TCS(tp) { @@ -281,6 +313,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, test_binary); ATF_TP_ADD_TC(tp, test_append_binary_pos); ATF_TP_ADD_TC(tp, test_size_0); + ATF_TP_ADD_TC(tp, test_rdonly_wronly); return (atf_no_error()); } From nobody Tue Oct 29 19:27:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKyR31p8z5bqGf; Tue, 29 Oct 2024 19:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKyR2TyPz4GQG; Tue, 29 Oct 2024 19:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/yVGW5qDigU5aEY5BmYSZDQDkoM3HBGpHq1wJq9TCWw=; b=u744xMe5DaVooLdmqK9ZV3KLz2Fj/44tsu/eAhtPFOep9xqpZhzIbWh4l7snFowuFS3E69 pHWh8ibVrEY+DvwUhTP6bPbK/V85tr1fc7hFS0WfG2fkVeI3jb1+4KvmVFDNnlxVNz9eci Ct4rwOeHhcLhj/Qpx3HlHuGI3Y08d0gcOl1EOJykrRHiQLO4V6aFKceZO+rP98zBwZR2rP 266dQD7n2uIV25VoYSf3F4JqkF2OgFh2iq7pSlx7r6BeHPIrJQc3DpjHx0t5rpoS9Pb5wn ALVEM4TDl4an4woiLpE6qiB45QivscQIP0m5AsyPz/PsK+vS9X9gjkNO9pjgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/yVGW5qDigU5aEY5BmYSZDQDkoM3HBGpHq1wJq9TCWw=; b=DlfVQPvN9AiSvbsp1u0+0IZoE+F6eVtlFrM4vQ3zsBCZnhey5dTzNUnrUI4KLNUJ85HvwG REuc+YILBFA/TBz9j/SAQEMpoF9R4mYLk2cZIT/IqFeSHh5XLl6tac5TQoNQdCuRCI1Nq9 pSHBcj2zyTv7HxyfxH2QGQJ5hqLGFLNuyjU5eilz63A1gqTjP1n1ZdmyoGYSsiZsR8Ogx/ 1Y526egS/FyQ401F24C9X7OwFyy/snUk1IetnZ0NlLX55nCozw2Nsm3BmH1M3OZmxdEGV0 UvnENjZsBAcFCm6dFNHpg9HWydcrYcNOT70kzQqLpO0UpnMpsvnoSOKbQPVrNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730230031; a=rsa-sha256; cv=none; b=rnPimAyjlg1ffU7JUWko0rTpL/PgKwqeUS1icdCsOc0UcdimFv05BO0qGm/MMK35I2bLEJ ZlhfEvHp5tZ9FkVLu6rM7RBnAgMdXfp4b23zlHPCY1OQJqeg3lHFEeiZbusvRBPluDV0lP 6Mka7IomwZ9fmqbcbKta5sXkWqAgjQ2swaaynz0ZE7/doCyXhZzXXZHI6ZdiquuHcA92J/ qZ6U1M3aCO1DalMKxBotNNpOonMUMqevbi9MvVPUvFKBR9+XXOfgm1BQS/W3w5prlpG59a ulGdmTDsChZT8XL4ctKwSj1qdcCgPuVWQfJGTSZQdw17z4WDIuZH3pCQa0jaPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKyR25GXzcXg; Tue, 29 Oct 2024 19:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJRB7G093878; Tue, 29 Oct 2024 19:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJRBHp093875; Tue, 29 Oct 2024 19:27:11 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:27:11 GMT Message-Id: <202410291927.49TJRBHp093875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 7dc78150c730 - main - tcp: refactor cwnd during SACK transmissions to allow TSO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7dc78150c730e90fa2afdaba3aa645932b30c429 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc78150c730e90fa2afdaba3aa645932b30c429 commit 7dc78150c730e90fa2afdaba3aa645932b30c429 Author: Richard Scheffenegger AuthorDate: 2024-10-29 17:47:06 +0000 Commit: Richard Scheffenegger CommitDate: 2024-10-29 18:04:12 +0000 tcp: refactor cwnd during SACK transmissions to allow TSO Refactoring of cwnd and moving the adjustment for SACKed data into tcp_output() - cwnd tracking the maximum extent starting at snd_una - allows both SACK loss recovery as well as SACK transmissions after RTO during slow start and if allowed, the use of TSO while in loss recovery. Reviewed By: tuexen, cc, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43470 --- sys/netinet/tcp_input.c | 85 +++++++++++++++++++++++++++++------------------- sys/netinet/tcp_output.c | 69 +++++++++++++++++++++------------------ sys/netinet/tcp_sack.c | 17 +++++----- 3 files changed, 97 insertions(+), 74 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 5d14664f3fc0..e5f5e09e57d8 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2653,13 +2653,14 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, tcp_do_prr_ack(tp, th, &to, sack_changed, &maxseg); } else if (tcp_is_sack_recovery(tp, &to) && - IN_FASTRECOVERY(tp->t_flags)) { + IN_FASTRECOVERY(tp->t_flags) && + (tp->snd_nxt == tp->snd_max)) { int awnd; /* * Compute the amount of data in flight first. * We can inject new data into the pipe iff - * we have less than 1/2 the original window's + * we have less than ssthresh * worth of data in flight. */ if (V_tcp_do_newsack) { @@ -2669,10 +2670,18 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, tp->sackhint.sack_bytes_rexmit; } if (awnd < tp->snd_ssthresh) { - tp->snd_cwnd += maxseg; + tp->snd_cwnd += imax(maxseg, + imin(2 * maxseg, + tp->sackhint.delivered_data)); if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; } + } else if (tcp_is_sack_recovery(tp, &to) && + IN_FASTRECOVERY(tp->t_flags) && + SEQ_LT(tp->snd_nxt, tp->snd_max)) { + tp->snd_cwnd += imax(maxseg, + imin(2 * maxseg, + tp->sackhint.delivered_data)); } else { tp->snd_cwnd += maxseg; } @@ -2696,14 +2705,13 @@ enter_recovery: tcp_seq onxt = tp->snd_nxt; /* - * If we're doing sack, or prr, check - * to see if we're already in sack + * If we're doing sack, check to + * see if we're already in sack * recovery. If we're not doing sack, * check to see if we're in newreno * recovery. */ - if (V_tcp_do_prr || - (tp->t_flags & TF_SACK_PERMIT)) { + if (tcp_is_sack_recovery(tp, &to)) { if (IN_FASTRECOVERY(tp->t_flags)) { tp->t_dupacks = 0; break; @@ -2723,29 +2731,40 @@ enter_recovery: tp->t_rtttime = 0; if (V_tcp_do_prr) { /* - * snd_ssthresh is already updated by - * cc_cong_signal. + * snd_ssthresh and snd_recover are + * already updated by cc_cong_signal. */ if (tcp_is_sack_recovery(tp, &to)) { /* - * Exclude Limited Transmit + * Include Limited Transmit * segments here */ tp->sackhint.prr_delivered = - maxseg; + imin(tp->snd_max - th->th_ack, + (tp->snd_limited + 1) * maxseg); } else { tp->sackhint.prr_delivered = - imin(tp->snd_max - tp->snd_una, - imin(INT_MAX / 65536, - tp->t_dupacks) * maxseg); + maxseg; } tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); } + tp->snd_limited = 0; if (tcp_is_sack_recovery(tp, &to)) { TCPSTAT_INC(tcps_sack_recovery_episode); - tp->snd_cwnd = maxseg; + /* + * When entering LR after RTO due to + * Duplicate ACKs, retransmit existing + * holes from the scoreboard. + */ + tcp_resend_sackholes(tp); + /* Avoid inflating cwnd in tcp_output */ + tp->snd_nxt = tp->snd_max; + tp->snd_cwnd = tcp_compute_pipe(tp) + + maxseg; (void) tcp_output(tp); + /* Set cwnd to the expected flightsize */ + tp->snd_cwnd = tp->snd_ssthresh; if (SEQ_GT(th->th_ack, tp->snd_una)) { goto resume_partialack; } @@ -2790,7 +2809,8 @@ enter_recovery: (tp->t_rxtshift == 0)) tp->snd_cwnd = SEQ_SUB(tp->snd_nxt, - tp->snd_una); + tp->snd_una) - + tcp_sack_adjust(tp); tp->snd_cwnd += (tp->t_dupacks - tp->snd_limited) * maxseg; @@ -3049,9 +3069,8 @@ process_ACK: SEQ_GEQ(th->th_ack, tp->snd_recover)) { cc_post_recovery(tp, th); } - if (tp->t_flags & TF_SACK_PERMIT) { - if (SEQ_GT(tp->snd_una, tp->snd_recover)) - tp->snd_recover = tp->snd_una; + if (SEQ_GT(tp->snd_una, tp->snd_recover)) { + tp->snd_recover = tp->snd_una; } if (SEQ_LT(tp->snd_nxt, tp->snd_una)) tp->snd_nxt = tp->snd_una; @@ -4138,9 +4157,7 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, */ if (IN_FASTRECOVERY(tp->t_flags)) { if (tcp_is_sack_recovery(tp, to)) { - tp->snd_cwnd = tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + - (snd_cnt * maxseg); + tp->snd_cwnd = pipe - del_data + (snd_cnt * maxseg); } else { tp->snd_cwnd = (tp->snd_max - tp->snd_una) + (snd_cnt * maxseg); @@ -4168,17 +4185,19 @@ tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th) tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; - tp->snd_nxt = th->th_ack; - /* - * Set snd_cwnd to one segment beyond acknowledged offset. - * (tp->snd_una has not yet been updated when this function is called.) - */ - tp->snd_cwnd = maxseg + BYTES_THIS_ACK(tp, th); - tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); - tp->snd_cwnd = ocwnd; - if (SEQ_GT(onxt, tp->snd_nxt)) - tp->snd_nxt = onxt; + if (IN_FASTRECOVERY(tp->t_flags)) { + tp->snd_nxt = th->th_ack; + /* + * Set snd_cwnd to one segment beyond acknowledged offset. + * (tp->snd_una has not yet been updated when this function is called.) + */ + tp->snd_cwnd = maxseg + BYTES_THIS_ACK(tp, th); + tp->t_flags |= TF_ACKNOW; + (void) tcp_output(tp); + tp->snd_cwnd = ocwnd; + if (SEQ_GT(onxt, tp->snd_nxt)) + tp->snd_nxt = onxt; + } /* * Partial window deflation. Relies on fact that tp->snd_una * not updated yet. diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index a048abf5f97a..860b785b631b 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -266,8 +266,10 @@ again: * resending already delivered data. Adjust snd_nxt accordingly. */ if ((tp->t_flags & TF_SACK_PERMIT) && - SEQ_LT(tp->snd_nxt, tp->snd_max)) + (tp->sackhint.nexthole != NULL) && + !IN_FASTRECOVERY(tp->t_flags)) { sendwin = tcp_sack_adjust(tp); + } sendalot = 0; tso = 0; mtu = 0; @@ -292,10 +294,13 @@ again: if ((tp->t_flags & TF_SACK_PERMIT) && (IN_FASTRECOVERY(tp->t_flags) || SEQ_LT(tp->snd_nxt, tp->snd_max)) && (p = tcp_sack_output(tp, &sack_bytes_rxmt))) { - uint32_t cwin; + int32_t cwin; - cwin = - imax(min(tp->snd_wnd, tp->snd_cwnd) - sack_bytes_rxmt, 0); + if (IN_FASTRECOVERY(tp->t_flags)) { + cwin = imax(sendwin - tcp_compute_pipe(tp), 0); + } else { + cwin = imax(sendwin - off, 0); + } /* Do not retransmit SACK segments beyond snd_recover */ if (SEQ_GT(p->end, tp->snd_recover)) { /* @@ -314,19 +319,34 @@ again: goto after_sack_rexmit; } else { /* Can rexmit part of the current hole */ - len = ((int32_t)ulmin(cwin, - SEQ_SUB(tp->snd_recover, p->rxmit))); + len = SEQ_SUB(tp->snd_recover, p->rxmit); + if (cwin <= len) { + len = cwin; + } else { + sendalot = 1; + } } } else { - len = ((int32_t)ulmin(cwin, - SEQ_SUB(p->end, p->rxmit))); + len = SEQ_SUB(p->end, p->rxmit); + if (cwin <= len) { + len = cwin; + } else { + sendalot = 1; + } } + /* we could have transmitted from the scoreboard, + * but sendwin (expected flightsize) - pipe didn't + * allow any transmission. + * Bypass recalculating the possible transmission + * length further down by setting sack_rxmit. + * Wouldn't be here if there would have been + * nothing in the scoreboard to transmit. + */ + sack_rxmit = 1; if (len > 0) { off = SEQ_SUB(p->rxmit, tp->snd_una); KASSERT(off >= 0,("%s: sack block to the left of una : %d", __func__, off)); - sack_rxmit = 1; - sendalot = 1; } } after_sack_rexmit: @@ -390,34 +410,15 @@ after_sack_rexmit: */ if (sack_rxmit == 0) { if ((sack_bytes_rxmt == 0) || SEQ_LT(tp->snd_nxt, tp->snd_max)) { - len = ((int32_t)min(sbavail(&so->so_snd), sendwin) - - off); + len = imin(sbavail(&so->so_snd), sendwin) - off; } else { - int32_t cwin; - /* * We are inside of a SACK recovery episode and are * sending new data, having retransmitted all the * data possible in the scoreboard. */ - len = ((int32_t)min(sbavail(&so->so_snd), tp->snd_wnd) - - off); - /* - * Don't remove this (len > 0) check ! - * We explicitly check for len > 0 here (although it - * isn't really necessary), to work around a gcc - * optimization issue - to force gcc to compute - * len above. Without this check, the computation - * of len is bungled by the optimizer. - */ - if (len > 0) { - cwin = tp->snd_cwnd - imax(0, (int32_t) - (tp->snd_nxt - tp->snd_recover)) - - sack_bytes_rxmt; - if (cwin < 0) - cwin = 0; - len = imin(len, cwin); - } + len = imin(sbavail(&so->so_snd) - off, + sendwin - tcp_compute_pipe(tp)); } } @@ -1647,6 +1648,10 @@ timer: if ((error == 0) && sack_rxmit && SEQ_LT(tp->snd_nxt, SEQ_MIN(p->rxmit, p->end))) { + /* + * When transmitting from SACK scoreboard + * after an RTO, pull snd_nxt along. + */ tp->snd_nxt = SEQ_MIN(p->rxmit, p->end); } if (error) { diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 09e172ad4601..f642acd4c46a 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -961,16 +961,15 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th, u_int *maxsegp) /* Send one or 2 segments based on how much new data was acked. */ if ((BYTES_THIS_ACK(tp, th) / maxseg) >= 2) num_segs = 2; - if (V_tcp_do_newsack) { - tp->snd_cwnd = imax(tp->snd_nxt - th->th_ack + - tp->sackhint.sack_bytes_rexmit - - tp->sackhint.sacked_bytes - - tp->sackhint.lost_bytes, maxseg) + - num_segs * maxseg; - } else { + if (tp->snd_nxt == tp->snd_max) { tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit + - imax(0, tp->snd_nxt - tp->snd_recover) + - num_segs * maxseg); + (tp->snd_nxt - tp->snd_recover) + num_segs * maxseg); + } else { + /* + * Since cwnd is not the expected flightsize during + * SACK LR, not deflating cwnd allows the partial + * ACKed amount to be sent. + */ } if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; From nobody Tue Oct 29 19:28:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKzf1pJbz5bq0D; Tue, 29 Oct 2024 19:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKzf0SfVz4HKw; Tue, 29 Oct 2024 19:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSyqg7fN1LVs/XzZTzGe5qXFvRBfv43BNnHvTNE6KF4=; b=XLyF5NgXo70cgA1GlgvKz5t6gPCdavjZV9k9elRpMxt8XMgm5/ttWPoSX6GlynyjdgOTwF 8TbO6Ptl2Yd/CjZeW+TdaYvemxY80KwsuZ1lCGrQlVi33Fl/3eEzVwChxNNaE91Vh3UGrd iE8zz96gdnC0cPLqfAJjTZUMbVXdGnxMPlS2pp1xnQ0/611zNxWqEdKhU25fr9Ikgi/6df LhblsObVePA459dCsq7b9YoJs7Rxe6A75tX+qjjjsRYPHi/sI4NyLXU9ZpwoK6XDjmNMJv UF7SlRgP3AXcLx27POaIFxELFrf+eYferrBjIqJ4c3OeCH5LQRBAhQ3FtVp3jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSyqg7fN1LVs/XzZTzGe5qXFvRBfv43BNnHvTNE6KF4=; b=AD3ybU9J7FbTDmbwwZyIHjaxiK2Y+yc8JfnkmDUnDgPIe5rZRHlvx9tlQAJiUeFkA3hou9 fRE1mGh7wVuxjo64WRp7CKrj4X2LTgZOjVz1908y3N59+1BFI2dxkjKQLO0cb1gktayRUw vDBsw5sKRSYxYNV7CFcsPfk21f5wX84ligx+IPPsvzWqUlu8DjZliRnkXepUw27lF/lNMU nfkVrddvSI6hA5fAqEIFsq2rFnVTHbrF6/Kry8xjIRAXsPAJtBK2QULA4ul9E89zfJ4lBB LhVmuuLplvaA1qMMici9i0P5UjJWNO5RIDBVrYx8SdGEC0+0c/IIhT+a5DQtJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730230094; a=rsa-sha256; cv=none; b=mTRD92ng2WoLK6++/xoj4XcwjPqIFqMqgMGRsT1d7FtfgnASbyaI24e0phjaNa9J7Slzy5 gYk5bP0hW1gCaiw9DRdWBNK2K5ROHjyrfnaZdymMPB0hx9DuoEDpDb6/FKzVmtNTPdvkF+ E6KAOyEVjMwSONZaohBVoDF0eeKo6SHh1lVIue9yAaxPJ5cI/kOI2JcMggs7xpwIuBEI8I mDlCuFdzDNolaWiWJB5x1drM8KoIPi7kqX6AHPWPetsqn/uRC7NyUtSPjPNliJNNl2AMz6 FSaSZPhQBZLhqAZTlrQJcUOCPSmc2pulTBtuwzLDlp9cb1TNZuIGMRNm3O+/SQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKzf039xzcXj; Tue, 29 Oct 2024 19:28:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJSD7t094322; Tue, 29 Oct 2024 19:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJSDcg094319; Tue, 29 Oct 2024 19:28:13 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:28:13 GMT Message-Id: <202410291928.49TJSDcg094319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: babfd2e46762 - stable/14 - bhyve: Initialize stack buffer in pci_ahci List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: babfd2e46762cb835fec66945aa60404f247c521 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=babfd2e46762cb835fec66945aa60404f247c521 commit babfd2e46762cb835fec66945aa60404f247c521 Author: Pierre Pronchery AuthorDate: 2024-07-23 14:34:03 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:19:45 +0000 bhyve: Initialize stack buffer in pci_ahci In the function ahci_handle_dsm_trim, if the call to read_prdt fails, the variable buf[512] is used while it contains uninitialized data. It is easy to make the call to read_prdt fail, for instance if hdr->prdtl == NULL, the function will return without writing anything in buf. In addition, this code could be hardened by checking the value of done before accessing &buf[done]. Reported by: Synacktiv Reviewed by: markj Security: HYP-15 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46090 (cherry picked from commit 71fa171c6480d60f4d9c01dea1c71a7249e7b8ab) --- usr.sbin/bhyve/pci_ahci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 1eef285a871c..e4c877229425 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -782,7 +782,7 @@ ahci_handle_flush(struct ahci_port *p, int slot, uint8_t *cfis) assert(err == 0); } -static inline void +static inline unsigned int read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, unsigned int size) { @@ -809,6 +809,7 @@ read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, to += sublen; prdt++; } + return (size - len); } static void @@ -821,6 +822,7 @@ ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done uint32_t len, elen; int err, first, ncq; uint8_t buf[512]; + unsigned int written; first = (done == 0); if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { @@ -832,9 +834,12 @@ ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done len *= 512; ncq = 1; } - read_prdt(p, slot, cfis, buf, sizeof(buf)); + written = read_prdt(p, slot, cfis, buf, sizeof(buf)); + memset(buf + written, 0, sizeof(buf) - written); next: + if (done >= sizeof(buf) - 8) + return; entry = &buf[done]; elba = ((uint64_t)entry[5] << 40) | ((uint64_t)entry[4] << 32) | From nobody Tue Oct 29 19:28:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdKzg1xj2z5bqL8; Tue, 29 Oct 2024 19:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKzg19VGz4H1r; Tue, 29 Oct 2024 19:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gi+6eW5yJYdR+rSv8I0KmQzRRpBeZNDh+YHTxxcrIIQ=; b=d08cQXLYVAw9idwNU3Qg9EVapCPOHOqHdL5/EiqvFePwdd2dlMzGHu1ECiuHQjxI6+nl44 uOadf1a/UELzX1yx42clL8aO4v6cmoBjiJ4nT44q8N/xpIK5okE08ibA3YYg6sBQ9pLuuq 6+r1mPVmYeXBbOZKo8zbxBwFEGkuzgXiofjeHhnme7Qk0fTYrcfGfp/X4jBrXCr7l8UDoA WmGhR77XjXiQkivL7uzpg5iSnFBoMN70hmodaDrp/TYm6+6eGxzk4rBsWFTWHsG2/S2aU0 pvOksWI/yIcQAUl5UCKKleQqirUIfS3kiYzrCCFpNgzeK3MtzmFDGx1qm/gUwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730230095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gi+6eW5yJYdR+rSv8I0KmQzRRpBeZNDh+YHTxxcrIIQ=; b=wjTabWxNu5rR4jn1PDuHleklelYjGiDdLC32vZh3kOWCIjWtdm4bm33CVOjI3S8J410i1o vahycF2qSzkfBhVY6BJe9TZ0LjEWyg/ViE523OplJ/koOrtQdnV15AmOVk8iJ+h1t+S6N6 bWAh3jDEffZuv1kva4kJAUKT1t8lICUJn4ulBKyIVneABDPIIQeLdJb5gilk04fkSR+/F3 yhVFOfJI0LGR6/4bqq1HACR9P3+6TpwdaAgKSR7GlBo/1r89W1ZnuVzfzCaNMHqwiaLdQy hUxeDQSfYe4ubuCV6F1hITZQqKzy2IwRa5+NaNgVge4+dTdHAg4/FXId3sUHjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730230095; a=rsa-sha256; cv=none; b=HX5wZZoknb+B1mgdsA1ultaPmwp6Q4MGgJsmWnTYXPY8j2UktewOHpPaR9umwQTB+sARr0 xy762qGvqf9BAB7LFzfP3c1nAnEEj9iywhf3SS94X/liUw2Sejj1oU6UdsZSWHead0beN6 CMBDVdp4tdEWsHGWJOQkoeMXHaZ5G+dHRxniov+H5TwrCyV0jzRm7AG5b5aE5Kh5RQaejj CW1tBkSvAzP667GoIJoSGc7VD2fLj8kFm5yo5hESfEXzkhbnEbbo8H+e/twK4CCTFpmY2W G9m1BPfwCGHOLeHR1j/wHAxrcfvsFezOyWRfe3KAXa+MucM5V3xwLB1cQcdgFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKzg0khNzcXk; Tue, 29 Oct 2024 19:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TJSEe6094395; Tue, 29 Oct 2024 19:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TJSE29094392; Tue, 29 Oct 2024 19:28:14 GMT (envelope-from git) Date: Tue, 29 Oct 2024 19:28:14 GMT Message-Id: <202410291928.49TJSE29094392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3981cf108773 - stable/14 - bhyve ahci: Improve robustness of TRIM handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3981cf108773d6b29c8e100bc3b4a105eae681ec Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3981cf108773d6b29c8e100bc3b4a105eae681ec commit 3981cf108773d6b29c8e100bc3b4a105eae681ec Author: John Baldwin AuthorDate: 2024-10-24 14:18:09 +0000 Commit: Ed Maste CommitDate: 2024-10-29 19:19:51 +0000 bhyve ahci: Improve robustness of TRIM handling The previous fix for a stack buffer leak in the ahci device model actually broke the handling of TRIM as one of the checks it added caused TRIM commands to never be completed. This resulted in command timeouts if a guest OS did a 'newfs -E' of an AHCI disk, for example. Also, for the invalid case the previous check was handling, the device model should be failing with an error rather than claiming success. To resolve this, validate the length of a TRIM request and fail with an error if it exceeds the maximum number of supported blocks advertised via IDENTIFY. In addition, if the PRDT does not provide enough data, fail the command with an error rather than performing a partial completion. This is somewhat complicated by the implementation of TRIM in the ahci device model. A single TRIM request can specify multiple LBA ranges. The device model handles this by dispatching blockif_delete() requests one at a time. When a blockif_delete() request completes, the device model locates the TRIM buffer and searches for the next LBA range to handle. Previously, the device model would re-read the trim buffer from guest memory each time. However, this was subject to some unpleasant races if the guest changed the PRDT entries or CFIS while a command was in flight. Instead, read the buffer of trim ranges once and cache it across multipe internal blockif requests. Reviewed by: mav Fixes: 71fa171c6480 bhyve: Initialize stack buffer in pci_ahci Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47224 (cherry picked from commit 8c8ebbb045185396083cd3e4d333fe1851930ee7) --- usr.sbin/bhyve/pci_ahci.c | 145 ++++++++++++++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 50 deletions(-) diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index e4c877229425..2c55431c0275 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -127,6 +127,7 @@ struct ahci_ioreq { STAILQ_ENTRY(ahci_ioreq) io_flist; TAILQ_ENTRY(ahci_ioreq) io_blist; uint8_t *cfis; + uint8_t *dsm; uint32_t len; uint32_t done; int slot; @@ -214,6 +215,8 @@ struct pci_ahci_softc { }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) +static void ahci_handle_next_trim(struct ahci_port *p, int slot, uint8_t *cfis, + uint8_t *buf, uint32_t len, uint32_t done); static void ahci_handle_port(struct ahci_port *p); static inline void lba_to_msf(uint8_t *buf, int lba) @@ -813,18 +816,14 @@ read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, } static void -ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done) +ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis) { - struct ahci_ioreq *aior; - struct blockif_req *breq; - uint8_t *entry; - uint64_t elba; - uint32_t len, elen; - int err, first, ncq; - uint8_t buf[512]; - unsigned int written; + uint32_t len; + int ncq; + uint8_t *buf; + unsigned int nread; - first = (done == 0); + buf = NULL; if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { len = (uint16_t)cfis[13] << 8 | cfis[12]; len *= 512; @@ -834,39 +833,84 @@ ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done len *= 512; ncq = 1; } - written = read_prdt(p, slot, cfis, buf, sizeof(buf)); - memset(buf + written, 0, sizeof(buf) - written); -next: - if (done >= sizeof(buf) - 8) - return; - entry = &buf[done]; - elba = ((uint64_t)entry[5] << 40) | - ((uint64_t)entry[4] << 32) | - ((uint64_t)entry[3] << 24) | - ((uint64_t)entry[2] << 16) | - ((uint64_t)entry[1] << 8) | - entry[0]; - elen = (uint16_t)entry[7] << 8 | entry[6]; - done += 8; - if (elen == 0) { - if (done >= len) { - if (ncq) { - if (first) - ahci_write_fis_d2h_ncq(p, slot); - ahci_write_fis_sdb(p, slot, cfis, - ATA_S_READY | ATA_S_DSC); - } else { - ahci_write_fis_d2h(p, slot, cfis, - ATA_S_READY | ATA_S_DSC); - } + /* Support for only a single block is advertised via IDENTIFY. */ + if (len > 512) { + goto invalid_command; + } + + buf = malloc(len); + nread = read_prdt(p, slot, cfis, buf, len); + if (nread != len) { + goto invalid_command; + } + ahci_handle_next_trim(p, slot, cfis, buf, len, 0); + return; + +invalid_command: + free(buf); + if (ncq) { + ahci_write_fis_d2h_ncq(p, slot); + ahci_write_fis_sdb(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + } else { + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + } +} + +static void +ahci_handle_next_trim(struct ahci_port *p, int slot, uint8_t *cfis, + uint8_t *buf, uint32_t len, uint32_t done) +{ + struct ahci_ioreq *aior; + struct blockif_req *breq; + uint8_t *entry; + uint64_t elba; + uint32_t elen; + int err; + bool first, ncq; + + first = (done == 0); + if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { + ncq = false; + } else { /* ATA_SEND_FPDMA_QUEUED */ + ncq = true; + } + + /* Find the next range to TRIM. */ + while (done < len) { + entry = &buf[done]; + elba = ((uint64_t)entry[5] << 40) | + ((uint64_t)entry[4] << 32) | + ((uint64_t)entry[3] << 24) | + ((uint64_t)entry[2] << 16) | + ((uint64_t)entry[1] << 8) | + entry[0]; + elen = (uint16_t)entry[7] << 8 | entry[6]; + done += 8; + if (elen != 0) + break; + } + + /* All remaining ranges were empty. */ + if (done == len) { + free(buf); + if (ncq) { + if (first) + ahci_write_fis_d2h_ncq(p, slot); + ahci_write_fis_sdb(p, slot, cfis, + ATA_S_READY | ATA_S_DSC); + } else { + ahci_write_fis_d2h(p, slot, cfis, + ATA_S_READY | ATA_S_DSC); + } + if (!first) { p->pending &= ~(1 << slot); ahci_check_stopped(p); - if (!first) - ahci_handle_port(p); - return; + ahci_handle_port(p); } - goto next; + return; } /* @@ -879,6 +923,7 @@ next: aior->slot = slot; aior->len = len; aior->done = done; + aior->dsm = buf; aior->more = (len != done); breq = &aior->io_req; @@ -1756,7 +1801,7 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis) case ATA_DATA_SET_MANAGEMENT: if (cfis[11] == 0 && cfis[3] == ATA_DSM_TRIM && cfis[13] == 0 && cfis[12] == 1) { - ahci_handle_dsm_trim(p, slot, cfis, 0); + ahci_handle_dsm_trim(p, slot, cfis); break; } ahci_write_fis_d2h(p, slot, cfis, @@ -1766,7 +1811,7 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis) if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM && cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM && cfis[11] == 0 && cfis[3] == 1) { - ahci_handle_dsm_trim(p, slot, cfis, 0); + ahci_handle_dsm_trim(p, slot, cfis); break; } ahci_write_fis_d2h(p, slot, cfis, @@ -1904,12 +1949,12 @@ ata_ioreq_cb(struct blockif_req *br, int err) struct ahci_port *p; struct pci_ahci_softc *sc; uint32_t tfd; - uint8_t *cfis; - int slot, ncq, dsm; + uint8_t *cfis, *dsm; + int slot, ncq; DPRINTF("%s %d", __func__, err); - ncq = dsm = 0; + ncq = 0; aior = br->br_param; p = aior->io_pr; cfis = aior->cfis; @@ -1921,10 +1966,8 @@ ata_ioreq_cb(struct blockif_req *br, int err) cfis[2] == ATA_READ_FPDMA_QUEUED || cfis[2] == ATA_SEND_FPDMA_QUEUED) ncq = 1; - if (cfis[2] == ATA_DATA_SET_MANAGEMENT || - (cfis[2] == ATA_SEND_FPDMA_QUEUED && - (cfis[13] & 0x1f) == ATA_SFPDMA_DSM)) - dsm = 1; + dsm = aior->dsm; + aior->dsm = NULL; pthread_mutex_lock(&sc->mtx); @@ -1942,8 +1985,9 @@ ata_ioreq_cb(struct blockif_req *br, int err) hdr->prdbc = aior->done; if (!err && aior->more) { - if (dsm) - ahci_handle_dsm_trim(p, slot, cfis, aior->done); + if (dsm != NULL) + ahci_handle_next_trim(p, slot, cfis, dsm, + aior->len, aior->done); else ahci_handle_rw(p, slot, cfis, aior->done); goto out; @@ -1965,6 +2009,7 @@ ata_ioreq_cb(struct blockif_req *br, int err) ahci_check_stopped(p); ahci_handle_port(p); + free(dsm); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit", __func__); From nobody Tue Oct 29 20:36:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdMVQ1NVRz5bt4M; Tue, 29 Oct 2024 20:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdMVQ0x4fz4Q6g; Tue, 29 Oct 2024 20:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730234190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=557Bkuo5eofv9CDStRODzQGot0hc3qb7UvYrfNh0qZQ=; b=pyA/Ar66OArQQhCBQI+1eJDpfBoho8TFZ9aizifYihA+3s4oyXucnbwXFMoEL4GdrWCKIa nu/uJt0FGAy/O2aHG5uUqRGWcgMrMM52ie2RMrMonbofPBp1ihczkLz/RRM4P3bsmULWCk 32LFEfnL2qCNphmRYXhPvPduET/i/pDO7yAi5cC4uMmxPQiRXQ+ISCWsb0YBDKaSUHmb21 nSQ2v82WviPWYBzJ8JR29KqFrpmToNHT5yTQK7umA9VSrSNmG+hiERuqyw9ecnwOkzx13s BAYud0ebScT1stTdGdaozrfmjvealoUA9Y+ZXpc2SaeeMqs/9ZJop7M/205wSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730234190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=557Bkuo5eofv9CDStRODzQGot0hc3qb7UvYrfNh0qZQ=; b=x4aoEAv7+zk/v5E4UHYHV+EmqTSqUzEtfP7C3EdSH7AXLS/4U5no5AYfuF24uv3Hd/Kp9J AVFEBQGezexvgOSgFv+0joT9C7t9y23s3ZqpTRSzY+echedRCOUrio0pnPohBIfWCsF0VB 0MaXRoziUX1gJ6dJ4L6NaKRVu/k6sTvHB/kZSJTfAw/89MbiuccupqUF/pmuB2SHjFUiF8 CBXODaW5aIEpV1/fVlZHBClLRVF90wzBr8LrriXv/yXginX/25Cg6RV138e+tUlPbOAlwP k5t2IMmao0bUNTOdn6g7iL5/5/ei2xP/apCuhF8xTmhFQ4kS7NSFF/lKLtckSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730234190; a=rsa-sha256; cv=none; b=sqNmBoARZUxlEqheqO9mkMTtthXPS4yAhFI++VKxrshQvcE/u+ekJ6i3MgcX27CTHKswLZ fWmE9b5wi36IA32k1lOGBTICU8GfASfMzv5vsBxFK9X/EcZw1Soqd4ElcIeEAuGGpjB6Uj UikoXZR9E8swR5lVO8ugDCsg6YuLGI05HlrQspFDzWnFK/MKiTqpMLB/2TJDI+NSb+VKnk sb2nwkEKdmE2O/OGFf0oLHy7idTuaeYMjvs1eExoaNm0UzAvbZ4PzGsbFNkcqQrD2t8Fkh LK/+UA7hTMnxIItPUAwOfHVi6LnUDWrKkJsT6Q95aoSIcp6KbEBxMjfMfHRljQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdMVQ0N9bzfNh; Tue, 29 Oct 2024 20:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TKaT7N022936; Tue, 29 Oct 2024 20:36:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TKaT3t022933; Tue, 29 Oct 2024 20:36:29 GMT (envelope-from git) Date: Tue, 29 Oct 2024 20:36:29 GMT Message-Id: <202410292036.49TKaT3t022933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: dd72aa6be4ee - stable/14 - style.9: clarify FALLTHROUGH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd72aa6be4eec5d6d6406b00190e5729bba179db Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dd72aa6be4eec5d6d6406b00190e5729bba179db commit dd72aa6be4eec5d6d6406b00190e5729bba179db Author: Ed Maste AuthorDate: 2024-10-22 16:13:55 +0000 Commit: Ed Maste CommitDate: 2024-10-29 20:33:10 +0000 style.9: clarify FALLTHROUGH FALLTHROUGH is intended for a block of code that cascades to the next case block. Multiple case statements sharing a single block of code do not need a FALLTHROUGH comment. Reviewed by: imp, markj, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47242 (cherry picked from commit d55d5dd9f7adcffa6a1f2a49956d7fd7d549aba1) --- share/man/man9/style.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index f00286ba9c48..52292b896add 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -530,7 +530,7 @@ parts of the cascade. Elements in a .Ic switch -statement that cascade should have a +statement that execute some code and then cascade to the next case should have a .Li FALLTHROUGH comment. Numerical arguments should be checked for accuracy. From nobody Tue Oct 29 20:36:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdMVR3WYmz5bt6k; Tue, 29 Oct 2024 20:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdMVR1jtnz4Q6h; Tue, 29 Oct 2024 20:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730234191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Mck1PVDh/+lLdnFdyjXNj6CNmOdFmDz9fNEzEKMcnQ=; b=bHZPvl4FqJqqqe29Td/nW20umI8nEcfs4BObOowZhvYrwgaNgCzigvAnsGsrfAG+1ZTIma Rlkb3xVi0tx6HRD121Zn2BX1J5uAfFquZeaPMFlNqDASoL2aHNCClPz5DIyBka86gNWP3u yXIv9el7yUPZ84wkacoxfwjvraXJck32fhEv8yyOCQIALtP8RHY61Ei3/peba9Rni8bmvQ ncXih2Y2etQ6/JQAvOSdCA/+Seu3c2cFjIju+pTzEWjYf+7CHDzX49T8RknevyFCF22Hhw urL4ChP1/g4+g54fdjH+ucmuXr6IIehzViE51wBsny2ZZIEbYc+uDtJSuUJZWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730234191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Mck1PVDh/+lLdnFdyjXNj6CNmOdFmDz9fNEzEKMcnQ=; b=p9+gZAoyKIFhUCMU93iu7kUW0but2y6YN/Ej3xPb4VUsxEVnwXlMYzjuXWGk9y6ZT4Rljd bW0J685Cu7/VcjPkrUQmbVkMPpGZbgxiFsa4T2W7oGDMt8kWnwoH7BkhMzKIc6DZ7SXcQg KmkXlbe7QZWdupew660zMcq88yeVn4ZyNBfnPgnFS/AWfrgj/ekpCZEpO+/M2MpTj3+5lC 0b5iomjz+FJMA4W97EiE0XfPCy43kzvXNnSJwjdhG9/vZcgHetWUbPsLCiQ6qXoukwvc7d IrBNHbeB1SeQuCnUQdHZw/0GYlPTec17qE046HD8bZcBKluJVn0KW14LszOcug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730234191; a=rsa-sha256; cv=none; b=Z5EyaBWNbNlbmiVjU3Hpj9TGcRDqN+kfVx4AlZO/n8IRtc9P4Yeveow0N0AcssF4SbsTKT M/sv3KdVxT6T1FOEo1jGTr3/zBXSZHzDeAD1utYSoK7clYmCoFERfueBZmLkOqrz0ujl6l YKLeiV/SzSTsgEyIplMDJ3srmIKTeWWG575W/8B8GxVEXpIb6uUVnRLM8kvxzFEkUCoKTf l2aBjkMSDTglk+G4ZXczAVNhqjf1+KtXHxGHE/VOJ+WjAIxkZD+EWEewc/pe7mldedwnfR u9E9cVgy6YjUfPo7nxJXguA/e64Wkzqh3bFHgsVS+l7a6Ew6T8ZRohhtIZb2/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdMVR1L6lzfR0; Tue, 29 Oct 2024 20:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TKaVmD022975; Tue, 29 Oct 2024 20:36:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TKaVOw022972; Tue, 29 Oct 2024 20:36:31 GMT (envelope-from git) Date: Tue, 29 Oct 2024 20:36:31 GMT Message-Id: <202410292036.49TKaVOw022972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 915d84fbba27 - stable/14 - zstream: avoid absolute symlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 915d84fbba276e2ceac64ff42d3baa7da51cba6a Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=915d84fbba276e2ceac64ff42d3baa7da51cba6a commit 915d84fbba276e2ceac64ff42d3baa7da51cba6a Author: Ed Maste AuthorDate: 2024-10-21 17:15:46 +0000 Commit: Ed Maste CommitDate: 2024-10-29 20:33:26 +0000 zstream: avoid absolute symlink PR: 282192 Reported by: wosch Fixes: 44877c8db05b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47226 (cherry picked from commit 01a5af6a98fc3935b57a5b0616521f46e916caec) --- cddl/usr.bin/zstream/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.bin/zstream/Makefile b/cddl/usr.bin/zstream/Makefile index 4444973b2211..4cd60b3a2f0b 100644 --- a/cddl/usr.bin/zstream/Makefile +++ b/cddl/usr.bin/zstream/Makefile @@ -17,7 +17,7 @@ SRCS= \ zstream_redup.c \ zstream_token.c -SYMLINKS= ${BINDIR}/zstream ${BINDIR}/zstreamdump +SYMLINKS= zstream ${BINDIR}/zstreamdump WARNS?= 2 CFLAGS+= \ From nobody Tue Oct 29 20:36:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdMVS3n8nz5btLh; Tue, 29 Oct 2024 20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdMVS33qxz4Q4p; Tue, 29 Oct 2024 20: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=1730234192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I4IfJNxVvOP5rjH6phpeKuaUpqegdnQe0iyr4AYxC/A=; b=D+Gf3L3mqXnwIsAT+3nv5tActYfQfVq4kmBu8Moqx6S1hejLwPmPObLSytrrK7w5v9M4no uiTP4Cy0TLYmnlCjLDMktcri8dWznEZpjd/HjMWw3CGArjuSLkhOg3Z9EDhaNUPEjrnS0O XQkg8YmO/j5JcrNuYVlZDltSLgPdWa+P6nbOh0+BwkLcSD6PeDwe5vFZED/f+hPc6p6R0Q SRbqVd++tyEb/0BSPmdNzmqzXPhb08ON9Nsv7AL/pxzn/XM3usW2NToKGr1sQHrztS5e6F VapHbjARmDN5e9qtwtu7CqB0sghjIrpBmmQjHMF/gIIhO4bcrjYUKaMASU59rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730234192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I4IfJNxVvOP5rjH6phpeKuaUpqegdnQe0iyr4AYxC/A=; b=Yyky9sBGvv0kf32iG0ehbdhmm9VjdmRMZgKKzn2a21WWUvjZ22PqNAKxiiLPSTwxvAlVGG WOMfk/RHwhdri9Ao3YU7Wdtcy1TT2kzhvp8UfCuDVBR5P+7G+Tdm8CwCyW4uHkMFFivsuM hOWYVJafi20eu2pKc5sZmE6XUVHR0e87l2hfzCp8ledPM9hfJLFhG2Z+a+3pCigSiuwJ/j AIfsjDg4ccxcWBXepi0oGCeHiwfHWv3jV1SlS+7fgHpm8TGPC2zcKeA8lX71En7Ei2DCFB tX/pE/sQ5IGi3UmPkDQUJdUTXseM7BBttQvjknucdp93226juhpP1aWm/WdGkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730234192; a=rsa-sha256; cv=none; b=yfZkQEdlwrhoT8aQmXlVWi9DWBU7IjOjLRxasmJunt5kprs/FUiPUdl0NA39Xcmoca9o42 nnLCpmt6MFV9I+tlaDB7kz6WlTQ56pei9HOabTs3xT/Cbu68i1loBLNSrvhH7sJBokUEiz dXQXsrloiRNEaTvNQ19uDCa2ts1qbpTswo4Y3W9TZGHhEjW86nsOrjrFUXSIrFCykFj5Ax ItfvJqV4m9MKGv7wYNR4VdhpPNN35tDlXacxYFJhn3RqwovyFETogfSqv7NfgopX23WzkT C2h2kYXFn3MxDynM5JhZHMLUQLSsYAeT7XZk1VKZm8Bx1Mgg/l/4+m0VrwrY2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdMVS2HYxzf9Q; Tue, 29 Oct 2024 20:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TKaWVG023015; Tue, 29 Oct 2024 20:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TKaWpU023012; Tue, 29 Oct 2024 20:36:32 GMT (envelope-from git) Date: Tue, 29 Oct 2024 20:36:32 GMT Message-Id: <202410292036.49TKaWpU023012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 4a894adc41ba - stable/14 - nfs: trivial typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4a894adc41ba2f9aebf57ed7f5d7d5d289c9e8c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4a894adc41ba2f9aebf57ed7f5d7d5d289c9e8c1 commit 4a894adc41ba2f9aebf57ed7f5d7d5d289c9e8c1 Author: Ed Maste AuthorDate: 2024-10-08 16:46:47 +0000 Commit: Ed Maste CommitDate: 2024-10-29 20:33:33 +0000 nfs: trivial typo fix via is not an abbreviation and doesn't need a period. (cherry picked from commit 52d895fe63eb22c1265362c54983db6038ebea3c) --- sys/fs/nfsclient/nfs_clvfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index c050eef7d4c3..1cbe8e70867f 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -415,7 +415,7 @@ ncl_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred, } /* - * Mount a remote root fs via. nfs. This depends on the info in the + * Mount a remote root fs via nfs. This depends on the info in the * nfs_diskless structure that has been filled in properly by some primary * bootstrap. * It goes something like this: From nobody Tue Oct 29 20:50:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdMq51twzz5bt7r; Tue, 29 Oct 2024 20:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdMq50d8Yz4S8b; Tue, 29 Oct 2024 20:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730235057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZRguIFFziMIzFgXJ2KVAvDlskSraVo20M7JizqJ23Dg=; b=bWiBre/AtR21NI7abMvXHG3UqMNt70oplkdhMOrRvHRDfeO8zwj/cZajA+T7zS8/Vah+/T 4PvWnVst6KZLQ5gJH9UUFbb3EzPpZawcuVp4TfvIzfGE6u0RpYx01LhxGlAoSCOl0foSkE zWhcVnMTCB3RH55uej2Kz26BNNB2OQyfNk2B0WcXpWmjo02LFfPifFPE6cSiWaqzMU7EgC Oz/jNZRgjVfLPdbv3xV4iGxAgzCkSj590iQQU+W2ww/gLNAVrxa98uSB1SfbrLQUlrnEAs S8DDqFA5j88GT2AjUXUUdgBRCiLkxGj0jbHQFpREV71XrQ+gJZjosBx9z6wAcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730235057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZRguIFFziMIzFgXJ2KVAvDlskSraVo20M7JizqJ23Dg=; b=x6M0RVTOOSiVXxoC6pJAtgCqvNcUmSF9neG/W+N/LHpJ/x66OdMINNLCsVLTLLXo97JIjz POn4kEWY5ZH1G2wNs/eq5cY72HLYHgxYgqrjm9JFxusDyEfTrc4JLCe7Ob+Rc/IOfDHQs1 9mOLZ/3nR2E0SC/jh010wPpcP870J44VGwXgHlrQzkHy/B7KYovyQXGFjHis+Vc4V0+aLG HO5pFixMXNnwanPQETNQ0BgUaVSHlnk83EjKZ+H3/RzhoPXGke8K8j6aMZy/89VbrRk8ZB sHl1o1fE8ACGHysun4VcBnjwcG8fYaZD6RTpHTpnfHjFNCyoVnNNMhE02BDpqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730235057; a=rsa-sha256; cv=none; b=GO1vzKns2C2xWtTQZsHDn5NlGr6mufU4bKVfZNX94TAUeIX5gYHCSwtxtFLNlJIamJoOo8 ee0mSN0Hg52QBYKcj4qwiGuuCuhhrmrDxWOlHhDeE+eewojpqHtkup1Gg7NuWB4kbTt7vu uncL+KN7Erk2Yt8Ucr6PAPc/KB1IAk5RVso388I/FG/YYnceJYkCy+11doIJehKAzqFHJ4 tHa09O/WBMi/2KzbfcbumJr0LyuZ4p67zJ/wY0siPyjT2F3twQL6sp0AyH3lAScaAii80l c4B7Nn4qr1W5WKwMwHVPQNz3aAV9uum+qFwBaA68phC20UqGusue6cwb2qlhPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdMq50FCXzff3; Tue, 29 Oct 2024 20:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TKouQV052460; Tue, 29 Oct 2024 20:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TKou5j052457; Tue, 29 Oct 2024 20:50:56 GMT (envelope-from git) Date: Tue, 29 Oct 2024 20:50:56 GMT Message-Id: <202410292050.49TKou5j052457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8549e3ce0cd6 - main - pkgbase: don't remove the 'latest' symlink until the repo is final List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b commit 8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b Author: Kyle Evans AuthorDate: 2024-10-29 20:50:49 +0000 Commit: Kyle Evans CommitDate: 2024-10-29 20:50:49 +0000 pkgbase: don't remove the 'latest' symlink until the repo is final We can encounter many issues in the pkg-repo(8) process which would currently leave us with no more 'latest' symlink in the repository. The main problems with this are that we've now broken a subsequent `update-packages` because we can't determine a PKG_VERSION_FROM, but also we break configured clients that are still expecting to see *some* repository. Switch to just replacing the `latest` symlink entirely after we have made it past the pkg-repo(8) step so that we only swap over when we have a finished repository. Reviewed by: bapt, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47303 --- Makefile.inc1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 69a1ad2c8d01..4bd85a8cbf04 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2367,14 +2367,13 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @[ -L "${REPODIR}/${PKG_ABI}/latest" ] && unlink ${REPODIR}/${PKG_ABI}/latest; \ - ${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ + @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${PKG_REPO_SIGNING_KEY} ; \ cd ${REPODIR}/${PKG_ABI}; \ - ln -s ${PKG_OUTPUT_DIR} latest + ln -hfs ${PKG_OUTPUT_DIR} latest # # From nobody Tue Oct 29 21:04:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdN6R0FFHz5bvcf; Tue, 29 Oct 2024 21:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdN6Q6r3Rz4W06; Tue, 29 Oct 2024 21:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730235855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GAuRNQXrlcksx253HCpgl0tGShv4QEDNgGwbWXMJ+qQ=; b=Uf672I3zHpr7gl7qE/kl2aF5eT1NHpJ0alqT+18UikyU5H1N4Ob121ry9y6noZ0pHRWOV+ mlW5o6ZolQeKXRh9af60B6VJf9TqA+CrYCcl5jNvw9oLfnjGV36uu7xAY/T7AdJ4o2bsGR qmO6+Vn5E0r+G4LGiYF9pMJpZYKAXs16XRkV6Rp5lIrdwEoD9xbUkvk9A05XqAFfSL6xe5 t3k9Qu9ozyRVG0f9AdYQKoWz4oOXMxxNaAugu8cIwKp2RF6IRgucew4WGCOF2ECkF4zI+B /jVzNyEcaHiK7KKjkjDEs0fM1kQg+SWSPMocUdWzPzb92jj3XgllTZAuUduXaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730235855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GAuRNQXrlcksx253HCpgl0tGShv4QEDNgGwbWXMJ+qQ=; b=DMKbnkuy0Lsuvqj3JH3vJKAypWlOHkKrP69P5Q5ngAwGMeDeIUBkFt0Nw/Mlg9/gCjKeBn Ejf/SEx6GY3s5Bz6/+/gNQZ8xkeqHtBM7NCSxkYGcEHD6LkGcRJgMVvniDpu3qgmGccZeO 97DFI4EZl/LJVh6hJ2XNoYp/7vk5kUtw1GipkBljrmhfPHrUF8IEdg9ktz/qloepiWgXzO 0AL5PY1wKJzomOv/QZEmOiQntu44Hpdj8+eZqzE27r9t9JCSaUuvQaIW3YLqJYPyOEUHMC GY3mlH/+3AlNQ9IMLFnnjXElvJ5SDeTJdUu1x19+kI3DpuLaaMDXsue8oIwmJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730235855; a=rsa-sha256; cv=none; b=d8FnplNTJjBtJrYoM5tFKfortrGTltD4KELavmqZbVkMQh0IU/r6OmSZvedHvzeJeNlTIK 3j9uoMZZLJuoW9ofobyOk2mS/sRfC0yUAcnZyam/Yc4LRkqRzmAPIayFKV6mgv3R7xbzvV BWJBfzN9verQVTi/SE1alBHJZA7jSAZ+hWJang4MAYsi3H2mQIiPR/r4mpIc0eoCgQH2pd Y27qWivyvN5G02okMxLinmN/u2sVYL/UxeAdkY4v8pUU++0FYGGOs9GqeqcswTZREsyW6R 7XVhPgrVWNyjNzM9OW3xMC6OwLL4KS1tCEkhGT4Y3WD+7zx0es4zwyptMrkkkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdN6Q6JX2zfT6; Tue, 29 Oct 2024 21:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TL4EA1078926; Tue, 29 Oct 2024 21:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TL4EEQ078923; Tue, 29 Oct 2024 21:04:14 GMT (envelope-from git) Date: Tue, 29 Oct 2024 21:04:14 GMT Message-Id: <202410292104.49TL4EEQ078923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a1269171d71f - stable/14 - libcxxrt: Add a stub implementation of __cxa_call_terminate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a1269171d71f6e03014f13ba52d4e86b6e8782a2 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a1269171d71f6e03014f13ba52d4e86b6e8782a2 commit a1269171d71f6e03014f13ba52d4e86b6e8782a2 Author: John Baldwin AuthorDate: 2024-08-21 17:37:48 +0000 Commit: Ed Maste CommitDate: 2024-10-29 20:34:21 +0000 libcxxrt: Add a stub implementation of __cxa_call_terminate This function is called by GCC 14 if a destructor invoked during exception unwinding throws an exception. Reviewed by: emaste Obtained from: libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7 Differential Revision: https://reviews.freebsd.org/D46004 (cherry picked from commit 297a9e552b9a5adf07d195eae9649b0758f395af) --- contrib/libcxxrt/exception.cc | 13 +++++++++++++ lib/libcxxrt/Version.map | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index 35ff997dd445..b56333e979a2 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -1433,6 +1433,19 @@ extern "C" void __cxa_call_unexpected(void*exception) abort(); } +/** + * ABI function, called when an object destructor exits due to an + * exception during stack unwinding. + * + * This function does not return. + */ +extern "C" void __cxa_call_terminate(void *exception) throw() +{ + std::terminate(); + // Should not be reached. + abort(); +} + /** * ABI function, returns the adjusted pointer to the exception object. */ diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map index a54b6a4daad5..39a54f4868a9 100644 --- a/lib/libcxxrt/Version.map +++ b/lib/libcxxrt/Version.map @@ -287,6 +287,10 @@ CXXABI_1.3.11 { __cxa_init_primary_exception; } CXXABI_1.3.9; +CXXABI_1.3.15 { + __cxa_call_terminate; +} CXXABI_1.3.11; + CXXRT_1.0 { extern "C++" { From nobody Tue Oct 29 21:30:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdNhG5wCWz5bwm4; Tue, 29 Oct 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdNhG5P3pz4XXc; Tue, 29 Oct 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730237406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+aliNxZ502SNoEvoyT5ScyEhkb+GuIqjx71Nvo1j/Kw=; b=mBLqpWSL5u6gMFG1p/FzgjPLwBsxPFgUQqAYEtrsr4YgMZAIetwr8IL9oaInZ2ncOsX4gx U1ipovPWKaJFtrYRhjozmn7IlDnoWANHCptnGVvzea8hyklHdHkkctR9IH7q4t4+ATd+Kw dFWZMwFGXC0+VH5hi0YoyMfbBq17qW++UGKEAwAVyMs+SfHBEemVKyKrRl/JWM61s5+9q8 JHk7DQeTzsvz6tqqfncHuFrcYVCP/itrILCnoomNOTIMQskos5OCUtPw6fKnGBAEUBXR03 QTPdSFcHdXtTZkwybLhOtgTPwDQlYUtFr9rcQiOtw9yxvQPci+AggJtD9KbJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730237406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+aliNxZ502SNoEvoyT5ScyEhkb+GuIqjx71Nvo1j/Kw=; b=Q75F2nGR+CPP5iXZLKgvycZil8s+/kC4v9wNKVRnFGVwA/LXy4Jk+lmL9sMwAi0OH+6vzG p6S1lhaMub9G7ZGGKxPnhq6sgX8koMSoMOxMwsmDLVQpcTbNI61WVU3VYbotbrzJ3SF6xA wBwkGVyusUKT4qgLqJUv7oHuyM428olSPTy/w7j7F+bi0Bf1QKVoj2FRXjKcEslMsJVKVy 04MLv4u8h9lxZDF4yhk6Z8fFleXDk219LgFiWqe5eK2g/Rn6AYZ5E6E+Mh6AuqaVNZEmIa GA9OC9mKtuDVPsvHN3a40aI6rKeFefSkD4A1EjaI3bfWn9JdDsnY+8PAvx+N+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730237406; a=rsa-sha256; cv=none; b=xEV5YmiHpLAgkg1hW8HjKyW7SiGpuVf5guLBVLJyU2gYQM6OHjBvfSI/Py36Pc6uscClqC MeDiw5N2FQZwARIcxZc+UuaS3h8m1rsBnGnq4wvHpb9YXNDEENw7LU7wKDjsTKBf5AzHwN vDiCe4USRypkgZe1bk3yoUhR7KuPkt+F/lDyBB+KFVKLzgmkjgGKgJhRtBbbisMyVfUU5k FcXKA/HJrrp+9Ip0/1iptuEGUJhpm0QD2ve1VVmCl6vBf3tDJRGVJOTxccxganw5AQgEjR Wwguaud0e5a9sZhBxJEWuIOP7CRqx0yBuR8s8j6sumMcx8SyNKjVWIfOpqhp/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdNhG50GzzgYj; Tue, 29 Oct 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TLU6Ui020428; Tue, 29 Oct 2024 21:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TLU6q4020423; Tue, 29 Oct 2024 21:30:06 GMT (envelope-from git) Date: Tue, 29 Oct 2024 21:30:06 GMT Message-Id: <202410292130.49TLU6q4020423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 2cb39df0a12f - main - tests: Switch sys/kern/sysctl_security_jail_children to execenv=jail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cb39df0a12fcb80a8debaaeabc44006827a70f1 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=2cb39df0a12fcb80a8debaaeabc44006827a70f1 commit 2cb39df0a12fcb80a8debaaeabc44006827a70f1 Author: Igor Ostapenko AuthorDate: 2024-10-29 21:28:02 +0000 Commit: Igor Ostapenko CommitDate: 2024-10-29 21:28:02 +0000 tests: Switch sys/kern/sysctl_security_jail_children to execenv=jail Kyua skips tests based on the jail execution environment if a system is built WITHOUT_JAIL. Thus, the test case does not need to handle it. Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D47105 --- tests/sys/kern/Makefile | 1 - tests/sys/kern/sysctl_security_jail_children.sh | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 933c1c9aa10e..b2d133a0457f 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -63,7 +63,6 @@ TEST_METADATA.sonewconn_overflow+= required_user="root" TEST_METADATA.sonewconn_overflow+= is_exclusive="true" ATF_TESTS_SH+= sendfile_test ATF_TESTS_SH+= sysctl_security_jail_children -TEST_METADATA.sysctl_security_jail_children+= is_exclusive="true" ${PACKAGE}FILES+= sonewconn_overflow.py ${PACKAGE}FILESMODE_sonewconn_overflow.py=0555 diff --git a/tests/sys/kern/sysctl_security_jail_children.sh b/tests/sys/kern/sysctl_security_jail_children.sh index d4c57915880f..ac990e57ff74 100644 --- a/tests/sys/kern/sysctl_security_jail_children.sh +++ b/tests/sys/kern/sysctl_security_jail_children.sh @@ -24,21 +24,15 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# -# Even being is_exclusive="true" this test does not expect a host to spawn -# other jails during the test execution. -# atf_test_case "max_cur" "cleanup" max_cur_head() { atf_set descr 'Test maximum and current number of child jails' atf_set require.user root + atf_set execenv jail } max_cur_body() { - if ! which -s jail; then - atf_skip "This test requires jail" - fi origin_max=$(sysctl -n security.jail.children.max) origin_cur=$(sysctl -n security.jail.children.cur) From nobody Tue Oct 29 21:51:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdP8n5zmrz5byy7; Tue, 29 Oct 2024 21:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdP8n5Cv0z55vt; Tue, 29 Oct 2024 21:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730238681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w96JnFotI10hqZ+haEbZLguOTAd8Ryz/D5KOO64LDlA=; b=g1DHphnLpik4BBztF4yKH21MjRBvkWBh8X2c7tjUlIqSNllQKAJPmh82+hcWLPxHGP8uSH zXPPMMqa4h2gc+Z2/P8jfCX6NshYhzDMi9wRoPyl4Bya5OLpxRyKn1BTHU8k98IaYrBy7q odYCtAhV7AOmzU65psyiQ8eTOQUaBx5c86BOs/M1Y+2njwdGODGCu48RVbA1w+hUbvXFy/ /RgzPSElNyHzFHMzjOo2KSyXSVibeGzSdsMxfFy1jDFkHUBq4dD1Qq6RNLYf+H67DwgxY8 XUzOAmgzgm7HMUgH2ynaGOtNQ2wvfliVO8g8plQPxLMfPMW+hI/DHxzCuyUECw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730238681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w96JnFotI10hqZ+haEbZLguOTAd8Ryz/D5KOO64LDlA=; b=J0St5nzF/PiQZLuTbgpT30Wd+X6S6nkvQU9aw/I/iFztO6U/EdkofKGqYsyxk1W+LXFoYE +yZPpFuC1ZuIKLvP7kPc+4I/XP5xebRWyCE5JHnWY1BVxkGcLe2ClYq/fFXa2KIlbr0Zj9 baLiT3ZTzvbpfQ4roTQyOP1O7MAxVlT8AsRIMw0ukqtsHs33E9NgczW2ffPBhJw685W19j lUnv4xc+JRlQX8osofPtvc7jsQO+I+AcWhMxk0UTyANoNScWiwt3+CEGJ43wfa99zqUqaE 3B3OBuyqW3bRADqS4UHtM13eaxNMXpHHTTquRiBsKzLYsDL0yNQXquEl7GD3Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730238681; a=rsa-sha256; cv=none; b=o4VYZiGJdlaQvroheo9SXt4pXRjJjboT19iT8AlAZPDWqEuYroTm0UTk2fTL2vz214SMpz 6RsBgP0psdlM9TULQclfo7JCRcEBpMtNk+00g59sTJ7tLUXkXDwutl9oqxvnHuUpNujgy0 j1/nc/HfpOagQA6m8EnqAw65pStAB03eN/MsCUnQw+nt5L98qoaNPl5P+m6bf75eLNjqpD QoE8lUC1gP+5TcVAhgSJOA/JOCJlOEkfCZKS4hjsqZSMNtpl4000hpTk1TEUPKuzbq0djM 6sl/8UO03KX4QkvMBW35cZe1mALznH9dCSHw/LqFMkIY3Tt9bg/4bVE6gfNcGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdP8n4pz9zgsH; Tue, 29 Oct 2024 21:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TLpLNN066209; Tue, 29 Oct 2024 21:51:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TLpLHA066206; Tue, 29 Oct 2024 21:51:21 GMT (envelope-from git) Date: Tue, 29 Oct 2024 21:51:21 GMT Message-Id: <202410292151.49TLpLHA066206@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: b426202aaf76 - stable/14 - Fix gcc uninitialized warning in FreeBSD zio_crypt.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b426202aaf76c0f815db60dc5aa392ac0625b4f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b426202aaf76c0f815db60dc5aa392ac0625b4f6 commit b426202aaf76c0f815db60dc5aa392ac0625b4f6 Author: Dimitry Andric AuthorDate: 2024-10-25 12:51:05 +0000 Commit: Dimitry Andric CommitDate: 2024-10-29 21:49:16 +0000 Fix gcc uninitialized warning in FreeBSD zio_crypt.c With gcc we are seeing the following -Werror warning: In file included from /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h:28, from /workspace/src/sys/contrib/openzfs/include/sys/zfs_context.h:69: In function 'zfs_uio_init', inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1690:2: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'puio_s.uio_offset' is used uninitialized [-Werror=uninitialized] 102 | zfs_uio_soffset(uio) = uio_s->uio_offset; | ~~~~~^~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data': /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:20: note: 'puio_s' declared here 1683 | struct uio puio_s, cuio_s; | ^~~~~~ In function 'zfs_uio_init', inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1691:2: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'cuio_s.uio_offset' is used uninitialized [-Werror=uninitialized] 102 | zfs_uio_soffset(uio) = uio_s->uio_offset; | ~~~~~^~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data': /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:28: note: 'cuio_s' declared here 1683 | struct uio puio_s, cuio_s; | ^~~~~~ Indeed, `zfs_uio_init()` does: static __inline void zfs_uio_init(zfs_uio_t *uio, struct uio *uio_s) { memset(uio, 0, sizeof (zfs_uio_t)); if (uio_s != NULL) { GET_UIO_STRUCT(uio) = uio_s; zfs_uio_soffset(uio) = uio_s->uio_offset; } } while the code in `zio_crypt.c` has: /* * Primary encryption / decryption entrypoint for zio data. */ int zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, dmu_object_type_t ot, boolean_t byteswap, uint8_t *salt, uint8_t *iv, uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf, boolean_t *no_crypt) { int ret; boolean_t locked = B_FALSE; uint64_t crypt = key->zk_crypt; uint_t keydata_len = zio_crypt_table[crypt].ci_keylen; uint_t enc_len, auth_len; zfs_uio_t puio, cuio; struct uio puio_s, cuio_s; uint8_t enc_keydata[MASTER_KEY_MAX_LEN]; crypto_key_t tmp_ckey, *ckey = NULL; freebsd_crypt_session_t *tmpl = NULL; uint8_t *authbuf = NULL; zfs_uio_init(&puio, &puio_s); zfs_uio_init(&cuio, &cuio_s); memset(GET_UIO_STRUCT(&puio), 0, sizeof (struct uio)); memset(GET_UIO_STRUCT(&cuio), 0, sizeof (struct uio)); So between the declaration of `puio_s` and `cuio_s`, there is no initialization of these variables before `zfs_uio_init()` gets called. Similar to the Linux variant of zio_crypt.c, I think it would be better to memset the structs `puio_s` and `cuis_s` _before_ calling `zfs_uio_init()`. Reviewed by: tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47281 (cherry picked from commit 3ceba58a7509418b47b8fca2d2b6bbf088714e26) --- sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c index b08916b317f8..ebf18aaa3403 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c @@ -1692,11 +1692,10 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, freebsd_crypt_session_t *tmpl = NULL; uint8_t *authbuf = NULL; - + memset(&puio_s, 0, sizeof (puio_s)); + memset(&cuio_s, 0, sizeof (cuio_s)); zfs_uio_init(&puio, &puio_s); zfs_uio_init(&cuio, &cuio_s); - memset(GET_UIO_STRUCT(&puio), 0, sizeof (struct uio)); - memset(GET_UIO_STRUCT(&cuio), 0, sizeof (struct uio)); #ifdef FCRYPTO_DEBUG printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n", From nobody Tue Oct 29 21:52:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdPB44Wfyz5bywH; Tue, 29 Oct 2024 21:52: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdPB444D8z56PT; Tue, 29 Oct 2024 21:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730238748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4dTky6q7n53OCOHEeKMJfdVDfS1umj1jRWEy7mbOmw=; b=o0byS4bMzJ+wMD82N7QknlAvM2jfM4LoLTADd+C9q1DHyc+UZSxIeJX60deWTTfWlJH48a cC8DDZIng9X5eW9Ri/hbHoywTyO5SKgjhysst+ur++FWIWwqJqRaRknbjC8wmfRixP0QQj NKzmaevQ07gNLsHpAsqSKvXbHScZZxsq6B7K/kbjN3UmkAmTrxaW2ZJsP9q0QYW94oISl1 6OCVYL1+NcmZ7RVOK9H4FKiGBKl9nUvDY04kGVXqlL12NzsT41WYSRYh3xCcbYsJaLKkG6 zniejeuZqNEM7dHgMhfJD5Gz9gRrjxotlkdTp3Fqx0nhiTvicDXgng+MeQHXCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730238748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4dTky6q7n53OCOHEeKMJfdVDfS1umj1jRWEy7mbOmw=; b=cjREyriCNxqfuMH/ZIpwv+fbXwzadm74n6vP5Fl/SBARgGD+Ix8wqIiame4x4A74afONjG j5/cqiOLMGSz5U0c72nvD50p7sHAc4rP9vrLAsU5M8HVU2k07Wf7934bI+eHMj59VJB267 5G1gWNH9++aUOLOUG8usQVtVta2rgpOAQCaUck6Rz1O+ak7rMKLJr0o9r/IFT7LVmdyEBU 5d89r1F3z8oDa26G+hymTTKfP7IxJv/2AQOToMOaSJMjDnmtm8Zg/WDA8pdpm5O9G38abz U7AYUL0N0LsWV+H91TFhebnLI7W/zOsyGduE5me+rYwwwupCAd39l+FlQO6GXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730238748; a=rsa-sha256; cv=none; b=L0Gz96DorMC9DpmYQkyP1cKsEhOfd2HIwjravngkMJSWML8xjrxElD9iDeJlLvgSMZZrxS Pcwn6LhvKDtIdlOF80bwMlUL1xQ/yhGMtT6PF42leh972IiBupJOOM+9Aq5VcuL5XR93Q1 9H//BtDu3CECxyCWpUVjYbSKM4eAMkdMR1RTscO2jenRaATsoLYGrJCKJ5O9Ye/Brw0G0+ mu5ew6yBp7mmj4jNYlvo2RuwiSrHMLXsLRWfURTXmP9d70aOZEj2sVe2oAz96gsTreqIn8 /miWRCwfo1IZGPyROsBIjI+xOe1PlH5y25uXAdqxagHj4VUbkCgZGO7N+bgsqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdPB43gpzzgsc; Tue, 29 Oct 2024 21:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TLqSuu070131; Tue, 29 Oct 2024 21:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TLqSX2070128; Tue, 29 Oct 2024 21:52:28 GMT (envelope-from git) Date: Tue, 29 Oct 2024 21:52:28 GMT Message-Id: <202410292152.49TLqSX2070128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 4f55232d2d32 - stable/13 - Fix gcc uninitialized warning in FreeBSD zio_crypt.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f55232d2d326cedd1108ead0cecec2442c4feaa Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4f55232d2d326cedd1108ead0cecec2442c4feaa commit 4f55232d2d326cedd1108ead0cecec2442c4feaa Author: Dimitry Andric AuthorDate: 2024-10-25 12:51:05 +0000 Commit: Dimitry Andric CommitDate: 2024-10-29 21:52:14 +0000 Fix gcc uninitialized warning in FreeBSD zio_crypt.c With gcc we are seeing the following -Werror warning: In file included from /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h:28, from /workspace/src/sys/contrib/openzfs/include/sys/zfs_context.h:69: In function 'zfs_uio_init', inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1690:2: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'puio_s.uio_offset' is used uninitialized [-Werror=uninitialized] 102 | zfs_uio_soffset(uio) = uio_s->uio_offset; | ~~~~~^~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data': /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:20: note: 'puio_s' declared here 1683 | struct uio puio_s, cuio_s; | ^~~~~~ In function 'zfs_uio_init', inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1691:2: /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'cuio_s.uio_offset' is used uninitialized [-Werror=uninitialized] 102 | zfs_uio_soffset(uio) = uio_s->uio_offset; | ~~~~~^~~~~~~~~~~~ /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data': /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:28: note: 'cuio_s' declared here 1683 | struct uio puio_s, cuio_s; | ^~~~~~ Indeed, `zfs_uio_init()` does: static __inline void zfs_uio_init(zfs_uio_t *uio, struct uio *uio_s) { memset(uio, 0, sizeof (zfs_uio_t)); if (uio_s != NULL) { GET_UIO_STRUCT(uio) = uio_s; zfs_uio_soffset(uio) = uio_s->uio_offset; } } while the code in `zio_crypt.c` has: /* * Primary encryption / decryption entrypoint for zio data. */ int zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, dmu_object_type_t ot, boolean_t byteswap, uint8_t *salt, uint8_t *iv, uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf, boolean_t *no_crypt) { int ret; boolean_t locked = B_FALSE; uint64_t crypt = key->zk_crypt; uint_t keydata_len = zio_crypt_table[crypt].ci_keylen; uint_t enc_len, auth_len; zfs_uio_t puio, cuio; struct uio puio_s, cuio_s; uint8_t enc_keydata[MASTER_KEY_MAX_LEN]; crypto_key_t tmp_ckey, *ckey = NULL; freebsd_crypt_session_t *tmpl = NULL; uint8_t *authbuf = NULL; zfs_uio_init(&puio, &puio_s); zfs_uio_init(&cuio, &cuio_s); memset(GET_UIO_STRUCT(&puio), 0, sizeof (struct uio)); memset(GET_UIO_STRUCT(&cuio), 0, sizeof (struct uio)); So between the declaration of `puio_s` and `cuio_s`, there is no initialization of these variables before `zfs_uio_init()` gets called. Similar to the Linux variant of zio_crypt.c, I think it would be better to memset the structs `puio_s` and `cuis_s` _before_ calling `zfs_uio_init()`. Reviewed by: tsoome MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47281 (cherry picked from commit 3ceba58a7509418b47b8fca2d2b6bbf088714e26) --- sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c index 9e0ab52a2ea2..9e3181db5af9 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c @@ -1692,11 +1692,10 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, freebsd_crypt_session_t *tmpl = NULL; uint8_t *authbuf = NULL; - + bzero(&puio_s, sizeof (puio_s)); + bzero(&cuio_s, sizeof (cuio_s)); zfs_uio_init(&puio, &puio_s); zfs_uio_init(&cuio, &cuio_s); - bzero(GET_UIO_STRUCT(&puio), sizeof (struct uio)); - bzero(GET_UIO_STRUCT(&cuio), sizeof (struct uio)); #ifdef FCRYPTO_DEBUG printf("%s(%s, %p, %p, %d, %p, %p, %u, %s, %p, %p, %p)\n", From nobody Tue Oct 29 22:17:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdPlL2PVmz5c1sr; Tue, 29 Oct 2024 22:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdPlL1ql7z59HH; Tue, 29 Oct 2024 22:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730240270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vwrwUpKYNhYBb9DaT1m/fF+jBfLqOiYP37iFRgQ6cNM=; b=SH26M9x88ub+bKcPFbeAc8jMvzVTI4dOUMnLbMz2sWm5gjECQGNXhpsxwlbnaR+CGtJRMx BZLWM95Ix7uAQ7ArVHrXl0emz5RWMtnCCqH3x2YUHx6axDpH50Tp7FcVKAGPwV/mzmL8PA cRNeglEdqupuzj/JC3L90g8OQHQ1VZ+fHogzFUQHqg+HlKzu90TzcVdyBLhONxoRvlncek iMB5CmIV4JSmWcHKVZJ3QjWbJ8UIe3W1OKx2fzEfXZ9/k8md5Jp5/8BwHv5QaGA5KtlB2k AMTEkeoTAal8wG+RNcpma/73jOrA5ukxPC7yBF6ooWPpyCCevQSD3ELIZe2uhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730240270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vwrwUpKYNhYBb9DaT1m/fF+jBfLqOiYP37iFRgQ6cNM=; b=LBJOb2QYTtG8PcY6HI/wRq4tSz96XULbMq+dFM1l2kN2ilCeDS91vgIU1vrO08MJNxp7bH Yz9whZzLy0wrRe+4mBfzB2GFQRUZpZOxdIjODleIQxLHIhM8MAUEJZg81phuQWQggV5X2i 4kgQYbzLdNH3Ql4BScdsnruLH+XitaEh8WPzy6bSdQ1LjsQbM5Ea9zuhAGQyMCx5DpetFO PLOgrErKc3Yr1k7xcHAnnybQBgOwMrgavNe5lXNnXMYx5wj28tcVdm7bK25aiZ3YangOAU HeXSQCQVwkwsKi/nkTkm0NUMnJyz3z0Licym1FABFLXlEqPOPoAYMTni0leN1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730240270; a=rsa-sha256; cv=none; b=m8L0TvrbeIZ+NOEpF6PzbAM7n1w1/d6JriIMC9QjqKaTDZgXYjmeMaMJByLcYn+iycs14u SCkUXjDkiwP1fsjMTP446nvjfEgI9065wqul+MJldw2m+qd+ZX5rSsE35t3K6SgtCtUKAZ uwPYfvdWNUMJriAryovWe5eiHo/TwgW4Up5VDcdtbh46HvZ5elwEuH8PH52fkXSx0qAZsL 0YZkr8/MqPZQ5pePoA5pABk0RXMX5bwlQ3mjKYMuNLUYk7CiiSCv5EUKU4wXXwjN1kZiD+ uO/bhcXOIaJ0DwrFdErmWOqS+IsGz2r/i+3zXZdLrSKArWSqcqXx9a7BM8mSTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdPlL0jygzhKD; Tue, 29 Oct 2024 22:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TMHo7g009618; Tue, 29 Oct 2024 22:17:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TMHnKF009615; Tue, 29 Oct 2024 22:17:49 GMT (envelope-from git) Date: Tue, 29 Oct 2024 22:17:49 GMT Message-Id: <202410292217.49TMHnKF009615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 17a7ea7e3e39 - stable/14 - libcxxrt: Update to upstream 698997bfde1f List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 17a7ea7e3e39cdfb1b367b27c7b38fb0ea6c0806 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=17a7ea7e3e39cdfb1b367b27c7b38fb0ea6c0806 commit 17a7ea7e3e39cdfb1b367b27c7b38fb0ea6c0806 Author: Ed Maste AuthorDate: 2024-10-22 23:40:09 +0000 Commit: Ed Maste CommitDate: 2024-10-29 22:17:05 +0000 libcxxrt: Update to upstream 698997bfde1f Interesting fixes: 045c52c Mark __cxa_allocate_exception, __cxa_free_exception and __cxa_init_primary_exception noexcept. 8a2f123 Define _LIBCXXRT_NOEXCEPT in cxxabi.h and use it instead of throw() 9529236 Fix memory corruption in cpp_demangle_read_sname() 8f5c74e Add test cases, fix more bugs, and improve perf 391a3dc Add a simple implementation of __cxa_call_terminate 40e4fa2 mark std::terminate as noreturn and noexcept 5eede09 Print diagnostics in default std::terminate handler Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47238 (cherry picked from commit 13da1af1cd677b7901d3bf4b9dbe3290b94130d5) --- contrib/libcxxrt/atomic.h | 2 +- contrib/libcxxrt/cxxabi.h | 17 +++- contrib/libcxxrt/exception.cc | 174 ++++++++++++++++++----------------- contrib/libcxxrt/libelftc_dem_gnu3.c | 92 +++++++++--------- contrib/libcxxrt/memory.cc | 14 ++- contrib/libcxxrt/noexception.cc | 4 +- contrib/libcxxrt/stdexcept.cc | 40 ++++---- contrib/libcxxrt/stdexcept.h | 42 +++++---- 8 files changed, 196 insertions(+), 189 deletions(-) diff --git a/contrib/libcxxrt/atomic.h b/contrib/libcxxrt/atomic.h index 701d05337cf1..0768c08038df 100644 --- a/contrib/libcxxrt/atomic.h +++ b/contrib/libcxxrt/atomic.h @@ -56,7 +56,7 @@ namespace /** * Constructor, takes a value. */ - atomic(T init) : val(init) {} + constexpr atomic(T init) : val(init) {} /** * Atomically load with the specified memory order. diff --git a/contrib/libcxxrt/cxxabi.h b/contrib/libcxxrt/cxxabi.h index ef4076a08a0a..2bf7f99b5245 100644 --- a/contrib/libcxxrt/cxxabi.h +++ b/contrib/libcxxrt/cxxabi.h @@ -41,8 +41,15 @@ namespace std */ #ifdef __cplusplus +#if __cplusplus < 201103L +#define _LIBCXXRT_NOEXCEPT throw() +#else +#define _LIBCXXRT_NOEXCEPT noexcept +#endif namespace __cxxabiv1 { extern "C" { +#else +#define _LIBCXXRT_NOEXCEPT #endif /** * Function type to call when an unexpected exception is encountered. @@ -76,7 +83,7 @@ typedef void (*terminate_handler)(); */ struct __cxa_exception { -#if __LP64__ +#ifdef __LP64__ /** * Now _Unwind_Exception is marked with __attribute__((aligned)), which * implies __cxa_exception is also aligned. Insert padding in the @@ -154,7 +161,7 @@ struct __cxa_exception * need to adjust the thrown pointer to make it all work correctly. */ void *adjustedPtr; -#if !__LP64__ +#ifndef __LP64__ /** * Reference count. Used to support the C++11 exception_ptr class. This * is prepended to the structure in 64-bit mode and squeezed in to the @@ -204,12 +211,12 @@ __cxa_eh_globals *__cxa_get_globals_fast(void); std::type_info * __cxa_current_exception_type(); -void *__cxa_allocate_exception(size_t thrown_size) throw(); +void *__cxa_allocate_exception(size_t thrown_size) _LIBCXXRT_NOEXCEPT; -void __cxa_free_exception(void* thrown_exception) throw(); +void __cxa_free_exception(void* thrown_exception) _LIBCXXRT_NOEXCEPT; __cxa_exception *__cxa_init_primary_exception( - void *object, std::type_info* tinfo, void (*dest)(void *)) throw(); + void *object, std::type_info* tinfo, void (*dest)(void *)) _LIBCXXRT_NOEXCEPT; /** * Throws an exception returned by __cxa_current_primary_exception(). This diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index b56333e979a2..c87fe5ac4468 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -121,7 +121,7 @@ static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex } -extern "C" void __cxa_free_exception(void *thrown_exception) throw(); +extern "C" void __cxa_free_exception(void *thrown_exception) _LIBCXXRT_NOEXCEPT; extern "C" void __cxa_free_dependent_exception(void *thrown_exception); extern "C" void* __dynamic_cast(const void *sub, const __class_type_info *src, @@ -198,7 +198,7 @@ struct __cxa_thread_info */ struct __cxa_dependent_exception { -#if __LP64__ +#ifdef __LP64__ void *reserve; void *primaryException; #endif @@ -217,7 +217,7 @@ struct __cxa_dependent_exception const char *languageSpecificData; void *catchTemp; void *adjustedPtr; -#if !__LP64__ +#ifndef __LP64__ void *primaryException; #endif _Unwind_Exception unwindHeader; @@ -241,8 +241,8 @@ namespace std class exception { public: - virtual ~exception() throw(); - virtual const char* what() const throw(); + virtual ~exception() _LIBCXXRT_NOEXCEPT; + virtual const char* what() const _LIBCXXRT_NOEXCEPT; }; } @@ -296,15 +296,80 @@ namespace std { // Forward declaration of standard library terminate() function used to // abort execution. - void terminate(void); + [[noreturn]] void terminate(void) _LIBCXXRT_NOEXCEPT; } using namespace ABI_NAMESPACE; +#ifdef LIBCXXRT_NO_DEFAULT_TERMINATE_DIAGNOSTICS +/** The global termination handler. */ +static atomic terminateHandler = abort; +#else +/** + * Callback function used with _Unwind_Backtrace(). + * + * Prints a stack trace. Used only for debugging help. + * + * Note: As of FreeBSD 8.1, dladdr() still doesn't work properly, so this only + * correctly prints function names from public, relocatable, symbols. + */ +static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c) +{ + Dl_info myinfo; + int mylookup = + dladdr(reinterpret_cast(__cxa_current_exception_type), &myinfo); + void *ip = reinterpret_cast(_Unwind_GetIP(context)); + Dl_info info; + if (dladdr(ip, &info) != 0) + { + if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0) + { + printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname); + } + } + return _URC_CONTINUE_UNWIND; +} + +static void terminate_with_diagnostics() { + __cxa_eh_globals *globals = __cxa_get_globals(); + __cxa_exception *ex = globals->caughtExceptions; + + if (ex != nullptr) { + fprintf(stderr, "Terminating due to uncaught exception %p", static_cast(ex)); + ex = realExceptionFromException(ex); + static const __class_type_info *e_ti = + static_cast(&typeid(std::exception)); + const __class_type_info *throw_ti = + dynamic_cast(ex->exceptionType); + if (throw_ti) + { + std::exception *e = + static_cast(e_ti->cast_to(static_cast(ex+1), throw_ti)); + if (e) + { + fprintf(stderr, " '%s'", e->what()); + } + } + + size_t bufferSize = 128; + char *demangled = static_cast(malloc(bufferSize)); + const char *mangled = ex->exceptionType->name(); + int status; + demangled = __cxa_demangle(mangled, demangled, &bufferSize, &status); + fprintf(stderr, " of type %s\n", + status == 0 ? demangled : mangled); + if (status == 0) { free(demangled); } + + _Unwind_Backtrace(trace, 0); + } + abort(); +} /** The global termination handler. */ -static atomic terminateHandler = abort; +static atomic terminateHandler = terminate_with_diagnostics; +#endif + /** The global unexpected exception handler. */ static atomic unexpectedHandler = std::terminate; @@ -611,7 +676,7 @@ static void free_exception(char *e) * emergency buffer if malloc() fails, and may block if there are no such * buffers available. */ -extern "C" void *__cxa_allocate_exception(size_t thrown_size) throw() +extern "C" void *__cxa_allocate_exception(size_t thrown_size) _LIBCXXRT_NOEXCEPT { size_t size = thrown_size + sizeof(__cxa_exception); char *buffer = alloc_or_die(size); @@ -633,7 +698,7 @@ extern "C" void *__cxa_allocate_dependent_exception(void) * In this implementation, it is also called by __cxa_end_catch() and during * thread cleanup. */ -extern "C" void __cxa_free_exception(void *thrown_exception) throw() +extern "C" void __cxa_free_exception(void *thrown_exception) _LIBCXXRT_NOEXCEPT { __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(thrown_exception) - 1; // Free the object that was thrown, calling its destructor @@ -680,39 +745,15 @@ void __cxa_free_dependent_exception(void *thrown_exception) free_exception(reinterpret_cast(ex)); } -/** - * Callback function used with _Unwind_Backtrace(). - * - * Prints a stack trace. Used only for debugging help. - * - * Note: As of FreeBSD 8.1, dladd() still doesn't work properly, so this only - * correctly prints function names from public, relocatable, symbols. - */ -static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c) -{ - Dl_info myinfo; - int mylookup = - dladdr(reinterpret_cast(__cxa_current_exception_type), &myinfo); - void *ip = reinterpret_cast(_Unwind_GetIP(context)); - Dl_info info; - if (dladdr(ip, &info) != 0) - { - if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0) - { - printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname); - } - } - return _URC_CONTINUE_UNWIND; -} - /** * Report a failure that occurred when attempting to throw an exception. * * If the failure happened by falling off the end of the stack without finding - * a handler, prints a back trace before aborting. + * a handler, catch the exception before calling terminate. The default + * terminate handler will print a backtrace before aborting. */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -extern "C" void *__cxa_begin_catch(void *e) throw(); +extern "C" void *__cxa_begin_catch(void *e) _LIBCXXRT_NOEXCEPT; #else extern "C" void *__cxa_begin_catch(void *e); #endif @@ -731,41 +772,6 @@ static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exce #endif case _URC_END_OF_STACK: __cxa_begin_catch (&(thrown_exception->unwindHeader)); - std::terminate(); - fprintf(stderr, "Terminating due to uncaught exception %p", - static_cast(thrown_exception)); - thrown_exception = realExceptionFromException(thrown_exception); - static const __class_type_info *e_ti = - static_cast(&typeid(std::exception)); - const __class_type_info *throw_ti = - dynamic_cast(thrown_exception->exceptionType); - if (throw_ti) - { - std::exception *e = - static_cast(e_ti->cast_to(static_cast(thrown_exception+1), - throw_ti)); - if (e) - { - fprintf(stderr, " '%s'", e->what()); - } - } - - size_t bufferSize = 128; - char *demangled = static_cast(malloc(bufferSize)); - const char *mangled = thrown_exception->exceptionType->name(); - int status; - demangled = __cxa_demangle(mangled, demangled, &bufferSize, &status); - fprintf(stderr, " of type %s\n", - status == 0 ? demangled : mangled); - if (status == 0) { free(demangled); } - // Print a back trace if no handler is found. - // TODO: Make this optional -#ifndef __arm__ - _Unwind_Backtrace(trace, 0); -#endif - - // Just abort. No need to call std::terminate for the second time - abort(); break; } std::terminate(); @@ -794,7 +800,7 @@ static void throw_exception(__cxa_exception *ex) } extern "C" __cxa_exception *__cxa_init_primary_exception( - void *object, std::type_info* tinfo, void (*dest)(void *)) throw() { + void *object, std::type_info* tinfo, void (*dest)(void *)) _LIBCXXRT_NOEXCEPT { __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(object) - 1; ex->referenceCount = 0; @@ -1245,7 +1251,7 @@ BEGIN_PERSONALITY_FUNCTION(__gxx_personality_v0) * C++ exceptions) of the unadjusted pointer (for foreign exceptions). */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -extern "C" void *__cxa_begin_catch(void *e) throw() +extern "C" void *__cxa_begin_catch(void *e) _LIBCXXRT_NOEXCEPT #else extern "C" void *__cxa_begin_catch(void *e) #endif @@ -1439,7 +1445,7 @@ extern "C" void __cxa_call_unexpected(void*exception) * * This function does not return. */ -extern "C" void __cxa_call_terminate(void *exception) throw() +extern "C" void __cxa_call_terminate(void*exception) _LIBCXXRT_NOEXCEPT { std::terminate(); // Should not be reached. @@ -1467,14 +1473,14 @@ namespace pathscale /** * Sets whether unexpected and terminate handlers should be thread-local. */ - void set_use_thread_local_handlers(bool flag) throw() + void set_use_thread_local_handlers(bool flag) _LIBCXXRT_NOEXCEPT { thread_local_handlers = flag; } /** * Sets a thread-local unexpected handler. */ - unexpected_handler set_unexpected(unexpected_handler f) throw() + unexpected_handler set_unexpected(unexpected_handler f) _LIBCXXRT_NOEXCEPT { static __cxa_thread_info *info = thread_info(); unexpected_handler old = info->unexpectedHandler; @@ -1484,7 +1490,7 @@ namespace pathscale /** * Sets a thread-local terminate handler. */ - terminate_handler set_terminate(terminate_handler f) throw() + terminate_handler set_terminate(terminate_handler f) _LIBCXXRT_NOEXCEPT { static __cxa_thread_info *info = thread_info(); terminate_handler old = info->terminateHandler; @@ -1499,7 +1505,7 @@ namespace std * Sets the function that will be called when an exception specification is * violated. */ - unexpected_handler set_unexpected(unexpected_handler f) throw() + unexpected_handler set_unexpected(unexpected_handler f) _LIBCXXRT_NOEXCEPT { if (thread_local_handlers) { return pathscale::set_unexpected(f); } @@ -1508,7 +1514,7 @@ namespace std /** * Sets the function that is called to terminate the program. */ - terminate_handler set_terminate(terminate_handler f) throw() + terminate_handler set_terminate(terminate_handler f) _LIBCXXRT_NOEXCEPT { if (thread_local_handlers) { return pathscale::set_terminate(f); } @@ -1518,7 +1524,7 @@ namespace std * Terminates the program, calling a custom terminate implementation if * required. */ - void terminate() + [[noreturn]] void terminate() _LIBCXXRT_NOEXCEPT { static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->terminateHandler) @@ -1551,7 +1557,7 @@ namespace std * Returns whether there are any exceptions currently being thrown that * have not been caught. This can occur inside a nested catch statement. */ - bool uncaught_exception() throw() + bool uncaught_exception() _LIBCXXRT_NOEXCEPT { __cxa_thread_info *info = thread_info(); return info->globals.uncaughtExceptions != 0; @@ -1560,7 +1566,7 @@ namespace std * Returns the number of exceptions currently being thrown that have not * been caught. This can occur inside a nested catch statement. */ - int uncaught_exceptions() throw() + int uncaught_exceptions() _LIBCXXRT_NOEXCEPT { __cxa_thread_info *info = thread_info(); return info->globals.uncaughtExceptions; @@ -1568,7 +1574,7 @@ namespace std /** * Returns the current unexpected handler. */ - unexpected_handler get_unexpected() throw() + unexpected_handler get_unexpected() _LIBCXXRT_NOEXCEPT { __cxa_thread_info *info = thread_info(); if (info->unexpectedHandler) @@ -1580,7 +1586,7 @@ namespace std /** * Returns the current terminate handler. */ - terminate_handler get_terminate() throw() + terminate_handler get_terminate() _LIBCXXRT_NOEXCEPT { __cxa_thread_info *info = thread_info(); if (info->terminateHandler) diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c index e75d1694562e..36e98deb1d2f 100644 --- a/contrib/libcxxrt/libelftc_dem_gnu3.c +++ b/contrib/libcxxrt/libelftc_dem_gnu3.c @@ -200,9 +200,9 @@ vector_str_find(const struct vector_str *v, const char *o, size_t l) static char * vector_str_get_flat(const struct vector_str *v, size_t *l) { - ssize_t elem_pos, elem_size, rtn_size; size_t i; - char *rtn; + char *rtn, *p; + ssize_t rtn_size; if (v == NULL || v->size == 0) return (NULL); @@ -213,16 +213,9 @@ vector_str_get_flat(const struct vector_str *v, size_t *l) if ((rtn = malloc(sizeof(char) * (rtn_size + 1))) == NULL) return (NULL); - elem_pos = 0; - for (i = 0; i < v->size; ++i) { - elem_size = strlen(v->container[i]); - - memcpy(rtn + elem_pos, v->container[i], elem_size); - - elem_pos += elem_size; - } - - rtn[rtn_size] = '\0'; + p = rtn; + for (i = 0; i < v->size; ++i) + p = stpcpy(p, v->container[i]); if (l != NULL) *l = rtn_size; @@ -305,6 +298,21 @@ vector_str_pop(struct vector_str *v) return (true); } +/** + * @brief Implements strlcpy() without result. + */ +static void +copy_string(char *dst, const char *src, size_t dsize) +{ + size_t remain; + if ((remain = dsize)) + while (--remain) + if (!(*dst++ = *src++)) + break; + if (!remain && dsize) + *dst = 0; +} + /** * @brief Push back string to vector. * @return false at failed, true at success. @@ -322,7 +330,7 @@ vector_str_push(struct vector_str *v, const char *str, size_t len) if ((v->container[v->size] = malloc(sizeof(char) * (len + 1))) == NULL) return (false); - snprintf(v->container[v->size], len + 1, "%s", str); + copy_string(v->container[v->size], str, len + 1); ++v->size; @@ -420,8 +428,8 @@ static char * vector_str_substr(const struct vector_str *v, size_t begin, size_t end, size_t *r_len) { - size_t cur, i, len; - char *rtn; + char *rtn, *p; + size_t i, len; if (v == NULL || begin > end) return (NULL); @@ -436,13 +444,9 @@ vector_str_substr(const struct vector_str *v, size_t begin, size_t end, if (r_len != NULL) *r_len = len; - cur = 0; - for (i = begin; i < end + 1; ++i) { - len = strlen(v->container[i]); - memcpy(rtn + cur, v->container[i], len); - cur += len; - } - rtn[cur] = '\0'; + p = rtn; + for (i = begin; i < end + 1; ++i) + p = stpcpy(p, v->container[i]); return (rtn); } @@ -2510,61 +2514,56 @@ cpp_demangle_read_subst(struct cpp_demangle_data *ddata) return (1); case SIMPLE_HASH('S', 'd'): - /* std::basic_iostream > */ + /* std::basic_iostream> */ if (!DEM_PUSH_STR(ddata, "std::basic_iostream >")) + "std::char_traits>")) return (0); ddata->last_sname = "basic_iostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, "std::basic_iostream >")); + ">")); return (1); case SIMPLE_HASH('S', 'i'): - /* std::basic_istream > */ + /* std::basic_istream> */ if (!DEM_PUSH_STR(ddata, "std::basic_istream >")) + "std::char_traits>")) return (0); ddata->last_sname = "basic_istream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, "std::basic_istream >")); + ">")); return (1); case SIMPLE_HASH('S', 'o'): - /* std::basic_ostream > */ + /* std::basic_ostream> */ if (!DEM_PUSH_STR(ddata, "std::basic_ostream >")) + "std::char_traits>")) return (0); ddata->last_sname = "basic_ostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, "std::basic_ostream >")); + ">")); return (1); case SIMPLE_HASH('S', 's'): /* - * std::basic_string, - * std::allocator > - * - * a.k.a std::string + * std::string for consistency with libcxxabi */ - if (!DEM_PUSH_STR(ddata, "std::basic_string, std::allocator >")) - return (0); + if (!DEM_PUSH_STR(ddata, "std::string")) + return 0; ddata->last_sname = "string"; ddata->cur += 2; if (*ddata->cur == 'I') - return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::basic_string," - " std::allocator >")); - return (1); + return cpp_demangle_read_subst_stdtmpl(ddata, + "std::string"); + return 1; case SIMPLE_HASH('S', 't'): /* std:: */ @@ -2740,7 +2739,7 @@ static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *ddata) { struct vector_str *v; - size_t arg_len, idx, limit, size; + size_t arg_len, idx, limit; char *arg; if (ddata == NULL || *ddata->cur == '\0') @@ -2773,12 +2772,7 @@ cpp_demangle_read_tmpl_args(struct cpp_demangle_data *ddata) if (*ddata->cur == 'E') { ++ddata->cur; - size = v->size; - assert(size > 0); - if (!strncmp(v->container[size - 1], ">", 1)) { - if (!DEM_PUSH_STR(ddata, " >")) - return (0); - } else if (!DEM_PUSH_STR(ddata, ">")) + if (!DEM_PUSH_STR(ddata, ">")) return (0); ddata->is_tmpl = true; break; diff --git a/contrib/libcxxrt/memory.cc b/contrib/libcxxrt/memory.cc index 7beb048ae914..0702f63f4527 100644 --- a/contrib/libcxxrt/memory.cc +++ b/contrib/libcxxrt/memory.cc @@ -73,10 +73,8 @@ namespace std #if __cplusplus < 201103L -#define NOEXCEPT throw() #define BADALLOC throw(std::bad_alloc) #else -#define NOEXCEPT noexcept #define BADALLOC #endif @@ -138,14 +136,14 @@ void* operator new(size_t size) BADALLOC __attribute__((weak)) -void* operator new(size_t size, const std::nothrow_t &) NOEXCEPT +void* operator new(size_t size, const std::nothrow_t &) _LIBCXXRT_NOEXCEPT { return noexcept_new<(::operator new)>(size); } __attribute__((weak)) -void operator delete(void * ptr) NOEXCEPT +void operator delete(void * ptr) _LIBCXXRT_NOEXCEPT { free(ptr); } @@ -159,14 +157,14 @@ void * operator new[](size_t size) BADALLOC __attribute__((weak)) -void * operator new[](size_t size, const std::nothrow_t &) NOEXCEPT +void * operator new[](size_t size, const std::nothrow_t &) _LIBCXXRT_NOEXCEPT { return noexcept_new<(::operator new[])>(size); } __attribute__((weak)) -void operator delete[](void * ptr) NOEXCEPT +void operator delete[](void * ptr) _LIBCXXRT_NOEXCEPT { ::operator delete(ptr); } @@ -176,14 +174,14 @@ void operator delete[](void * ptr) NOEXCEPT #if __cplusplus >= 201402L __attribute__((weak)) -void operator delete(void * ptr, size_t) NOEXCEPT +void operator delete(void * ptr, size_t) _LIBCXXRT_NOEXCEPT { ::operator delete(ptr); } __attribute__((weak)) -void operator delete[](void * ptr, size_t) NOEXCEPT +void operator delete[](void * ptr, size_t) _LIBCXXRT_NOEXCEPT { ::operator delete(ptr); } diff --git a/contrib/libcxxrt/noexception.cc b/contrib/libcxxrt/noexception.cc index 25dac1279684..7d17920c7cf4 100644 --- a/contrib/libcxxrt/noexception.cc +++ b/contrib/libcxxrt/noexception.cc @@ -30,7 +30,7 @@ namespace std * Returns whether there are any exceptions currently being thrown that * have not been caught. Without exception support this is always false. */ - bool uncaught_exception() throw() + bool uncaught_exception() _LIBCXXRT_NOEXCEPT { return false; } @@ -38,7 +38,7 @@ namespace std * Returns the number of exceptions currently being thrown that have not * been caught. Without exception support this is always 0. */ - int uncaught_exceptions() throw() + int uncaught_exceptions() _LIBCXXRT_NOEXCEPT { return 0; } diff --git a/contrib/libcxxrt/stdexcept.cc b/contrib/libcxxrt/stdexcept.cc index c1cea39f6aa6..22c6930dca6b 100644 --- a/contrib/libcxxrt/stdexcept.cc +++ b/contrib/libcxxrt/stdexcept.cc @@ -31,66 +31,66 @@ namespace std { -exception::exception() throw() {} +exception::exception() _LIBCXXRT_NOEXCEPT {} exception::~exception() {} -exception::exception(const exception&) throw() {} -exception& exception::operator=(const exception&) throw() +exception::exception(const exception&) _LIBCXXRT_NOEXCEPT {} +exception& exception::operator=(const exception&) _LIBCXXRT_NOEXCEPT { return *this; } -const char* exception::what() const throw() +const char* exception::what() const _LIBCXXRT_NOEXCEPT { return "std::exception"; } -bad_alloc::bad_alloc() throw() {} +bad_alloc::bad_alloc() _LIBCXXRT_NOEXCEPT {} bad_alloc::~bad_alloc() {} -bad_alloc::bad_alloc(const bad_alloc&) throw() {} -bad_alloc& bad_alloc::operator=(const bad_alloc&) throw() +bad_alloc::bad_alloc(const bad_alloc&) _LIBCXXRT_NOEXCEPT {} +bad_alloc& bad_alloc::operator=(const bad_alloc&) _LIBCXXRT_NOEXCEPT { return *this; } -const char* bad_alloc::what() const throw() +const char* bad_alloc::what() const _LIBCXXRT_NOEXCEPT { return "cxxrt::bad_alloc"; } -bad_cast::bad_cast() throw() {} +bad_cast::bad_cast() _LIBCXXRT_NOEXCEPT {} bad_cast::~bad_cast() {} -bad_cast::bad_cast(const bad_cast&) throw() {} -bad_cast& bad_cast::operator=(const bad_cast&) throw() +bad_cast::bad_cast(const bad_cast&) _LIBCXXRT_NOEXCEPT {} +bad_cast& bad_cast::operator=(const bad_cast&) _LIBCXXRT_NOEXCEPT { return *this; } -const char* bad_cast::what() const throw() +const char* bad_cast::what() const _LIBCXXRT_NOEXCEPT { return "std::bad_cast"; } -bad_typeid::bad_typeid() throw() {} +bad_typeid::bad_typeid() _LIBCXXRT_NOEXCEPT {} bad_typeid::~bad_typeid() {} -bad_typeid::bad_typeid(const bad_typeid &__rhs) throw() {} -bad_typeid& bad_typeid::operator=(const bad_typeid &__rhs) throw() +bad_typeid::bad_typeid(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT {} +bad_typeid& bad_typeid::operator=(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT { return *this; } -const char* bad_typeid::what() const throw() +const char* bad_typeid::what() const _LIBCXXRT_NOEXCEPT { return "std::bad_typeid"; } -bad_array_new_length::bad_array_new_length() throw() {} +bad_array_new_length::bad_array_new_length() _LIBCXXRT_NOEXCEPT {} bad_array_new_length::~bad_array_new_length() {} -bad_array_new_length::bad_array_new_length(const bad_array_new_length&) throw() {} -bad_array_new_length& bad_array_new_length::operator=(const bad_array_new_length&) throw() +bad_array_new_length::bad_array_new_length(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT {} +bad_array_new_length& bad_array_new_length::operator=(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT { return *this; } -const char* bad_array_new_length::what() const throw() +const char* bad_array_new_length::what() const _LIBCXXRT_NOEXCEPT { return "std::bad_array_new_length"; } diff --git a/contrib/libcxxrt/stdexcept.h b/contrib/libcxxrt/stdexcept.h index 892039357595..38cd36d8e566 100644 --- a/contrib/libcxxrt/stdexcept.h +++ b/contrib/libcxxrt/stdexcept.h @@ -29,17 +29,19 @@ * of the exceptions for the runtime to use. */ +#include "cxxabi.h" + namespace std { class exception { public: - exception() throw(); - exception(const exception&) throw(); - exception& operator=(const exception&) throw(); + exception() _LIBCXXRT_NOEXCEPT; + exception(const exception&) _LIBCXXRT_NOEXCEPT; + exception& operator=(const exception&) _LIBCXXRT_NOEXCEPT; virtual ~exception(); - virtual const char* what() const throw(); + virtual const char* what() const _LIBCXXRT_NOEXCEPT; }; @@ -49,11 +51,11 @@ namespace std class bad_alloc: public exception { public: - bad_alloc() throw(); - bad_alloc(const bad_alloc&) throw(); - bad_alloc& operator=(const bad_alloc&) throw(); + bad_alloc() _LIBCXXRT_NOEXCEPT; + bad_alloc(const bad_alloc&) _LIBCXXRT_NOEXCEPT; + bad_alloc& operator=(const bad_alloc&) _LIBCXXRT_NOEXCEPT; ~bad_alloc(); - virtual const char* what() const throw(); + virtual const char* what() const _LIBCXXRT_NOEXCEPT; }; /** @@ -61,11 +63,11 @@ namespace std */ class bad_cast: public exception { public: - bad_cast() throw(); - bad_cast(const bad_cast&) throw(); - bad_cast& operator=(const bad_cast&) throw(); + bad_cast() _LIBCXXRT_NOEXCEPT; + bad_cast(const bad_cast&) _LIBCXXRT_NOEXCEPT; + bad_cast& operator=(const bad_cast&) _LIBCXXRT_NOEXCEPT; virtual ~bad_cast(); - virtual const char* what() const throw(); + virtual const char* what() const _LIBCXXRT_NOEXCEPT; }; /** @@ -74,21 +76,21 @@ namespace std class bad_typeid: public exception { public: - bad_typeid() throw(); - bad_typeid(const bad_typeid &__rhs) throw(); + bad_typeid() _LIBCXXRT_NOEXCEPT; + bad_typeid(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT; virtual ~bad_typeid(); - bad_typeid& operator=(const bad_typeid &__rhs) throw(); - virtual const char* what() const throw(); + bad_typeid& operator=(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT; + virtual const char* what() const _LIBCXXRT_NOEXCEPT; }; class bad_array_new_length: public bad_alloc { public: - bad_array_new_length() throw(); - bad_array_new_length(const bad_array_new_length&) throw(); - bad_array_new_length& operator=(const bad_array_new_length&) throw(); + bad_array_new_length() _LIBCXXRT_NOEXCEPT; + bad_array_new_length(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT; + bad_array_new_length& operator=(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT; virtual ~bad_array_new_length(); - virtual const char *what() const throw(); + virtual const char *what() const _LIBCXXRT_NOEXCEPT; }; From nobody Tue Oct 29 23:13:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdQz82d0rz5b6Sw; Tue, 29 Oct 2024 23:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdQz81v5Qz43Jq; Tue, 29 Oct 2024 23:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730243588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jj2CoKv1jp6ttbqyKvV2tygoLDgcI8PARWEURFX6KV8=; b=qSBeJ0aN0nxlK4BaRvOhp7dp8pW1kDmH/V6qe780VigddHz6g7l0tQhWHsH3ZgcziHPny6 ZLwr8BUmx6vo2gxdcVYpxCbEcdzNCNR/ShtNIy0J11rb9dNEPpXSwf9fV6/xRIni36J7Gk Rv/1Ic9+6C3W2U/ktApYlJuZBl5NPxUmeBBYPXxuo79mE51Tm2NFfIiss7cfuYS19TSQEx 7K8g9YLeK+9EsJ79TusPyRqm7ETEA60OwodYCGH5WKZ4sGIcmlbBlcBlelRoFitCLE8vW8 uCe2GjM702KZiKo2+d0QxogFNpvgfpaAII4smfoOU3LYc2ijawhBrNmZfL63Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730243588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jj2CoKv1jp6ttbqyKvV2tygoLDgcI8PARWEURFX6KV8=; b=asby2LQ8LOJJ8QyT/81c3sSdmTFQyrGf7DWkqATbmAH+qhNDhRwDHuWw530bm0d+s7Ytpw MiFw99oDr4T/lMQi4e8zfHOjEPCmRwsOUleQmZpN8v9EG+uYtcH7dM6260+imk62sVYGkP woDyR7Odvhq/9xNsFeQY1osFy2sg2F3C0vv33P11lxIldvQaonrijS8nexOP+jn7U0OaVw oqZaMdJDtoHcF7MYaZh7+t7CXHjuR8QDVd7gVRjtN+Vob+eSjxQhtNoSSC5yJePFIGO16j aPj8ngoXK11p/QBytP75y91BO4/9sQ4WphKvcWmU4JiJGAJCp/2wLlaqsIDc9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730243588; a=rsa-sha256; cv=none; b=DcvL++EMp4GmNNrD8a4pttu8PvaGkWcxTrGseHoDW/jhlAcZfX7VjyAH6UoRAn00nuCD6E 25PFhCc1S/gRSVPy4KonsmTE3SwraLjav0ESKC9CP9ldRXGYqoBOacgUIhEskH1+Y8GmI+ qifR4lOy8akR3DF/dd/iwEF7GqHUa3ymfilF5iami3zMNOVxBKZB3SxIo9mNkf6qtEN2iZ siX4DdierdKG5tLXNvO+EIDIEHQxbPdWOWiRYc76B4M9PHLDi43lLUKNDM3DCqWgdxUmr0 +IScVAllsRpgFFuhzpQsP1mZWkp9UJLEjL8xeowGsPdcMfwpbO0XWqe3MyPTGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdQz81T52zk9l; Tue, 29 Oct 2024 23:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TND8UX019491; Tue, 29 Oct 2024 23:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TND8V7019488; Tue, 29 Oct 2024 23:13:08 GMT (envelope-from git) Date: Tue, 29 Oct 2024 23:13:08 GMT Message-Id: <202410292313.49TND8V7019488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 0ffd7d4d15d4 - main - acpi_gpiobus: IoRestriction is only for type IO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ffd7d4d15d468c60ef274f8368a5722e3f7f6a1 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0ffd7d4d15d468c60ef274f8368a5722e3f7f6a1 commit 0ffd7d4d15d468c60ef274f8368a5722e3f7f6a1 Author: Colin Percival AuthorDate: 2024-10-29 16:32:38 +0000 Commit: Colin Percival CommitDate: 2024-10-29 23:12:23 +0000 acpi_gpiobus: IoRestriction is only for type IO The IoRestriction field of ACPI_RESOURCE_GPIO is only meaningful for resources of type ACPI_RESOURCE_GPIO_TYPE_IO. Reported by: jrtc27 Reviewed by: jrtc27 Differential Revision: --- sys/dev/gpio/acpi_gpiobus.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 9828170daeca..c01d825fabf5 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -73,13 +73,15 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) flags |= GPIO_INTR_SHAREABLE; #endif } - switch (gpio_res->IoRestriction) { - case ACPI_IO_RESTRICT_INPUT: - flags |= GPIO_PIN_INPUT; - break; - case ACPI_IO_RESTRICT_OUTPUT: - flags |= GPIO_PIN_OUTPUT; - break; + if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_IO) { + switch (gpio_res->IoRestriction) { + case ACPI_IO_RESTRICT_INPUT: + flags |= GPIO_PIN_INPUT; + break; + case ACPI_IO_RESTRICT_OUTPUT: + flags |= GPIO_PIN_OUTPUT; + break; + } } switch (gpio_res->PinConfig) { From nobody Wed Oct 30 00:53:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTCD4Mw3z5bGDD; Wed, 30 Oct 2024 00:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTCD3qJgz4Hmq; Wed, 30 Oct 2024 00:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730249624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zhUAc/Dgo3uFMU2C2BrEW/oLz7YjQHTm8RFwwFg2sbw=; b=wcOcdFM+ekdLSNvJEff0ulZkAN81YDlDLXd8s8iDneTnCRFt9ANBYZWSX8ApYHzt/8ppXJ x57OIWdK/ZiLMgmLJJhXJMIPgxgv7jSG8euPLREMNr906OJ1nAEnENJs2uDLN72o3oPEIq ac427iWS+RXNq+dri1jCFfB4trXL4h3qLz7mG+mBfazIbyNVkfdeS+uMhCvZqFVVjPoVDD 44NwPSsGVfYRD+U++dznvkcQEb6AcVce00fLbgs8CLlpAlBGVyNTr7TrxnLNuMrKmicS0j azcXaG34BGE4/u0aTifma4AuzsrKzmzW921+t7XJ76LoQm/HiE3Jfy7eHVhbfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730249624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zhUAc/Dgo3uFMU2C2BrEW/oLz7YjQHTm8RFwwFg2sbw=; b=PZ3sB5fJ8oG3EvG2L9W/N4RJlAOO3jA/q5+tHl7BeqotS0nBdeVkocrUoK35lsu2SpWd/j oefzCMA4yJuT0M+O1/cM78mU5wWXV1aBuznZ1cTBNV6YntXnc1WzhWlng1n8neUHE0uMW5 ZjUvx/d/tPE/SkegSbb0ig/g94EtRBcdzRP8gxndpgI4qUt756xi/Oz/6PS9DB71V9haE0 Yfg56hk5NG2xKGJziP2AtPe05OLOJshBSXnD6j7dJdBIOxyp++k56EN28kXjycYpqvVezX r8flm7LCdKoZXFi/F5S/YcljRVpRIs9dU4rZ8/wEqbCGZd7zNy9iZQ9pnAfeLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730249624; a=rsa-sha256; cv=none; b=gQnTrdT2e+Cx5rYQT6Q8Mr2XUwZj4OKgr6XF/f7rAc52br28W8/AEv8L2WLLEKVYS2u4Vf YCr7ESYzF01lEXNIlNFAwz7LDAoafrRP8ANiNmQakKDkSor9vk+kLlg+RaNsVVOa0PAbwH V3mLcNWrDdy0m6zCbbChGgWJcHAOuXmUFsMvXdqEl3N/fgLWpo0fRBQXQ3BL4cddQI6DC/ YPdcBKzCyGDmXoU85pJpcEyoERKNjN2Eq/0xpL2E7onjLm3yuH7H05jIsSY4pi67+q97F1 RtuZgA3LNUuHOTvrjmmgUM1xAGdAd2MZ9bW/dejzTuNImiDaFkK/xa4QDSUkBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTCD3MwSzlwq; Wed, 30 Oct 2024 00:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U0ri1k004150; Wed, 30 Oct 2024 00:53:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U0ricl004147; Wed, 30 Oct 2024 00:53:44 GMT (envelope-from git) Date: Wed, 30 Oct 2024 00:53:44 GMT Message-Id: <202410300053.49U0ricl004147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 1e4603b7a819 - stable/14 - ncurses: Fix codegen for key names and codes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e4603b7a8193064a9879c6c1906be1c7cb57575 Auto-Submitted: auto-generated The branch stable/14 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4603b7a8193064a9879c6c1906be1c7cb57575 commit 1e4603b7a8193064a9879c6c1906be1c7cb57575 Author: SHENG-YI HONG AuthorDate: 2024-10-23 20:38:33 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-30 00:53:05 +0000 ncurses: Fix codegen for key names and codes Adding back arguments, which were missed during the import of ncurses version 6.5, to the code gen awk script. This is modified from lib_keyname.c and keys.list targets in contrib/ncurses/ncurses/Makefile.in of 21817992b3314c908ab50f0bb88d2ee750b9c4ac PR: 280697 Reported by: np Reviewed by: bapt Tested by: scf Fixes: 21817992b331 ncurses: vendor import version 6.5 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47153 (cherry picked from commit 514f4e89acd2e7b1824b261055bef49a3da6a956) --- lib/ncurses/tinfo/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ncurses/tinfo/Makefile b/lib/ncurses/tinfo/Makefile index b202a40a1cc3..072c2368d4b4 100644 --- a/lib/ncurses/tinfo/Makefile +++ b/lib/ncurses/tinfo/Makefile @@ -223,7 +223,8 @@ codes.c: MKcodes.awk ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c lib_keyname.c: keys.list MKkeyname.awk - ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKkeyname.awk bigstrings=${USE_BIG_STRINGS} keys.list > lib_keyname.c + ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKkeyname.awk use_sigwinch=${ENABLE_SIGWINCH} \ + bigstrings=${USE_BIG_STRINGS} keys.list > lib_keyname.c unctrl.c: MKunctrl.awk echo | ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} > unctrl.c @@ -271,7 +272,7 @@ curses.h: curses.head MKkey_defs.sh Caps Caps-ncurses # Generated intermediate files keys.list: MKkeys_list.sh Caps Caps-ncurses - AWK=${AWK} sh ${NCURSES_DIR}/ncurses/tinfo/MKkeys_list.sh \ + AWK=${AWK} USE_SIGWINCH=${ENABLE_SIGWINCH} sh ${NCURSES_DIR}/ncurses/tinfo/MKkeys_list.sh \ ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses | LC_ALL=C sort > keys.list .if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host" From nobody Wed Oct 30 01:02:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTP53qy7z5bGsJ; Wed, 30 Oct 2024 01:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTP53NgXz4K2W; Wed, 30 Oct 2024 01:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ims2KP2omIvMN+XHWu4QuIqYaRwKIA4/3u6qD2i2/gc=; b=mABSxL1ggWkaMsZQWUHAFS2ttFUJON4sVSF8q30svUiX3HPmDRkk8StAK326aAv4OdpCQ0 urB1AW6FAgBntwmOymzQT4dvHXvYY6o8MargtvNf3eZNB5o79HnKNxw6SD48s35c65zYa1 w735ROW40W41bQqsOjMt0AXR+qwrGQIWJExE1EUCN47AMjMSHJz2X2FQ2/oNIod7nPv8no 1DAr32ldV6ZhHm6Qe4Mu5feprxuk/fq7+mcdK02ll2HAlP24Mv3b3V2dqI1xbW1pw/w5Rb 5EOD7TbuyEAzUqwLDV+reWnhApjwBvhUEk+YhgGJYyteExkkPIJBtft7ROyU+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ims2KP2omIvMN+XHWu4QuIqYaRwKIA4/3u6qD2i2/gc=; b=P+O7Nzzj9IzXmS1PwIxcm2dcfiHGc/IdICAiISbw3VGXJ1kG8nAax7v20v+VV6JC94eI0x RIMnlr891wtxKudRAX2TRqVZCYwhGHJX6XOazsf5yTZn9IQghMWxWmSNFgsBBu2FNSm13T FXJyE7YRachI5ZSEuXN4RYJjRlBUPCAnRRsNQcJ1aOlhh435/eOhMYXvBkO2+JxsBw2C+O MG/7TcNRra9J7bcja6L4Jb1krbyMapJRmFBBsd0e0dqPPziPavrbfEbXAqA0REgBr9aOFz nJ5w0IITlX9lT2e6hr1KQ9q+4hWazpQtfQJGO1n9u8JTnaW4Ms0hM2BxtjbCQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250137; a=rsa-sha256; cv=none; b=AELGOkEPk5Wir5uAXPECcHwKBNBctsDrZGouL9aRf5SfJcSEFB04VFJvlN5iq4EY4hmnGy D6UZSuKg8DFJY97O8+zcju0mbn8/RmTSCDRaQ6ZSI0G/31NGdqBNzRYCLil30ddw4jJKFZ NzIhBAOLBxTi/GNdgj95kFmihNmKPrKvbMNiiUGeOrZ3dltFQE3KVIBfIOoVFxllOU709K XfWt2B272bg/2Mlnv7ZfCEfEb1lAwus8xs0AtigI2DqTo6CDkg/gaF8CpU6Qc79JTMzLId aGZXzpFQPXrC3g2yi1H+xIXwBOnrAQR9BpXO4PxK7l+IPjeoy2zHoA5uSlSFuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTP52r1MzmQR; Wed, 30 Oct 2024 01:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U12HOQ023079; Wed, 30 Oct 2024 01:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U12HPP023076; Wed, 30 Oct 2024 01:02:17 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:02:17 GMT Message-Id: <202410300102.49U12HPP023076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 86efff54916b - stable/14 - ixv: Check cap return before MSI-X enable write List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 86efff54916bba7b7543699fe5922d8363f16c11 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=86efff54916bba7b7543699fe5922d8363f16c11 commit 86efff54916bba7b7543699fe5922d8363f16c11 Author: Jeremiah Lott AuthorDate: 2024-10-27 07:18:54 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:01:04 +0000 ixv: Check cap return before MSI-X enable write In the QEMU workaround code in if_ixv.c, the ixv driver calls pci_find_cap(dev, PCIY_MSIX, &rid). It is not checking the return code from that function and the function appears to always be failing. This then causes the driver to use the rid variable uninitialized, which will mean setting a bit at an arbitrary offset in pci config space. For now, this seems to have no adverse impact, but it could easily cause very subtle problems. PR: 207037 Sponsored by: BBOX.io (cherry picked from commit b87b3696c973ef0a9df70143cd89f6b488531e93) --- sys/dev/ixgbe/if_ixv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 467a56e7269f..58384af5eea7 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1073,11 +1073,14 @@ ixv_if_msix_intr_assign(if_ctx_t ctx, int msix) */ if (sc->hw.mac.type == ixgbe_mac_82599_vf) { int msix_ctrl; - pci_find_cap(dev, PCIY_MSIX, &rid); - rid += PCIR_MSIX_CTRL; - msix_ctrl = pci_read_config(dev, rid, 2); - msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE; - pci_write_config(dev, rid, msix_ctrl, 2); + if (pci_find_cap(dev, PCIY_MSIX, &rid)) { + device_printf(dev, "Finding MSIX capability failed\n"); + } else { + rid += PCIR_MSIX_CTRL; + msix_ctrl = pci_read_config(dev, rid, 2); + msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE; + pci_write_config(dev, rid, msix_ctrl, 2); + } } return (0); From nobody Wed Oct 30 01:02:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTP652n3z5bHHQ; Wed, 30 Oct 2024 01:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTP641MJz4Jgs; Wed, 30 Oct 2024 01:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UMoHzJZUGmOaqKp9kuTVSBGHaCwZdlmxhbxE2iZhf0=; b=GQOlVDKSA6lndHClkBniwx3E3+lZySg3/DwvSy319XLkijZlXDIgrcsHTgqhRjLpSC3HIN J2vdBeknpzvIOKac9MCIzaQ6zU83BnJvpaoa9yZFba6BFUlQ1b3iyPKNy0bCNkjo1r7qKo GdgEwCGB+Xq6ohRIEdkJJf7Ik1M24cA/QkAkUwUe40bi1dmDP4NSz2QMSn69zBmHn7qodB Ubq1x1Lif+pAh7xIYf8a0daKBiiigZasnS5lCaQsL8ltTz65+/EdrvxTm/5lP8Wc17SEZT rjVtk+GIi1oDPqszqX6kFjrJ8lJKnA4GOdQgxpPz8AQcru/bFIP86J/BJ3bvdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4UMoHzJZUGmOaqKp9kuTVSBGHaCwZdlmxhbxE2iZhf0=; b=VarRCXtwN+wDFHhF64IZqzqG8HP6HshppgpZyAb6Cl/Q1t9TjarOrZbnkaUuMqCYiKy31I 6ZMz9V8DpmVPVQ60/gxuojQ9gxulVH/y4PwqrnrveFZtWioqHnPmf0I0wpj0rFY1X1vxJI jGYURQ6w2nZEoQELM44EWdY+LxgKgEdXzPOaHoip47mVApgzOey0pmboDHZai/zeBD1xnp kftH1xfnU/3Bwp2hoHjY72Ez52Ef+QflN680BVcIKq1jPWzQuTH5DOJO/n6Us4tDGcvRTo 0ONbFm3URaRc4XCQMWApicoJPlysBeBPm3Y+O/a+5Yr1yR0dqoNCI5WycqzwKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250138; a=rsa-sha256; cv=none; b=TqO7u5vzQ3ubv0lQ1iktiNQ2Q8q37zJ12sdDoyY/LVUeCmeY1A+AlXzZpHpPmJn7EpwknV iwoVi+I0vpWwQ8fdKkeviPNg7mvtchYG//qctiz/2Vb2KxiiMnWftcZoOpWvQ4ZwMsUwSS E3IeEq2cAIv3c/ohQ8D89lTil2N86v7jZHJNo6ANKuBahHWiQon4yx3r/Zs6jIE7vkmcK0 eEJAHC1X2u79ti0plJJHTX07gYhPgIoKSP6KINMwcNS8E32v/7d6bXyE9k+7Q0tSRdaaIc 8IWYTia7KQ0FGMEY7KTeblCs+lkL+tzWYGGfSvgdzDIz2oekX4K5ptBwy9Vs0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTP63cXBzmQS; Wed, 30 Oct 2024 01:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U12IJK023118; Wed, 30 Oct 2024 01:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U12IuC023115; Wed, 30 Oct 2024 01:02:18 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:02:18 GMT Message-Id: <202410300102.49U12IuC023115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 30a9cf87d326 - stable/14 - ixgbe.4: rename to ix.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30a9cf87d3261ace3d05844fa9d89f675d0ef474 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=30a9cf87d3261ace3d05844fa9d89f675d0ef474 commit 30a9cf87d3261ace3d05844fa9d89f675d0ef474 Author: Felix Johnson AuthorDate: 2024-10-27 00:26:34 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:01:19 +0000 ixgbe.4: rename to ix.4 PR: 213026 Reported by: Sergey Akhmatov Co-authored-by: Alexander Ziaee (cherry picked from commit d8b48a267fc0f737a13cb52dc1071981ecb1e003) --- share/man/man4/Makefile | 8 ++++---- share/man/man4/{ixgbe.4 => ix.4} | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 7f6c9a501238..e83be3054aca 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -259,7 +259,7 @@ MAN= aac.4 \ iwnfw.4 \ iwlwifi.4 \ iwlwififw.4 \ - ixgbe.4 \ + ix.4 \ ixl.4 \ jedec_dimm.4 \ jme.4 \ @@ -703,9 +703,9 @@ MLINKS+=iwi.4 if_iwi.4 MLINKS+=iwlwifi.4 if_iwlwifi.4 MLINKS+=iwm.4 if_iwm.4 MLINKS+=iwn.4 if_iwn.4 -MLINKS+=ixgbe.4 ix.4 -MLINKS+=ixgbe.4 if_ix.4 -MLINKS+=ixgbe.4 if_ixgbe.4 +MLINKS+=ix.4 if_ix.4 +MLINKS+=ix.4 if_ixgbe.4 +MLINKS+=ix.4 ixgbe.4 MLINKS+=ixl.4 if_ixl.4 MLINKS+=iavf.4 if_iavf.4 MLINKS+=jme.4 if_jme.4 diff --git a/share/man/man4/ixgbe.4 b/share/man/man4/ix.4 similarity index 95% rename from share/man/man4/ixgbe.4 rename to share/man/man4/ix.4 index ccdf50cf9674..32b5386ea7d4 100644 --- a/share/man/man4/ixgbe.4 +++ b/share/man/man4/ix.4 @@ -30,10 +30,10 @@ .\" * Other names and brands may be claimed as the property of others. .\" .Dd May 17, 2023 -.Dt IXGBE 4 +.Dt IX 4 .Os .Sh NAME -.Nm ixgbe +.Nm ix .Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" .Sh SYNOPSIS To compile this driver into the kernel, @@ -41,14 +41,14 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device iflib" -.Cd "device ixgbe" +.Cd "device ix" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_ixgbe_load="YES" +if_ix_load="YES" .Ed .Sh DESCRIPTION The @@ -88,11 +88,11 @@ Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El .Sh DIAGNOSTICS .Bl -diag -.It "ixgbe%d: Unable to allocate bus resource: memory" +.It "ix%d: Unable to allocate bus resource: memory" A fatal initialization error has occurred. -.It "ixgbe%d: Unable to allocate bus resource: interrupt" +.It "ix%d: Unable to allocate bus resource: interrupt" A fatal initialization error has occurred. -.It "ixgbe%d: watchdog timeout -- resetting" +.It "ix%d: watchdog timeout -- resetting" The device has stopped responding to the network, or there is a problem with the network connection (cable). .El From nobody Wed Oct 30 01:02:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTP760Qxz5bH8B; Wed, 30 Oct 2024 01:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTP74yslz4JkQ; Wed, 30 Oct 2024 01:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y/igCAyVnya/grgJy8lTNbXNsd1vHSCZ/U02BwZpDPo=; b=Nvh6VQXDruOvjhUfx3hWeTHTtB59BURlyV6ki78U8lIWMqbsxvz8HO9KMtXwFq/5N/nLcF crQ9BmiMTB69wNArpE+g3S8wAFeB/MZMEORHiHs+YG7z2AfnvR01ritSO0yUw6Fejjjed9 kzj+DAO3c3aIFgix/TrBTz16wQscBPLAviliH54gfFgTZ0/Y5p9bPXNN3PtPFV0VfXFZZL hiSHEwKScgFV1PdVgVf1MkVS+fx5f9dwfhmxSfe7kBNYD50TEc0oWDToM9ZRClkZphdraf /wQNDYvEvkUnlS15I9t15lFD/nvgDuDhbSfWTqFr+N5uwoRPMdf2O1iazvIjfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y/igCAyVnya/grgJy8lTNbXNsd1vHSCZ/U02BwZpDPo=; b=ZuX09D7UDPzczj4rBFvw69cPKI7PD60rPFsPkiPtHFGa2s/t1EgAbJrxjYI6tvabVErH9s LS4bh7vt9yyaFFkbRrffKGmCX76LOnuV4noUrfUwW/xbCl3leLeGKxY+ZVN+BTDQY96Ehy GQ1YfkhPPz6/6MyWzfWBlokqZ24QPv6y9V4Wn7ZXvZpjvbrQOnkrayaW8Des0JEmmTl/XM TJtms2J2F8n9ZQuDSPhS/LbPCGQqgEXX6dnyhDe090lT95Z6EAQO2D8n462CLl97uqwJif Id3kqEVf/gkoXZnh58nsytPd1urMA+sXWSSdJUR/mTrhG62tQgFJtu4G8pRw5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250139; a=rsa-sha256; cv=none; b=GBDMIU1ThFIBCM6vh2eB/JXs3sviFJID59ZAuUDVjATVvW10JljSrmZa7Kb1DG3kliVaPg 5aHhvIDt6aoxVH9IUcA6qfaJnwshblAcmuG1GBkCOhC9uFgTWjtDJhJFWQRXajCcS2hcmA teGPzTAlHU3RU+XOcHottbJcWD0vslRin3LEVCiT81KBfqp1yFRoNiJwi87e56Qj9LEBHM WJHVKNl51jY5u4kzizrFL2dE5gfMyW5qZnNFz3EnMpfxnRwia/AGNljcAH+OskTL1EpGpW ENR9js9rHR+RoOzKynpgO0wuQJnfkg8QkoATPXo8mpvhVGcfvnWSxtrpEbsfeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTP74ZdCzmpp; Wed, 30 Oct 2024 01:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U12Jx5023165; Wed, 30 Oct 2024 01:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U12J2w023162; Wed, 30 Oct 2024 01:02:19 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:02:19 GMT Message-Id: <202410300102.49U12J2w023162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2e0d2f95fe60 - stable/14 - ix.4: document LOADER TUNABLES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e0d2f95fe602fb746e4369bc6d8e2c3a836afa4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2e0d2f95fe602fb746e4369bc6d8e2c3a836afa4 commit 2e0d2f95fe602fb746e4369bc6d8e2c3a836afa4 Author: Felix Johnson AuthorDate: 2024-10-27 00:46:41 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:01:30 +0000 ix.4: document LOADER TUNABLES PR: 213026 Co-authored-by: Alexander Ziaee (cherry picked from commit a340b4649621f0dbc0607115217889909ce33bd1) --- share/man/man4/ix.4 | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 32b5386ea7d4..4f90ded1e3ee 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -86,6 +86,42 @@ Intel(R) 82598EB 10 Gigabit AF Network Connection .It Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El +.Sh LOADER TUNABLES +The +.Nm +driver supports the following loader tunables: +.Bl -tag -width "hw.ix.allow_unsupported_sfp" +.It Va hw.ix.max_interrupt_rate +Maximum interrupts per second. +.It Va hw.ix.flow_control +Default flow control used for all adapters. +.It Va hw.ix.advertise_speed +Default advertised speed for all adapters. +.It Va hw.ix.enable_msix +Enable Message Signalled Interrupts (MSI-X). +.It Va hw.ix.allow_unsupported_sfp +Allow unsupported small form-factor pluggable +.Pq SFP +modules. +Use at your own risk. +.It Va hw.ix.enable_fdir +Enable Flow Director. +Flow Director directs Ethernet packets to the core where the +packet consuming process, application, container, +or microservice is running. +.It Va hw.ix.enable_rss +Enable Receive-Side Scaling (RSS). +When RSS is enabled, all of the receive data processing for +a particular TCP connection is shared across multiple processors +or processor cores. +Without RSS, all of the processing is performed by a single +processor, resulting in inefficient system cache utilization. +This has no effect if your system has only one processing unit. +.It Va hw.ix.enable_aim +Enable Adaptive Interrupt Moderation (AIM). +Vary the interrupt rate over time based on the traffic for +that interrupt vector. +.El .Sh DIAGNOSTICS .Bl -diag .It "ix%d: Unable to allocate bus resource: memory" @@ -113,7 +149,8 @@ issue to .Xr ng_ether 4 , .Xr polling 4 , .Xr vlan 4 , -.Xr ifconfig 8 +.Xr ifconfig 8 , +.Xr sysctl 8 .Sh HISTORY The .Nm From nobody Wed Oct 30 01:02:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTP87205z5bHF5; Wed, 30 Oct 2024 01:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTP8672Rz4K2t; Wed, 30 Oct 2024 01:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QthOGeJGrKfZz1bcksQKcLp8/6lJUncf8dKIuPnt6hI=; b=HF/tbNlXz+An5GYPGJ/O5VIW6Pk+8Npovd1V0faqgECnqI4l0PmeCY+LaswDHV5TlaRs5Y nJs6LTb6ZzMe97KkvyzP/hGl41kcqNwH9MisMRZD2RrLWfkGIVePvfjsMeYN32pgNjK1Hb Ua75dJYnqJRwUhoiC+rgyMi5Jl4zeQZ/NIPvBoLuDSAvFRPjtEN1jqU2TRAHZdy8OVoyiP YBZHB2tFhv675bYRjE/zUX53HmOR90cUYV6EPwQ7T8HSyZFT74yOpVGvPX8X/AMesUptwn od3RGtDQEFAYfXNPWne7CoVwkrxxBAgllW5QK4dXynBVVh3+fm+rszTsu8DWXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QthOGeJGrKfZz1bcksQKcLp8/6lJUncf8dKIuPnt6hI=; b=L2xgZ6e9UBWTVLkfOS3TTwSc4yS/JVR/0Hx19dawTgtBRGw0uEQYgTOJiZbwr/VyZ1dZBZ oKpksqKqqIwReOf5N4vQDT4qO0RxnFPY1yU3aBKz/FtYX2hQngWr1MbTUSjQOQvOwYFaf2 ciwx2jKIhkfXJWCIATWou1nZjdBvzqCnlfJzVSgsm3YNlgUlFEJIht4YDmna/eeDqRdL47 Jvqe4P5FRnO4bGsFg2jtBOC+TA9l8AfKq+gvp8RQWu9Ec+RbrnQLAwD8LpLnlHQrDbEa9e LUpvc06ttstPoDNSd+HFj3Dn6rD7oXHA1VTGXUWZnTKLJ1G+yQsgP6TiCNQX2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250140; a=rsa-sha256; cv=none; b=qsUxsK5U37AUK/3tyc2AGACzgcIL6SOCBtBiSXrtNDGCF6p9dot9PdiwbueJ9TEofKoD43 LJhdFMqlMxg9VKT0FgiDasgYbN5L/MpJBzIjXSI0IvtcHuoff35iysRCR/gIaMrQM4VhoE GmWFFWxD3PZ0KfZDq4OyWpRU28pekiWZJ+oRRG3s2L8b6RCmlNQUiqq7LewKHrf0H0f+JI gLKWfZqNqEqGOHptdSyIR7mS4LBNahbhXj7YA8MSK4TjBTNsgDikRyZvDQy04y+wFFiF4k T/xWWPLoI3mGBItt83zC2m9BKyOytarCeedo4O0XVIoDSyjEDFDqcSj6LW6Kvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTP85X8szmQT; Wed, 30 Oct 2024 01:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U12KZh023209; Wed, 30 Oct 2024 01:02:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U12KaE023206; Wed, 30 Oct 2024 01:02:20 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:02:20 GMT Message-Id: <202410300102.49U12KaE023206@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f2793040b88c - stable/14 - ix.4: describe better List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2793040b88c14a18be6a8883d2e9dc40bdf082a Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f2793040b88c14a18be6a8883d2e9dc40bdf082a commit f2793040b88c14a18be6a8883d2e9dc40bdf082a Author: Alexander Ziaee AuthorDate: 2024-10-27 00:55:59 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:01:42 +0000 ix.4: describe better + add controller name to title for search keywords - remove "for the freebsd operating system" from title/search keywords - remove `(R)` from the page title for consistency with other drivers - increase specificity of HARDWARE for inclusion in Release HW Notes - order HARDWARE in reverse chronological so non-eol appear first - s/PCI/PCIe/ Reported by: kbowling (additional hardware supported) Pull Request: https://github.com/freebsd/freebsd-src/pull/1494 (cherry picked from commit 2d28fd51e5b9d8ef184445dfa204f6ba22d460a5) --- share/man/man4/ix.4 | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 4f90ded1e3ee..418b6e1188ab 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -29,12 +29,12 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd May 17, 2023 +.Dd October 26, 2024 .Dt IX 4 .Os .Sh NAME .Nm ix -.Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" +.Nd Intel 10Gb Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -53,8 +53,7 @@ if_ix_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for PCI 10Gb Ethernet adapters based on -the Intel 82598EB Intel(R) Network Connections. +driver provides support for Intel(R) 10Gb Ethernet PCIe adapters. The driver supports Jumbo Frames, MSIX, TSO, and RSS. .Pp For questions related to hardware requirements, @@ -74,17 +73,26 @@ For information on enabling VLANs, see .Sh HARDWARE The .Nm -driver supports the following cards: +driver supports Intel 10Gb Ethernet PCIe adapters, +including: .Pp .Bl -bullet -compact .It -Intel(R) 10 Gigabit XF SR/AF Dual Port Server Adapter +Intel(R) Ethernet X553 .It -Intel(R) 10 Gigabit XF SR/LR Server Adapter +Intel(R) Ethernet X552 .It -Intel(R) 82598EB 10 Gigabit AF Network Connection +Intel(R) Ethernet X550 .It -Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection +Intel(R) Ethernet X540 Bypass +.It +Intel(R) Ethernet X540 +.It +Intel(R) Ethernet X520 Bypass (82599) +.It +Intel(R) Ethernet X520 (82599) +.It +Intel(R) 10 Gigabit Server Adapter (82598EB) .El .Sh LOADER TUNABLES The From nobody Wed Oct 30 01:02:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTPB0lVDz5bGxv; Wed, 30 Oct 2024 01:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTP96SF7z4Jph; Wed, 30 Oct 2024 01:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iG0hoEEhiKoHJBZoEIf9Qn1K2o/EpT6qmw2bKuvyeGM=; b=tJdyQwzMUXO+G+/6w/FwlAFh1HfodLfbw/+DGYc3Z01Mu88YqqSszSnM2Rrb4elNsFHbnt dzkq4eodSbDAPAuI0L06e5N1AY+xO8VubhPC/fUzW8wSSK+3lpEF/e88JS8Zir1UDKp+Xk SsPHmIu079vwyLwpIuqK9Y/e8jkvX/6Ph/s0xdGcAAArLVy7IhoXRjhCSKARIyyrGMI/TZ 93bIfIpIeGVq9kjTXNmxTiVlNk/5X7O830TTu8GvtaU4WFWr2DiV13BXw9u8ZeKlJDhW/2 TWuzHh3snlete+rBdLgPXvjzwc0lIyHnga+kk6HMEz2lwuBv94nJ2jmr0G60sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iG0hoEEhiKoHJBZoEIf9Qn1K2o/EpT6qmw2bKuvyeGM=; b=ZZ/BVBAMi0cT1nnbWbXXOlJKEu3o0jT7DitObB5GBxnMRFyPsAslanrmPp8f7ioKkTfVpm twNoD5NYfz9w3Jpu2pVk1FcAez9HenEy2PCgBIyd0cY9vEzcmNCChdaLUvBS1XGB0oPHH+ PyeOz5FJqI3NkfEentpShZT/A4OXEZXHPGLBYTUPXzMnMVkj7cT0GnJY66bduOJpIRgqwv Uig3dIEZjBCP7Hamxb3hw92tS16twpNuuFnF/QQHXpkhm8Mb2bJPkuYqctBfOM3QWbvrxa eQxbHs5JoEqpvTzivgN1a6r5UyfKyemZ6GjTo2sJDjjUzfyMAkSBDEQvljVRYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250141; a=rsa-sha256; cv=none; b=k/2PG6a4UKbX3YiAc1FTbU6DtUI4VceTZfo8rbd6nBViVNRq+gcupDJ2XSniNNbstKLQ+K joW3rVnXaXaxmoZmP/4y5S1kY30Hq8uoS0MmHTLyPCAJ9To2VoOe9VdIesOCI4uoxYbjhk VgfHGYsoZELZk44KVQrC6E7gi2bk7AH775U+Kr0XJOpuh/tQ3r6IE80TrGDA8JuaLjupHd u0zcaDzbwi92OTG4B3jN935BsNNPaRUp+fIJ0KiYnXSgH43xxz5V7HVgZxodR+7KcglsCB IAXVfGElVuVKoea+qVW8TU69kDkMpk15v8GuYDeVm0NJeCoa16EiaT/Mpzqa9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTP964gyzm2j; Wed, 30 Oct 2024 01:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U12LRl023258; Wed, 30 Oct 2024 01:02:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U12LqX023255; Wed, 30 Oct 2024 01:02:21 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:02:21 GMT Message-Id: <202410300102.49U12LqX023255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 68dc2d295b64 - stable/14 - ix.4: update crossreferences to ixgbe.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 68dc2d295b64526ef0df008c458501b8add876da Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=68dc2d295b64526ef0df008c458501b8add876da commit 68dc2d295b64526ef0df008c458501b8add876da Author: Alexander Ziaee AuthorDate: 2024-10-27 01:54:00 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:01:54 +0000 ix.4: update crossreferences to ixgbe.4 Pull Request: https://github.com/freebsd/freebsd-src/pull/1494 (cherry picked from commit cadb71e4b013925c145dd5e0726a3594111410cb) --- share/man/man4/altq.4 | 2 +- share/man/man4/ixl.4 | 2 +- share/man/man4/netmap.4 | 2 +- share/man/man4/vlan.4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index 4761daa8d37e..d81d2dfe5de2 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -143,7 +143,7 @@ They have been applied to the following hardware drivers: .Xr fxp 4 , .Xr gem 4 , .Xr igb 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr jme 4 , .Xr le 4 , .Xr liquidio 4 , diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index 8397bd99a5e7..bd183be48cd2 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -209,7 +209,7 @@ When the driver is finding the last TX descriptor processed by the hardware, use a value written to memory by the hardware instead of scanning the descriptor ring for completed descriptors. Enabled by default; disable to mimic the TX behavior found in -.Xr ixgbe 4 . +.Xr ix 4 . .El .Sh SYSCTL PROCEDURES .Bl -tag -width indent diff --git a/share/man/man4/netmap.4 b/share/man/man4/netmap.4 index e258b60e11f6..5a12f8f32465 100644 --- a/share/man/man4/netmap.4 +++ b/share/man/man4/netmap.4 @@ -827,7 +827,7 @@ On .Xr em 4 , .Xr iflib 4 .Pq providing Xr igb 4 and Xr em 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr ixl 4 , .Xr re 4 , .Xr vtnet 4 . diff --git a/share/man/man4/vlan.4 b/share/man/man4/vlan.4 index 775eb3235c07..25405172ed62 100644 --- a/share/man/man4/vlan.4 +++ b/share/man/man4/vlan.4 @@ -130,7 +130,7 @@ in hardware: .Xr cxgbe 4 , .Xr em 4 , .Xr igb 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr jme 4 , .Xr liquidio 4 , .Xr msk 4 , From nobody Wed Oct 30 01:03:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTQk5zDnz5bHHh; Wed, 30 Oct 2024 01:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTQk5DJHz4LZr; Wed, 30 Oct 2024 01:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32PXllp2KO8kAZozepnpcc1Gb8aWRCYhT1IIlOxdoNY=; b=muNhk5CSvMVXM20qZRFtIlCl8LLwiYr/Ni2MJg64ZCFRaRIxF510SAPb25DBBqJqj3W/5A eJpJSmUXLoDAdJK5uuf8Fgr5tYT9uOG8lkWRCMoJ9Reb8lqUVFLWpBkD1dEbEeux2HIgQ1 AwgfKsxfma8RfHYdgOp1fNXLNBeDZwMzTR9Ad5RX8GWAFjNMcMSckIKrCLP50TTmgpaU9+ JAU5Lahb53wHbtH99jFPc+2PFqEa3EaGtlDd4fDPLBrNbLrhYHl4g62aOiF6dCEv5itOUv 75NY3YckamARk9bdCTh6ZX42IGlN+kSbWHPtpxbkK4MXqsT0gxio+CUIY+PRgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32PXllp2KO8kAZozepnpcc1Gb8aWRCYhT1IIlOxdoNY=; b=Jmd6LV4ZV65zjEh7T+NzYSrm4pCWcg/vgTlgLOSmTT0AZIiirV54dRzevVDbZD9FmDRE1S IhZmuJsjpQYsSCZ4cEhl1nEmBN2UV9zgo7T8KBjzpeenS9aObrkvvZGDgx+Xj5LeCOgGzp bsFVn0Hz9wBIKNty0IXtQasLqFUvg+Y8eBLwA28iUh8+YP727bDgoQq8H8o2fkBYvZc5mk w+Ch10YsX3n+AI2YuH/h0mqzf3f0wfPy/YFvEBxqDoENhwojdxAOTp+35AuWmYVB4Pfpf4 SrNcT2JvzqJCGYbLN7JmIej6BDp3AHvxuFJrnylMdTPI60n+dOnfoEcRzkPJbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250222; a=rsa-sha256; cv=none; b=eYgOoqhgU88QfmBdsk7e42IM/fft+2DQDz36O3OoMA+nt1eNcNxGM0uJeitNBdpEpKPKHB lm+2Xl0PbClFIEM3EWgb9iQ/YLD3T3+GlbSEj7ztpgt50GZx/hRcmQ15uz0woA1W6tNkzO JXqoybjiSEci9IbKQisuY3XLKdOid019sumHOCGhJ99jbC6/ncLIYQQQCUHmSNlGDAw0BQ UpjlHbEJZz6YBEmEaxdK7MZWwg38849FK/Ck9DZFQy4xX/7O/V7SehxNFuriw3m+gyitWr if1PJB8QGWhfOYLuMncNftjtgzteGSrCqsf7MfJvIfSw38bLDSs+Fl9o8ZMjig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTQk4qWFzmpx; Wed, 30 Oct 2024 01:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U13gxp023830; Wed, 30 Oct 2024 01:03:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U13gWM023827; Wed, 30 Oct 2024 01:03:42 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:03:42 GMT Message-Id: <202410300103.49U13gWM023827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 453f85caa93a - stable/13 - ixv: Check cap return before MSI-X enable write List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 453f85caa93a431911b66b2cd781595e4ebd59ec Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=453f85caa93a431911b66b2cd781595e4ebd59ec commit 453f85caa93a431911b66b2cd781595e4ebd59ec Author: Jeremiah Lott AuthorDate: 2024-10-27 07:18:54 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:02:46 +0000 ixv: Check cap return before MSI-X enable write In the QEMU workaround code in if_ixv.c, the ixv driver calls pci_find_cap(dev, PCIY_MSIX, &rid). It is not checking the return code from that function and the function appears to always be failing. This then causes the driver to use the rid variable uninitialized, which will mean setting a bit at an arbitrary offset in pci config space. For now, this seems to have no adverse impact, but it could easily cause very subtle problems. PR: 207037 Sponsored by: BBOX.io (cherry picked from commit b87b3696c973ef0a9df70143cd89f6b488531e93) --- sys/dev/ixgbe/if_ixv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 91ed47df429d..1a9514dc5b07 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1073,11 +1073,14 @@ ixv_if_msix_intr_assign(if_ctx_t ctx, int msix) */ if (sc->hw.mac.type == ixgbe_mac_82599_vf) { int msix_ctrl; - pci_find_cap(dev, PCIY_MSIX, &rid); - rid += PCIR_MSIX_CTRL; - msix_ctrl = pci_read_config(dev, rid, 2); - msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE; - pci_write_config(dev, rid, msix_ctrl, 2); + if (pci_find_cap(dev, PCIY_MSIX, &rid)) { + device_printf(dev, "Finding MSIX capability failed\n"); + } else { + rid += PCIR_MSIX_CTRL; + msix_ctrl = pci_read_config(dev, rid, 2); + msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE; + pci_write_config(dev, rid, msix_ctrl, 2); + } } return (0); From nobody Wed Oct 30 01:03:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTQm1Lgsz5bGsk; Wed, 30 Oct 2024 01:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTQl6Sppz4LVZ; Wed, 30 Oct 2024 01:03:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rda/RlSsiQ44aG3L0yPmF2qGznTxDZjwuOBjzgIhS5o=; b=D9ttvBc9uxV5Y2WQw3Q1l7XZPbOrUQt5JzVwWnlYJ9JLKRgzcCDaP4NfxZJi5lEBhScVKN Ab2Uk6YApgWDQ832uSTTcp8KWZUk10H/8LDJFJVnSrcIYCSWytLdsXPDZdkrD9P00an/S0 7keso1eirUPbuT7wXu91e5Fg3jXjhhKSDvZGIHnMhYtCtx2JOfeQ6y6Cl+mt6pzJZfalPi rmeoELe4zPrj87wX5M4y4hjB4qBVjs7Gob6Ujx2i4n+/F4X0yEPAz97gqG5j2PMg0hoqMz yvei3wdpNO6OrIzL5vxHVt/o5Xrv+HkElgragKHZT6wsw5YTke8DIirIW2vIHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rda/RlSsiQ44aG3L0yPmF2qGznTxDZjwuOBjzgIhS5o=; b=LGSy5sYey7PI0ONKfJZmTc9ssrw2WT31m66zvcXg+geKKuz5ofZOkJ8eTFoF+SxcgVnBhC VZ9ODFDr6nXn0pxUn5B93yzsQW4bJ9DBBh7mmEVtnVKfZj7OVX+W8DouUzJrNtz5eY9S9C VIYdsiWj5a/jquktx9dgc28t58/5j6FLdp5kBvApVBmoadLB239SbAPY5leKMcTRxVfdb1 d1Daw6VHP8wy0kib8u6WmjN1WunGc34PGF9aKpbwOAKQ5r6e1/cTOFGTFjPiaGbFY7KYLw 3ovoe4cSPMYVk6BILAHzmY1yh8F35EDFoZnB2UWgvQTk/Lw8ICvpjk+zfN+IpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250223; a=rsa-sha256; cv=none; b=b4awfIFVBjqjWZnKabEQckKhwJakZba8iu738aFIj9X3CVw17C/7yWMOie8zAORTJHGwNZ pp69yPhkdmZCZH81yRbWHUHF7A5ApKm4kwMRmd/vuZ6WtiAJYLoz/bMiWb+atpaYqKkbKV PBsPWvRLNmVrh8cCDNJWVynfPOa6Btm+cbQ2W3gFepm86J+4HKqIf37dGlYkiuz1Ve4eAi 7Et1Bj69qgH8kQ8IHtKJ2aOfSMK08t0pAGdNzhKJSAfY27OYv+hYSVR3Mts0+ebYDtfLWv kIDIhRL0IbHgjPllMoQtAUbTsmwP4JyT2cFtmv1BJyenm0vsv5KLdCKPc2BbtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTQl64HhzmqT; Wed, 30 Oct 2024 01:03:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U13htn023874; Wed, 30 Oct 2024 01:03:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U13h10023871; Wed, 30 Oct 2024 01:03:43 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:03:43 GMT Message-Id: <202410300103.49U13h10023871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c07626eaa21a - stable/13 - ixgbe.4: rename to ix.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c07626eaa21aadf07592f3d261151ad6c36e4360 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c07626eaa21aadf07592f3d261151ad6c36e4360 commit c07626eaa21aadf07592f3d261151ad6c36e4360 Author: Felix Johnson AuthorDate: 2024-10-27 00:26:34 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:02:57 +0000 ixgbe.4: rename to ix.4 PR: 213026 Reported by: Sergey Akhmatov Co-authored-by: Alexander Ziaee (cherry picked from commit d8b48a267fc0f737a13cb52dc1071981ecb1e003) --- share/man/man4/Makefile | 8 ++++---- share/man/man4/{ixgbe.4 => ix.4} | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 727768ae5bea..d961e7f17879 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -260,7 +260,7 @@ MAN= aac.4 \ iwnfw.4 \ iwlwifi.4 \ iwlwififw.4 \ - ixgbe.4 \ + ix.4 \ ixl.4 \ jedec_dimm.4 \ jme.4 \ @@ -716,9 +716,9 @@ MLINKS+=iwi.4 if_iwi.4 MLINKS+=iwlwifi.4 if_iwlwifi.4 MLINKS+=iwm.4 if_iwm.4 MLINKS+=iwn.4 if_iwn.4 -MLINKS+=ixgbe.4 ix.4 -MLINKS+=ixgbe.4 if_ix.4 -MLINKS+=ixgbe.4 if_ixgbe.4 +MLINKS+=ix.4 if_ix.4 +MLINKS+=ix.4 if_ixgbe.4 +MLINKS+=ix.4 ixgbe.4 MLINKS+=ixl.4 if_ixl.4 MLINKS+=iavf.4 if_iavf.4 MLINKS+=jme.4 if_jme.4 diff --git a/share/man/man4/ixgbe.4 b/share/man/man4/ix.4 similarity index 95% rename from share/man/man4/ixgbe.4 rename to share/man/man4/ix.4 index ccdf50cf9674..32b5386ea7d4 100644 --- a/share/man/man4/ixgbe.4 +++ b/share/man/man4/ix.4 @@ -30,10 +30,10 @@ .\" * Other names and brands may be claimed as the property of others. .\" .Dd May 17, 2023 -.Dt IXGBE 4 +.Dt IX 4 .Os .Sh NAME -.Nm ixgbe +.Nm ix .Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" .Sh SYNOPSIS To compile this driver into the kernel, @@ -41,14 +41,14 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device iflib" -.Cd "device ixgbe" +.Cd "device ix" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -if_ixgbe_load="YES" +if_ix_load="YES" .Ed .Sh DESCRIPTION The @@ -88,11 +88,11 @@ Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El .Sh DIAGNOSTICS .Bl -diag -.It "ixgbe%d: Unable to allocate bus resource: memory" +.It "ix%d: Unable to allocate bus resource: memory" A fatal initialization error has occurred. -.It "ixgbe%d: Unable to allocate bus resource: interrupt" +.It "ix%d: Unable to allocate bus resource: interrupt" A fatal initialization error has occurred. -.It "ixgbe%d: watchdog timeout -- resetting" +.It "ix%d: watchdog timeout -- resetting" The device has stopped responding to the network, or there is a problem with the network connection (cable). .El From nobody Wed Oct 30 01:03:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTQn31zlz5bH7f; Wed, 30 Oct 2024 01:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTQn0CC9z4LXx; Wed, 30 Oct 2024 01:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZnvk3ZYeuGyl9QQuyY6J8noiEVq95n2fFBnICkxPHU=; b=lOmtR+Y26EVbAyrHQ7jIpEyxrB/SLKKmszyIn2DSbHiC4Y6IbS1P8j7jdedGgEpdf/KfS2 C0fTds9GCX3xpD9X6HmhPoPl0siu5vu3eDRhAeO/JEoKu8WkoOcX1oO/7C5SxZLc2eTMVy I4+jPqBp3BMQWByxvhlppnYJlEIHun3W8zWj8EXukeuwuF+zmbiWK+JoLGvZDVG34nHdXW 89aAi6imdtmNcca3vRxg0f7AeV1IQfLK9KsPV1AjIU4ke4ynpQAZg6rCya2CX9HOHk9Oos DdkMXWJ3AVlXEkku1GKFXtdHc67A8dTjEGR6xJDAwN2enxiVAC1o0Z6bN6Gc/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZnvk3ZYeuGyl9QQuyY6J8noiEVq95n2fFBnICkxPHU=; b=KUsIGd7+h+SiW1oH4TS9BRC4LePWb+vGuvIfZmaIEAx4HHamxmm19bi5pnvu5JGz4Kgqxk E8cVPbF8t2oTr7yWOhwlWrGICf+BZAsXdUvC0XCBFOKAMCWIk4NZjpcMzzwAt594MyYJL7 9VAe1jqJplHu1Clk0aoDwnuzM1d4tlja4iMREtdk8HNzg6OiwsryaJgH5Jm61OxhZ4hJjX ebcFM1w1SKtsk2Mnze8sQWC7W6WEkDq4Y3FUfGjzBNqRr9CowhOegU9EuMojHsV/Cc54hJ +EehBL4yEpdzq+wN5/aZZbbxSVb2Kwb+X/ntt4Mi0jXt9s7n3RKw6s4ffPWNfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250225; a=rsa-sha256; cv=none; b=luaVbFsNh200WHytdbN4/KAph3gQIbxImoYNfXFkTyj5g8VfFvL1JqNY5Q67wiVQeL+4iI EuNBi6DFvja2u49zDMm2hHLQlK7otC3tfTjFs75cX3D7EDTaPoj6qtx8/7N2Ol0lpuyBiJ Gn9++PBW4hCcFX1rO9FjpiU1U3O9Af3FWiKT75i1ePV1um6T9KdEr3GcZhOpAtxWmuQZza SiaQnyeoSlvj97dMrY/zs74CPQqJf0KIEgVfZoZeODfZsOAKblAHwmDqEjPswWMJbe9kLO uyzDjwEH9T4Bi8if40LSme//p2nkMoFv43PNzU+BtcRpOOXVOCk0q5QkHo/NRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTQm6wx7zmpy; Wed, 30 Oct 2024 01:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U13irE023925; Wed, 30 Oct 2024 01:03:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U13itO023921; Wed, 30 Oct 2024 01:03:44 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:03:44 GMT Message-Id: <202410300103.49U13itO023921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 923e8f418cb8 - stable/13 - ix.4: document LOADER TUNABLES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 923e8f418cb804385e0bdc3ce102abb534fdf948 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=923e8f418cb804385e0bdc3ce102abb534fdf948 commit 923e8f418cb804385e0bdc3ce102abb534fdf948 Author: Felix Johnson AuthorDate: 2024-10-27 00:46:41 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:03:09 +0000 ix.4: document LOADER TUNABLES PR: 213026 Co-authored-by: Alexander Ziaee (cherry picked from commit a340b4649621f0dbc0607115217889909ce33bd1) --- share/man/man4/ix.4 | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 32b5386ea7d4..4f90ded1e3ee 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -86,6 +86,42 @@ Intel(R) 82598EB 10 Gigabit AF Network Connection .It Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El +.Sh LOADER TUNABLES +The +.Nm +driver supports the following loader tunables: +.Bl -tag -width "hw.ix.allow_unsupported_sfp" +.It Va hw.ix.max_interrupt_rate +Maximum interrupts per second. +.It Va hw.ix.flow_control +Default flow control used for all adapters. +.It Va hw.ix.advertise_speed +Default advertised speed for all adapters. +.It Va hw.ix.enable_msix +Enable Message Signalled Interrupts (MSI-X). +.It Va hw.ix.allow_unsupported_sfp +Allow unsupported small form-factor pluggable +.Pq SFP +modules. +Use at your own risk. +.It Va hw.ix.enable_fdir +Enable Flow Director. +Flow Director directs Ethernet packets to the core where the +packet consuming process, application, container, +or microservice is running. +.It Va hw.ix.enable_rss +Enable Receive-Side Scaling (RSS). +When RSS is enabled, all of the receive data processing for +a particular TCP connection is shared across multiple processors +or processor cores. +Without RSS, all of the processing is performed by a single +processor, resulting in inefficient system cache utilization. +This has no effect if your system has only one processing unit. +.It Va hw.ix.enable_aim +Enable Adaptive Interrupt Moderation (AIM). +Vary the interrupt rate over time based on the traffic for +that interrupt vector. +.El .Sh DIAGNOSTICS .Bl -diag .It "ix%d: Unable to allocate bus resource: memory" @@ -113,7 +149,8 @@ issue to .Xr ng_ether 4 , .Xr polling 4 , .Xr vlan 4 , -.Xr ifconfig 8 +.Xr ifconfig 8 , +.Xr sysctl 8 .Sh HISTORY The .Nm From nobody Wed Oct 30 01:03:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTQp4sHMz5bHFT; Wed, 30 Oct 2024 01:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTQp1bJkz4LMZ; Wed, 30 Oct 2024 01:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wcnVXRYKcgGBbo3F4oLluxZprcTpgCQ9aey8DsgmpQc=; b=xykx0f4njLR33lAseqifTEB7QdyBPR7dJ1zxCwuyv46nub9nAg14kipAFVgbz5OrIbF7OM 3V+Gp4GTcBnqwVCReCn9ApPClxudSvSt1vy5oE+DFB7Ot78Z4ifl7pABLf0jFZ0eIK8BB3 GcVxpPOS/Zty2gQkztAi+FHNdbxpppwY52UOw0ManoFzotMadYmTiQLPna5uG1sUge1Qt9 g0tKZMLvuaO6LeE6om9aMrj0fQ8EImGW9Jj2+ennS57wnkBbRv5CX9zI25Z1bf6JpDgLo3 t4IYVH01ZtO/bAS6z/ekK2+Qx+tSSzCQdV9Tl6uj5SDGhJtn3MYgUvQ+igla9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wcnVXRYKcgGBbo3F4oLluxZprcTpgCQ9aey8DsgmpQc=; b=HAfj/+ETwWljbhQnacxeJdyqP/WxwGLdpEmWJeqfMLZtQ4Ms/PYJv49pZa9p3LiBq+nVG0 lryUU/qYxxMhwz6yGDePGOurcdvkBc8XKcZw4e5s4vnO3Lg/Qi3zStn2qLwZ7JYPZcR6/z lAGLFoMFjMkkk31fWTDvuG0glI9tPGWXsl+dJTSA2UfvmWwYj1TeV9i6O1DUl62XTa/kB8 WYr6hgoAbJUOkEwy49NcULI+V+h+se9Bnvx6MPmDA3asEfafM+k8zlbcrf6lc9OO0P2slz dIbQFULME4WNuvrRC2zTSC1of0MfmYUsTnz6TCGgkDXEN+PCL3id2DwT3qu9tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250226; a=rsa-sha256; cv=none; b=H+UNrA6VIrZB3rQR1gqoktLlRG4sCeUlQ5Bh/T3eA9hTKXr2GtIoAKNR8We/mnOJ0rn+cp 95s1Eb97CK9UgFG1Gut81mONPv2ANE2KAgKWnum/amKPRB6GjyWwF8t175hfAFGtpbgU6J HhsFlF3QTc/qnbtGVuSmReS1cFL/V/krhYgJbHArHIIKHoy9ZRxuGtgI4h0zOhAWiWlXPm W7dxDw31+r9h1hjHsiavKj8YXqzhTd+i0+Nc9+q1q8A3rstXgv9/1tjJRiZnoh97ZmOztC kmtjXIZJJS0j18F3q0URfX5vtt5k8KrjSVI9IECd/NWzrh/UFUoGPKmWunhiGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTQp0n23zmqV; Wed, 30 Oct 2024 01:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U13kSO023968; Wed, 30 Oct 2024 01:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U13kcF023965; Wed, 30 Oct 2024 01:03:46 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:03:46 GMT Message-Id: <202410300103.49U13kcF023965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 7b518a4b647e - stable/13 - ix.4: describe better List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7b518a4b647ed675949d51bbb889eb2e176e672a Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7b518a4b647ed675949d51bbb889eb2e176e672a commit 7b518a4b647ed675949d51bbb889eb2e176e672a Author: Alexander Ziaee AuthorDate: 2024-10-27 00:55:59 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:03:21 +0000 ix.4: describe better + add controller name to title for search keywords - remove "for the freebsd operating system" from title/search keywords - remove `(R)` from the page title for consistency with other drivers - increase specificity of HARDWARE for inclusion in Release HW Notes - order HARDWARE in reverse chronological so non-eol appear first - s/PCI/PCIe/ Reported by: kbowling (additional hardware supported) Pull Request: https://github.com/freebsd/freebsd-src/pull/1494 (cherry picked from commit 2d28fd51e5b9d8ef184445dfa204f6ba22d460a5) --- share/man/man4/ix.4 | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 4f90ded1e3ee..418b6e1188ab 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -29,12 +29,12 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd May 17, 2023 +.Dd October 26, 2024 .Dt IX 4 .Os .Sh NAME .Nm ix -.Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" +.Nd Intel 10Gb Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -53,8 +53,7 @@ if_ix_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for PCI 10Gb Ethernet adapters based on -the Intel 82598EB Intel(R) Network Connections. +driver provides support for Intel(R) 10Gb Ethernet PCIe adapters. The driver supports Jumbo Frames, MSIX, TSO, and RSS. .Pp For questions related to hardware requirements, @@ -74,17 +73,26 @@ For information on enabling VLANs, see .Sh HARDWARE The .Nm -driver supports the following cards: +driver supports Intel 10Gb Ethernet PCIe adapters, +including: .Pp .Bl -bullet -compact .It -Intel(R) 10 Gigabit XF SR/AF Dual Port Server Adapter +Intel(R) Ethernet X553 .It -Intel(R) 10 Gigabit XF SR/LR Server Adapter +Intel(R) Ethernet X552 .It -Intel(R) 82598EB 10 Gigabit AF Network Connection +Intel(R) Ethernet X550 .It -Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection +Intel(R) Ethernet X540 Bypass +.It +Intel(R) Ethernet X540 +.It +Intel(R) Ethernet X520 Bypass (82599) +.It +Intel(R) Ethernet X520 (82599) +.It +Intel(R) 10 Gigabit Server Adapter (82598EB) .El .Sh LOADER TUNABLES The From nobody Wed Oct 30 01:03:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdTQq32Rfz5bH8Y; Wed, 30 Oct 2024 01:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdTQq2Bh6z4LW7; Wed, 30 Oct 2024 01:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BO4MSkEfHxMEinVKWcFXWkbLmMgNu36TPrsDV5Dd9ZI=; b=u+RIFxDT2nnP2xJStUybHXcF1FzCg40IUlxOJFKM9FUIPJebs814GryKMCp4BQ95v170+9 dsi0WJuawKDOqxSlQQhjHV+S/UqQ4OCjg81iL1h9i2CNPF/wJX302xcLVSENp53lm2B6Zr JKXpPcJtxlVpwz05uodT35OdhtbNIRPr+tqblSoxL4CBO+h0jEZoG3P1SX0mOFHx2v6g0D +iWcCWU1+a0uTleyRCvd4XQKoHd6ZpGsRUxgAJBi7czWe5g+YHKAvLjAjNRFxnSj5El7qA 9X98ak6ngoRXbqidRsfz2R9t3Pk1o7SAgTHgSzyD18CLW/6idDEXmh9lGgof5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730250227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BO4MSkEfHxMEinVKWcFXWkbLmMgNu36TPrsDV5Dd9ZI=; b=Px96thP488cWDUEmosDhlQBoG+PUD2tlnjOv1PjHvEyZHHA6mi1ivE0U00l+UVi2AqrDId Rt0o6Xwrm2LSmSb3iNxAGDKwLw7feMCKd8cWgcMiJfhOz3lsPRiL/9uPgfOLN/Q66mtgdr SApFuRBTF2ed1y6pwMyRlSDPmZ2jZgtEFioDZ94c5C6zL06qR0JNZgWTwX1g0rhBPjQyb9 EVDdy8rwseXT4WHNfwdppNx6ZAhaybzti440mQVGEw3EpgeOvS79eGyOzybxfg2Ea9gBg9 Hw2n8P8VRuYpp7R7iBmFkRTljnbw2Oi+xYmOMITVdiK0DZKiaqlkgKGm1Nlvcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730250227; a=rsa-sha256; cv=none; b=Br9pOJeKrt8UT++v5My2u5vBPLubDDepghMfs6SdSVZmOzaTn+1sXH94xk6COl2IvOu2rl lTHC1pSpJDrc6ch9DaHYinu6af6GCto4DJEIDgeev84wydCoj41FQpz2f9s1hmVLUKdQYY zkj/t7GOfXvs69W9f1BgG8fAeN4UM3BME+FtDbuiJgdZDKupTsV/NO4kK/RylsWeLUDUmy M/skStNITTjBt10Gzsja8U+WWtH9SzhZDt6xDULrYpPE3fgPZqzxp25x8gT7OcP1o2RccK jaS4LZBz2QSiUafFledW5jOKlTVXqQ/v7VNXXWoia18Xu6FDWgpcNuvN9ri1Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdTQq1n5gzmqW; Wed, 30 Oct 2024 01:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U13lH8024011; Wed, 30 Oct 2024 01:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U13lKT024008; Wed, 30 Oct 2024 01:03:47 GMT (envelope-from git) Date: Wed, 30 Oct 2024 01:03:47 GMT Message-Id: <202410300103.49U13lKT024008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 68b28407b67f - stable/13 - ix.4: update crossreferences to ixgbe.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68b28407b67f52d0dbd3e7c095fa5329c1453de3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=68b28407b67f52d0dbd3e7c095fa5329c1453de3 commit 68b28407b67f52d0dbd3e7c095fa5329c1453de3 Author: Alexander Ziaee AuthorDate: 2024-10-27 01:54:00 +0000 Commit: Kevin Bowling CommitDate: 2024-10-30 01:03:33 +0000 ix.4: update crossreferences to ixgbe.4 Pull Request: https://github.com/freebsd/freebsd-src/pull/1494 (cherry picked from commit cadb71e4b013925c145dd5e0726a3594111410cb) --- share/man/man4/altq.4 | 2 +- share/man/man4/ixl.4 | 2 +- share/man/man4/netmap.4 | 2 +- share/man/man4/vlan.4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index fc51b88e88b5..b1d6f556dd48 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -144,7 +144,7 @@ They have been applied to the following hardware drivers: .Xr fxp 4 , .Xr gem 4 , .Xr igb 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr jme 4 , .Xr le 4 , .Xr liquidio 4 , diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index 8397bd99a5e7..bd183be48cd2 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -209,7 +209,7 @@ When the driver is finding the last TX descriptor processed by the hardware, use a value written to memory by the hardware instead of scanning the descriptor ring for completed descriptors. Enabled by default; disable to mimic the TX behavior found in -.Xr ixgbe 4 . +.Xr ix 4 . .El .Sh SYSCTL PROCEDURES .Bl -tag -width indent diff --git a/share/man/man4/netmap.4 b/share/man/man4/netmap.4 index 3c286a0958e6..08949493a632 100644 --- a/share/man/man4/netmap.4 +++ b/share/man/man4/netmap.4 @@ -827,7 +827,7 @@ On .Xr em 4 , .Xr iflib 4 .Pq providing Xr igb 4 and Xr em 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr ixl 4 , .Xr re 4 , .Xr vtnet 4 . diff --git a/share/man/man4/vlan.4 b/share/man/man4/vlan.4 index 775eb3235c07..25405172ed62 100644 --- a/share/man/man4/vlan.4 +++ b/share/man/man4/vlan.4 @@ -130,7 +130,7 @@ in hardware: .Xr cxgbe 4 , .Xr em 4 , .Xr igb 4 , -.Xr ixgbe 4 , +.Xr ix 4 , .Xr jme 4 , .Xr liquidio 4 , .Xr msk 4 , From nobody Wed Oct 30 03:09:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCL4S0Lz5bST8; Wed, 30 Oct 2024 03:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCL3zP4z4XXK; Wed, 30 Oct 2024 03:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HIgsot0eHzW0luyjUdPXM43JBHcQl91Y38BABIkCktk=; b=esLAod1sLDXziIua83TOkYicBFkQ2RX63tLMwIA52iTlaykvntrtsbjGQsYEq79S2es5t1 ZlQDmr6c/HRmryTjD/xREuKOTmJs66q6QLbLKP3VwT/PgGutdVdTH4mhbm35xqKVi37afq fSrfKLo2EgoF2KwO0V1MXPIDSxifFALqFtRo8fx2eayGXSl6HDiGdWUnyrR+Iq+bj6xyxa IA96LMtrRXrImEAkUFVeBXWkt5scdYkj/fYIN8rJa9wgYZjZmHTEUZ9lmtfj/cc6NMuIcf EEIi+yNNsNtTmg9nxt8E627ms/yt1erEOX721nlcygN1DHi/5rKOSiuDFi2wvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HIgsot0eHzW0luyjUdPXM43JBHcQl91Y38BABIkCktk=; b=OUUBFirzbLiwECN8YgMlix7nOgkRRjE5dz9HRZL+X/DmcL27FZvIuX2a6HorIjMfIMkV1f 3I5ZVHZwfbbhbfpaRivkHU9JyEn8W6sdJPLf+3nBlGYERibX7OaHz6e5ehHqEpcV60EyTt JRkCxe5x04t863bp1hXLKpG+eEwqi9bQK8gwUf4iibUAu4nRjzmLz04+/yYXUprIFehaeU AtRqt2CVlTkFblIv4Ib7n7b7ML48lb1i0tiGZBhtLw8jaRtlRXBmrod+m023m1SMTCTxjX QABSucLGFcHmNRn+2G1hMOIBrjmvmBV1p9YTCvOhzQAzDfh5o5r4VIUBHkMBkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257742; a=rsa-sha256; cv=none; b=j/oRgjwC2ItEM4YglFu54TP3PEe6Z5Q8sHuMs9rsdU0UBXb/PlMXAB7wNjBgyR8KTLVdGn ce5gSdpnT9hBZJqfm8bLUgXxWVMo67eqpSa+O1IbdXU93AVXTay/IJo2POWd29O7HiHAvv 9tUH3E63QMgM9tjdgbmE59aC53OSAsu1Yhz1jE/m2napnhVqEbAAvHWXp0kESg2hKB4EH7 m5+PxNchC8wCW1WCXvfS3VGlb+DitjvN1B/pu4Sq/2OdZfrRXUGbndd49d909i6Q0XQrYO 6jf5oltoHqIbpQgGQVKwRiGrdKrnerMU81XmPrsDWUhSM3pLY9sfZOiTqdAVKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCL3ZfmzqDc; Wed, 30 Oct 2024 03:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U392cS048538; Wed, 30 Oct 2024 03:09:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U392Qi048535; Wed, 30 Oct 2024 03:09:02 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:02 GMT Message-Id: <202410300309.49U392Qi048535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 358908d6a337 - stable/14 - DMAR: handle affinity for in-memory data structures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 358908d6a337ab63d71f03ffce167a1e41036197 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=358908d6a337ab63d71f03ffce167a1e41036197 commit 358908d6a337ab63d71f03ffce167a1e41036197 Author: Konstantin Belousov AuthorDate: 2024-10-22 01:03:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 DMAR: handle affinity for in-memory data structures (cherry picked from commit 705090cba428525507fd0e8597cbf1cf8a68ae35) --- sys/x86/iommu/intel_dmar.h | 1 + sys/x86/iommu/intel_drv.c | 33 +++++++++++++++++++++++++++++++++ sys/x86/iommu/intel_idpgtbl.c | 17 ++++++++++++++--- sys/x86/iommu/intel_intrmap.c | 19 +++++++++++++++---- 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index c3163abf6f92..1a9b5041975c 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -109,6 +109,7 @@ struct dmar_unit { struct x86_unit_common x86c; uint16_t segment; uint64_t base; + int memdomain; /* Resources */ int reg_rid; diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index f4a1ec06b721..22d04029f9ae 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -325,12 +326,34 @@ dmar_print_caps(device_t dev, struct dmar_unit *unit, DMAR_ECAP_IRO(unit->hw_ecap)); } +/* Remapping Hardware Static Affinity Structure lookup */ +struct rhsa_iter_arg { + uint64_t base; + u_int proxim_dom; +}; + +static int +dmar_rhsa_iter(ACPI_DMAR_HEADER *dmarh, void *arg) +{ + struct rhsa_iter_arg *ria; + ACPI_DMAR_RHSA *adr; + + if (dmarh->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) { + ria = arg; + adr = (ACPI_DMAR_RHSA *)dmarh; + if (adr->BaseAddress == ria->base) + ria->proxim_dom = adr->ProximityDomain; + } + return (1); +} + static int dmar_attach(device_t dev) { struct dmar_unit *unit; ACPI_DMAR_HARDWARE_UNIT *dmaru; struct iommu_msi_data *dmd; + struct rhsa_iter_arg ria; uint64_t timeout; int disable_pmr; int i, error; @@ -358,6 +381,12 @@ dmar_attach(device_t dev) if (bootverbose) dmar_print_caps(dev, unit, dmaru); dmar_quirks_post_ident(unit); + unit->memdomain = -1; + ria.base = unit->base; + ria.proxim_dom = -1; + dmar_iterate_tbl(dmar_rhsa_iter, &ria); + if (ria.proxim_dom != -1) + unit->memdomain = acpi_map_pxm_to_vm_domainid(ria.proxim_dom); timeout = dmar_get_timeout(); TUNABLE_UINT64_FETCH("hw.iommu.dmar.timeout", &timeout); @@ -424,6 +453,10 @@ dmar_attach(device_t dev) unit->ctx_obj = vm_pager_allocate(OBJT_PHYS, NULL, IDX_TO_OFF(1 + DMAR_CTX_CNT), 0, 0, NULL); + if (unit->memdomain != -1) { + unit->ctx_obj->domain.dr_policy = DOMAINSET_PREF( + unit->memdomain); + } /* * Allocate and load the root entry table pointer. Enable the diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index e1b89571971b..11e71fa864a2 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -31,12 +31,13 @@ #include #include #include -#include +#include #include #include #include #include #include +#include #include #include #include @@ -232,6 +233,10 @@ dmar_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr) tbl->maxaddr = maxaddr; tbl->pgtbl_obj = vm_pager_allocate(OBJT_PHYS, NULL, IDX_TO_OFF(pglvl_max_pages(tbl->pglvl)), 0, 0, NULL); + /* + * Do not set NUMA policy, the identity table might be used + * by more than one unit. + */ VM_OBJECT_WLOCK(tbl->pgtbl_obj); dmar_idmap_nextlvl(tbl, 0, 0, 0); VM_OBJECT_WUNLOCK(tbl->pgtbl_obj); @@ -676,21 +681,27 @@ int dmar_domain_alloc_pgtbl(struct dmar_domain *domain) { vm_page_t m; + struct dmar_unit *unit; KASSERT(domain->pgtbl_obj == NULL, ("already initialized %p", domain)); + unit = domain->dmar; domain->pgtbl_obj = vm_pager_allocate(OBJT_PHYS, NULL, IDX_TO_OFF(pglvl_max_pages(domain->pglvl)), 0, 0, NULL); + if (unit->memdomain != -1) { + domain->pgtbl_obj->domain.dr_policy = DOMAINSET_PREF( + unit->memdomain); + } DMAR_DOMAIN_PGLOCK(domain); m = iommu_pgalloc(domain->pgtbl_obj, 0, IOMMU_PGF_WAITOK | IOMMU_PGF_ZERO | IOMMU_PGF_OBJL); /* No implicit free of the top level page table page. */ vm_page_wire(m); DMAR_DOMAIN_PGUNLOCK(domain); - DMAR_LOCK(domain->dmar); + DMAR_LOCK(unit); domain->iodom.flags |= IOMMU_DOMAIN_PGTBL_INITED; - DMAR_UNLOCK(domain->dmar); + DMAR_UNLOCK(unit); return (0); } diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c index 122b92827b77..4f69e2d44996 100644 --- a/sys/x86/iommu/intel_intrmap.c +++ b/sys/x86/iommu/intel_intrmap.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -345,10 +346,20 @@ dmar_init_irt(struct dmar_unit *unit) return (0); } unit->irte_cnt = clp2(num_io_irqs); - unit->irt = kmem_alloc_contig(unit->irte_cnt * sizeof(dmar_irte_t), - M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0, - DMAR_IS_COHERENT(unit) ? - VM_MEMATTR_DEFAULT : VM_MEMATTR_UNCACHEABLE); + if (unit->memdomain == -1) { + unit->irt = kmem_alloc_contig( + unit->irte_cnt * sizeof(dmar_irte_t), + M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0, + DMAR_IS_COHERENT(unit) ? + VM_MEMATTR_DEFAULT : VM_MEMATTR_UNCACHEABLE); + } else { + unit->irt = kmem_alloc_contig_domainset( + DOMAINSET_PREF(unit->memdomain), + unit->irte_cnt * sizeof(dmar_irte_t), + M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0, + DMAR_IS_COHERENT(unit) ? + VM_MEMATTR_DEFAULT : VM_MEMATTR_UNCACHEABLE); + } if (unit->irt == NULL) return (ENOMEM); unit->irt_phys = pmap_kextract((vm_offset_t)unit->irt); From nobody Wed Oct 30 03:09:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCM5nMTz5bSWk; Wed, 30 Oct 2024 03:09: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCM5Gmmz4XNm; Wed, 30 Oct 2024 03:09:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HRiH5D1I5GyRM5BQiOW8Fuu0Jbmz0wNgZkG/4f+IPg8=; b=oVdEy+/7K0KxHeSWo4I1BjeFpDsQCmqRFVtscciOvnJGhcFKY3yIx8XcyPFbY3K7pUd8Pw HVp8qM/Dw3ErmiEN1+wIqUZfHOtcoB2o485VNbDf9KTwWuo/YiYEDDPkalEXyR0bd+iRHd vOzAUSjLFByiVTizSfpXaSOtEHVDLiDKgxTuPn+LvMW9dxwFLEdVAZicMKORUYm2ec3h/e DY9MoewAMYfi8Jo/zZNpdHA0xTuCz8X1Z6M5k0YRUB2930P8yGJEUlSeLRqDplIsnOwpFu Atzyb5nAENIUuoBuiRrtMFGg5A765UExE/4HzxQR59s0GYhW08gquUVT0qfBRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HRiH5D1I5GyRM5BQiOW8Fuu0Jbmz0wNgZkG/4f+IPg8=; b=oT2NKEKJwwoCQhoT/aPH2K1QVd7Zz/m8THq7peLK6ZKSzLiL/aaic8Otw7yGpTuwunIS/N 0ZuobpdYQjAUnHWHxkThqRzKTEpzIXZcU3bmEeJCwzHf5hyMkXXvW3nadZN+mlCT8JkFvN E4p6gO1Pr4aFqD1bgoUEWdc/wjoH99kd/GrMOZFfXDaVgE7ZpJ6qxn5xD+sxM9L4v6QRGU 4mSPGms9bcYmFy3BUSFHjDclayZqL8QSJG8KRnnYhY16x6SOF95PaHjG00VSoN2kzWtWNs kNtHnzIXMhYlqX5Yx9Ol9fkDfr0rxsyAjsccTSJohs3HO5cEMj4Z/DfkkhshPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257743; a=rsa-sha256; cv=none; b=HhQ1AQyCwZluo81IQTB78F9ut2alS22Cm9tseGu07odtFWplQBn94yaagpAKB0DOReJI0J be833UUDep8kPrbi4Hh6Y83fTqnivsOOhCu3fxkzIf0PGpZYWr7ZZCN4y+tOOlzmWtll7h QwUuqwOot1DMSIi+8G8EDJ201zq3k5XRWV5/S57coqNmPK+nLs9wLPcbpJyyEXRDVMx1S4 ufhAg8eXZ8Rs2tfd+TfA2NG9coS55ZLudJBCvoEL69I+WxhFRf+2Vewa9Kpsv/DVfPcBxD q5rueM0/CJixsh+K6XEShfz+XIek6V8HQQwg0WLigm8acbv1j1gtkn3fOjszPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCM4tfjzqVq; Wed, 30 Oct 2024 03:09:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U393Va048597; Wed, 30 Oct 2024 03:09:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U393fV048594; Wed, 30 Oct 2024 03:09:03 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:03 GMT Message-Id: <202410300309.49U393fV048594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0066c70cd853 - stable/14 - x86 specialreg.h: visually align %cr4 and MSR_EFER bit mask definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0066c70cd8536e7cd73a4beff36845f0ff18169c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0066c70cd8536e7cd73a4beff36845f0ff18169c commit 0066c70cd8536e7cd73a4beff36845f0ff18169c Author: Konstantin Belousov AuthorDate: 2024-10-23 23:02:22 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg.h: visually align %cr4 and MSR_EFER bit mask definitions (cherry picked from commit 2ac21f2c98edf50e22f06a63f3528a99f4f963a0) --- sys/x86/include/specialreg.h | 64 ++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 16aa07c05e65..c39cfa432d2f 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -59,39 +59,45 @@ /* * Bits in PPro special registers */ -#define CR4_VME 0x00000001 /* Virtual 8086 mode extensions */ -#define CR4_PVI 0x00000002 /* Protected-mode virtual interrupts */ -#define CR4_TSD 0x00000004 /* Time stamp disable */ -#define CR4_DE 0x00000008 /* Debugging extensions */ -#define CR4_PSE 0x00000010 /* Page size extensions */ -#define CR4_PAE 0x00000020 /* Physical address extension */ -#define CR4_MCE 0x00000040 /* Machine check enable */ -#define CR4_PGE 0x00000080 /* Page global enable */ -#define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ -#define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ -#define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ -#define CR4_UMIP 0x00000800 /* User Mode Instruction Prevention */ -#define CR4_LA57 0x00001000 /* Enable 5-level paging */ -#define CR4_VMXE 0x00002000 /* enable VMX operation (Intel-specific) */ -#define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ -#define CR4_PCIDE 0x00020000 /* Enable Context ID */ -#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ -#define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ -#define CR4_SMAP 0x00200000 /* Supervisor-Mode Access Prevention */ -#define CR4_PKE 0x00400000 /* Protection Keys Enable */ +#define CR4_VME 0x00000001 /* Virtual 8086 mode extensions */ +#define CR4_PVI 0x00000002 /* Protected-mode virtual interrupts */ +#define CR4_TSD 0x00000004 /* Time stamp disable */ +#define CR4_DE 0x00000008 /* Debugging extensions */ +#define CR4_PSE 0x00000010 /* Page size extensions */ +#define CR4_PAE 0x00000020 /* Physical address extension */ +#define CR4_MCE 0x00000040 /* Machine check enable */ +#define CR4_PGE 0x00000080 /* Page global enable */ +#define CR4_PCE 0x00000100 /* Performance monitoring counter + enable */ +#define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ +#define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_UMIP 0x00000800 /* User Mode Instruction Prevention */ +#define CR4_LA57 0x00001000 /* Enable 5-level paging */ +#define CR4_VMXE 0x00002000 /* enable VMX operation + (Intel-specific) */ +#define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE access + instructions */ +#define CR4_PCIDE 0x00020000 /* Enable Context ID */ +#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ +#define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution + Prevention */ +#define CR4_SMAP 0x00200000 /* Supervisor-Mode Access + Prevention */ +#define CR4_PKE 0x00400000 /* Protection Keys Enable */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. */ -#define EFER_SCE 0x000000001 /* System Call Extensions (R/W) */ -#define EFER_LME 0x000000100 /* Long mode enable (R/W) */ -#define EFER_LMA 0x000000400 /* Long mode active (R) */ -#define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ -#define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ -#define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ -#define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ -#define EFER_TCE 0x000008000 /* Translation Cache Extension */ -#define EFER_MCOMMIT 0x00020000 /* Enable MCOMMIT (AMD) */ +#define EFER_SCE 0x000000001 /* System Call Extensions (R/W) */ +#define EFER_LME 0x000000100 /* Long mode enable (R/W) */ +#define EFER_LMA 0x000000400 /* Long mode active (R) */ +#define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ +#define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved + for Intel */ +#define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ +#define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ +#define EFER_TCE 0x000008000 /* Translation Cache Extension */ +#define EFER_MCOMMIT 0x000020000 /* Enable MCOMMIT (AMD) */ /* * Intel Extended Features registers From nobody Wed Oct 30 03:09:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCP0Wxvz5bSd6; Wed, 30 Oct 2024 03:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCN65fvz4XRj; Wed, 30 Oct 2024 03:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXw624RpiDulHWotygwKAo+XQYcDnQwCmAcTI2IshHw=; b=Iez4aQquHWMtgR4shu9DjgvgzNVfmSmqCZmoj2tH/uqjliBpzDiLOu1egwWE+/+QYaUw7q Yw2yFKM8BbYpS/PMyOHfp/KAoVyjohm7WZkXyPHDjnepJw3k5S6a9ZaE05Q1ltOWUvzUpZ 9CKVCNhfE60CczVAakwpm5bDNgkOXxXzbPWUovPQ476VPxSeU0/pOfJW3pue2E9k6kETrv QDCfLG14ASQIpN6v0ndwHuXpUmKgWJMhyPunT05M4ZcXT4htux8vxSKxQoeQeXP1lS9nxR 7VqOrmiJyWd7NTF6u/A9sdPhvyEM40yHayE2JnfM1rYk8Amy02zSiD3L4VCwKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXw624RpiDulHWotygwKAo+XQYcDnQwCmAcTI2IshHw=; b=tEhmCnN43lX6lY1k+EtiMLOtRfTsBFueKjvsVk62EcrpLFLZycfNfmFwYHejpzW39JWRLR WXZPxlA4MRNr5M2IiL83zFkOsZRQLeLVjTswipk98mN8alHeaZgSP6qyudbGAKXjOI4al1 8PCUx7RB6tzEe6P6u1H5pIQP7nzLGTLxDQGLfLKbUtDnVbaAXfLqBvgbjPjFPhzpgmButy wCWfFIo7Y0gT93PEYyJsDIJYjpF2Ji7wax8W4jYVD+npy9AB2bLFf79ZadpwbayVJuLLav 7YgUEUwbFdw7MK6ax0cQwtkSD8nr9G9uFy/eJX+FvQo+NaC5kWUtVu/tK5diog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257744; a=rsa-sha256; cv=none; b=Eun5zLx07e3PqsRFl1xSZIU+YHUYK2Ta/BSZ7vjCpIrRQZSXRHZI4vjHLLJNH3YwEDQk/8 vuC2xAkTIDXAOfROezVGpu1bnEMZwK12B7Mufln12clX0j+e4q2ozHAdHLAVT/h3G4n5Z7 qi8HfMXK57i5hxOAJ5KjJzPsFQb20l5r+Ptd2apKiD6n6wDCdZjbuTrRxCqJLiCtvoZDDS Wad6VHDinkvj0m0GxmIvJpiBFKy5yTFEgsPK8UAQ96Nm6MH5A6rlRStrQ5L+ABNB4iDWJK 3Yt3Jd8C+PpL/MThKQQh6NquV5D1aKeC5yqJ5R0wDRIRyq7FpVQ/pRkPjcebUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCN5g15zqwH; Wed, 30 Oct 2024 03:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U394YO048664; Wed, 30 Oct 2024 03:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U394ue048661; Wed, 30 Oct 2024 03:09:04 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:04 GMT Message-Id: <202410300309.49U394ue048661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 03005c9195c7 - stable/14 - x86 specialreg.h: add all defined bits for %cr4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 03005c9195c79ddbdba5c90019883d196fca1330 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=03005c9195c79ddbdba5c90019883d196fca1330 commit 03005c9195c79ddbdba5c90019883d196fca1330 Author: Konstantin Belousov AuthorDate: 2024-10-23 23:11:50 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg.h: add all defined bits for %cr4 (cherry picked from commit cc11bc1150d59c3da5c7319c9a23b3e48b069f1f) --- sys/x86/include/specialreg.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index c39cfa432d2f..d67112a3758b 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -84,6 +84,13 @@ #define CR4_SMAP 0x00200000 /* Supervisor-Mode Access Prevention */ #define CR4_PKE 0x00400000 /* Protection Keys Enable */ +#define CR4_CET 0x00800000 /* Control-flow Enforcement + Technology */ +#define CR4_PKS 0x01000000 /* Protection Keys for Supervisor */ +#define CR4_UINTR 0x02000000 /* User Interrupts Enable */ +#define CR4_LASS 0x08000000 /* Linear Address Space Separation */ +#define CR4_LAM_SUP 0x10000000 /* Linear-Address Masking for + Supervisor */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From nobody Wed Oct 30 03:09:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCQ259Vz5bSWn; Wed, 30 Oct 2024 03:09:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCQ0C6Vz4Xhv; Wed, 30 Oct 2024 03:09:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAPMZNSrtmoRU2llmjeOK/pexXZCoBUSKEnPZG7bjnM=; b=OHRgMQ9BiMCS9khKOktHTxjrz1/v/xb9Jvb/4K3u8jB00Qmw4ga66L+lFC7Bu4B00HRP2s R2pozs7ojTQ+E7rYKtvwD0taD+/DdO8zRRuCE8rO9xoTQTAy2C0rcm3iJb1OEAXCOwsgxU vJSdd3CUzus+omNTwG1BUk+7g42fViOYuwHgoEkUhM34ERbbWP1KfpayVbTW7zNy48sHtz jAybbI4z1tt21J0giy8ZG7hYc29yDSpj9XpDFDBz/KbXghYe/ZDfuQL/Mw3oUTDNU8fUOz czYfGFqnOJteic82HpgzklY3V2FhBMZAP9TnZXnyNlVRuKcS7milPt5B/uFDKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAPMZNSrtmoRU2llmjeOK/pexXZCoBUSKEnPZG7bjnM=; b=LPVyh6pKq8KP0ePnJzDL29fglnaS6R6mL6+FhtmJBEiOWK0QEw7tXwgXjkPRx8Rdtl3MBn PUuacPV4zmdV4JuUaUBXM9Grjh2e43j8TmhvO4WlUgcb3xUaPJGCnwZmU9bXOz4A1Ckk3M gh1dvtXvuHqyXJgOGw1oFg+FsGHwjiqWC7VynBGlKMHybJQlp7bRuz8GzjVbItsFaFdpSD ysE8FMS67B8nXDhxqhAvDYcV7DdQ++5G209kZDn8mxDdJFcB4I0RycdHs0lWmJfvazwYbM tc+HdSOwu5OgBjJ8zK5+g6xiq3jhNl33JZHtiQLhuoBxOSX5XT2TMIAiASaGRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257746; a=rsa-sha256; cv=none; b=H3+A25FrUwecoK8uAQ3oEtZNec21+4Om+lqFyC6AUvhPX62cYABfUVpkRf7jNp6Wc3bXod bkw3q6+HlMvnpNmL2LafyooXew1AKisjKSnrv6edTGn81WHi1477g5NbItSVIGnpothQ9I PgP/JVEoP12AtWVUBU0WUKTi0WPYePZehAKb7XZzLc8qw+ICxLhnShj0wGgyE2ZOuf6/KC sC6dAx1GRKt5axR94bNmDJBqFA/EeycqU7AFskWhV9CtNl46Wxi2E1dHCP7KelWDCQxUWD 3YD6uQbfLuDWjIf6oJ7VotssaFoPOPOGZIF9ZqxZ8umNX2kSVbvfli4JPVUZlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCP6fx5zqPr; Wed, 30 Oct 2024 03:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U3959x048742; Wed, 30 Oct 2024 03:09:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U395rP048739; Wed, 30 Oct 2024 03:09:05 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:05 GMT Message-Id: <202410300309.49U395rP048739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5a0da3fb3827 - stable/14 - x86 specialreg: reorder %cr3 bits masks definitions by value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a0da3fb3827315b37fb5d9a88be505e0e5fd2b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5a0da3fb3827315b37fb5d9a88be505e0e5fd2b1 commit 5a0da3fb3827315b37fb5d9a88be505e0e5fd2b1 Author: Konstantin Belousov AuthorDate: 2024-10-23 23:13:45 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg: reorder %cr3 bits masks definitions by value (cherry picked from commit cc4b25f10211fdd5a347a5a9fc26b2c86476db7f) --- sys/x86/include/specialreg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index d67112a3758b..a8ff7aa2b30d 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -53,8 +53,8 @@ #define CR0_NW 0x20000000 /* Not Write-through */ #define CR0_CD 0x40000000 /* Cache Disable */ -#define CR3_PCID_SAVE 0x8000000000000000 -#define CR3_PCID_MASK 0xfff +#define CR3_PCID_MASK 0x0000000000000fff +#define CR3_PCID_SAVE 0x8000000000000000 /* * Bits in PPro special registers From nobody Wed Oct 30 03:09:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCR3F8jz5bSZd; Wed, 30 Oct 2024 03:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCR0frbz4XcZ; Wed, 30 Oct 2024 03:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMBzZfx9DZ9nUbqk+QYk6Gy2JSsB4sNOnzQmJrMlB8o=; b=SpMPQnRqvcpiEjYxWasA/IEmp0YYTIblxQmvlJ5FW6Rp24LI8t40Py5f+sxkUtlHm+hSz0 zKo/m8HRnK4WhvHSDVCmp9us/qupEqiqJqGjtlwg2sZiVzKIAts6v+16LkpYERYWoyDSUF /gNqN+Du4FduxYjtsQUYDKtYP7dT66wIUHX5vElMBO4TPoXNj+N6LYQFhMqg5wvfD/9eYq 8mEq8AqdxNHvdDF1O0337XXQ1BHcVN1ZT75VdiSZLl3G2ciMyW77cH/lrCQfrLQ8qNcXnE i+a6Hjl/3B7rmt1s47fvd89mF0KU2hD0sch5nbbnICszd4pArTigBEPvaSVAnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMBzZfx9DZ9nUbqk+QYk6Gy2JSsB4sNOnzQmJrMlB8o=; b=fTOzBM8X5MDrkxXH7y1rbHI03dyhBT0F9jX6sh89wllTUhujkGuXzKPN6JcDyp7F/owsU6 p0QBa+53YMFf3yiBg39v/TMRUVdN3rK39t5xokwvLPuwym8H4oX0HAVdFI0BnPYjmu6NRB gN0ps41GvYDoBanDL1mVg1JuKjP6nVfhCJ0AeFBgaHduynSlR2x3EUfzdmn9RmaAHWdQb0 O2ddncHPOMA7omIKYy4BfDRP/G1vx0rUeBqEXAK2od+PiB29U+UA8e+KmIzmTNZ3VxLXsL GB9iVEJs+Y02kIhe2LqPkmUTvSJ2xZWAeoRRoNPpwgDsbEFQ09h2nsyWj6+RWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257747; a=rsa-sha256; cv=none; b=mgsnTwvw5ujZbwHtxFUl8NaHlHoStizqgsCFP9l73Cq1IA8yd+/L/XhCw8gcCLYvV1i7MX axTjfcZNpW91HKN0C8eXoW+iA0xW7tRPFFFV+ES0FKRrqBqUvyhSvNg26pnyqHclg9ZpN/ +zd8MiCFtUx2FoXLTVTu1h0ixcAg41LXkxz9D2Vf64Rg6si+B0HBByht8ZPy6dgMEQlKwW FDPRehwdKtpySgl/wYv9ak6vVMX49M6ZfzNLCWN7TxV0JXmycL2raaC9invZMQqtQI9C+N NJuM9ey0Xp8YRVH4I+LRjkqdYjy+qJWJu6GywBmDfXAz+vbqHwzNptItvDIBnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCR0H0MzqVr; Wed, 30 Oct 2024 03:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U396El048823; Wed, 30 Oct 2024 03:09:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U396Vg048820; Wed, 30 Oct 2024 03:09:06 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:06 GMT Message-Id: <202410300309.49U396Vg048820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6f26bce4680e - stable/14 - x86 specialreg: add bit masks definitions for LAM in %cr3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f26bce4680e3497b2a4cf3640cdaaa85fed5b3b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6f26bce4680e3497b2a4cf3640cdaaa85fed5b3b commit 6f26bce4680e3497b2a4cf3640cdaaa85fed5b3b Author: Konstantin Belousov AuthorDate: 2024-10-23 23:16:47 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg: add bit masks definitions for LAM in %cr3 (cherry picked from commit 5999b74e963769cbd12eadbe1cebcd34fb312f01) --- sys/x86/include/specialreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index a8ff7aa2b30d..87461bdeafea 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -54,6 +54,8 @@ #define CR0_CD 0x40000000 /* Cache Disable */ #define CR3_PCID_MASK 0x0000000000000fff +#define CR3_LAM_U57 0x2000000000000000 +#define CR3_LAM_U48 0x4000000000000000 #define CR3_PCID_SAVE 0x8000000000000000 /* From nobody Wed Oct 30 03:09:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCS4yCwz5bSwW; Wed, 30 Oct 2024 03:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCS270sz4XPL; Wed, 30 Oct 2024 03:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gLAUpJ5qAT8mhq0Mnojqd6s4tJQ5Gpjx42Se2IQlwCw=; b=HStzUDBG6m/fJV4sKlp/CKov5u5eG719iql9I2+yAO0RSVoc4RqZEjFy8xErpLL9UCd57x IBc/Li1zBzsFO5qhfAZN+moVowZ2EuDRCLQuiv9wsfecW0BkzNOaXfMv74I5qVQJP0QUcu pXHFcarmFhakQCgpspCpjW3qxrFma4Do+6uhvho7gFZJg16eGjLnn80SCPiIQMl80Hlb2A G9w+qBNm8pIuAZOVlDfjcJYVTa5Rhj+6S8FKaAq7IH2mYmXx+wBrGgBORId0TByy/8VEQn 0N4fGmi+hnY2rStZ9WIe5g/IfEqsnksb5Qq2Be52ZAsvFq4RwsU8kXihvo/4dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gLAUpJ5qAT8mhq0Mnojqd6s4tJQ5Gpjx42Se2IQlwCw=; b=pUSGxauAMQYwX+p3h3DiDE+RxGHFFYQJ2KH/deWmua/YwDc9luFFOC0cYUJKT3BXQ24gOi qdl2B+zm9Aahukn4E4XIaTQMqUpL9ybpSg/oqzKY1BAXXbY6eyiA+7bioKUVWKx8BjHQEA rETZ1CFG6nOPeD6o5kj3d+GDHSqz1YfSKy5DnjHKpPgealdjBXwOASFmyqOCZQ6m8jRj5I MFmRDreWyzkNgkU8yN02uxVHM/P20ku5rvwJt1MbS07dR/S/+jI3YBQ2Y9aBuWCKru5m1y SojjHafGR2ysYqykFjjBJLR776BZYQn8BeSCKzUfJYk+hDlTP1fqkGIzNPso5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257748; a=rsa-sha256; cv=none; b=bfXgqXLcKjBZ+kWPtxV2WMzxPtRaCHYFaePckpNwyIFmBaw2RU7N96THfENhIu2YqEitc+ X1y/9UZoGZ7TcUs/Njt5c29IWqD+CG38iCFT9DpAoy1zwXLvjUJGJj35u5L68zJsYlFKIE hvlkAIe5Xm2R5xqV3P775/lsYQEgnTQWWHngyI4MOuAKqaWsaI3XThWLNDW8xEvT5zAx6q ouDCTyXa7GrroLB7z8AHLL40KgGWtsQSFIbFxpLxBW0sZOPf80Tkow+lEkrYvBBMTnC3+k zxsnPWddPu++9435duvjypEfzM//HmXaevowWGnOSiYj5RtUcJ0t8L0tIJj7Qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCS1ZwXzql3; Wed, 30 Oct 2024 03:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U398v4048887; Wed, 30 Oct 2024 03:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U398PL048884; Wed, 30 Oct 2024 03:09:08 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:08 GMT Message-Id: <202410300309.49U398PL048884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a00d2dd06189 - stable/14 - x86 specialreg: add bit masks definitions for EFER features List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a00d2dd06189b894ef7b7175a2fe98afbc5486c2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a00d2dd06189b894ef7b7175a2fe98afbc5486c2 commit a00d2dd06189b894ef7b7175a2fe98afbc5486c2 Author: Konstantin Belousov AuthorDate: 2024-10-23 23:21:11 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg: add bit masks definitions for EFER features (cherry picked from commit 6308db659f2ad45b30bbf1d9c47abdc97d14ebb0) --- sys/x86/include/specialreg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 87461bdeafea..1f9069e3c1e1 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -107,6 +107,9 @@ #define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ #define EFER_TCE 0x000008000 /* Translation Cache Extension */ #define EFER_MCOMMIT 0x000020000 /* Enable MCOMMIT (AMD) */ +#define EFER_INTWB 0x000040000 /* Interruptible WBINVD */ +#define EFER_UAIE 0x000100000 /* Upper Address Ignore */ +#define EFER_AIBRSE 0x000200000 /* Automatic IBRS */ /* * Intel Extended Features registers From nobody Wed Oct 30 03:09:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdXCT4nwJz5bSyy; Wed, 30 Oct 2024 03:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdXCT37gcz4XZl; Wed, 30 Oct 2024 03:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pOnlMK5A4UNVT8sbhMKkV7f2QrZo0rF7o1FHpEpgMng=; b=P00FpDPyPtJ77ngWjIlTrcpSwMDgD7AmJbmNE4Tjqe1wBmEGP+kXj7Rxz69uuA3nxMwFh1 DrfU2UXtnbxCdLp9+KgMu9dtMDM8HaMeAijRyuM482jPUVzfe0FG1tXui3l5XJnjbutyoE dfu+Ff7MdodzKgMz2yP7Bcv9BH+/9mjmj3JOSuEccaf9ZfKncQE6thnM54sZrCnEa8A3zy cMolYzm0ZtRvXhIMpzkWt/yNtUoqv/BEJo6rmkgjR8WT57LAx1v1GKJ89QfmL5Gl9v3G6m 7VlyCVBqaNJjaO5shm/Leuk9pzpsriYL6lkK/MP9AAOoLMkUppEDO7Wl0aKOZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730257749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pOnlMK5A4UNVT8sbhMKkV7f2QrZo0rF7o1FHpEpgMng=; b=fwYCekya4bOhtQatahuDZYqS/qOxcvMeF7dIFlF1+QEAbB3eHB/eEcTax7e4yH++jqQ6cy 45Aqe5VvE1EKqFWc9l7ZSW3ZxR/zucb5N9r1Rs1d1NkPqg+qKGSkgwVwMEfHEEhxQb06dE GYLRmmpvy59OPD8iaxbSUt+WcaiesIwBKLoD3pxihSKWJNn8fhWxwdiDyQmrNQvabGdM4l G8uNG05s+NUbD+diyzX5GVWfv0ggcck8Pr1u4f+8WMa3wfcfm9FM+prduHzjOlxfH9e+2g 973SgOFaiLhKHmyf8o/i6nf5j0ujt6Z0OT0SbWQnn0jg8lC7YKKPpEZWriazHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730257749; a=rsa-sha256; cv=none; b=DpBEJ2kbOtqDxO/Xy4kgHB+xmD96FAMfJ72Xu1OTUUH5GVrq+419F3OTjuv95tXtRaLGBL 0MsnnNelGRpbldNVjOvfvGo1BEN1S/rVIZMYR0fQdiC2ebtozOTEGYdLbHzRSoWkxIOuZ4 /ZyKBjSq8ZvWKvlC/au6lXmv+hU+C3VpGoRplcKu2ok1ealhh+y44befR/GzEGvlGEXdee MTFkmV2ZfnRe6PdM3y1/3PWLqJCYQNj1m5cvL+ZbcB3YITk5ORsOh6OiEwhlIv0LgDCafg RnOcsBkxJq17tZelYxdMsQA1xr3wcp9S4toNtPYDfTEnuPgjuKyERIjfiskurg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdXCT2hYHzqVs; Wed, 30 Oct 2024 03:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U3999o048947; Wed, 30 Oct 2024 03:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U399VZ048944; Wed, 30 Oct 2024 03:09:09 GMT (envelope-from git) Date: Wed, 30 Oct 2024 03:09:09 GMT Message-Id: <202410300309.49U399VZ048944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 90d8c39d22e0 - stable/14 - x86 specialreg: add bit masks definitions for LASS and LAM features List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 90d8c39d22e0e939b48a062cad27859e951aede0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=90d8c39d22e0e939b48a062cad27859e951aede0 commit 90d8c39d22e0e939b48a062cad27859e951aede0 Author: Konstantin Belousov AuthorDate: 2024-10-23 23:40:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-30 02:40:30 +0000 x86 specialreg: add bit masks definitions for LASS and LAM features (cherry picked from commit 9f718b57b846b8e1fa562584747fdae42ffed8f4) --- sys/x86/include/specialreg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 1f9069e3c1e1..bd98aa31c9a8 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -536,6 +536,12 @@ #define CPUID_STDEXT3_CORE_CAP 0x40000000 #define CPUID_STDEXT3_SSBD 0x80000000 +/* + * CPUID instruction 7 Structured Extended Features, leaf 1 eax info + */ +#define CPUID_STDEXT4_LASS 0x00000040 +#define CPUID_STDEXT4_LAM 0x04000000 + /* CPUID_HYBRID_ID leaf 0x1a */ #define CPUID_HYBRID_CORE_MASK 0xff000000 #define CPUID_HYBRID_SMALL_CORE 0x20000000 From nobody Wed Oct 30 04:43:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdZJX63sfz5bcNG; Wed, 30 Oct 2024 04:43:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdZJX4bZQz4lp4; Wed, 30 Oct 2024 04:43:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730263420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtKiZiWzvtna/6Y1cWsovB7hS/P51VoZWTOhedFe28s=; b=PP8M7+hhkmvu8NBvEpr+UTufbTLAc1b0c6e3tCqFsXGHD4N6bm80+o8nbbW6x2IID9+3AN T113GtpkaRiCoUvsanO0Jo2vHvaHWRZT4+Fgo70KPUNnvBqrzkp2ZG47NMBybxZ9RMdjJt 6asXG5xhv4VuGyqupNa3xIwsPAiGY31/DEDiZOr2WVCC1EdNatSzDdb8ISZsg2kglh1exA 2lDRLdiRy7S3HlcRAq+V/a3dwPlHnu921KswCT5SrRv1ZGs/BdteP9FGZfLfrrhcOusFqX yFlDMCU8Cd7IQImTSebelccuXUIHtV5eA/HW45P245uVdr5HrHlAy0tNwCT4Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730263420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtKiZiWzvtna/6Y1cWsovB7hS/P51VoZWTOhedFe28s=; b=vVJdpBVftUdtpwyncbHQuLvYG5PojSZGEW4v34HFj6+Gu6JzDVvd++geD/mJRpclvrIhxg 5QUaWtOMVIfVnHeXU6D7B5Dc9m0MC9GKcTJReLbb8qi870o3drnGDpSPKATeuK7oAqEh6G 1CwysEXuJdlHlEWlJKKSdKlbIvDL9keRP5KsTEIHShj2uSXvkpnRvQdaiHG47DqJnq0E3H ZkVB0bQiGYbFNhJc4XvG/NvoSdEv3NrhRT+x4S/P8Lpm4WhiEKSUz2KeKobvV6/DgKml2B ZQYioEbB3uYUFyaZOyTfhKPz7fER53lElOjHmsYXUKGJxjBSMoUDIJbMTNlJ1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730263420; a=rsa-sha256; cv=none; b=u31+WIIEWMFUuyl0NP5Wq48Zos0LOWcahuBFzhnjKuz0iEUlYUDYyVtObdp8hXhgk5EQUe jsZcAqawfofaXurhZNHtyx2drWtzK0VHOq+kBn3YbyD772pZl36rMQsDDIyq+DHje6lsIt aSZ1KbGGVgiXOHYZ7LuRQbXHNbqnDB3rt/HAjQtjDXiGVYxwd/CXu6v+Oj6+Tj6w+Xg/Ym 8xUFFm1l+6ENePEjhwuSOZLteP6rexGdBrJ4Dlmk3qwcuq0j/iZ8aikRquyGt3JC/yUGqx EjkvA+D90TxseTDh0Sr3XYU1YjFsTIqqd4sgN4Oix9SsqIeXQHykF1LZ586u0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdZJX4BscztJm; Wed, 30 Oct 2024 04:43:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49U4heij032452; Wed, 30 Oct 2024 04:43:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49U4heK1032449; Wed, 30 Oct 2024 04:43:40 GMT (envelope-from git) Date: Wed, 30 Oct 2024 04:43:40 GMT Message-Id: <202410300443.49U4heK1032449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 22429a464a5f - main - committers-src: Add jlduran with emaste as mentor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22429a464a5f4f6bb5a056aae1353985db83b721 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=22429a464a5f4f6bb5a056aae1353985db83b721 commit 22429a464a5f4f6bb5a056aae1353985db83b721 Author: Jose Luis Duran AuthorDate: 2024-10-30 04:42:11 +0000 Commit: Jose Luis Duran CommitDate: 2024-10-30 04:42:11 +0000 committers-src: Add jlduran with emaste as mentor Reviewed by: imp Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47302 --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index ee1bb79b3c0f..6e3464227ff2 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -225,6 +225,7 @@ jimharris [label="Jim Harris\njimharris@FreeBSD.org\n2011/12/09"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2005/07/06"] jkoshy [label="A. Joseph Koshy\njkoshy@FreeBSD.org\n1998/05/13"] +jlduran [label="Jose Luis Duran\njlduran@FreeBSD.org\n2024/09/05"] jlh [label="Jeremie Le Hen\njlh@FreeBSD.org\n2012/04/22"] jls [label="Jordan Sissel\njls@FreeBSD.org\n2006/12/06"] jmcneill [label="Jared McNeill\njmcneill@FreeBSD.org\n2016/02/24"] @@ -547,6 +548,7 @@ eivind -> rwatson emaste -> achim emaste -> bwidawsk emaste -> dteske +emaste -> jlduran emaste -> kd emaste -> kevans emaste -> lwhsu From nobody Wed Oct 30 13:21:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdnng5Z2Lz5bMH3; Wed, 30 Oct 2024 13:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdnng56lnz4hwT; Wed, 30 Oct 2024 13:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HhrabnpZmQ93ZJ+q8aZKKazYDZNSwvzPZznrWGy3AOs=; b=BZmykwCpWpCxSgXMX9qQ8CRZePohLvZwYFN/28uBhsN/DobUi+wYANrFel7BpmtGyrruWK WOA/V4QKrtr3L9jkDI5TAIexp+94h/kR2IXrCNuczyFKb0VY2DbKYgvVGrHQhzUhecXVSV vRBH31dvML2iKpYMVrBxnE3NV9mTDS15ajwAmMZw2mV2fiZkgrkZma1r3lNuGiBeW8S/K9 SE/NYJ4yt4p4aLQW2keZL6bUvIa0X9zPKPahHeXQg+o+WzuO4oiF+yJNtHE7mU23RqwveZ tUPTK9dFuXcxQdR5oyxB3xw9XMfS+rgaLs63i0++nVwaieivLdVYK/K2/a6/xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HhrabnpZmQ93ZJ+q8aZKKazYDZNSwvzPZznrWGy3AOs=; b=EH8T6K6dtVjfOuocurNtjN6vvJU/R9ViRZ0Xbo4PwsEf3tcERLUuGqFhlfXoR1pldvKNdr 7WftfgTvRBDZv9amu7J5LXKG8mXSXpJT3kR7Y43ABwwBqbRWWXr9vJIl6PkTVvQY/NY+xX fXJmuT/bn/2n+p4EV93/A62TyCjA3Kc6c31yhkWAYZKQdlmUTn8d64TLXVD8m6fpL7RpuR 2iHAgo+xvUiS+FtmyPDGFH/+RyhBTm5tpOs15P1J9ygapQXGrA+QXBsjxh7ccxT4W5OT7E aECxJkgiK2wm59mFYq31Dal5PIyIoac47DB6XE2y8/BTd1qQE6+Cm9RhZ9H7fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730294471; a=rsa-sha256; cv=none; b=SWUYEQlmvzkI3QgqVxnoYF9CvNgLECjeLApV1n8yw4eo/D90MliF/ebD2O+/8nUE2w0TRU Bp2WSir29dWR5iCDSioLyhZ+aNNHNSKWp9Jg2ObYhFWn4Cj+DxxiZLVkkjKs17poTDyM4E as06DFWqbP90jiYpODvzPohm3zXpNKxxS8qgjpEUqv2FWUHIZQUUlY0UC6C3mAQqZHg0DM nVtj/nDzdSK0dyy06Dk7p3aCuTOqKjpDtOLf3SerfqwSXT7EhTmADsvseIU9zLuhSvgfsz 4LsJQ/DvrgyZdFtsg/Lb4BnmqKP/9trbIYIi8J10f9sXF7RgzACszhOC+y7O8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdnng4kbjz18PP; Wed, 30 Oct 2024 13:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UDLB2h087492; Wed, 30 Oct 2024 13:21:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UDLB2f087489; Wed, 30 Oct 2024 13:21:11 GMT (envelope-from git) Date: Wed, 30 Oct 2024 13:21:11 GMT Message-Id: <202410301321.49UDLB2f087489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bf2145f361b8 - stable/14 - mixer: Fix a bogus free() call in the main loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bf2145f361b8b19573648add42817fae57f4be53 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bf2145f361b8b19573648add42817fae57f4be53 commit bf2145f361b8b19573648add42817fae57f4be53 Author: Mark Johnston AuthorDate: 2024-10-23 16:55:39 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 13:21:06 +0000 mixer: Fix a bogus free() call in the main loop After a strsep() call, p might not point at the original allocation anymore. Reported by: CHERI Reviewed by: christos MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47266 (cherry picked from commit c22be0b181e954a4cc00ed4f5c7df974f3061c3c) --- usr.sbin/mixer/mixer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 468130ddaa88..70a35f71b25f 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -147,7 +147,9 @@ main(int argc, char *argv[]) parse: while (argc > 0) { - if ((p = strdup(*argv)) == NULL) + char *orig; + + if ((orig = p = strdup(*argv)) == NULL) err(1, "strdup(%s)", *argv); /* Check if we're using the shorthand syntax for volume setting. */ @@ -200,7 +202,7 @@ parse: /* Input: `dev.control=val`. */ cp->mod(cp->parent_dev, valstr); next: - free(p); + free(orig); argc--; argv++; } From nobody Wed Oct 30 13:21:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdnnh6h0Yz5bMDJ; Wed, 30 Oct 2024 13:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdnnh664Pz4j2F; Wed, 30 Oct 2024 13:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvA0vyOXld+qR4/bxIz8DqA9Ki2Bt7ijaVlcFq0l3vw=; b=NN7Irbv/V4m0LyqQRX7gZtp2p5q6UjOjY/w7pHtVgNujbRteUiuxmaG573VcOHDmWSsckp UHGlzqlO4M4pmwCjnqF7ZAaQgrLABnS+CDQvzEcv9EctkYWYCO7V17zZ3GqUFBRTzXgTeW 8ak4fV/89ZrC/HKVxp47xw384uiM6HublHFHKjrJiHdGVTfccfWxD6VdIHSdH+TqamM/Ow wBN274RGfuWdyzaS3NJVAnUOU3zTXNAughIGtugDA+/xzuVCPNQ2RgQ5wkw/QwRhmrjNFu dbytiw8gILz5LV/Mt5eT4zUR3hzSUv5OH2mIlWMnrP9yOEpXDHcmLxgg6zZJkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvA0vyOXld+qR4/bxIz8DqA9Ki2Bt7ijaVlcFq0l3vw=; b=AgUY5s+YYuJ6OOHIeoQkqrMgLp+v6rXK11c0JzabJiRw9NxKcqLlGiKXZPdR9CQg773vGD aZoeKaSoZiUEDoAZRlP9LUQ7KSwyrYxPFeKxQJmbyItE0JA567AD9lfBw9JZmyf3vu7tzG fYV4QRTi0gy93ma9IQXpHKKA3VDNCNQZENEwZ6Gl1Y2U/GEdv5Fkqn54t8vOi4Xs/e6wPi 0V8muPFwn4ibl0sqtQNIpD0PRomsTJcqvalrD2jneBXtxmoPYGs3z241+ooeS5eCi7GA5t DtT84hsjGY5yDiGf5OIJ1tewi6GtfqLdUYooxEY+xosrdFKQl4QXoNcmD/oSZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730294472; a=rsa-sha256; cv=none; b=WXyHS+TcwUca2azkX8VpMnjT99BSDgnRWAUaZgWweUa6rjrN4kKRhefbb1RgPsLJlZUUDe dg1qUuhKzcS/dq23poyQ3aLkHuzKKRs4cs1V6V8+HQIvzHJ6tOFZVRs25msbvup3oryIcS ZnEcFhw+Hze6Mpuz9G1JU2BuId6dPO/BYEUrfOO7jmdPvreMRUcATuR8nzGmecckrWipxU NfcEDYElw8Ic0hbB9YhGs6Zm0yjjxf8XNYWR33O/splYC4t0sZo7UTG88+eRtrDjDCwDAI VVbZ+ic6a3d9VUj2h1YHFQZzaVWKdmb/ddIYlLo2abplK2zaOuKqZpmkyFZsvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdnnh5jYSz17sJ; Wed, 30 Oct 2024 13:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UDLCPl087546; Wed, 30 Oct 2024 13:21:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UDLCRX087543; Wed, 30 Oct 2024 13:21:12 GMT (envelope-from git) Date: Wed, 30 Oct 2024 13:21:12 GMT Message-Id: <202410301321.49UDLCRX087543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4990a7d344d9 - stable/14 - devmatch: Catch truncated linker hints files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4990a7d344d985668917d00cde0675c042cd5649 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4990a7d344d985668917d00cde0675c042cd5649 commit 4990a7d344d985668917d00cde0675c042cd5649 Author: Mark Johnston AuthorDate: 2024-10-23 16:55:16 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 13:21:06 +0000 devmatch: Catch truncated linker hints files PR: 282268 Reviewed by: christos, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47243 (cherry picked from commit 9b2f2fbfcbc51f77e96a41e62b1c06a8ccd4ca15) --- sbin/devmatch/devmatch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index 2485120c57b6..d961a1e92daa 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -127,6 +127,12 @@ read_linker_hints(void) err(1, "Can't open %s for reading", fn); } + if (len < sizeof(int)) { + warnx("Linker hints file too short."); + free(hints); + hints = NULL; + return; + } if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { warnx("Linker hints version %d doesn't match expected %d.", *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); From nobody Wed Oct 30 13:21:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdnnk2WyZz5bM36; Wed, 30 Oct 2024 13:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdnnj75dsz4hnx; Wed, 30 Oct 2024 13:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gixq0nqwtGBb9VYfaFqsozZDTCIAxHP3eAtemc1Yyw=; b=whby/L4OwdJbBp2h+KwcCMbO+Nf+Ia89tl5zHjDldUbfBAcWd+C/UQ83gTzzaByTnwwGl+ xl2Pl2eTPSSLc66APV0UXCdOoRZv+DcJykWw325eSA9v1hzABmSdTZCg7XQpG9MTkJocug fFz9odbxCFtsE5SqZUUydiYxvRBTfujdaaqiiZOrlB/23KDwDBWAYq+m9N1cVcoqzB23ek c7FKkVSP4hokKnUNeNGCvzg9XhUl571X64J/iJKaO2eNmXt/EAq5vY3zA9TmWz8dvCUS2X 1pg23ZAKIOmSHl9Krjw7giv5iAPFByqkvE3iR4xsY9y+gWkwfAejtRi7jz1JHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gixq0nqwtGBb9VYfaFqsozZDTCIAxHP3eAtemc1Yyw=; b=fTPXnT57uSaEAjR7UJtIwH6Qf0PyMU/4ZZUzqrCi3laiBIrMucw+tSLcW8OYXb+IMBFgYn nr6/pQyASLqu8qw3NpXpuLpIH4/nPQfBuY15NTeyrmnK7g93NxvLsv2OIzAhj6mNEM4t0O U6Q1hbzMbgjFonzP76OqXBVmvS4Ra6Ry8H/37F937idF7Lm7iZlsdxNA4BTdl8eyG2mN+s hriSrTRw5Dyr5PqWoaNl4YZCyMgj3NRD1KpsP5RvEf5ovsGjqZ0P1kIH657XuSlf5YEYtI iJ+Ccp5L+zXv07BAZLGRBElES4vmrAHKPqBdIlAf3TMVD5bNo6+eLCkgWz16GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730294474; a=rsa-sha256; cv=none; b=vN86Uifk6NleBGu1/ftlh5lzmUQ2RXb2XKR6YlqK/rZThlzqOyrlk2hSCp5mz/FIcS/KTQ cXcXW8t/rdHPpgU5hXwrZ7g9QRUaHTMt6Scyyys65xrMaB/B2AvBPib4RrcevDeUYi/3RE OUIhaobVh1HpOGlIgwHdktUYPD96BmKQSvp7U0/+8dDhiEmHl+0ELeCptPUnBwkrUWPNpf Ivvbh22kCwIrckAuvP28Nnb8ZDJmAx5if6haI9vfrFwdZYnVUzXe6pXtzSiwNqkTl8x7RY YktsAs6QL0FPzycnt3yJjX1fF71m/mE4a50cFE23wdX9lF4OLLbmIEDLYKqYRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdnnj6k2zz17sK; Wed, 30 Oct 2024 13:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UDLDq0087594; Wed, 30 Oct 2024 13:21:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UDLDvB087591; Wed, 30 Oct 2024 13:21:13 GMT (envelope-from git) Date: Wed, 30 Oct 2024 13:21:13 GMT Message-Id: <202410301321.49UDLDvB087591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9e3e111d749a - stable/14 - linker: Handle a truncated hints file properly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e3e111d749ac83f213a36254fd0717265534e05 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9e3e111d749ac83f213a36254fd0717265534e05 commit 9e3e111d749ac83f213a36254fd0717265534e05 Author: Mark Johnston AuthorDate: 2024-10-23 16:54:56 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 13:21:06 +0000 linker: Handle a truncated hints file properly If vattr.va_size is 0, we will end up accessing invalid memory. This is mostly harmless (because malloc(0) still allocates some memory), but it triggers a KASAN report. PR: 282268 Reviewed by: christos, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47240 (cherry picked from commit b5149b265346c55994c7ebaab2a6a6fd1bd6fe5e) --- sys/kern/kern_linker.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 15fd7e8c30fb..53a743f29459 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1947,6 +1947,10 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, printf("linker.hints file too large %ld\n", (long)vattr.va_size); goto bad; } + if (vattr.va_size < sizeof(ival)) { + printf("linker.hints file truncated\n"); + goto bad; + } hints = malloc(vattr.va_size, M_TEMP, M_WAITOK); error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)hints, vattr.va_size, 0, UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td); From nobody Wed Oct 30 13:21:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdnpM0QnBz5bM0r; Wed, 30 Oct 2024 13:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdnpL5LV2z4jdw; Wed, 30 Oct 2024 13:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7a0tARKwQ6lyLgqeeY6g7Q/RTarAmakJdRqe6lAVYsY=; b=gSEtH69kcmdzsgxd3/NTQU71pCjgxqB2BMd4sSDjzOJs+V2fZmFfcbx7feTiXbXhJ8FEcx sBLJYLjbp79S1QiZWg/dgkiBAMwsrP5idccJwEeou2CLcWKaznEEFcQqD2BnBX/zRZbOeV nIrnjSnd44AZBftGHhkQKLx0L4jB9grzdlxJYPIXldFP2QBnlpd0G68DbL0ty0gt1hNAr+ UCSKYToLKzKlI0icfAzdaj7ilEQcLNyd91PgTiYyb3D88bol1mhZj/E0OZD89t0d9ljcu9 v4MAsQoQ3WEZYH2yGMl2bwhG9Lo09peONN4+LgBfjN5uCJb8241RY08YGfhP2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7a0tARKwQ6lyLgqeeY6g7Q/RTarAmakJdRqe6lAVYsY=; b=J/yCmbLxJ9ocYlXusTwmC2bjqg64nhh4k0y+paO2lU4SS+oPKZnIyBxFOiUJkcM2f7wdOb jLB3yG8O82F48++hhnbMMdDlrbvE4uiM3HnJMv1Rr+CIkrsa8D2kNEuLprS3DI/S8urRuD Wo3ZBE8kH19tqZGVLMhqblvvX36Srcq3I/ShXQXv2Xyr4PWCMP8d5ULca7rO50Iy4YkU6x gGjevYnFmUVKKb+ITJyBvIpAQH051YrMvzdAp/Vmlt4z5iqNYrHGD2GgmWRy3GrHx3PPBs FXAIRWUmobA4v7rul8P58RrrD7o8aqfQAHIO1o4H9iO8i3LNkHqu0WlPNg8WaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730294506; a=rsa-sha256; cv=none; b=CyQjzbof3e/GKdshVecXDyh9N8BxCGInHN7ibYmp5BMAdeTqu2yjZNVkYR/IL8lvK40X96 lTdbFVNYMGxDX9clk1RYA+nwY2dR++Y+fcQ6JWILcDGO+svfM6ns2IjAHyIOrf8FO7lWSA Cj8z6xtlrd/LDTcbYGhLAk4LNj0sHhFu40O0IYRtCo8vrBO5GjJWcX1o2gXRp5h3RXakzf H6Et6Xwg1rzlYug8DKpjqS+4ZZG9fMMG6As9gCC3dosovjhb5NxLurqQQUC8qojIiLlPN/ eBlDrNRgtFtMYzMwkmDVHxChfPNyQ7p2z3km5vyME8nCZjdB2ef4Cgn4jS0DrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdnpL4yKHz17yg; Wed, 30 Oct 2024 13:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UDLkoq088812; Wed, 30 Oct 2024 13:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UDLkbp088809; Wed, 30 Oct 2024 13:21:46 GMT (envelope-from git) Date: Wed, 30 Oct 2024 13:21:46 GMT Message-Id: <202410301321.49UDLkbp088809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 390486cb25f9 - stable/13 - devmatch: Catch truncated linker hints files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 390486cb25f9e4a2a3f592695bbdbffe5019e898 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=390486cb25f9e4a2a3f592695bbdbffe5019e898 commit 390486cb25f9e4a2a3f592695bbdbffe5019e898 Author: Mark Johnston AuthorDate: 2024-10-23 16:55:16 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 13:21:31 +0000 devmatch: Catch truncated linker hints files PR: 282268 Reviewed by: christos, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47243 (cherry picked from commit 9b2f2fbfcbc51f77e96a41e62b1c06a8ccd4ca15) --- sbin/devmatch/devmatch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index 490398bf4a2e..cdd8d92ffefa 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -120,6 +120,12 @@ read_linker_hints(void) err(1, "Can't open %s for reading", fn); } + if (len < sizeof(int)) { + warnx("Linker hints file too short."); + free(hints); + hints = NULL; + return; + } if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) { warnx("Linker hints version %d doesn't match expected %d.", *(int *)(intptr_t)hints, LINKER_HINTS_VERSION); From nobody Wed Oct 30 13:21:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdnpN0Ddkz5bMB4; Wed, 30 Oct 2024 13:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdnpM62lsz4jhw; Wed, 30 Oct 2024 13:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gIgD1dmmDliW+2ItvwZsEN7t9kdU9TZ7KBL0CdMr3Eo=; b=x2TWxGeJUpaNliXl7FnBfRaCwcsQpt/8R1+dQ6pfLTU5OmAD+fuTUwe67fVraEVODGOs6R nuxkpO7CTMcEx1gJ/6gowq0xIRrfgkw+UNv7cORsvDTIE8FiCvzsa6h/jQlH4MCAxj89JH T9EhN+gnnzlHzoW1e8IolkVcRAc3yzePZ1ADEZaTTbBIKmg6D0dhpJSRKbf2BO20jngkvt Y1p8Y3E6SZRAjpvmqiMy1Qag4NTYVlLAGiFu0z04H+55/EBof9s+8tbqTbwMMMltAf3sD9 kcesC9C9k+h4r5RnX2kxeZWc+pBq9YBkfjqREDHw7aYweE3c57EBkDwQVr2Zvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730294507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gIgD1dmmDliW+2ItvwZsEN7t9kdU9TZ7KBL0CdMr3Eo=; b=EyNLrukAAFRUkqQUTqrT6lmIyoHYtVsFoanz9VdSepEzpft48cLDfcQBmJL5vSOkHHFXBX e+EeNg8rk3uKMdYm6wa5uLfNbxs8MyGtptuvM7QvuAuZaSK7g5WpOVmCZ0jFPV4ucxe/BD 2WrtHe6XQMLXkiOEmr28WJgAWMmEETh4ZiF5aCWBC+aXctOxw7CKWxbJ1EnRfMgnf0LS1r F/BkYceogAMDXNQor/uzpPMt/9yDwRy5/wVfyWUlVcrXI1hdsWHO97gZ/NstUdrmEvguUW A2EYnv1pG72cHr/diCqFMW2tYHiqv/paR9z8we1OaGDooyjan17/WI3lIi0avg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730294507; a=rsa-sha256; cv=none; b=rbuk2bhkDNJUYsrXJ3oWZhiDW8thq6SWPqfSKIlY/6kielRkMNH+LOdjbIYey7I6h9TYLd USrQHFbQ0zIcU01HUoAshzfDyQPwxOPKEdOdEs2ts3jU5+XSG4eifTtJlIybpfJ6lGN1hC pZbQ3/8mBbzS+HnaNYPhe/J0ko85fWOmAkORezEZ9nlf+PpNRcX3JxHr6k81Gao+7mvZXa CUZorJUG3wRcIRhGlgOiE1IGqwhxXWh9vhPbquBF36QjzId6wsMC1q34YMAxDUInCjrgrN Pm9y+tWDtvkfykAJlEgyk2G9Ze3HnyFIEkwZaR5YCqBL3+NrJb8gFudCa9BWWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdnpM5fCDz186J; Wed, 30 Oct 2024 13:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UDLliD088861; Wed, 30 Oct 2024 13:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UDLlea088858; Wed, 30 Oct 2024 13:21:47 GMT (envelope-from git) Date: Wed, 30 Oct 2024 13:21:47 GMT Message-Id: <202410301321.49UDLlea088858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d57d71423847 - stable/13 - linker: Handle a truncated hints file properly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d57d714238471eaa44c20538df1488fae378665e Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d57d714238471eaa44c20538df1488fae378665e commit d57d714238471eaa44c20538df1488fae378665e Author: Mark Johnston AuthorDate: 2024-10-23 16:54:56 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 13:21:39 +0000 linker: Handle a truncated hints file properly If vattr.va_size is 0, we will end up accessing invalid memory. This is mostly harmless (because malloc(0) still allocates some memory), but it triggers a KASAN report. PR: 282268 Reviewed by: christos, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47240 (cherry picked from commit b5149b265346c55994c7ebaab2a6a6fd1bd6fe5e) --- sys/kern/kern_linker.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 5271d002fba4..caee3aaedcd7 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1931,6 +1931,10 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, printf("linker.hints file too large %ld\n", (long)vattr.va_size); goto bad; } + if (vattr.va_size < sizeof(ival)) { + printf("linker.hints file truncated\n"); + goto bad; + } hints = malloc(vattr.va_size, M_TEMP, M_WAITOK); error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)hints, vattr.va_size, 0, UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td); From nobody Wed Oct 30 18:21:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdwRc5sDSz5bnjn; Wed, 30 Oct 2024 18:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdwRc4slQz4NTV; Wed, 30 Oct 2024 18:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9WLCTXrn4E8XfRAIUTUNWEs65oo3P/IHZ/pkvFYVZI=; b=k8t1hwmrdXekMOmUEjzUNjxjBoXMnsK/wZb8ay+tuxygWUj6V8aAHsoIrRhQ73ab2cXDgz tAq9nm/w6klLiAjvCvcleeCLjkTH3ccNLH173R570T/sdDuCNRL58MA1eS1gt3OQe71yjH XoECRMMx+Wvl0bKet2SEW4M1Od2DWNK0yePP2yR8g2euGOcjisqf/f6uiWuYfE0XlkYaOx 6pKnoEbGgnynLa+GbjSyElTLTnooLvrYmKJjCcsU4pqGIQZYu2DCMquP56j8rjKGGCaJmg ya+i+7pTKkEpQjnSIJLMcU5nlCMFViUi8HnQzFV0Jy8fSPFM4ydMzPIoPuqHcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9WLCTXrn4E8XfRAIUTUNWEs65oo3P/IHZ/pkvFYVZI=; b=DD7KCa4BMZhoa1wqekCFbNy6pdP2301DOHbi/oFXwHvJpAIQi/cdyTGRAleQqISdql1zQ3 fdGvN+DOG1cuOIbVm8Y/weqth9R4zRI1PybP65t1SGoi9kaIVs7goHNFv56x7CN/qcgmBX 9aO7lfYa0x+rXZjMN/NlHG1umLhlEXo51+Abj52Wp+9zjrtIrLA5rsRSxaDoRNZliQZlgG 2C3ZVAFEXWS49Bk3bVpJvuPGZLo7eFxu0WodkHaCCGQ+g7leA4YbnxxLn0JCEZ4uVrMHF2 GAetZA8VHdauW8g3nf89xsMnRZ4HXZ7gcZqKurQbMmM8J3nqiy57NGDNmdAVCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730312460; a=rsa-sha256; cv=none; b=ocxGaszXEYBtwl7hqcvhHmbP52iExbrd4R27PfUHPrGMLLcKUw/fj9W2d1/up32zDy60IG WY2I8J+gguvrsNo7EGvAEVR3sDXQFX2dGQqk7PS5tcwMbwwa/VZKfs1a7olMO+9OBI6o1r 9Q+6T3Q5NnLua2dFEfKyyxr6sElPK/r0TR0pECs0dPjlPP+PMOFBaDsNPYGOyNovyzUTam UmYiT6Me1fKxiiHLc+nqgc/eTsOZi+DUK3k+7f2iS2f1H1MPDQ1qJushKDUGwXqIswo+Pg OoRUQt1qUXu6bPngVoCeX4k84cfnUJx9uELVm4I7yK573/WzVuDGcM6QjX8mvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdwRc4SVvz1Hgp; Wed, 30 Oct 2024 18:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UIL0P0048839; Wed, 30 Oct 2024 18:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UIL0mY048836; Wed, 30 Oct 2024 18:21:00 GMT (envelope-from git) Date: Wed, 30 Oct 2024 18:21:00 GMT Message-Id: <202410301821.49UIL0mY048836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 5050fdb6b60e - main - plic: tweak macro argument names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5050fdb6b60e98e78c093f69b679d33fb9f5effd Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5050fdb6b60e98e78c093f69b679d33fb9f5effd commit 5050fdb6b60e98e78c093f69b679d33fb9f5effd Author: Mitchell Horne AuthorDate: 2024-10-30 18:16:28 +0000 Commit: Mitchell Horne CommitDate: 2024-10-30 18:16:28 +0000 plic: tweak macro argument names Be clearer in the intention. 'h' implies a hart ID, but these take logical CPU IDs instead. 'n' is acceptable, but '_irq' is clearer. Reviewed by: br MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47133 --- sys/riscv/riscv/plic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index 5280ec0bb333..7ae68c00d78a 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -63,13 +63,13 @@ #define PLIC_CONTEXT_THRESHOLD 0x0U #define PLIC_CONTEXT_CLAIM 0x4U -#define PLIC_PRIORITY(n) (PLIC_PRIORITY_BASE + (n) * sizeof(uint32_t)) -#define PLIC_ENABLE(sc, n, h) \ - (sc->contexts[h].enable_offset + ((n) / 32) * sizeof(uint32_t)) -#define PLIC_THRESHOLD(sc, h) \ - (sc->contexts[h].context_offset + PLIC_CONTEXT_THRESHOLD) -#define PLIC_CLAIM(sc, h) \ - (sc->contexts[h].context_offset + PLIC_CONTEXT_CLAIM) +#define PLIC_PRIORITY(_irq) (PLIC_PRIORITY_BASE + (_irq) * sizeof(uint32_t)) +#define PLIC_ENABLE(_sc, _irq, _cpu) \ + (_sc->contexts[_cpu].enable_offset + ((_irq) / 32) * sizeof(uint32_t)) +#define PLIC_THRESHOLD(_sc, _cpu) \ + (_sc->contexts[_cpu].context_offset + PLIC_CONTEXT_THRESHOLD) +#define PLIC_CLAIM(_sc, _cpu) \ + (_sc->contexts[_cpu].context_offset + PLIC_CONTEXT_CLAIM) static pic_disable_intr_t plic_disable_intr; static pic_enable_intr_t plic_enable_intr; From nobody Wed Oct 30 18:21:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdwRf2lkTz5bndW; Wed, 30 Oct 2024 18:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdwRd6DpJz4NZJ; Wed, 30 Oct 2024 18:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/PJRLkyiZKehZBK3YXMnQtsV6ovIJX9CoSyPnfWPxFg=; b=ocO0Oy38nosE0baShU0YA0+6LLYAEU+wT8lZpYV8PiWyGNkMiX4Yf2miMg/phOiYuhuEUx f3AGG0yhtHGJcljgIiFOaGhONV9X36ixqGiM2njxw40IB1OSyLCVj4Q5DQNxgxGqNLiUHg mGyp/kgHE8ZMP0EA+L+AKiDM/HxdPSsYhORqsr9wj2krZ2uCDjlWpGZ1Kwsh2ycjnEtzI6 9uG/qcpEzftYyC5QUyAUe6A0M+8aqIjaIE/PpsGUCvXFPQM25bb5s/nceCijc44PLcXXaj 0H016kyKO8v1YUEjm9JKUCDTXAOfnu5n+MFrUzeqpFJkYqbX6xGzzg8oQ55dkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/PJRLkyiZKehZBK3YXMnQtsV6ovIJX9CoSyPnfWPxFg=; b=yncmFshLKx8wldmAOhivCL26IBJIw8+o8PfZ9cHsej7aWx4K3M0adqhx1wGJAXjBoV57XI egqYREuuVk3FZqZO6XQBg3lj6b5l0mtuII0m3iZ1ZJuNaCtmGlrsj+DQ+WLBLnT4wFMzpz XQsHAZ0WqeMhMx7XFU4iwa6rVxGHJokYLkwsDNdunby+pTw+HQhfXSgLJJ0qz2GcUY2c3o rllgfX6aFJ2/4ZJgRva0EYY8aXr4HgWgyAytN3TUuoH3PT4xCLpQciz0m1GDQ2Ncl3I9xh tCubt4/mtR5c7CdsJ40oLHfCTHDFCOxdz2gAjqmFG/5FXJFHepea3OX6y9f7zQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730312461; a=rsa-sha256; cv=none; b=MMKlkDHbvfK/G3FYYQnSV08UdV40XmcYK68n2XWVmspugXC7P0NULWnCEjGSmddy2SZbeV kDMRws0MjNUNyRSMrcmbDHZHNdKjJ2i4+T8LJlYR4mMIdddrGsWL1eAYQoYuyc77UZ7AOg qiYpCbsXe7Oae+l1g3widutRrBok3PB6Ph2OQZU5ze5USMfVw5GD/l0dpjAwyZKO5M2/vf 4w3pGjILampK8/TWdYDKCNcF1XT5N2d3KeHcBUdhL+wJ3CV8U5K4w9iojSA5vQTEQ/FpiE XOyJX0U+Lyz0lrtuy4vTkovhDw9/ApJyyo+oh6Q1/na18AfkS1k4Bb4JfDPz5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdwRd5lgqz1Hgq; Wed, 30 Oct 2024 18:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UIL17w048892; Wed, 30 Oct 2024 18:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UIL11v048889; Wed, 30 Oct 2024 18:21:01 GMT (envelope-from git) Date: Wed, 30 Oct 2024 18:21:01 GMT Message-Id: <202410301821.49UIL11v048889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: d584228930a1 - main - plic, aplic: handle all pending interrupts for hart List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d584228930a1689479d62fb303a51c42ecd7b6ec Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d584228930a1689479d62fb303a51c42ecd7b6ec commit d584228930a1689479d62fb303a51c42ecd7b6ec Author: Mitchell Horne AuthorDate: 2024-10-30 18:16:47 +0000 Commit: Mitchell Horne CommitDate: 2024-10-30 18:16:47 +0000 plic, aplic: handle all pending interrupts for hart Otherwise, we are going to take another interrupt-induced exception immediately upon execution of the sret instruction -- overall wasting cycles. Reviewed by: br MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47134 --- sys/riscv/riscv/aplic.c | 18 ++++++++++-------- sys/riscv/riscv/plic.c | 5 ++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/riscv/riscv/aplic.c b/sys/riscv/riscv/aplic.c index af58bb014745..6550b7ba36d1 100644 --- a/sys/riscv/riscv/aplic.c +++ b/sys/riscv/riscv/aplic.c @@ -224,21 +224,23 @@ aplic_intr(void *arg) { struct aplic_softc *sc; struct trapframe *tf; - u_int claimi, prio, irq; + uint32_t claimi; + u_int prio, irq; int cpu; sc = arg; cpu = PCPU_GET(cpuid); - /* Claim any pending interrupt. */ - claimi = aplic_read(sc, APLIC_IDC_CLAIMI(sc, cpu)); - prio = APLIC_IDC_CLAIMI_PRIO(claimi); - irq = APLIC_IDC_CLAIMI_IRQ(claimi); + /* Claim all pending interrupts. */ + while ((claimi = aplic_read(sc, APLIC_IDC_CLAIMI(sc, cpu))) != 0) { + prio = APLIC_IDC_CLAIMI_PRIO(claimi); + irq = APLIC_IDC_CLAIMI_IRQ(claimi); - KASSERT((irq != 0), ("Invalid IRQ 0")); + KASSERT((irq != 0), ("Invalid IRQ 0")); - tf = curthread->td_intr_frame; - aplic_irq_dispatch(sc, irq, prio, tf); + tf = curthread->td_intr_frame; + aplic_irq_dispatch(sc, irq, prio, tf); + } return (FILTER_HANDLED); } diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index 7ae68c00d78a..e28019e6f458 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -175,9 +175,8 @@ plic_intr(void *arg) sc = arg; cpu = PCPU_GET(cpuid); - /* Claim any pending interrupt. */ - pending = RD4(sc, PLIC_CLAIM(sc, cpu)); - if (pending) { + /* Claim all pending interrupts. */ + while ((pending = RD4(sc, PLIC_CLAIM(sc, cpu))) != 0) { tf = curthread->td_intr_frame; plic_irq_dispatch(sc, pending, tf); } From nobody Wed Oct 30 18:21:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdwRg2VjVz5bndX; Wed, 30 Oct 2024 18:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdwRg0dfhz4NrP; Wed, 30 Oct 2024 18:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9hXmJDLR63N1Pvq2WcIQBgiH04FgUkwpzQ3BxtBjE7c=; b=tbuG90Xr12mndiWJcYNHpjQ+XqHfGm2CkOul2aePHymJXzrrZj4xsPwLiyqwAh8PX1y2BB LIEuQV6AFAiosQOobviUwi+nK8IotRu9pcUb5gGAe1UYKH5VH630TH7rOGz7d8wsTt+TDS hz8JxGbibLtnY7WaInsP0103oDMFYM6nBPNodEo0MZddpqvxlcL+ITUiPEYYfjeRZs5Jeu ZBCGqD2S1VuXC9CdOU7R9U4l/GPZqZ2q28ajvjSlMZMrfpkZ0rxtg5m0i5U1cVa53GNa9D gWoroJ2dd3d6HsB+jSmECZdZiEWlTkI352izpwTvDzxGAi1c1oF7fhmK8ZYlDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730312463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9hXmJDLR63N1Pvq2WcIQBgiH04FgUkwpzQ3BxtBjE7c=; b=vtt8P1x7dhePI+qc44Wk1F3UhkHUepsIMmmZeO+fV1pQolnLtjDJyLx03GXQye66ngFO/h rI/Mx2iOlJ9q5HpL/uyyfgVk6v8IzTyYFf27e6V1LuzhR5rAXrZ4txay4McVzq3Kd0TQv9 m/c3xPPRXLaVshRK/llDc20DFtkfm96Bjlgpe0c4fhEKzlfRz2Wpih0A7Um0mGNl4AHvfJ 4P9CI7DIXEvpiYpfw0dPknwB7BejquQMGjs29gzjxOrfrA1xNd7eJg9jxwJjpZnDJ96jel kRivDd4wUl+or0/JNKBFDcxcs1tcytMFT5Stmm2INO5OfuxZxzyDUUHuKnHqew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730312463; a=rsa-sha256; cv=none; b=Fa5dknmy29O7AJzbcqAIl00MC7L0uxKwOVpuVxXD+mY8UmmatJWS+UJImqRTTzg5sGUxad 8gUsyQkeRWF7aq2Kgmq/aSnDD5IGCJ+u8U/3NNCohJ5ttpOs7ehmTkC+Svin2PNnbMSO+m QRRt8YtxdL9t/6NljYqbSDiQ1W4Q91EgxvHaRIG+clrkOFw1tnFKPWECawH6qdEUt9im9U u9R9WTa15dFJFgGPx6odG6cq1GzylsPqBRkWduG9fNpQn6rdh7zsWIhvVhMUEyvBKugqyM hgTpI5tI6S/X4NRcy0Eau0su2fInp9WuL31b0N1+x+PL7CgRTyhp/29yL63l6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdwRf6T1gz1Hvg; Wed, 30 Oct 2024 18:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UIL2Ok048953; Wed, 30 Oct 2024 18:21:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UIL2bY048950; Wed, 30 Oct 2024 18:21:02 GMT (envelope-from git) Date: Wed, 30 Oct 2024 18:21:02 GMT Message-Id: <202410301821.49UIL2bY048950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 47ca5d103f22 - main - plic: handling for interrupt-cells == 2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ca5d103f229b090899379ce449af5e89faf627 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=47ca5d103f229b090899379ce449af5e89faf627 commit 47ca5d103f229b090899379ce449af5e89faf627 Author: Mitchell Horne AuthorDate: 2024-10-30 18:17:09 +0000 Commit: Mitchell Horne CommitDate: 2024-10-30 18:18:16 +0000 plic: handling for interrupt-cells == 2 Some device trees report interrupt info in two cells: the first value is the IRQ number, the second value indicates the trigger type, such as IRQ_TYPE_LEVEL_HIGH. The device tree for the Allwinner D1(s) is one such case. Thus, extend the PLIC driver to accept this extra information when available. Apparently, some PLIC implementations using edge-triggered interrupts will require some special handling. This is not required for the D1, and therefore not implemented in this change. However, to prevent misbehaviour a check is added to reject this case and a message will be printed. Similarly, emit messages for the error paths, e.g. ncells == 3. Drivers will fail to attach all the same, but the message will aid in diagnosing the issue more quickly. Reviewed by: br MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47135 --- sys/riscv/riscv/plic.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index e28019e6f458..b7dda1d19daf 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -49,6 +49,8 @@ #include #include +#include + #include "pic_if.h" #define PLIC_MAX_IRQS 1024 @@ -82,6 +84,7 @@ static pic_bind_intr_t plic_bind_intr; struct plic_irqsrc { struct intr_irqsrc isrc; u_int irq; + u_int trigtype; }; struct plic_context { @@ -214,6 +217,7 @@ plic_map_intr(device_t dev, struct intr_map_data *data, { struct intr_map_data_fdt *daf; struct plic_softc *sc; + u_int irq, type; sc = device_get_softc(dev); @@ -221,10 +225,47 @@ plic_map_intr(device_t dev, struct intr_map_data *data, return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - if (daf->ncells != 1 || daf->cells[0] > sc->ndev) + if (daf->ncells != 1 && daf->ncells != 2) { + device_printf(dev, "invalid ncells value: %u\n", daf->ncells); + return (EINVAL); + } + + irq = daf->cells[0]; + type = daf->ncells == 2 ? daf->cells[1] : IRQ_TYPE_LEVEL_HIGH; + + if (irq > sc->ndev) { + device_printf(dev, "irq (%u) > sc->ndev (%u)", + daf->cells[0], sc->ndev); + return (EINVAL); + } + + /* + * TODO: handling of edge-triggered interrupts. + * + * From sifive,plic-1.0.0.yaml: + * + * "The PLIC supports both edge-triggered and level-triggered + * interrupts. For edge-triggered interrupts, the RISC-V PLIC spec + * allows two responses to edges seen while an interrupt handler is + * active; the PLIC may either queue them or ignore them. In the first + * case, handlers are oblivious to the trigger type, so it is not + * included in the interrupt specifier. In the second case, software + * needs to know the trigger type, so it can reorder the interrupt flow + * to avoid missing interrupts. This special handling is needed by at + * least the Renesas RZ/Five SoC (AX45MP AndesCore with a NCEPLIC100) + * and the T-HEAD C900 PLIC." + * + * For now, prevent interrupts with type IRQ_TYPE_EDGE_RISING from + * allocation. Emit a message so that when the relevant driver fails to + * attach, it will at least be clear why. + */ + if (type != IRQ_TYPE_LEVEL_HIGH) { + device_printf(dev, "edge-triggered interrupts not supported\n"); return (EINVAL); + } - *isrcp = &sc->isrcs[daf->cells[0]].isrc; + sc->isrcs[irq].trigtype = type; + *isrcp = &sc->isrcs[irq].isrc; return (0); } From nobody Wed Oct 30 19:28:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdxxm376kz5bt7T; Wed, 30 Oct 2024 19:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdxxm2Rzvz4Xdh; Wed, 30 Oct 2024 19:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730316524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FIK+hZRIowonx/0G3tmx4BeEiYtDXbwP5whcnTixPfc=; b=Wtm/TgMyDJLzCtbVwB5U1aMNllooHrFPE9HFY3Xq13k1D9XC/c5BM+5oMIg0Zn/0we4rd/ CAYYhlqFgxfDUBp2qbl2qkHO8+gFA64zZuE+oUE3MgILUdtGorXL6Afh2tj+VugPuxl9Zm LN6MjaRJiektzPu6G6L8tHQOAc66U3L1oPLR2FEgTJi+Jw+LKUv5teOP4R9pL3Yin8TSw7 x4V/LQ3mmsPeIMl8FSxwHyo4kUcLqKiz15UvqqJ3zcoaBgC2HkynPTn+t+EyrANk59YXWR FvtFeepQrOMxkq6wUPkQHn2dlkKF7kSKehZkNq0jmCanTj2giZ4D/FAx/idbYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730316524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FIK+hZRIowonx/0G3tmx4BeEiYtDXbwP5whcnTixPfc=; b=lCfYguH67AYEd5xThv4qN4QWJ791ENBtQ6oDRzYRostodZxQaF8fnmaTk3mCpgziPGVKz6 OMh5Cw1fcvXO7Gamt6TKkkL7nPdwuk/pMpGPBYqy9DzPdPQ1IY2GhZMtxl4A7Nb6u/PmXz yb3TvcJ2c+yYISrT+78TZ9bBlUds+HFEXK1vk2hY+77Uio7zBoBsmODwLgIG9EGh5YG/wR PP9s/D/AOjiiZ0Xx35uec/BvIyaD8PRNU/YJh6tf+koHyaHqFIUxkSb1mucLgndPiIHnnA vvzshZQ/tGD4MOBRvEtprDjHLbC+fU3HbDVfDR6DTnzrpcRIcyvxeQVh58LeTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730316524; a=rsa-sha256; cv=none; b=Ylc3s4j2DhOFiYbMkYMEUoHzAqUv10Vw2iivcWV+03tXF2mIDCbOgz3HTDxuQaFdcZxkUT Ha0n66Qt89Py3qeMF26SHhCG43GS34Cn+zNSfP+NZfloqDLk2/XKRibE0Hgs8P1R16XQs6 A0X0jE53RNGu8C5SVunHqbrfBdfKZR3HMNLa7KXb+Bl56iIPdr6Oe8DrW0b2640ROSaHTR xfQBk/yPJa/zEmHj/rYPxClnvKehTDYc9T55h7b/dSrznE8OGGRy2StXeSqsvoTNNVg1VZ 8uL+Mg9xYlwjnQRS+TvxnSYkFysu09UUb5yj4lwN1AX8HFo4VvoCxSIeTRGfzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdxxm22ygz1KD6; Wed, 30 Oct 2024 19:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UJSiZ0066057; Wed, 30 Oct 2024 19:28:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UJSiQR066054; Wed, 30 Oct 2024 19:28:44 GMT (envelope-from git) Date: Wed, 30 Oct 2024 19:28:44 GMT Message-Id: <202410301928.49UJSiQR066054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a5d1cf5e362a - main - rpc: Fix the definition of xdr_void() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6 commit a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6 Author: Mark Johnston AuthorDate: 2024-10-30 19:27:18 +0000 Commit: Mark Johnston CommitDate: 2024-10-30 19:27:18 +0000 rpc: Fix the definition of xdr_void() xdr_void() should have type xdrproc_t, make it so. PR: 280514 Reviewed by: brooks, dim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47340 --- include/rpc/xdr.h | 2 +- lib/libc/xdr/xdr.c | 4 +--- sys/rpc/xdr.h | 2 +- sys/xdr/xdr.c | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index 11d6a8d13b49..ecf10e1659e4 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -278,7 +278,7 @@ struct xdr_discrim { * These are the "generic" xdr routines. */ __BEGIN_DECLS -extern bool_t xdr_void(void); +extern bool_t xdr_void(XDR *, void *); extern bool_t xdr_int(XDR *, int *); extern bool_t xdr_u_int(XDR *, u_int *); extern bool_t xdr_long(XDR *, long *); diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c index 6992cae69bf1..59a843405abf 100644 --- a/lib/libc/xdr/xdr.c +++ b/lib/libc/xdr/xdr.c @@ -84,13 +84,11 @@ xdr_free(xdrproc_t proc, void *objp) * XDR nothing */ bool_t -xdr_void(void) +xdr_void(XDR *xdrs __unused, void *ptr __unused) { - return (TRUE); } - /* * XDR integers */ diff --git a/sys/rpc/xdr.h b/sys/rpc/xdr.h index 745eb115f58f..1bb03a2a58ba 100644 --- a/sys/rpc/xdr.h +++ b/sys/rpc/xdr.h @@ -285,7 +285,7 @@ struct xdr_discrim { * These are the "generic" xdr routines. */ __BEGIN_DECLS -extern bool_t xdr_void(void); +extern bool_t xdr_void(XDR *, void *); extern bool_t xdr_int(XDR *, int *); extern bool_t xdr_u_int(XDR *, u_int *); extern bool_t xdr_long(XDR *, long *); diff --git a/sys/xdr/xdr.c b/sys/xdr/xdr.c index 245ac7cef4fb..81d238ebf19f 100644 --- a/sys/xdr/xdr.c +++ b/sys/xdr/xdr.c @@ -84,9 +84,8 @@ xdr_free(xdrproc_t proc, void *objp) * XDR nothing */ bool_t -xdr_void(void) +xdr_void(XDR *xrds __unused, void *ptr __unused) { - return (TRUE); } From nobody Wed Oct 30 19:36:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdy6P1yrdz5btmR; Wed, 30 Oct 2024 19:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdy6P1H94z4YTy; Wed, 30 Oct 2024 19:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730316973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxYtRIYQQk4YJmQ32drvJ/BZdrhMgI8FY5w0Ql7DwYQ=; b=IAdWVG7c5pfyBc5Tcr+Hmd/HhpvrPs+YXJ+siqd+BxCRvp/Y+AwPmvsQrea404Io7C94wk neH1VcpETxDA8sisgbsMLPQS9Vqj7awU56m6iaZeRgEgLs2hU5O9kwEAJxzKa9VnIAWLOv T/vjY6nbiAicFIlg9NUm1tMN1y18ZSEbyrqeDsLL8Gc/hYet0cQ0y9FsOx30Q5AhS0Q5y3 suwSvU/9X5I5zgrmPCuacPeuxc0QHBFmeTC+6X6G/yajUzojvq8bbbidPUu+BV93u9kNjB Zjj7Pjk2cV+hb1Kt/eiXXz9Jo1uGCEpb8dOldF3biQtYLHhmiF1KrRD5rpxkUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730316973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxYtRIYQQk4YJmQ32drvJ/BZdrhMgI8FY5w0Ql7DwYQ=; b=uQ3wo2rUKHoNxyJwCwtY+0R56LTfsEI6Ofc9N5hJmzwhh4emsWYo3hNELOfjMEkF1G/S0K y2Ii4EJvlIgW2nk/s1+DMMaARj/4slpxj0KAaWAChql2Mnq7e/OjK5otmncR6GE5i1xjzc 4wBw7PRazJGSCwbJDl4YmTl/79apR2o8Lh/t/uL260SRzfyPfNE8QNP/6i6E2IEbpndYHh wHR7ZBcfpn5SWH/TJiX1HLr359EJMqaI2Z38caHaUOF4qL1RDO5nayKIfR4m0eMwxvy7pN cxoSHdPCVl3iYnjnXUQQjyH2Ts2npfq581VO4Lpmy/wJEIVtkic0Bn9fXIdUkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730316973; a=rsa-sha256; cv=none; b=rPWCBuvDLxAUfwnEOnf+tXoOz0qDdnlSJCqmLbZYrKGa1+gqTL4sQVfNN1jZmqJQ2/G39V GyJbEW4IpGUZmD6q6sBjMFVQWTwiVT1CGaC26IKsUcZ7r7p30Jd/e1viQwW6TlBR0hqdpI 2j3++fJRaHQmTI2794G7IwZxABNvDWIS3fPjaWOcnaFAPWKL9rfG0bpOa6ZJCU6+y38YB3 NpgaWT6AEngO7H4JYI/PhWoSD0IYLChnQdMH1x8M+MZQoWm0OMhvgP8r49juXN/dioUV2a 2owfkT+WN9zQlQcvkdSXiikpN+FiUjKcl7im5z8WuWTtszqjVQQ2GlFwZsahLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdy6P0tJBz1KDh; Wed, 30 Oct 2024 19:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UJaDCK084316; Wed, 30 Oct 2024 19:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UJaDAS084313; Wed, 30 Oct 2024 19:36:13 GMT (envelope-from git) Date: Wed, 30 Oct 2024 19:36:13 GMT Message-Id: <202410301936.49UJaDAS084313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 50b5a37a12d0 - main - src.conf.5: LOADER_BIOS_TEXTONLY default change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50b5a37a12d032085276b1f0ebb5f92c0cabed32 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=50b5a37a12d032085276b1f0ebb5f92c0cabed32 commit 50b5a37a12d032085276b1f0ebb5f92c0cabed32 Author: Brooks Davis AuthorDate: 2024-10-30 19:33:51 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 19:35:57 +0000 src.conf.5: LOADER_BIOS_TEXTONLY default change WITH_LOADER_BIOS_TEXTONLY is now the default so document WITHOUT_LOADER_BIOS_TEXTONLY. Fixes: 23dee252daf2 loader: Change this BIOS tradeoff... --- share/man/man5/src.conf.5 | 9 ++++----- tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY | 2 ++ tools/build/options/WITH_LOADER_BIOS_TEXTONLY | 3 --- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 72ca14b8eae8..e8cbd30892d3 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd October 4, 2024 +.Dd October 30, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1025,10 +1025,9 @@ Do not build LLVM target support for X86. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. -.It Va WITH_LOADER_BIOS_TEXTONLY -Use the old, FreeBSD 12 vidconsole.c. -This only supports text mode without teken, without any graphics, font or video mode support. -This setting only affects the i386 and amd64 BIOS boot loader. +.It Va WITHOUT_LOADER_BIOS_TEXTONLY +Include graphics, font and video mode support in the i386 and amd64 BIOS +boot loader. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 diff --git a/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY b/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY new file mode 100644 index 000000000000..0b243b4276c4 --- /dev/null +++ b/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY @@ -0,0 +1,2 @@ +Include graphics, font and video mode support in the i386 and amd64 BIOS +boot loader. diff --git a/tools/build/options/WITH_LOADER_BIOS_TEXTONLY b/tools/build/options/WITH_LOADER_BIOS_TEXTONLY deleted file mode 100644 index 08804c19c691..000000000000 --- a/tools/build/options/WITH_LOADER_BIOS_TEXTONLY +++ /dev/null @@ -1,3 +0,0 @@ -Use the old, FreeBSD 12 vidconsole.c. -This only supports text mode without teken, without any graphics, font or video mode support. -This setting only affects the i386 and amd64 BIOS boot loader. From nobody Wed Oct 30 20:39:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XdzWb1ZwDz5c0YP; Wed, 30 Oct 2024 20:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdzWb0kHYz4kvP; Wed, 30 Oct 2024 20:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730320779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z0tAX/fzNkvN0C+hhmUNGr4IwilWKAkdTvvp0pSEahU=; b=J/EamUvDA2cfMjWpQw7Q3QV7CAqHu7070xIQS5JVIHjT5Q4gj0YpWiVHdwSiYDQyfN1cpA yYv9cRDTJOJnjtMElFRhsjgwnp67V8jn7cWA0okVCBquX4hoopaS31dyqquR4leJWyGb05 uoNqaoQDt0iXl29FtPtla2Sf3NMiUKv1taXys4Lv9vsbabO02NXmZNRC/+wrw3h2S51jzg LVoD5Kps70gsGK/p1Ur1OnR2GqxJ2giNf61CKjg+eslUNxm66cpVewaCAnwzEOxB7EaS6u ogZGptMjKLk8zKu0PDZRnBi6gJ9op9X/ghUer9q9yaBfPZg/UkCiBtON2Y5jQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730320779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z0tAX/fzNkvN0C+hhmUNGr4IwilWKAkdTvvp0pSEahU=; b=HfknbjehvPEWPT6q0ZisgEyqP68t7qYmcJF7p3I1S5csIvi2myzIzsowmIf1habrGGX3+S OSGg+iJmZz4V29DVRmxepoe8j/fN8CCa7CsvjyQr1zMXO3o8sOGdK4pGrmNIJO2BYBJrKx 3EF4uVKj81i7SKzgJv4QBtkNhmsYsvacRt/c5Y7B5sSfXA/X6LvIMvsU4T3LWhZml4zltt mWAkz6lk0kxHfxp5cOJQvQmsP7Ii4P3YQL35Haj0c46oXziQ/BNO8E9Ai0cLtm6OE9RdBm nw71oKHFP5Dxv1T4ea0brpN8v+mSDOuST+eEUNu1Le4PFaxOlQA8lS5ofkZPow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730320779; a=rsa-sha256; cv=none; b=DTIVcPN9PdY9jsAnIHgyTP1R3QckockDbSBn6YekfE+9+9e+7t+KWK6zluq58AvAgWk2wt NkX60cfmmQrfkyxLd9EKN5a8iDIGjuT7Owgl+yumgqsaCw//WOAmycsVDtzmAp44db0vNd VezRk6CN1Dmh1OtHj0WS+xQQxGMJAjXPFPaPaPtXag0GgOMVilwvzRi+ca4ERyiH893lVp pK9lm+nEMp5X0kz8CdAaFcXk58CSLgq4kP1uqhB3SKA049/Qq3nkQiChzizXrqX8CFElb1 aB5dLVVw3GzG2I9US29KUAIx1OijhuB+60G+3/ZB4XytF3TdaUIj4r7YQyXcbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdzWZ75Lnz1MKB; Wed, 30 Oct 2024 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKdc7b097241; Wed, 30 Oct 2024 20:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKdcaZ097238; Wed, 30 Oct 2024 20:39:38 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:39:38 GMT Message-Id: <202410302039.49UKdcaZ097238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 03e1f25dcb20 - main - ice: Remove RDMA feature block on E830 devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03e1f25dcb200edbd6553ffc2748e7410b9ff264 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=03e1f25dcb200edbd6553ffc2748e7410b9ff264 commit 03e1f25dcb200edbd6553ffc2748e7410b9ff264 Author: Eric Joyner AuthorDate: 2024-10-30 20:35:40 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:35:40 +0000 ice: Remove RDMA feature block on E830 devices The decision to disable RDMA on E830 devices has been reversed; some SKUs will officially launch with RDMA support. This reverts a change introduced in "ice: Update to 1.42.5-k". Signed-off-by: Eric Joyner Sponsored by: Intel Corporation --- sys/dev/ice/if_ice_iflib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 9b3f38f885b9..e60ee0f1c5c3 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -2916,8 +2916,7 @@ ice_init_device_features(struct ice_softc *sc) /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); - if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma || - ice_is_e830(hw)) + if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma) ice_clear_bit(ICE_FEATURE_RDMA, sc->feat_cap); if (!hw->func_caps.common_cap.dcb) ice_clear_bit(ICE_FEATURE_DCB, sc->feat_cap); From nobody Wed Oct 30 20:57:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw320k2z5c1yx; Wed, 30 Oct 2024 20:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw31Mypz4pkh; Wed, 30 Oct 2024 20:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KzGoQT6GdsJsfxHhTrj1RsNhO823dMUCxhGpdCzSR5Y=; b=TRrS9LKdu5P3Z3RcG1xN8Ybd7TmptBTcLjXloG+xbISTc36hGDqll84p53tm/mWm0M4bx8 Ok3T8xW76CUuwwUYx+mCUfM1ZuZd0fD9AbobB4oLmehIdRxgSvyFxaZYtDjX5+eB3p6cVm Pwkp6qEKfPPB6QTyRlZjn/EUgyw9ifF1o11kYqtQHvSJgzdBn3J9ByNY8LR3cavbe0XVPT v17TNRGvoPLGnX+lBjoISfYsI8UtP6PUwe/fNpuwZH7jM7xyOT8Ub2Rhb1XhdVAzp9si7U 2cJ2sAfFr+bFAvPLVW2m5yZAMwhTWucOk4g92C1BfDck0PDO6edEhRW480R30Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KzGoQT6GdsJsfxHhTrj1RsNhO823dMUCxhGpdCzSR5Y=; b=XsSvvAkvMBFfqQ8fpFvBJBaCCUGO69Cba/feBipaZjgoSmY9OS11zMgfhUJvUC8u7PkQvR JN9w8BX8NRksY7HKisD/sYoa0Sr7qpyvui81mKFGB9klHkkqyJheGuaiJGEi77pofuNKxz B5Z+YpJT3M4qe1NUTIupBidQf3lAjEe4+8b4OPhPsmyituzqRdZjCNQKhCft0M8H5KIf4E NFgNA5AgILeu4+c3J62lgj35iF4ZkurIPTdr0emq3rx5mR+eNo/dIsNMjDVqDxDSnorUNX vtAS8rnMazx48UjzkgEGNpjrp/GhOPiDEqq8nMteMhyYN/RvVtBo3kiUdBUROQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321843; a=rsa-sha256; cv=none; b=eeJOvaIdaNU/agnys+/P/EBfsySdizx4nRTW2xeHuBl5gy0v7+4PdxAUbGMB3PE8rqecGP 60HarMzbBrsZs9rSkv4EX1TPZOoaAMJWGSeX3iPHpUGkNeD0eg2+YBcB/9aKS2l/6cQPVT k4Wm8um7vx9VfaOHRFzcdx5vTE/cc3bnNfbVLpcpmFRT8Js1Zc6SKEWNSiZ52RlNQT+JXl dYOOL2fDX4tEwVDNRqqBkjVoYhkh9hpP4A2IJAnHGO1AJ/x8wLm0yi6AuWk6YPzfR9YXnb NQOczqtLQCU9k0XjX8wKvzqu1KRzWmp0QDvuuaTs3Xj+Dw4BWy8/gmJgZzrkMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw30nmXz1Md9; Wed, 30 Oct 2024 20:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvN2C033404; Wed, 30 Oct 2024 20:57:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvM3h033401; Wed, 30 Oct 2024 20:57:22 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:22 GMT Message-Id: <202410302057.49UKvM3h033401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: cfcf4ea70de9 - stable/14 - Address module reproducibility issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfcf4ea70de9637f8498cd4590bc9100e4deb323 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=cfcf4ea70de9637f8498cd4590bc9100e4deb323 commit cfcf4ea70de9637f8498cd4590bc9100e4deb323 Author: Dan McGregor AuthorDate: 2024-05-09 23:37:52 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:51:34 +0000 Address module reproducibility issues Use .PATH & bare filename. This prevents the real source path from being included in the built object, which improves reproducibility. Signed-off-by: Dan McGregor Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1211 (cherry picked from commit 8c2f6c3be0125142d3c1782e4b0ee0634c584b9e) --- sys/modules/ice_ddp/Makefile | 4 +++- sys/modules/qatfw/qat_200xx/Makefile | 2 +- sys/modules/qatfw/qat_4xxx/Makefile | 2 +- sys/modules/qatfw/qat_c3xxx/Makefile | 2 +- sys/modules/qatfw/qat_c4xxx/Makefile | 2 +- sys/modules/qatfw/qat_c62x/Makefile | 2 +- sys/modules/qatfw/qat_dh895xcc/Makefile | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index 7329f0897325..e0ef344a8283 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,5 +1,7 @@ +.PATH: ${SRCTOP}/sys/contrib/dev/ice + KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.36.0.pkg:ice_ddp:0x01032400 +FIRMWS= ice-1.3.36.0.pkg:ice_ddp:0x01032400 .include diff --git a/sys/modules/qatfw/qat_200xx/Makefile b/sys/modules/qatfw/qat_200xx/Makefile index ce80b75f78fd..97ec5080f1c8 100644 --- a/sys/modules/qatfw/qat_200xx/Makefile +++ b/sys/modules/qatfw/qat_200xx/Makefile @@ -4,6 +4,6 @@ KMOD= qat_200xx_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_200xx.bin:qat_200xx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_200xx_mmp.bin:qat_200xx_mmp_fw:111 +FIRMWS= qat_200xx.bin:qat_200xx_fw:111 qat_200xx_mmp.bin:qat_200xx_mmp_fw:111 .include diff --git a/sys/modules/qatfw/qat_4xxx/Makefile b/sys/modules/qatfw/qat_4xxx/Makefile index e4d3ed495f8a..fb7171bcaf45 100644 --- a/sys/modules/qatfw/qat_4xxx/Makefile +++ b/sys/modules/qatfw/qat_4xxx/Makefile @@ -4,6 +4,6 @@ KMOD= qat_4xxx_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_4xxx.bin:qat_4xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_4xxx_mmp.bin:qat_4xxx_mmp_fw:111 +FIRMWS= qat_4xxx.bin:qat_4xxx_fw:111 qat_4xxx_mmp.bin:qat_4xxx_mmp_fw:111 .include diff --git a/sys/modules/qatfw/qat_c3xxx/Makefile b/sys/modules/qatfw/qat_c3xxx/Makefile index e0759fe3a99b..e5c8c0741fa2 100644 --- a/sys/modules/qatfw/qat_c3xxx/Makefile +++ b/sys/modules/qatfw/qat_c3xxx/Makefile @@ -4,6 +4,6 @@ KMOD= qat_c3xxx_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c3xxx.bin:qat_c3xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c3xxx_mmp.bin:qat_c3xxx_mmp_fw:111 +FIRMWS= qat_c3xxx.bin:qat_c3xxx_fw:111 qat_c3xxx_mmp.bin:qat_c3xxx_mmp_fw:111 .include diff --git a/sys/modules/qatfw/qat_c4xxx/Makefile b/sys/modules/qatfw/qat_c4xxx/Makefile index 7e859dcbd989..8b4e0cda6746 100644 --- a/sys/modules/qatfw/qat_c4xxx/Makefile +++ b/sys/modules/qatfw/qat_c4xxx/Makefile @@ -4,6 +4,6 @@ KMOD= qat_c4xxx_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c4xxx.bin:qat_c4xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c4xxx_mmp.bin:qat_c4xxx_mmp_fw:111 +FIRMWS= qat_c4xxx.bin:qat_c4xxx_fw:111 qat_c4xxx_mmp.bin:qat_c4xxx_mmp_fw:111 .include diff --git a/sys/modules/qatfw/qat_c62x/Makefile b/sys/modules/qatfw/qat_c62x/Makefile index ac1636b81e56..0385653bc7ff 100644 --- a/sys/modules/qatfw/qat_c62x/Makefile +++ b/sys/modules/qatfw/qat_c62x/Makefile @@ -4,6 +4,6 @@ KMOD= qat_c62x_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c62x.bin:qat_c62x_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c62x_mmp.bin:qat_c62x_mmp_fw:111 +FIRMWS= qat_c62x.bin:qat_c62x_fw:111 qat_c62x_mmp.bin:qat_c62x_mmp_fw:111 .include diff --git a/sys/modules/qatfw/qat_dh895xcc/Makefile b/sys/modules/qatfw/qat_dh895xcc/Makefile index 7a377c088081..d277e3dc02f7 100644 --- a/sys/modules/qatfw/qat_dh895xcc/Makefile +++ b/sys/modules/qatfw/qat_dh895xcc/Makefile @@ -4,6 +4,6 @@ KMOD= qat_dh895xcc_fw -FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_895xcc.bin:qat_dh895xcc_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_895xcc_mmp.bin:qat_dh895xcc_mmp_fw:111 +FIRMWS= qat_895xcc.bin:qat_dh895xcc_fw:111 qat_895xcc_mmp.bin:qat_dh895xcc_mmp_fw:111 .include From nobody Wed Oct 30 20:57:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw42JMrz5c1sL; Wed, 30 Oct 2024 20:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw422pzz4pkl; Wed, 30 Oct 2024 20:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hl0TQTgr73/l8sr15xJX0WrEoIp68BFpjBST8IvrcyI=; b=kFppSJ1FCryG8zJER/DifSQgvZZ3AioStyabfEVKYAV9fFCfRYICF1H+hmhOZwyXjeh6/x 2t4qqDPMca45EkOmo7IjepFbtliqsA1ZinmrdHdmBiGTHuSC6yI9bDj2RFOmCNnvfSkw86 5gU1OOg/R+a5P81ko+Gmm8WssSghmnCSI+buMx3hQX5MAFK2OOrF6J90wOjNKUViRHSpyo O1/cAl6sG5+jiwtZoKAhK5A/GzA+fddoh5nGPscqwD8kcSmAaQQxYEhipqbutocXRPVO/r UxGQUbIOKZiX6RNogilasHLuCYnUxhJTTKyjr57EueWeAQ9S10cY3KLhWEifEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hl0TQTgr73/l8sr15xJX0WrEoIp68BFpjBST8IvrcyI=; b=e9r5dc8uSXPnQGhMWqYvZEGXkH8z4AA0v6HnEaTNcWHpRVRM9KgEqXla4jb0QmBWFuCKhZ iTfZh4JwAQFLV51N+x1uZW/Ud78A5n1BI/QOf48LbY55YPehEX40iuub3/HRJImD4eqWLx bI5wyOlL8ay/elzjbr7gtpn7E84XWQxgOmBcqAKRMHeHgoIBQi+e/R6aG4CnaOJf/Svrr/ iJQKtMKHWpQcY+CaM/bwau9VZilt9h2665sv8hnH9bSUPRViuJ7OfgrTKx/LcEx18pxXqK aWA94KKTdX2AV2uz2eTOu7YZ6GlJMX40/SmtE0Qs4FCWm0+YkOQKJfBSvwWa2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321844; a=rsa-sha256; cv=none; b=Bo3eJ5ZVfGeVEbBpp9Pl8oM+5lRdpecP7mfQlwD9KQdHquUP2m+cBqCCN6tKGVJdzWthul G9cDA9uL0CmNoxbrcsh1pzw8yX9lukPazvTa55MT1ZHqs0quFC4xu72KGl8jVIaR/00K+a A9Upje86p4EWUKs8CPJbJEaV4IkibpDPNNUi51GqLmuHWe6tWNa6aMzjli7f6a/zNDISbH YC0dStHloXocXbst4mKXYEpYAv/ZHGUBVLovqiHLiBsHtNOGwtBMWHa3uV1b2F8jpSEA9p 7wshJDODnJbR5URTQ22Q5SD38lpCzaCtgNoYmRrkHv8cTmJ1dGp43ezv9wKoMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw41T4Pz1MNr; Wed, 30 Oct 2024 20:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvOfE033450; Wed, 30 Oct 2024 20:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvODb033447; Wed, 30 Oct 2024 20:57:24 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:24 GMT Message-Id: <202410302057.49UKvODb033447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: a9d78bb714e3 - stable/14 - ice_ddp: Update to 1.3.41.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9d78bb714e37f950ad0ce1e82e8b456bb72325a Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a9d78bb714e37f950ad0ce1e82e8b456bb72325a commit a9d78bb714e37f950ad0ce1e82e8b456bb72325a Author: Eric Joyner AuthorDate: 2024-10-28 22:48:47 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:51:47 +0000 ice_ddp: Update to 1.3.41.0 Primarily adds support for E830 devices, unlocking all of their functionality. As well, update the README and remove the non-FreeBSD sections from it. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation (cherry picked from commit f9a039060e834e89e0b2de1e8a442d78bd5c083d) --- sys/conf/files.amd64 | 6 +- sys/conf/files.arm64 | 6 +- sys/conf/files.powerpc | 6 +- sys/contrib/dev/ice/README | 330 ++++++++------------- .../dev/ice/{ice-1.3.36.0.pkg => ice-1.3.41.0.pkg} | Bin 692776 -> 1352580 bytes sys/modules/ice_ddp/Makefile | 2 +- 6 files changed, 133 insertions(+), 217 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 58946eb3c663..80ebc2ab6768 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -193,7 +193,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -202,8 +202,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 0fefcca97c6c..563a8e93c3ad 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -322,7 +322,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -331,8 +331,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 1a0388884ee8..6d44d9114e25 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -95,7 +95,7 @@ dev/ice/irdma_di_if.m optional ice pci powerpc64 | ice pci powerpc64le \ dev/ice/ice_ddp_common.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp powerpc64 | ice pci powerpc64le \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ @@ -104,8 +104,8 @@ ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp powerpc64 | ice pci powerpc64le \ - dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.41.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.41.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ixl/if_ixl.c optional ixl pci powerpc64 \ diff --git a/sys/contrib/dev/ice/README b/sys/contrib/dev/ice/README index e2ce84d72e71..c0840ecb499f 100644 --- a/sys/contrib/dev/ice/README +++ b/sys/contrib/dev/ice/README @@ -1,285 +1,201 @@ OS Default Dynamic Device Personalization (DDP) Package -====================================================================== -May 12, 2022 +******************************************************* +August 09, 2024 -Contents -======== -- Overview -- Supported Operating Systems -- Safe Mode -- Notes -- Installation -- Troubleshooting -- Legal +Contents +^^^^^^^^ -Overview -======== -Devices based on the Intel(R) Ethernet 800 Series require a Dynamic Device -Personalization (DDP) package file to enable advanced features (such as dynamic -tunneling, Intel(R) Ethernet Flow Director, RSS, and ADQ). - -DDP allows you to change the packet processing pipeline of a device by applying -a profile package to the device at runtime. Profiles can be used to, for -example, add support for new protocols, change existing protocols, or change -default settings. DDP profiles can also be rolled back without rebooting the -system. - -The DDP package loads during device initialization or driver runtime, depending -on the operating system. The driver checks to see if the DDP package is present -and compatible. If this file exists, the driver will load it into the device. -If the DDP package file is missing or incompatible with the driver, the driver -will go into Safe Mode where it will use the configuration contained in the -device's NVM. Refer to the Intel(R) Ethernet Adapters and Devices User Guide -for more information on Safe Mode. - -A general-purpose, default DDP package is automatically installed with all -supported Intel Ethernet 800 Series drivers on supported operating systems. -Additional DDP packages are available to address needs for specific market -segments or targeted solutions. - -The default DDP package supports the following: -- MAC -- EtherType -- VLAN -- IPv4 -- IPv6 -- TCP -- ARP -- UDP -- SCTP -- ICMP -- ICMPv6 -- CTRL -- LLDP -- VXLAN-GPE -- VXLAN (non-GPE) -- Geneve -- GRE -- NVGRE -- RoCEv2 -- MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group) +* OS Default Dynamic Device Personalization (DDP) Package + * Overview -Supported Operating Systems -=========================== -This DDP package is supported on the following operating systems: -- Microsoft* Windows Server* -- Linux* -- FreeBSD* -- VMware* ESXi* + * Supported Operating Systems -Refer to the Intel(R) Ethernet Adapters and Devices User Guide for currently -supported versions of these operating systems. + * Contents of This Package + * Related Documentation -Safe Mode -========= -Safe Mode disables advanced and performance features, and supports only basic -traffic and minimal functionality, such as updating the NVM or downloading a -new driver or DDP package. + * Notes -Refer to the Intel(R) Ethernet Adapters and Devices User Guide for more details -on DDP and Safe Mode. + * Installation + * Troubleshooting -Notes -===== -- In Linux, FreeBSD, and Windows, you cannot update the DDP package if any PF -drivers are already loaded. To overwrite a package, unload all PFs and then -reload the driver with the new package. + * Legal / Disclaimers -- In ESXi, use esxcli to load and unload DDP packages for specific market -segments during driver runtime. - -- In FreeBSD and Windows, you can only use one DDP package per driver, even if -you have more than one device installed that uses the driver. -- In Linux, FreeBSD, and Windows, only the first loaded PF per device can -download a package for that device. In ESXi, you can load different DDP -packages for different PFs associated with a device. +Overview +======== -- If you are using DPDK, see the DPDK documentation at https://www.dpdk.org/ -for installation instructions and more information. +Devices based on the Intel(R) Ethernet 800 Series require a Dynamic +Device Personalization (DDP) package file to enable advanced features +(such as dynamic tunneling, Intel(R) Ethernet Flow Director, RSS, and +ADQ). +DDP allows you to change the packet processing pipeline of a device by +applying a profile package to the device at runtime. Profiles can be +used to, for example, add support for new protocols, change existing +protocols, or change default settings. DDP profiles can also be rolled +back without rebooting the system. -Installation -============ +The DDP package loads during device initialization or driver runtime, +depending on the operating system. The driver checks to see if the DDP +package is present and compatible. If this file exists, the driver +will load it into the device. If the DDP package file is missing or +incompatible with the driver, the driver will go into Safe Mode where +it will use the configuration contained in the device's NVM. -Microsoft Windows ------------------ -TO INSTALL THE OS DEFAULT DDP PACKAGE: +Safe Mode disables advanced and performance features, and supports +only basic traffic and minimal functionality, such as updating the NVM +or downloading a new driver or DDP package. -The default DDP package is installed as part of the driver binary. You don't -need to take additional steps to install the DDP package file. +Refer to the Intel(R) Ethernet Adapters and Devices User Guide for +more details on DDP and Safe Mode. +A general-purpose, default DDP package is automatically installed with +all supported Intel Ethernet 800 Series drivers on supported operating +systems. Additional DDP packages are available to address needs for +specific market segments or targeted solutions. -FreeBSD -------- -TO INSTALL THE OS DEFAULT DDP PACKAGE: - -The FreeBSD driver automatically installs the default DDP package file during -driver installation. See the base driver README for general installation and -building instructions. - -The DDP package loads during device initialization. The driver looks for the -ice_ddp module and checks that it contains a valid DDP package file. +The default DDP package supports the following: -NOTE: It's important to do 'make install' during initial ice driver -installation so that the driver loads the DDP package automatically. +* MAC +* EtherType -Linux ------ -TO INSTALL THE OS DEFAULT DDP PACKAGE: +* VLAN -The Linux driver automatically installs the default DDP package file during -driver installation. Read the base driver README for general installation and -building instructions. +* IPv4 -The DDP package loads during device initialization. The driver looks for -intel/ice/ddp/ice.pkg in your firmware root (typically /lib/firmware/ or -/lib/firmware/updates/) and checks that it contains a valid DDP package file. -The ice.pkg file is a symbolic link to the default DDP package file installed -by the linux-firmware software package or the out-of-tree driver installation. +* IPv6 +* TCP -TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: +* ARP -You can install specific DDP package files for different physical devices in -the same system. To install a specific DDP package: +* UDP -1. Download the DDP package file (ice-x.x.x.x.zip) you want for your device. In -addition to licensing information and this README, this zip file contains the -following files: - ice-x.x.x.x.pkg - ice.pkg +* SCTP -NOTE: The ice.pkg file is a Linux symbolic link file pointing to -ice-x.x.x.x.pkg (in the same path). +* ICMP -2. Rename the ice-x.x.x.x.pkg file as ice-xxxxxxxxxxxxxxxx.pkg, where -'xxxxxxxxxxxxxxxx' is the unique 64-bit PCI Express device serial number (in -hex) of the device you want the package downloaded on. The filename must -include the complete serial number (including leading zeros) and be all -lowercase. For example, if the 64-bit serial number is b887a3ffffca0568, then -the file name would be ice-b887a3ffffca0568.pkg. +* ICMPv6 -To find the serial number from the PCI bus address, you can use the following -command: +* CTRL -# lspci -vv -s af:00.0 | grep -i Serial -Capabilities: [150 v1] Device Serial Number b8-87-a3-ff-ff-ca-05-68 +* LLDP -You can use the following command to format the serial number without the -dashes: +* VXLAN-GPE -# lspci -vv -s af:00.0 | grep -i Serial | awk '{print $7}' | sed s/-//g -b887a3ffffca0568 +* VXLAN (non-GPE) -3. Copy the renamed DDP package file to /lib/firmware/updates/intel/ice/ddp/. -If the directory does not yet exist, create it before copying the file. +* Geneve -4. Unload all of the PFs on the device. +* GRE -5. Reload the driver with the new package. +* NVGRE -NOTE: The presence of a device-specific DDP package file overrides the loading -of the default DDP package file. +* RoCEv2 +* MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 + header group) -ESX ---- -TO INSTALL THE OS DEFAULT DDP PACKAGE: -The default DDP package is installed as part of the driver binary. You don't -need to take additional steps to install the DDP package file. +Supported Operating Systems +=========================== -TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: +This DDP package is supported on the following operating systems: -You must first install the Intel(R) ESXCLI Plug-In for Managing Intel(R) -Ethernet Network Adapters to be able to install and load market-specific DDP -packages. Download it from: -https://www.intel.com/content/www/us/en/download/19380/intel-esxcli-plug-in-for- -managing-intel-ethernet-network-adapters.html +* Microsoft* Windows Server* -NOTE: ESXi support for DDP packages for specific market segments requires the -following: -- OS: ESXi 6.7 or higher -- Driver: icen 1.9.1.x or higher -- Tool: intnet 1.8.3.x or higher +* Linux* -To install and load this DDP package: +* FreeBSD* -1. Download and install the esxcli plug-in from the URL above. +* VMware* ESXi* -2. Download the DDP package. +Refer to the Intel(R) Ethernet Adapters and Devices User Guide for +currently supported versions of these operating systems. -3. Copy the DDP package file to the following location: /store/intel/icen/ddp/. - If the directory does not yet exist, create it before copying the file. -4. From the command prompt, run the following command to load the DDP package: +Related Documentation +===================== - # esxcli intnet ddp load -n -p -f +See the "Intel(R) Ethernet Adapters and Devices User Guide" for +additional information on features: - Where: - = the name of the NIC - = the name of the DDP package to load - -f = forces the package to load +* https://cdrdv2.intel.com/v1/dl/getContent/705831/ - NOTE: This operation will cause the driver to reset. +Additionally, a detailed technology guide is available for this DDP +package: -5. Wait for the load result status. +* https://cdrdv2.intel.com/v1/dl/getContent/617015 -To list all active DDP packages for all virtual NICs, run the following: +Notes +===== -# esxcli intnet ddp list +* In Linux, FreeBSD, and Windows, you cannot update the DDP package if + any PF drivers are already loaded. To overwrite a package, unload + all PFs and then reload the driver with the new package. -To unload (roll back) a DDP package, run the following: +* In FreeBSD and Windows, you can only use one DDP package per driver, + even if you have more than one device installed that uses the + driver. -# esxcli intnet ddp rollback -n -f +* In Linux, FreeBSD, and Windows, only the first loaded PF per device + can download a package for that device. In ESXi, you can load + different DDP packages for different PFs associated with a device. -NOTE: This operation will cause the driver to reset. +* If you are using DPDK, see the DPDK documentation at + https://www.dpdk.org/ for installation instructions and more + information. Troubleshooting =============== -Microsoft Windows ------------------ -If you encounter issues with the DDP package file, download the latest driver. FreeBSD ------- -If you encounter issues with the DDP package file, you may need to download an -updated driver or ice_ddp module. See the log messages for more information. -Linux ------ -If you encounter issues with the DDP package file, you may need to download an -updated driver or DDP package file. Refer to the log messages for more -information. - -ESX ---- -If you encounter issues with the DDP package file, download the latest driver. +If you encounter issues with the DDP package file, you may need to +download an updated driver or ice_ddp module. See the log messages for +more information. Legal / Disclaimers =================== -Copyright (c) 2019 - 2022, Intel Corporation. -Intel and the Intel logo are trademarks of Intel Corporation or its -subsidiaries in the U.S. and/or other countries. +Copyright (c) 2019 - 2024, Intel Corporation. + +Intel technologies may require enabled hardware, software or service +activation. + +No product or component can be absolutely secure. + +Your costs and results may vary. + +Intel, the Intel logo, and other Intel marks are trademarks of Intel +Corporation or its subsidiaries. Other names and brands may be +claimed as the property of others. + +Performance varies by use, configuration, and other factors. Learn +more at https://www.Intel.com/PerformanceIndex. + +The products described may contain design defects or errors known as +errata which may cause the product to deviate from published +specifications. Current characterized errata are available on request. -*Other names and brands may be claimed as the property of others. +This software and the related documents are Intel copyrighted +materials, and your use of them is governed by the express license +under which they were provided to you ("License"). Unless the License +provides otherwise, you may not use, modify, copy, publish, +distribute, disclose or transmit this software or the related +documents without Intel's prior written permission. -This software and the related documents are Intel copyrighted materials, and -your use of them is governed by the express license under which they were -provided to you ("License"). Unless the License provides otherwise, you may not -use, modify, copy, publish, distribute, disclose or transmit this software or -the related documents without Intel's prior written permission. -This software and the related documents are provided as is, with no express or -implied warranties, other than those that are expressly stated in the License. +This software and the related documents are provided as is, with no +express or implied warranties, other than those that are expressly +stated in the License. diff --git a/sys/contrib/dev/ice/ice-1.3.36.0.pkg b/sys/contrib/dev/ice/ice-1.3.41.0.pkg similarity index 50% rename from sys/contrib/dev/ice/ice-1.3.36.0.pkg rename to sys/contrib/dev/ice/ice-1.3.41.0.pkg index ce5dbf41f557..71e75a5d7836 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.36.0.pkg and b/sys/contrib/dev/ice/ice-1.3.41.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index e0ef344a8283..cb5653911d5c 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/contrib/dev/ice KMOD= ice_ddp -FIRMWS= ice-1.3.36.0.pkg:ice_ddp:0x01032400 +FIRMWS= ice-1.3.41.0.pkg:ice_ddp:0x01032900 .include From nobody Wed Oct 30 20:57:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw562b6z5c1x7; Wed, 30 Oct 2024 20:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw53X51z4pnN; Wed, 30 Oct 2024 20:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDw+ltTFaaNxpgVZbhMyjKS3yvkJk6auXdWBUFAVAmE=; b=SVRPHb0stID4jx1T84c/Dwk6aXSz5plcympIYkdBg77/yf1fabJlbMOGL/lZTTUcaoNNgT BJ0mckTLdFAh/FiaEv00fu59+2fEko6GV2c8QT9sql+ssDKNRkD1tWFq1t586ruArI8ovc coIjCRg6PPbqudjdNRTmGxcc3mqBP9NpkAYJrOY9+Np++WfmXhZ5FgmZDjRusbVtu8NIu6 3m/0kZiH26S9Rkd/kH7HYOYmnfoaLDx5OXKCO117sxjq7WN2hVz45vynHtrIRI5ycf5xqL h6WPL9WNYNVcY18UNz/9/7CksKQGMO5iXwDTOuVo4soqI14irX1D3LUxWGb8dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KDw+ltTFaaNxpgVZbhMyjKS3yvkJk6auXdWBUFAVAmE=; b=WzrgOWLDGLD9RJ8DquMHDxHMKRNQoX9SVx9ZVzkWRbZRy4n1MUPsX0rE52F6EmEqG0JNSk FlFfXCtJE4zB/m5zkCmhLF3xMwbUdamgmREHLsrw4FL0ZZq0UNcSLZsNRB6ITm1tQnkcP5 pr0Q65yEatppjrj59VElT5eBvIYqvj/2kcn4VHE8D/q/m1v/qQLoMLFg01tG+EM9YNXGgq j59I81zMo/md05XEKI9va9jVdH0CE6Jv+oJxlN1+pf5QYOm+BbrXLFFX8CnCnXxoTkMTB2 Yw+BOsWgLotYr5VZSUqFm6JRApkdajYY+4b3e4uC3k5aIoVi4MmYpwUrTFFVKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321845; a=rsa-sha256; cv=none; b=G9tJl6KpP4Qq43gcNqSoLlqol4YzuNppJiSwx7y53cdqr2zrLpmNGedrpbgHr2Yqb5uF60 P4JMKOL263GsIbJ4Ey002FxPgGEbbxP3GUwcFJBlegD9qvokBGE+6BlAzP44Ie+0nsUCEu Kklw8UZG3Kd8bBSP+MRRFIaJdJbOwPgxu/0sx9x54DPal2SnDswnp68ayhInaURcYgnjJC I5HiUU8X3/DSU+cfKrYZhpBs5sck11sc3eQgSFT+ZqOqC7WVtEIQFphroAfUaZ8uF26smK 6v0Z80ZJFh1CZiU6O1jOOXhT1PrD083PQTUFzbYcTETlRoMzsIUYn/c6Egzofg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw52p98z1MdB; Wed, 30 Oct 2024 20:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvP86033489; Wed, 30 Oct 2024 20:57:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvPKR033486; Wed, 30 Oct 2024 20:57:25 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:25 GMT Message-Id: <202410302057.49UKvPKR033486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 5cf8640220e7 - stable/14 - ice: Update to 1.42.1-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5cf8640220e7fa84cd5f1368bad648d037a20e44 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf8640220e7fa84cd5f1368bad648d037a20e44 commit 5cf8640220e7fa84cd5f1368bad648d037a20e44 Author: Eric Joyner AuthorDate: 2024-08-29 22:41:20 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:52:07 +0000 ice: Update to 1.42.1-k Summary: - Adds E830 device support - Adds pre-release E825C support (for the Ethernet device included in an upcoming Xeon D platform) - Add sysctl for E810 devices to print out PHY debug statistics (mostly for FEC debugging) - Adds per-TX-queue tso counter sysctl to count how many times a TSO offload was requested for a packet, matching other Intel drivers - Various bug fixes Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper Relnotes: yes Sponsored by: Intel Corporation Differential Revisison: https://reviews.freebsd.org/D46949 (cherry picked from commit f2635e844dd138ac9dfba676f27d41750049af26) --- sys/dev/ice/ice_adminq_cmd.h | 191 ++- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 967 ++++++++++------ sys/dev/ice/ice_common.h | 189 +-- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 143 ++- sys/dev/ice/ice_controlq.h | 24 +- sys/dev/ice/ice_dcb.c | 90 +- sys/dev/ice/ice_dcb.h | 42 +- sys/dev/ice/ice_ddp_common.c | 123 +- sys/dev/ice/ice_ddp_common.h | 19 +- sys/dev/ice/ice_devids.h | 38 +- sys/dev/ice/ice_drv_info.h | 49 +- sys/dev/ice/ice_features.h | 3 + sys/dev/ice/ice_flex_pipe.c | 266 ++--- sys/dev/ice/ice_flex_pipe.h | 38 +- sys/dev/ice/ice_flow.c | 100 +- sys/dev/ice/ice_flow.h | 14 +- sys/dev/ice/ice_fw_logging.c | 4 +- sys/dev/ice/ice_fwlog.c | 39 +- sys/dev/ice/ice_fwlog.h | 12 +- sys/dev/ice/ice_hw_autogen.h | 2557 +++++++++++++++++++++++++++++++++++------ sys/dev/ice/ice_iflib.h | 1 - sys/dev/ice/ice_lan_tx_rx.h | 8 +- sys/dev/ice/ice_lib.c | 1113 +++++++++++++++--- sys/dev/ice/ice_lib.h | 109 +- sys/dev/ice/ice_nvm.c | 374 +++--- sys/dev/ice/ice_nvm.h | 56 +- sys/dev/ice/ice_rdma.c | 2 +- sys/dev/ice/ice_sbq_cmd.h | 120 ++ sys/dev/ice/ice_sched.c | 487 ++++---- sys/dev/ice/ice_sched.h | 102 +- sys/dev/ice/ice_strings.c | 4 +- sys/dev/ice/ice_switch.c | 304 ++--- sys/dev/ice/ice_switch.h | 93 +- sys/dev/ice/ice_type.h | 36 +- sys/dev/ice/ice_vlan_mode.c | 22 +- sys/dev/ice/ice_vlan_mode.h | 2 +- sys/dev/ice/if_ice_iflib.c | 59 +- sys/dev/ice/virtchnl.h | 28 + 40 files changed, 5678 insertions(+), 2156 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 70b56144faf2..6225abc0f38b 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -187,7 +187,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_ROCEV2_LAG 0x0092 #define ICE_AQC_BIT_ROCEV2_LAG 0x01 #define ICE_AQC_BIT_SRIOV_LAG 0x02 - +#define ICE_AQC_CAPS_NEXT_CLUSTER_ID 0x0096 u8 major_ver; u8 minor_ver; /* Number of resources described by this capability */ @@ -320,7 +320,12 @@ struct ice_aqc_set_port_params { (0x3F << ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S) #define ICE_AQC_SET_P_PARAMS_IS_LOGI_PORT BIT(14) #define ICE_AQC_SET_P_PARAMS_SWID_VALID BIT(15) - u8 reserved[10]; + u8 lb_mode; +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID BIT(2) +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL 0x00 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NO 0x01 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_HIGH 0x02 + u8 reserved[9]; }; /* These resource type defines are used for all switch resource @@ -1389,7 +1394,18 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 4 +#define ICE_PHY_TYPE_HIGH_200G_CR4_PAM4 BIT_ULL(5) +#define ICE_PHY_TYPE_HIGH_200G_SR4 BIT_ULL(6) +#define ICE_PHY_TYPE_HIGH_200G_FR4 BIT_ULL(7) +#define ICE_PHY_TYPE_HIGH_200G_LR4 BIT_ULL(8) +#define ICE_PHY_TYPE_HIGH_200G_DR4 BIT_ULL(9) +#define ICE_PHY_TYPE_HIGH_200G_KR4_PAM4 BIT_ULL(10) +#define ICE_PHY_TYPE_HIGH_200G_AUI4_AOC_ACC BIT_ULL(11) +#define ICE_PHY_TYPE_HIGH_200G_AUI4 BIT_ULL(12) +#define ICE_PHY_TYPE_HIGH_200G_AUI8_AOC_ACC BIT_ULL(13) +#define ICE_PHY_TYPE_HIGH_200G_AUI8 BIT_ULL(14) +#define ICE_PHY_TYPE_HIGH_400GBASE_FR8 BIT_ULL(15) +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 15 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1541,11 +1557,14 @@ struct ice_aqc_get_link_status { enum ice_get_link_status_data_version { ICE_GET_LINK_STATUS_DATA_V1 = 1, + ICE_GET_LINK_STATUS_DATA_V2 = 2, }; #define ICE_GET_LINK_STATUS_DATALEN_V1 32 +#define ICE_GET_LINK_STATUS_DATALEN_V2 56 /* Get link status response data structure, also used for Link Status Event */ +#pragma pack(1) struct ice_aqc_get_link_status_data { u8 topo_media_conflict; #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0) @@ -1618,7 +1637,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2 #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3 __le16 link_speed; -#define ICE_AQ_LINK_SPEED_M 0x7FF +#define ICE_AQ_LINK_SPEED_M 0xFFF #define ICE_AQ_LINK_SPEED_10MB BIT(0) #define ICE_AQ_LINK_SPEED_100MB BIT(1) #define ICE_AQ_LINK_SPEED_1000MB BIT(2) @@ -1630,12 +1649,37 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_SPEED_40GB BIT(8) #define ICE_AQ_LINK_SPEED_50GB BIT(9) #define ICE_AQ_LINK_SPEED_100GB BIT(10) +#define ICE_AQ_LINK_SPEED_200GB BIT(11) #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15) - __le32 reserved3; /* Aligns next field to 8-byte boundary */ + __le16 reserved3; /* Aligns next field to 8-byte boundary */ + u8 ext_fec_status; +#define ICE_AQ_LINK_RS_272_FEC_EN BIT(0) /* RS 272 FEC enabled */ + u8 reserved4; __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + /* Get link status version 2 link partner data */ + __le64 lp_phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ + __le64 lp_phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + u8 lp_fec_adv; +#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2) +#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3) +#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4) +#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5) + u8 lp_fec_req; +#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2) +#define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3) + u8 lp_flowcontrol; +#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0) +#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1) + u8 reserved[5]; }; +#pragma pack() + /* Set event mask command (direct 0x0613) */ struct ice_aqc_set_event_mask { u8 lport_num; @@ -1793,14 +1837,46 @@ struct ice_aqc_dnl_call_command { u8 ctx; /* Used in command, reserved in response */ u8 reserved; __le16 activity_id; +#define ICE_AQC_ACT_ID_DNL 0x1129 __le32 reserved1; __le32 addr_high; __le32 addr_low; }; +struct ice_aqc_dnl_equa_param { + __le16 data_in; +#define ICE_AQC_RX_EQU_SHIFT 8 +#define ICE_AQC_RX_EQU_PRE2 (0x10 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_PRE1 (0x11 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_POST1 (0x12 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_BFLF (0x13 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_BFHF (0x14 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_RX_EQU_DRATE (0x15 << ICE_AQC_RX_EQU_SHIFT) +#define ICE_AQC_TX_EQU_PRE1 0x0 +#define ICE_AQC_TX_EQU_PRE3 0x3 +#define ICE_AQC_TX_EQU_ATTEN 0x4 +#define ICE_AQC_TX_EQU_POST1 0x8 +#define ICE_AQC_TX_EQU_PRE2 0xC + __le16 op_code_serdes_sel; +#define ICE_AQC_OP_CODE_SHIFT 4 +#define ICE_AQC_OP_CODE_RX_EQU (0x9 << ICE_AQC_OP_CODE_SHIFT) +#define ICE_AQC_OP_CODE_TX_EQU (0x10 << ICE_AQC_OP_CODE_SHIFT) + __le32 reserved[3]; +}; + +struct ice_aqc_dnl_equa_resp { + /* Equalization value can be -ve */ + int val; + __le32 reserved[3]; +}; + /* DNL call command/response buffer (indirect 0x0682) */ struct ice_aqc_dnl_call { - __le32 stores[4]; + union { + struct ice_aqc_dnl_equa_param txrx_equa_reqs; + __le32 stores[4]; + struct ice_aqc_dnl_equa_resp txrx_equa_resp; + } sto; }; /* Used for both commands: @@ -1902,8 +1978,8 @@ struct ice_aqc_link_topo_addr { #define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S) /* Used to decode the handle field */ #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9) -#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM 0 +#define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ BIT(9) #define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0 /* In case of a Mezzanine type */ #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \ @@ -1919,7 +1995,7 @@ struct ice_aqc_link_topo_addr { struct ice_aqc_get_link_topo { struct ice_aqc_link_topo_addr addr; u8 node_part_num; -#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 +#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 u8 rsvd[9]; }; @@ -2054,6 +2130,7 @@ struct ice_aqc_get_port_options_elem { #define ICE_AQC_PORT_OPT_MAX_LANE_25G 5 #define ICE_AQC_PORT_OPT_MAX_LANE_50G 6 #define ICE_AQC_PORT_OPT_MAX_LANE_100G 7 +#define ICE_AQC_PORT_OPT_MAX_LANE_200G 8 u8 global_scid[2]; u8 phy_scid[2]; u8 pf2port_cid[2]; @@ -2201,6 +2278,29 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4 /* In Bits */ #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_OFFSET 0xD8 +#define ICE_AQC_NVM_SDP_CFG_PTR_RD_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_PTR_M MAKEMASK(0x7FFF, 0) +#define ICE_AQC_NVM_SDP_CFG_PTR_TYPE_M BIT(15) +#define ICE_AQC_NVM_SDP_CFG_HEADER_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_SEC_LEN_LEN 2 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_DATA_LEN 14 /* In Bytes */ +#define ICE_AQC_NVM_SDP_CFG_MAX_SECTION_SIZE 7 +#define ICE_AQC_NVM_SDP_CFG_PIN_SIZE 10 +#define ICE_AQC_NVM_SDP_CFG_PIN_OFFSET 6 +#define ICE_AQC_NVM_SDP_CFG_PIN_MASK MAKEMASK(0x3FF, \ + ICE_AQC_NVM_SDP_CFG_PIN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET 4 +#define ICE_AQC_NVM_SDP_CFG_CHAN_MASK MAKEMASK(0x3, \ + ICE_AQC_NVM_SDP_CFG_CHAN_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_DIR_OFFSET 3 +#define ICE_AQC_NVM_SDP_CFG_DIR_MASK MAKEMASK(0x1, \ + ICE_AQC_NVM_SDP_CFG_DIR_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET 0 +#define ICE_AQC_NVM_SDP_CFG_SDP_NUM_MASK MAKEMASK(0x7, \ + ICE_AQC_NVM_SDP_CFG_SDP_NUM_OFFSET) +#define ICE_AQC_NVM_SDP_CFG_NA_PIN_MASK MAKEMASK(0x1, 15) + #define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 #define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B #define ICE_AQC_NVM_CMPO_MOD_ID 0x153 @@ -2265,6 +2365,29 @@ struct ice_aqc_nvm_checksum { u8 rsvd2[12]; }; +/* Used for NVM Sanitization command - 0x070C */ +struct ice_aqc_nvm_sanitization { + u8 cmd_flags; +#define ICE_AQ_NVM_SANITIZE_REQ_READ 0 +#define ICE_AQ_NVM_SANITIZE_REQ_OPERATE BIT(0) + +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_BITS 0 +#define ICE_AQ_NVM_SANITIZE_READ_SUBJECT_NVM_STATE BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_SUBJECT_CLEAR 0 + u8 values; +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_HOST_CLEAN_SUPPORT BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_BITS_BMC_CLEAN_SUPPORT BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_NVM_STATE_BMC_CLEAN_SUCCESS BIT(3) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_DONE BIT(0) +#define ICE_AQ_NVM_SANITIZE_OPERATE_HOST_CLEAN_SUCCESS BIT(1) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_DONE BIT(2) +#define ICE_AQ_NVM_SANITIZE_OPERATE_BMC_CLEAN_SUCCESS BIT(3) + u8 reserved[14]; +}; + /* * Send to PF command (indirect 0x0801) ID is only used by PF * @@ -2560,6 +2683,15 @@ struct ice_aqc_get_set_rss_lut { __le32 addr_low; }; +/* Sideband Control Interface Commands */ +/* Neighbor Device Request (indirect 0x0C00); also used for the response. */ +struct ice_aqc_neigh_dev_req { + __le16 sb_data_len; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + /* Add Tx LAN Queues (indirect 0x0C30) */ struct ice_aqc_add_txqs { u8 num_qgrps; @@ -2812,19 +2944,33 @@ struct ice_aqc_event_lan_overflow { /* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals { __le16 cluster_id; /* Expresses next cluster ID in response */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E810 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E810 1 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E810 2 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E810 3 /* EMP_DRAM only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM 4 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK 5 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM_E810 4 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E810 5 /* AUX_REGS only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS 6 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB 7 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS 22 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS_E810 6 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E810 7 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E810 8 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E810 9 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E810 21 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS_E810 22 + +/* Start cluster to discover first available cluster */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_START_ALL 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW_E830 100 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_ACL_E830 101 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED_E830 102 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES_E830 103 +/* EMP_DRAM only dumpable in device debug mode */ +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK_E830 105 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB_E830 107 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P_E830 108 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG_E830 109 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE_E830 121 __le16 table_id; /* Used only for non-memory clusters */ __le32 idx; /* In table entries for tables, in bytes for memory */ __le32 addr_high; @@ -3076,6 +3222,7 @@ struct ice_aq_desc { struct ice_aqc_nvm nvm; struct ice_aqc_nvm_cfg nvm_cfg; struct ice_aqc_nvm_checksum nvm_checksum; + struct ice_aqc_nvm_sanitization sanitization; struct ice_aqc_pf_vf_msg virt; struct ice_aqc_read_write_alt_direct read_write_alt_direct; struct ice_aqc_read_write_alt_indirect read_write_alt_indirect; @@ -3095,6 +3242,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; + struct ice_aqc_neigh_dev_req neigh_dev; struct ice_aqc_add_txqs add_txqs; struct ice_aqc_dis_txqs dis_txqs; struct ice_aqc_move_txqs move_txqs; @@ -3330,6 +3478,7 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_update_empr = 0x0709, ice_aqc_opc_nvm_pkg_data = 0x070A, ice_aqc_opc_nvm_pass_component_tbl = 0x070B, + ice_aqc_opc_nvm_sanitization = 0x070C, /* PF/VF mailbox commands */ ice_mbx_opc_send_msg_to_pf = 0x0801, @@ -3360,6 +3509,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_rss_lut = 0x0B03, ice_aqc_opc_get_rss_key = 0x0B04, ice_aqc_opc_get_rss_lut = 0x0B05, + /* Sideband Control Interface commands */ + ice_aqc_opc_neighbour_device_request = 0x0C00, /* Tx queue handling commands/events */ ice_aqc_opc_add_txqs = 0x0C30, diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 499ee41228c3..c480900596f4 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -445,10 +445,10 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) * Note that this function assumes it is operating on a bitmap declared using * ice_declare_bitmap. */ -static inline int +static inline u16 ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) { - int count = 0; + u16 count = 0; u16 bit = 0; while (size > (bit = ice_find_next_bit(bm, size, bit))) { diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index ef487bcfd0f4..ad4ea4c8e7a1 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -32,7 +32,6 @@ #include "ice_common.h" #include "ice_sched.h" #include "ice_adminq_cmd.h" - #include "ice_flow.h" #include "ice_switch.h" @@ -111,6 +110,17 @@ static const char * const ice_link_mode_str_high[] = { ice_arr_elem_idx(2, "100G_CAUI2"), ice_arr_elem_idx(3, "100G_AUI2_AOC_ACC"), ice_arr_elem_idx(4, "100G_AUI2"), + ice_arr_elem_idx(5, "200G_CR4_PAM4"), + ice_arr_elem_idx(6, "200G_SR4"), + ice_arr_elem_idx(7, "200G_FR4"), + ice_arr_elem_idx(8, "200G_LR4"), + ice_arr_elem_idx(9, "200G_DR4"), + ice_arr_elem_idx(10, "200G_KR4_PAM4"), + ice_arr_elem_idx(11, "200G_AUI4_AOC_ACC"), + ice_arr_elem_idx(12, "200G_AUI4"), + ice_arr_elem_idx(13, "200G_AUI8_AOC_ACC"), + ice_arr_elem_idx(14, "200G_AUI8"), + ice_arr_elem_idx(15, "400GBASE_FR8"), }; /** @@ -151,7 +161,7 @@ ice_dump_phy_type(struct ice_hw *hw, u64 low, u64 high, const char *prefix) * This function sets the MAC type of the adapter based on the * vendor ID and device ID stored in the HW structure. */ -enum ice_status ice_set_mac_type(struct ice_hw *hw) +int ice_set_mac_type(struct ice_hw *hw) { ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -188,13 +198,43 @@ enum ice_status ice_set_mac_type(struct ice_hw *hw) case ICE_DEV_ID_E823C_SGMII: hw->mac_type = ICE_MAC_GENERIC; break; + case ICE_DEV_ID_E825C_BACKPLANE: + case ICE_DEV_ID_E825C_QSFP: + case ICE_DEV_ID_E825C_SFP: + case ICE_DEV_ID_E825C_SGMII: + hw->mac_type = ICE_MAC_GENERIC_3K_E825; + break; + case ICE_DEV_ID_E830_BACKPLANE: + case ICE_DEV_ID_E830_QSFP56: + case ICE_DEV_ID_E830_SFP: + case ICE_DEV_ID_E830C_BACKPLANE: + case ICE_DEV_ID_E830_L_BACKPLANE: + case ICE_DEV_ID_E830C_QSFP: + case ICE_DEV_ID_E830_L_QSFP: + case ICE_DEV_ID_E830C_SFP: + case ICE_DEV_ID_E830_L_SFP: + hw->mac_type = ICE_MAC_E830; + break; default: hw->mac_type = ICE_MAC_UNKNOWN; break; } ice_debug(hw, ICE_DBG_INIT, "mac_type: %d\n", hw->mac_type); - return ICE_SUCCESS; + return 0; +} + +/** + * ice_is_generic_mac + * @hw: pointer to the hardware structure + * + * returns true if mac_type is ICE_MAC_GENERIC, false if not + */ +bool ice_is_generic_mac(struct ice_hw *hw) +{ + return (hw->mac_type == ICE_MAC_GENERIC || + hw->mac_type == ICE_MAC_GENERIC_3K || + hw->mac_type == ICE_MAC_GENERIC_3K_E825); } /** @@ -223,7 +263,7 @@ bool ice_is_e810t(struct ice_hw *hw) case ICE_SUBDEV_ID_E810T2: case ICE_SUBDEV_ID_E810T3: case ICE_SUBDEV_ID_E810T4: - case ICE_SUBDEV_ID_E810T5: + case ICE_SUBDEV_ID_E810T6: case ICE_SUBDEV_ID_E810T7: return true; } @@ -231,8 +271,8 @@ bool ice_is_e810t(struct ice_hw *hw) case ICE_DEV_ID_E810C_QSFP: switch (hw->subsystem_device_id) { case ICE_SUBDEV_ID_E810T2: + case ICE_SUBDEV_ID_E810T3: case ICE_SUBDEV_ID_E810T5: - case ICE_SUBDEV_ID_E810T6: return true; } break; @@ -243,6 +283,17 @@ bool ice_is_e810t(struct ice_hw *hw) return false; } +/** + * ice_is_e830 + * @hw: pointer to the hardware structure + * + * returns true if the device is E830 based, false if not. + */ +bool ice_is_e830(struct ice_hw *hw) +{ + return hw->mac_type == ICE_MAC_E830; +} + /** * ice_is_e823 * @hw: pointer to the hardware structure @@ -268,6 +319,25 @@ bool ice_is_e823(struct ice_hw *hw) } } +/** + * ice_is_e825c + * @hw: pointer to the hardware structure + * + * returns true if the device is E825-C based, false if not. + */ +bool ice_is_e825c(struct ice_hw *hw) +{ + switch (hw->device_id) { + case ICE_DEV_ID_E825C_BACKPLANE: + case ICE_DEV_ID_E825C_QSFP: + case ICE_DEV_ID_E825C_SFP: + case ICE_DEV_ID_E825C_SGMII: + return true; + default: + return false; + } +} + /** * ice_clear_pf_cfg - Clear PF configuration * @hw: pointer to the hardware structure @@ -275,7 +345,7 @@ bool ice_is_e823(struct ice_hw *hw) * Clears any existing PF configuration (VSIs, VSI lists, switch rules, port * configuration, flow director filters, etc.). */ -enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) +int ice_clear_pf_cfg(struct ice_hw *hw) { struct ice_aq_desc desc; @@ -299,14 +369,14 @@ enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) * ice_discover_dev_caps is expected to be called before this function is * called. */ -enum ice_status +int ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, struct ice_sq_cd *cd) { struct ice_aqc_manage_mac_read_resp *resp; struct ice_aqc_manage_mac_read *cmd; struct ice_aq_desc desc; - enum ice_status status; + int status; u16 flags; u8 i; @@ -340,7 +410,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, ETH_ALEN, ICE_NONDMA_TO_NONDMA); break; } - return ICE_SUCCESS; + return 0; } /** @@ -401,16 +471,21 @@ static void ice_set_media_type(struct ice_port_info *pi) * type is FIBER */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, - ICE_MEDIA_OPT_PHY_TYPE_LOW_M, 0) || - (phy_type_low & ICE_MEDIA_OPT_PHY_TYPE_LOW_M && - phy_type_low & ICE_MEDIA_C2M_PHY_TYPE_LOW_M)) + ICE_MEDIA_OPT_PHY_TYPE_LOW_M, + ICE_MEDIA_OPT_PHY_TYPE_HIGH_M) || + ((phy_type_low & ICE_MEDIA_OPT_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_OPT_PHY_TYPE_HIGH_M) && + (phy_type_low & ICE_MEDIA_C2M_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) *media_type = ICE_MEDIA_FIBER; /* else if PHY types are only DA, or DA and C2C, then media type DA */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, - ICE_MEDIA_DAC_PHY_TYPE_LOW_M, 0) || - (phy_type_low & ICE_MEDIA_DAC_PHY_TYPE_LOW_M && - (phy_type_low & ICE_MEDIA_C2C_PHY_TYPE_LOW_M || - phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) + ICE_MEDIA_DAC_PHY_TYPE_LOW_M, + ICE_MEDIA_DAC_PHY_TYPE_HIGH_M) || + ((phy_type_low & ICE_MEDIA_DAC_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_DAC_PHY_TYPE_HIGH_M) && + (phy_type_low & ICE_MEDIA_C2C_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) *media_type = ICE_MEDIA_DA; /* else if PHY types are only C2M or only C2C, then media is AUI */ else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, @@ -435,7 +510,7 @@ static void ice_set_media_type(struct ice_port_info *pi) * * Returns the various PHY capabilities supported on the Port (0x0600) */ -enum ice_status +int ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, struct ice_aqc_get_phy_caps_data *pcaps, struct ice_sq_cd *cd) @@ -443,9 +518,9 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, struct ice_aqc_get_phy_caps *cmd; u16 pcaps_size = sizeof(*pcaps); struct ice_aq_desc desc; - enum ice_status status; const char *prefix; struct ice_hw *hw; + int status; cmd = &desc.params.get_phy; @@ -510,7 +585,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ice_debug(hw, ICE_DBG_LINK, "%s: module_type[2] = 0x%x\n", prefix, pcaps->module_type[2]); - if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { + if (!status && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, @@ -525,81 +600,65 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, } /** - * ice_aq_get_netlist_node - * @hw: pointer to the hw struct - * @cmd: get_link_topo AQ structure - * @node_part_number: output node part number if node found - * @node_handle: output node handle parameter if node found + * ice_aq_get_phy_equalization - function to read serdes equalizer value from + * firmware using admin queue command. + * @hw: pointer to the HW struct + * @data_in: represents the serdes equalization parameter requested + * @op_code: represents the serdes number and flag to represent tx or rx + * @serdes_num: represents the serdes number + * @output: pointer to the caller-supplied buffer to return serdes equalizer + * + * Returns 0 on success, + * non-zero status on error */ -enum ice_status -ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, - u8 *node_part_number, u16 *node_handle) +int ice_aq_get_phy_equalization(struct ice_hw *hw, u16 data_in, u16 op_code, + u8 serdes_num, int *output) { + struct ice_aqc_dnl_call_command *cmd; + struct ice_aqc_dnl_call buf; struct ice_aq_desc desc; + int err = 0; - ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); - desc.params.get_link_topo = *cmd; + if (!hw || !output) + return (ICE_ERR_PARAM); - if (ice_aq_send_cmd(hw, &desc, NULL, 0, NULL)) - return ICE_ERR_NOT_SUPPORTED; + memset(&buf, 0, sizeof(buf)); + buf.sto.txrx_equa_reqs.data_in = CPU_TO_LE16(data_in); + buf.sto.txrx_equa_reqs.op_code_serdes_sel = + CPU_TO_LE16(op_code | (serdes_num & 0xF)); - if (node_handle) - *node_handle = - LE16_TO_CPU(desc.params.get_link_topo.addr.handle); - if (node_part_number) - *node_part_number = desc.params.get_link_topo.node_part_num; + cmd = &desc.params.dnl_call; + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_dnl_call); + desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_BUF | ICE_AQ_FLAG_RD | + ICE_AQ_FLAG_SI); + desc.datalen = CPU_TO_LE16(sizeof(struct ice_aqc_dnl_call)); + cmd->activity_id = CPU_TO_LE16(ICE_AQC_ACT_ID_DNL); + cmd->ctx = 0; - return ICE_SUCCESS; + err = ice_aq_send_cmd(hw, &desc, &buf, + sizeof(struct ice_aqc_dnl_call), NULL); + if (!err) + *output = buf.sto.txrx_equa_resp.val; + + return err; } -#define MAX_NETLIST_SIZE 10 +#define ice_get_link_status_data_ver(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + ICE_GET_LINK_STATUS_DATA_V2 : ICE_GET_LINK_STATUS_DATA_V1) + /** - * ice_find_netlist_node - * @hw: pointer to the hw struct - * @node_type_ctx: type of netlist node to look for - * @node_part_number: node part number to look for - * @node_handle: output parameter if node found - optional + * ice_get_link_status_datalen + * @hw: pointer to the HW struct * - * Find and return the node handle for a given node type and part number in the - * netlist. When found ICE_SUCCESS is returned, ICE_ERR_DOES_NOT_EXIST - * otherwise. If node_handle provided, it would be set to found node handle. + * return Get Link Status datalen */ -enum ice_status -ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, - u16 *node_handle) +static u16 ice_get_link_status_datalen(struct ice_hw *hw) { - struct ice_aqc_get_link_topo cmd; - u8 rec_node_part_number; - u16 rec_node_handle; - u8 idx; - - for (idx = 0; idx < MAX_NETLIST_SIZE; idx++) { - enum ice_status status; - - memset(&cmd, 0, sizeof(cmd)); - - cmd.addr.topo_params.node_type_ctx = - (node_type_ctx << ICE_AQC_LINK_TOPO_NODE_TYPE_S); - cmd.addr.topo_params.index = idx; - - status = ice_aq_get_netlist_node(hw, &cmd, - &rec_node_part_number, - &rec_node_handle); - if (status) - return status; - - if (rec_node_part_number == node_part_number) { - if (node_handle) - *node_handle = rec_node_handle; - return ICE_SUCCESS; - } - } - - return ICE_ERR_DOES_NOT_EXIST; + return (ice_get_link_status_data_ver(hw) == + ICE_GET_LINK_STATUS_DATA_V1) ? ICE_GET_LINK_STATUS_DATALEN_V1 : + ICE_GET_LINK_STATUS_DATALEN_V2; } -#define ice_get_link_status_datalen(hw) ICE_GET_LINK_STATUS_DATALEN_V1 - /** * ice_aq_get_link_info * @pi: port information structure @@ -609,7 +668,7 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, * * Get Link Status (0x607). Returns the link status of the adapter. */ -enum ice_status +int ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, struct ice_link_status *link, struct ice_sq_cd *cd) { @@ -619,9 +678,9 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, struct ice_fc_info *hw_fc_info; bool tx_pause, rx_pause; struct ice_aq_desc desc; - enum ice_status status; struct ice_hw *hw; u16 cmd_flags; + int status; if (!pi) return ICE_ERR_PARAM; @@ -639,7 +698,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, status = ice_aq_send_cmd(hw, &desc, &link_data, ice_get_link_status_datalen(hw), cd); - if (status != ICE_SUCCESS) + if (status) return status; /* save off old link status information */ @@ -696,7 +755,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, /* flag cleared so calling functions don't call AQ again */ pi->phy.get_link_info = false; - return ICE_SUCCESS; + return 0; } /** @@ -721,17 +780,28 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, * Also, because we are operating on transmit timer and fc * threshold of LFC, we don't turn on any bit in tx_tmr_priority */ -#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX +#define E800_IDX_OF_LFC E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX - /* Retrieve the transmit timer */ - val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); - tx_timer_val = val & - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; - cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + if ((hw)->mac_type == ICE_MAC_E830) { + /* Retrieve the transmit timer */ + val = rd32(hw, E830_PRTMAC_CL01_PAUSE_QUANTA); + tx_timer_val = val & E830_PRTMAC_CL01_PAUSE_QUANTA_CL0_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); - /* Retrieve the fc threshold */ - val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); - fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + /* Retrieve the fc threshold */ + val = rd32(hw, E830_PRTMAC_CL01_QUANTA_THRESH); + fc_thres_val = val & E830_PRTMAC_CL01_QUANTA_THRESH_CL0_QUANTA_THRESH_M; + } else { + /* Retrieve the transmit timer */ + val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(E800_IDX_OF_LFC)); + tx_timer_val = val & + E800_PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + + /* Retrieve the fc threshold */ + val = rd32(hw, E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(E800_IDX_OF_LFC)); + fc_thres_val = val & E800_PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + } cmd->fc_refresh_threshold = CPU_TO_LE16(fc_thres_val); } @@ -745,7 +815,7 @@ ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, * * Set MAC configuration (0x0603) */ -enum ice_status +int ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, bool auto_drop, struct ice_sq_cd *cd) { @@ -772,10 +842,10 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, bool auto_drop, * ice_init_fltr_mgmt_struct - initializes filter management list and locks * @hw: pointer to the HW struct */ -static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) +int ice_init_fltr_mgmt_struct(struct ice_hw *hw) { struct ice_switch_info *sw; - enum ice_status status; + int status; hw->switch_info = (struct ice_switch_info *) ice_malloc(hw, sizeof(*hw->switch_info)); @@ -793,7 +863,7 @@ static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) ice_free(hw, hw->switch_info); return status; } - return ICE_SUCCESS; + return 0; } /** @@ -866,7 +936,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) * ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks * @hw: pointer to the HW struct */ -static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) +void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) { ice_cleanup_fltr_mgmt_single(hw, hw->switch_info); } @@ -911,7 +981,7 @@ void ice_print_rollback_msg(struct ice_hw *hw) orom = &hw->flash.orom; nvm = &hw->flash.nvm; - SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", + (void)SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", nvm->major, nvm->minor, nvm->eetrack, orom->major, orom->build, orom->patch); ice_warn(hw, @@ -934,12 +1004,12 @@ void ice_set_umac_shared(struct ice_hw *hw) * ice_init_hw - main hardware initialization routine * @hw: pointer to the hardware structure */ -enum ice_status ice_init_hw(struct ice_hw *hw) +int ice_init_hw(struct ice_hw *hw) { struct ice_aqc_get_phy_caps_data *pcaps; - enum ice_status status; u16 mac_buf_len; void *mac_buf; + int status; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); @@ -957,6 +1027,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) return status; ice_get_itr_intrl_gran(hw); + hw->fw_vsi_num = ICE_DFLT_VSI_INVAL; + status = ice_create_all_ctrlq(hw); if (status) goto err_unroll_cqinit; @@ -987,9 +1059,11 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (ice_get_fw_mode(hw) == ICE_FW_MODE_ROLLBACK) ice_print_rollback_msg(hw); - status = ice_clear_pf_cfg(hw); - if (status) - goto err_unroll_cqinit; + if (!hw->skip_clear_pf) { + status = ice_clear_pf_cfg(hw); + if (status) + goto err_unroll_cqinit; + } ice_clear_pxe_mode(hw); @@ -1005,6 +1079,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) goto err_unroll_cqinit; } + hw->port_info->loopback_mode = ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL; + /* set the back pointer to HW */ hw->port_info->hw = hw; @@ -1088,7 +1164,7 @@ enum ice_status ice_init_hw(struct ice_hw *hw) goto err_unroll_fltr_mgmt_struct; ice_init_lock(&hw->tnl_lock); - return ICE_SUCCESS; + return 0; err_unroll_fltr_mgmt_struct: ice_cleanup_fltr_mgmt_struct(hw); @@ -1135,7 +1211,7 @@ void ice_deinit_hw(struct ice_hw *hw) * ice_check_reset - Check to see if a global reset is complete * @hw: pointer to the hardware structure */ -enum ice_status ice_check_reset(struct ice_hw *hw) +int ice_check_reset(struct ice_hw *hw) { u32 cnt, reg = 0, grst_timeout, uld_mask, reset_wait_cnt; *** 16783 LINES SKIPPED *** From nobody Wed Oct 30 20:57:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw71Qs2z5c1tt; Wed, 30 Oct 2024 20:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw64MGnz4pl9; Wed, 30 Oct 2024 20:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0aWhFbgaui4rG4y7rEye1mYi2bJJp4VCCzc2TNAe8=; b=CpUWcjzqn+kaM+T1xbXepx8hBIV57jkFHW8L9TBnR81zxAP8IrLrMJPvBgzFj4t2RkAAaq v5OSsX6BhgYOcfxOLjBlKyqYETFoCQ+k6WF55ZWFlI2K2dVc0MIM6zt+VqL5rzQXyVZdCB dHyLwi5jYKUBrf/SHo7OwhBdmsfdZZkiqDf4He7NNgHbF5h8S2aoSezmpeUi9ryy4dzBy4 9czv8zsDA51hhPDQaYcM49IkBc4Kom3+g0eqLPlcMtcRI+194/owskkDy72yFie3PtEI9d StACHlQEOr+Ez/MtcWWc0zHrdqxNG76cTvOAxSjW2n9aOghPZMVhufpF2nOmiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0aWhFbgaui4rG4y7rEye1mYi2bJJp4VCCzc2TNAe8=; b=D/TsN73D4aaokFR5NZCnlfjwa+poEaKLkOcWAPl4jiJezytyoXSVaMMTRJS1T4EyBQOgfJ FjLlFOoCeZzMcT1RzVyR73JQO3kpcGEy1HuT/9ccubobIPhpuwWJXWNxaxSOQ3COPBGXk9 AbMUR8vUi3C8w+crHAAcskmlLL+NTCTW3uNbZMdGXOavL6JAjXaVMWWMLMJpd0/w2damu1 +myXTjk+cOlZYdUBBujmt7fJBJ73wpl5rdsHU6DW9/MhEWtqd/i7f7nDhHzGZ0A/yOHZRd f/oDnQUdEd5h3nq5qAVMEftELJC4Y0WLtTxgH5Nhhe+mhQkKngppiG09nFoB7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321846; a=rsa-sha256; cv=none; b=cCAyga+uG8sgU0Q6BYKMm1zuNBLr5k92QH58AA0LRfOj0vhfGXCOu9Bk1nwTsPrE14eWbd GbV34u9JdFXP3JGIy7DxI2Cw3kMzzKesIxPNubSRu8eD6lDajn1+FljdixNWU6YVk5VRZL C+ML32XiRtk2hLYtSduunhfRBuBdJwb2UGcTYLfe/I6i2c6x163lg8JG9kMYKWdjqtE6Kz X8bogwL3w4n4qlPDKzqMXV8UlTxRWARDDQxtsQ5PRJbQBi2hyGYL3oqJx2lWvJYYMlH7in 1aVfv55uxeoSsOv9keKmH6XBX21aTR8bZ9PyyL1MsLrqvwbwQMNhTY8CSTtJGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw63vdBz1Llm; Wed, 30 Oct 2024 20:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvQHQ033543; Wed, 30 Oct 2024 20:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvQSR033540; Wed, 30 Oct 2024 20:57:26 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:26 GMT Message-Id: <202410302057.49UKvQSR033540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 5f92347a9bc8 - stable/14 - ice: Update to 1.42.5-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5f92347a9bc8f372eef46555e2ba3de65259f97d Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=5f92347a9bc8f372eef46555e2ba3de65259f97d commit 5f92347a9bc8f372eef46555e2ba3de65259f97d Author: Eric Joyner AuthorDate: 2024-08-30 00:28:59 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:52:25 +0000 ice: Update to 1.42.5-k - Removes duplicate E825C printout - Fixes a package download issue with E830 - Updates mentions of E830-XXV to E830-L - Fix FW logging on load issue by limiting the setting of FW log masks and other global configuration to just the first PF of the controller - Update ice_hw_autogen.h with timesync registers (unused in this driver) - Fix possible overflow condition in NVM access function - Blocks RDMA load on E830 devices Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46950 (cherry picked from commit 440addc642496f8d04fe17af9eb905ac4a5bdbd8) --- sys/dev/ice/ice_ddp_common.c | 31 +++++++++++++++++--- sys/dev/ice/ice_ddp_common.h | 5 +++- sys/dev/ice/ice_devids.h | 12 ++++---- sys/dev/ice/ice_drv_info.h | 20 ++++++------- sys/dev/ice/ice_fw_logging.c | 69 +++++++++++++++++++++++--------------------- sys/dev/ice/ice_hw_autogen.h | 14 +++++++++ sys/dev/ice/ice_lib.c | 38 ------------------------ sys/dev/ice/ice_lib.h | 1 - sys/dev/ice/ice_nvm.c | 36 +++++++++++++++-------- sys/dev/ice/if_ice_iflib.c | 9 +++--- 10 files changed, 126 insertions(+), 109 deletions(-) diff --git a/sys/dev/ice/ice_ddp_common.c b/sys/dev/ice/ice_ddp_common.c index 87ecdad5e7bf..dfc50cc1f966 100644 --- a/sys/dev/ice/ice_ddp_common.c +++ b/sys/dev/ice/ice_ddp_common.c @@ -526,12 +526,13 @@ ice_download_pkg_sig_seg(struct ice_hw *hw, struct ice_sign_seg *seg) * @idx: segment index * @start: starting buffer * @count: buffer count + * @last_seg: last segment being downloaded * * Note: idx must reference a ICE segment */ static enum ice_ddp_state ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, - u32 idx, u32 start, u32 count) + u32 idx, u32 start, u32 count, bool last_seg) { struct ice_buf_table *bufs; enum ice_ddp_state state; @@ -549,7 +550,7 @@ ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, return ICE_DDP_PKG_ERR; state = ice_dwnld_cfg_bufs_no_lock(hw, bufs->buf_array, start, count, - true); + last_seg); return state; } @@ -568,9 +569,11 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, { enum ice_ddp_state state; struct ice_sign_seg *seg; + bool last_seg = true; u32 conf_idx; u32 start; u32 count; + u32 flags; seg = (struct ice_sign_seg *)ice_get_pkg_seg_by_idx(pkg_hdr, idx); if (!seg) { @@ -581,6 +584,10 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, conf_idx = LE32_TO_CPU(seg->signed_seg_idx); start = LE32_TO_CPU(seg->signed_buf_start); count = LE32_TO_CPU(seg->signed_buf_count); + flags = LE32_TO_CPU(seg->flags); + + if (flags & ICE_SIGN_SEG_FLAGS_VALID) + last_seg = !!(flags & ICE_SIGN_SEG_FLAGS_LAST); state = ice_download_pkg_sig_seg(hw, seg); if (state) @@ -595,7 +602,7 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, } state = ice_download_pkg_config_seg(hw, pkg_hdr, conf_idx, start, - count); + count, last_seg); exit: return state; @@ -2321,6 +2328,22 @@ void ice_release_change_lock(struct ice_hw *hw) ice_release_res(hw, ICE_CHANGE_LOCK_RES_ID); } +/** + * ice_is_get_tx_sched_new_format + * @hw: pointer to the HW struct + * + * Determines if the new format for the Tx scheduler get api is supported + */ +static bool +ice_is_get_tx_sched_new_format(struct ice_hw *hw) +{ + if (ice_is_e830(hw)) + return true; + if (ice_is_e825c(hw)) + return true; + return false; +} + /** * ice_get_set_tx_topo - get or set tx topology * @hw: pointer to the HW struct @@ -2354,7 +2377,7 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo); cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM; - if (!ice_is_e830(hw)) + if (!ice_is_get_tx_sched_new_format(hw)) desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD); } diff --git a/sys/dev/ice/ice_ddp_common.h b/sys/dev/ice/ice_ddp_common.h index b7dae1f526f0..a7b717c3e15e 100644 --- a/sys/dev/ice/ice_ddp_common.h +++ b/sys/dev/ice/ice_ddp_common.h @@ -204,7 +204,10 @@ struct ice_sign_seg { __le32 signed_seg_idx; __le32 signed_buf_start; __le32 signed_buf_count; -#define ICE_SIGN_SEG_RESERVED_COUNT 44 +#define ICE_SIGN_SEG_FLAGS_VALID 0x80000000 +#define ICE_SIGN_SEG_FLAGS_LAST 0x00000001 + __le32 flags; +#define ICE_SIGN_SEG_RESERVED_COUNT 40 u8 reserved[ICE_SIGN_SEG_RESERVED_COUNT]; struct ice_buf_table buf_tbl; }; diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index 396f59b9d6d9..9b142a1110b2 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -52,16 +52,16 @@ #define ICE_DEV_ID_E830_SFP 0x12D3 /* Intel(R) Ethernet Controller E830-C for backplane */ #define ICE_DEV_ID_E830C_BACKPLANE 0x12D5 -/* Intel(R) Ethernet Controller E830-XXV for backplane */ -#define ICE_DEV_ID_E830_XXV_BACKPLANE 0x12DC +/* Intel(R) Ethernet Controller E830-L for backplane */ +#define ICE_DEV_ID_E830_L_BACKPLANE 0x12DC /* Intel(R) Ethernet Controller E830-C for QSFP */ #define ICE_DEV_ID_E830C_QSFP 0x12D8 -/* Intel(R) Ethernet Controller E830-XXV for QSFP */ -#define ICE_DEV_ID_E830_XXV_QSFP 0x12DD +/* Intel(R) Ethernet Controller E830-L for QSFP */ +#define ICE_DEV_ID_E830_L_QSFP 0x12DD /* Intel(R) Ethernet Controller E830-C for SFP */ #define ICE_DEV_ID_E830C_SFP 0x12DA -/* Intel(R) Ethernet Controller E830-XXV for SFP */ -#define ICE_DEV_ID_E830_XXV_SFP 0x12DE +/* Intel(R) Ethernet Controller E830-L for SFP */ +#define ICE_DEV_ID_E830_L_SFP 0x12DE /* Intel(R) Ethernet Controller E810-C for backplane */ #define ICE_DEV_ID_E810C_BACKPLANE 0x1591 /* Intel(R) Ethernet Controller E810-C for QSFP */ diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 6f4d5f05edd0..22e23ee53491 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.42.1-k"; +const char ice_driver_version[] = "1.42.5-k"; const uint8_t ice_major_version = 1; const uint8_t ice_minor_version = 42; -const uint8_t ice_patch_version = 1; +const uint8_t ice_patch_version = 5; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.42.1-k") + PVID(vendor, devid, name " - 1.42.5-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.1-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.5-k") /** * @var ice_vendor_info_array @@ -217,12 +217,12 @@ static const pci_vendor_info_t ice_vendor_info_array[] = { "Intel(R) Ethernet Connection E830-C for QSFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830C_SFP, "Intel(R) Ethernet Connection E830-C for SFP"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_BACKPLANE, - "Intel(R) Ethernet Connection E830-XXV for backplane"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_QSFP, - "Intel(R) Ethernet Connection E830-XXV for QSFP"), - PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_XXV_SFP, - "Intel(R) Ethernet Connection E830-XXV for SFP"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_BACKPLANE, + "Intel(R) Ethernet Connection E830-L for backplane"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_QSFP, + "Intel(R) Ethernet Connection E830-L for QSFP"), + PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E830_L_SFP, + "Intel(R) Ethernet Connection E830-L for SFP"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_BACKPLANE, "Intel(R) Ethernet Connection E825-C for backplane"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E825C_QSFP, diff --git a/sys/dev/ice/ice_fw_logging.c b/sys/dev/ice/ice_fw_logging.c index 8e52e34b2752..0025a65d73fc 100644 --- a/sys/dev/ice/ice_fw_logging.c +++ b/sys/dev/ice/ice_fw_logging.c @@ -359,23 +359,6 @@ ice_add_fw_logging_tunables(struct ice_softc *sc, struct sysctl_oid *parent) "Firmware Logging"); fwlog_list = SYSCTL_CHILDREN(fwlog_node); - cfg->log_resolution = 10; - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "log_resolution", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - 0, ice_sysctl_fwlog_log_resolution, - "CU", ICE_SYSCTL_HELP_FWLOG_LOG_RESOLUTION); - - cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "arq_en", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - ICE_FWLOG_OPTION_ARQ_ENA, ice_sysctl_fwlog_set_cfg_options, - "CU", ICE_SYSCTL_HELP_FWLOG_ARQ_ENA); - - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "uart_en", - ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, - ICE_FWLOG_OPTION_UART_ENA, ice_sysctl_fwlog_set_cfg_options, - "CU", ICE_SYSCTL_HELP_FWLOG_UART_ENA); - SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "on_load", ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, ICE_FWLOG_OPTION_REGISTER_ON_INIT, ice_sysctl_fwlog_set_cfg_options, @@ -386,23 +369,43 @@ ice_add_fw_logging_tunables(struct ice_softc *sc, struct sysctl_oid *parent) 0, ice_sysctl_fwlog_register, "CU", ICE_SYSCTL_HELP_FWLOG_REGISTER); - module_node = SYSCTL_ADD_NODE(ctx, fwlog_list, OID_AUTO, "severity", - ICE_CTLFLAG_DEBUG | CTLFLAG_RD, NULL, - "Level of log output"); - - module_list = SYSCTL_CHILDREN(module_node); - - for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { - /* Setup some defaults */ - cfg->module_entries[i].module_id = i; - cfg->module_entries[i].log_level = ICE_FWLOG_LEVEL_NONE; - module = (enum ice_aqc_fw_logging_mod)i; + hw->pf_id = ice_get_pf_id(hw); + if (hw->pf_id == 0) { + module_node = SYSCTL_ADD_NODE(ctx, fwlog_list, OID_AUTO, "severity", + ICE_CTLFLAG_DEBUG | CTLFLAG_RD, NULL, + "Level of log output"); + + module_list = SYSCTL_CHILDREN(module_node); + + for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) { + /* Setup some defaults */ + cfg->module_entries[i].module_id = i; + cfg->module_entries[i].log_level = ICE_FWLOG_LEVEL_NONE; + module = (enum ice_aqc_fw_logging_mod)i; + + SYSCTL_ADD_PROC(ctx, module_list, + OID_AUTO, ice_fw_module_str(module), + ICE_CTLFLAG_DEBUG | CTLTYPE_STRING | CTLFLAG_RWTUN, sc, + module, ice_sysctl_fwlog_module_log_severity, + "A", ICE_SYSCTL_HELP_FWLOG_MODULE_SEVERITY); + } - SYSCTL_ADD_PROC(ctx, module_list, - OID_AUTO, ice_fw_module_str(module), - ICE_CTLFLAG_DEBUG | CTLTYPE_STRING | CTLFLAG_RWTUN, sc, - module, ice_sysctl_fwlog_module_log_severity, - "A", ICE_SYSCTL_HELP_FWLOG_MODULE_SEVERITY); + cfg->log_resolution = 10; + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "log_resolution", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + 0, ice_sysctl_fwlog_log_resolution, + "CU", ICE_SYSCTL_HELP_FWLOG_LOG_RESOLUTION); + + cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA; + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "arq_en", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + ICE_FWLOG_OPTION_ARQ_ENA, ice_sysctl_fwlog_set_cfg_options, + "CU", ICE_SYSCTL_HELP_FWLOG_ARQ_ENA); + + SYSCTL_ADD_PROC(ctx, fwlog_list, OID_AUTO, "uart_en", + ICE_CTLFLAG_DEBUG | CTLTYPE_U8 | CTLFLAG_RWTUN, sc, + ICE_FWLOG_OPTION_UART_ENA, ice_sysctl_fwlog_set_cfg_options, + "CU", ICE_SYSCTL_HELP_FWLOG_UART_ENA); } } diff --git a/sys/dev/ice/ice_hw_autogen.h b/sys/dev/ice/ice_hw_autogen.h index 47256263d66c..3f2778d91a4b 100644 --- a/sys/dev/ice/ice_hw_autogen.h +++ b/sys/dev/ice/ice_hw_autogen.h @@ -40,6 +40,20 @@ #define PRTMAC_CTL_RX_PAUSE_ENABLE_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE) #define PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_S_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_S : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE_HSEC_CTL_RX_PAUSE_ENABLE_S) #define PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_M_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? E830_PRTMAC_CTL_RX_PAUSE_ENABLE_RX_PAUSE_ENABLE_M : E800_PRTMAC_HSEC_CTL_RX_PAUSE_ENABLE_HSEC_CTL_RX_PAUSE_ENABLE_M) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE(_i) (0x000FD000 + ((_i) * 64)) /* _i=0...7 */ /* Reset Source: CORER */ +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_MAX_INDEX 7 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_START_S 0 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_START_M MAKEMASK(0x3F, 0) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_END_S 6 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_END_M MAKEMASK(0x3F, 6) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_TYPE_S 12 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_TYPE_M MAKEMASK(0x3, 12) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_NUM_S 14 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_VM_VF_NUM_M MAKEMASK(0x3FF, 14) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_PF_NUM_S 24 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_PF_NUM_M MAKEMASK(0x7, 24) +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_ENABLE_S 31 +#define E830_GLTCLAN_TSYN_REG_RANGE_ENFORCE_ENABLE_M BIT(31) #define GL_HIDA(_i) (0x00082000 + ((_i) * 4)) #define GL_HIBA(_i) (0x00081000 + ((_i) * 4)) #define GL_HICR 0x00082040 diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index ef55df061f3c..d2d13cd2db60 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -11875,44 +11875,6 @@ ice_sysctl_allow_no_fec_mod_in_auto(SYSCTL_HANDLER_ARGS) return (0); } -/** - * ice_print_dual_nac_info - Print NAC status/ID information - * @sc: device softc structure - * - * Prints out information about the NAC mode if the device is capable of - * being part of a system with multiple NACs. - * - * @pre Must be called after ice_init_hw() and ice_init_device_features() - * sometime during driver load. - */ -void -ice_print_dual_nac_info(struct ice_softc *sc) -{ - struct ice_hw *hw = &sc->hw; - device_t dev = sc->dev; - bool is_dual_nac, is_primary_nac; - u8 cpk_id; - - is_dual_nac = (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M); - is_primary_nac = (hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M); - cpk_id = hw->dev_caps.nac_topo.id; - - if (ice_is_bit_set(sc->feat_cap, ICE_FEATURE_DUAL_NAC)) { - log(LOG_INFO, "%s: In %s NAC mode\n", - device_get_nameunit(dev), - is_dual_nac ? "Dual" : "Single"); - - if (is_dual_nac) { - ice_set_bit(ICE_FEATURE_DUAL_NAC, sc->feat_en); - log(LOG_INFO, - "%s: PF is configured in %s mode with IP instance ID %u\n", - device_get_nameunit(dev), - is_primary_nac ? "primary" : "secondary", - cpk_id); - } - } -} - /** * ice_sysctl_temperature - Retrieve NIC temp via AQ command * @oidp: sysctl oid structure diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index b524db61403c..afc03ebd3b51 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -1010,7 +1010,6 @@ void ice_init_health_events(struct ice_softc *sc); void ice_cfg_pba_num(struct ice_softc *sc); int ice_handle_debug_dump_ioctl(struct ice_softc *sc, struct ifdrv *ifd); u8 ice_dcb_get_tc_map(const struct ice_dcbx_cfg *dcbcfg); -void ice_print_dual_nac_info(struct ice_softc *sc); void ice_do_dcb_reconfig(struct ice_softc *sc, bool pending_mib); int ice_setup_vsi_mirroring(struct ice_vsi *vsi); diff --git a/sys/dev/ice/ice_nvm.c b/sys/dev/ice/ice_nvm.c index 9a41f30386c0..ff30adfe8fa7 100644 --- a/sys/dev/ice/ice_nvm.c +++ b/sys/dev/ice/ice_nvm.c @@ -711,6 +711,8 @@ int ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data) return status; } +#define check_add_overflow __builtin_add_overflow + /** * ice_get_pfa_module_tlv - Reads sub module TLV from NVM PFA * @hw: pointer to hardware structure @@ -726,8 +728,7 @@ int ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, u16 module_type) { - u16 pfa_len, pfa_ptr; - u32 next_tlv; + u16 pfa_len, pfa_ptr, next_tlv, max_tlv; int status; status = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr); @@ -740,11 +741,23 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, ice_debug(hw, ICE_DBG_INIT, "Failed to read PFA length.\n"); return status; } - /* Starting with first TLV after PFA length, iterate through the list + + if (check_add_overflow(pfa_ptr, (u16)(pfa_len - 1), &max_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "PFA starts at offset %u. PFA length of %u caused 16-bit arithmetic overflow.\n", + pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } + + /* The Preserved Fields Area contains a sequence of TLVs which define + * its contents. The PFA length includes all of the TLVs, plus its + * initial length word itself, *and* one final word at the end of all + * of the TLVs. + * + * Starting with first TLV after PFA length, iterate through the list * of TLVs to find the requested one. */ next_tlv = pfa_ptr + 1; - while (next_tlv < ((u32)pfa_ptr + pfa_len)) { + while (next_tlv < max_tlv) { u16 tlv_sub_module_type; u16 tlv_len; @@ -761,10 +774,6 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV length.\n"); break; } - if (tlv_len > pfa_len) { - ice_debug(hw, ICE_DBG_INIT, "Invalid TLV length.\n"); - return ICE_ERR_INVAL_SIZE; - } if (tlv_sub_module_type == module_type) { if (tlv_len) { *module_tlv = (u16)next_tlv; @@ -773,10 +782,13 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len, } return ICE_ERR_INVAL_SIZE; } - /* Check next TLV, i.e. current TLV pointer + length + 2 words - * (for current TLV's type and length) - */ - next_tlv = next_tlv + tlv_len + 2; + + if (check_add_overflow(next_tlv, (u16)2, &next_tlv) || + check_add_overflow(next_tlv, tlv_len, &next_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "TLV of type %u and length 0x%04x caused 16-bit arithmetic overflow. The PFA starts at 0x%04x and has length of 0x%04x\n", + tlv_sub_module_type, tlv_len, pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } } /* Module does not exist */ return ICE_ERR_DOES_NOT_EXIST; diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 65690ea7e429..0fb7faecb2d7 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -539,8 +539,6 @@ reinit_hw: ice_init_device_features(sc); - ice_print_dual_nac_info(sc); - /* Keep flag set by default */ ice_set_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN); @@ -2605,7 +2603,9 @@ ice_rebuild(struct ice_softc *sc) } /* Re-enable FW logging. Keep going even if this fails */ - status = ice_fwlog_set(hw, &hw->fwlog_cfg); + status = ICE_SUCCESS; + if (hw->pf_id == 0) + status = ice_fwlog_set(hw, &hw->fwlog_cfg); if (!status) { /* * We should have the most updated cached copy of the @@ -2901,7 +2901,8 @@ ice_init_device_features(struct ice_softc *sc) /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); - if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma) + if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma || + ice_is_e830(hw)) ice_clear_bit(ICE_FEATURE_RDMA, sc->feat_cap); if (!hw->func_caps.common_cap.dcb) ice_clear_bit(ICE_FEATURE_DCB, sc->feat_cap); From nobody Wed Oct 30 20:57:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw80hlmz5c22N; Wed, 30 Oct 2024 20:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw75PHtz4pd5; Wed, 30 Oct 2024 20:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6iqFnlg11WtAsXu/FBDQMN3Hf8Iftu9qw+wIJWpKa8=; b=aqZ2oyUdV82hd+lOOXYrniDVXg955IKIGEeEqHnBBwRdBud+FKuZWWO+TyzEj3jivCbwrY UfLKxQE2w43sPVrbmfoIojBb9GZEzPr3PgbsORMswjXMEjiw2502PA66SPFdzmFwkGRw1D PY8+sPoJ+14+x5MazDUxle8qlhuiV1Ci48QBkUoFMmPfxFcPGhhfCjmCrwy0GA05U4zR9p 6Qb6yctFTKYeSuA9J/LOEn6TJtCjHAzc9U6LteSHUpjYMI/sHDYWeaEOMsGfTnA2cf4m3g wVby271eRH7twKwkeTWsN0863+i5BBV4RA8xWMM9OtutGs8L4WGEo8jGVLtEuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H6iqFnlg11WtAsXu/FBDQMN3Hf8Iftu9qw+wIJWpKa8=; b=LbmdoYuaIF7ypvdg/c/kb/MNy7lwNEEWGKmAzH+k83f4PhJ4yPWm2nXrZBKOA44VsVHyi7 8eHQLgOe6CwJJQTNS+lwXZGmk0WTYKGcwjdIic2CN4ajfssWt8x10vxNXSRqeSjXDMTGYg CmUTNnrmWeBtBp8JRDAu84gxzg34weR0G5i0hkoDCkiG39RwkiM3TmwX+H9NP+2puN2eGH 5gNOxG7c6psy6RPQdZUYDiExPcgEYrA0ifpMHR9/nHsx750ihr+xf070TVYpK9Q8Wmtv4W JrKuw18L6SYNUgTi/o6OABARE2ZTbjA6T0BzDhDfUh3D2k7gwEJV3MBVf5LNUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321847; a=rsa-sha256; cv=none; b=LeRqCJ8p6Ezc7W3avZbJh1RKg4voXTvOKIzGDKRSI9dRlx20c66wfsWOIMWY2IqBIXPD5v /tDouE6Ah19syUNtWTDyFr/uuZJCX31g/PUeffJpZBD++r/can6h6hWEGQFkBBi6LsMWkX uUOKhsqDQQVhdTwaznX9zc2ge9JtjIbLlswGcqoBerSwpAtWyDJwJX2IC+S+r/rwskYrXY BpVooi7YKxxZfNRZixyiy6qpBhAZeIgWahXt5DX21Vc5h76kUvF+NuB9DmpNMORc8Ksdg/ mXANE5KPjUwZuHsTbKsqVXRFVXIvJJWYr7bcZUgiL46r3rXVmbDSVe0si3JdpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw74xfxz1Lln; Wed, 30 Oct 2024 20:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvRZM033583; Wed, 30 Oct 2024 20:57:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvRnw033580; Wed, 30 Oct 2024 20:57:27 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:27 GMT Message-Id: <202410302057.49UKvRnw033580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 38a1655adcb3 - stable/14 - ice: Update to 1.43.2-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38a1655adcb32635283f0ab54df75639432cdb1f Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=38a1655adcb32635283f0ab54df75639432cdb1f commit 38a1655adcb32635283f0ab54df75639432cdb1f Author: Eric Joyner AuthorDate: 2024-09-19 22:58:40 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:52:47 +0000 ice: Update to 1.43.2-k - Add extra time while waiting for an EMPR to finish on E830 and E825C devices - Fix debug mask sysctl help message - Handle EAGAIN error messages from the Get Link Status AQ command by retrying them several times - Handle the condition where E830 extended temperature SKUs can have the chip initialize without the PHY subsystem being ready due to very low temperatures; the driver will print out a message when this happens - Fix inability to set link speed using the advertise_speed sysctl when link is down and the link_active_on_if_down sysctl is set to 0 - Fix issue where VLANs would not properly be set back up after a hardware reset (e.g. PF reset) (Thanks jacob.e.keller@intel.com) Signed-off-by: Eric Joyner Tested by: Jeffrey Pieper Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46951 (cherry picked from commit f377a0c7dfa97035844e58c2aec810001bebce17) --- sys/dev/ice/ice_controlq.c | 23 ++++++++++++-- sys/dev/ice/ice_drv_info.h | 10 +++--- sys/dev/ice/ice_lib.c | 37 +++++++++++++++------- sys/dev/ice/ice_lib.h | 11 +++++++ sys/dev/ice/ice_strings.c | 2 ++ sys/dev/ice/ice_switch.c | 2 -- sys/dev/ice/if_ice_iflib.c | 79 ++++++++++++++++++++++++++++++++++++---------- 7 files changed, 128 insertions(+), 36 deletions(-) diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index e96c7e230310..e1a6b0fb5662 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -879,16 +879,35 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) struct ice_ctl_q_ring *sq = &cq->sq; u16 ntc = sq->next_to_clean; struct ice_aq_desc *desc; + u32 head; desc = ICE_CTL_Q_DESC(*sq, ntc); - while (rd32(hw, cq->sq.head) != ntc) { - ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head)); + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } + + while (head != ntc) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "ntc %d head %d.\n", + ntc, head); ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM); ntc++; if (ntc == sq->count) ntc = 0; desc = ICE_CTL_Q_DESC(*sq, ntc); + + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } } sq->next_to_clean = ntc; diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 22e23ee53491..80b517bb5b08 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.42.5-k"; +const char ice_driver_version[] = "1.43.2-k"; const uint8_t ice_major_version = 1; -const uint8_t ice_minor_version = 42; -const uint8_t ice_patch_version = 5; +const uint8_t ice_minor_version = 43; +const uint8_t ice_patch_version = 2; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.42.5-k") + PVID(vendor, devid, name " - 1.43.2-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.5-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.43.2-k") /** * @var ice_vendor_info_array diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index d2d13cd2db60..d44ae5f37750 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -3308,7 +3308,8 @@ ice_sysctl_advertise_speed(SYSCTL_HANDLER_ARGS) pi->phy.curr_user_speed_req = sysctl_speeds; - if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) && !sc->link_up) + if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) && + !sc->link_up && !(if_getflags(sc->ifp) & IFF_UP)) return 0; /* Apply settings requested by user */ @@ -6246,11 +6247,12 @@ ice_sysctl_dump_state_flags(SYSCTL_HANDLER_ARGS) "\n\t 0x20000 - Resources" \ "\n\t 0x40000 - ACL" \ "\n\t 0x80000 - PTP" \ -"\n\t 0x100000 - Admin Queue messages" \ -"\n\t 0x200000 - Admin Queue descriptors" \ -"\n\t 0x400000 - Admin Queue descriptor buffers" \ -"\n\t 0x800000 - Admin Queue commands" \ -"\n\t 0x1000000 - Parser" \ +"\n\t ..." \ +"\n\t 0x1000000 - Admin Queue messages" \ +"\n\t 0x2000000 - Admin Queue descriptors" \ +"\n\t 0x4000000 - Admin Queue descriptor buffers" \ +"\n\t 0x8000000 - Admin Queue commands" \ +"\n\t 0x10000000 - Parser" \ "\n\t ..." \ "\n\t 0x80000000 - (Reserved for user)" \ "\n\t" \ @@ -9493,15 +9495,28 @@ ice_init_link_configuration(struct ice_softc *sc) struct ice_port_info *pi = sc->hw.port_info; struct ice_hw *hw = &sc->hw; device_t dev = sc->dev; - int status; + int status, retry_count = 0; +retry: pi->phy.get_link_info = true; status = ice_get_link_status(pi, &sc->link_up); + if (status) { - device_printf(dev, - "%s: ice_get_link_status failed; status %s, aq_err %s\n", - __func__, ice_status_str(status), - ice_aq_str(hw->adminq.sq_last_status)); + if (hw->adminq.sq_last_status == ICE_AQ_RC_EAGAIN) { + retry_count++; + ice_debug(hw, ICE_DBG_LINK, + "%s: ice_get_link_status failed with EAGAIN, attempt %d\n", + __func__, retry_count); + if (retry_count < ICE_LINK_AQ_MAX_RETRIES) { + ice_msec_pause(ICE_LINK_RETRY_DELAY); + goto retry; + } + } else { + device_printf(dev, + "%s: ice_get_link_status failed; status %s, aq_err %s\n", + __func__, ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + } return; } diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index afc03ebd3b51..466cb8701b79 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -395,6 +395,16 @@ enum ice_rx_dtype { */ #define ICE_I2C_MAX_RETRIES 10 +/* + * The Get Link Status AQ command and other link commands can return + * EAGAIN, indicating that the FW Link Management engine is busy. + * Define the number of times that the driver should retry sending these + * commands and the amount of time it should wait between those retries + * (in milliseconds) here. + */ +#define ICE_LINK_AQ_MAX_RETRIES 10 +#define ICE_LINK_RETRY_DELAY 17 + /* * The Start LLDP Agent AQ command will fail if it's sent too soon after * the LLDP agent is stopped. The period between the stop and start @@ -698,6 +708,7 @@ enum ice_state { ICE_STATE_FIRST_INIT_LINK, ICE_STATE_DO_CREATE_MIRR_INTFC, ICE_STATE_DO_DESTROY_MIRR_INTFC, + ICE_STATE_PHY_FW_INIT_PENDING, /* This entry must be last */ ICE_STATE_LAST, }; diff --git a/sys/dev/ice/ice_strings.c b/sys/dev/ice/ice_strings.c index 5b5da737cadb..1b377a1bf518 100644 --- a/sys/dev/ice/ice_strings.c +++ b/sys/dev/ice/ice_strings.c @@ -1052,6 +1052,8 @@ ice_state_to_str(enum ice_state state) return "DO_CREATE_MIRR_INTFC"; case ICE_STATE_DO_DESTROY_MIRR_INTFC: return "DO_DESTROY_MIRR_INTFC"; + case ICE_STATE_PHY_FW_INIT_PENDING: + return "PHY_FW_INIT_PENDING"; case ICE_STATE_LAST: return NULL; } diff --git a/sys/dev/ice/ice_switch.c b/sys/dev/ice/ice_switch.c index 1edd39497ab5..1880d6abdd26 100644 --- a/sys/dev/ice/ice_switch.c +++ b/sys/dev/ice/ice_switch.c @@ -4292,8 +4292,6 @@ ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi, if (!itr->vsi_list_info || !ice_is_bit_set(itr->vsi_list_info->vsi_map, vsi_handle)) continue; - /* Clearing it so that the logic can add it back */ - ice_clear_bit(vsi_handle, itr->vsi_list_info->vsi_map); f_entry.fltr_info.vsi_handle = vsi_handle; f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI; /* update the src in case it is VSI num */ diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 0fb7faecb2d7..9b3f38f885b9 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -84,6 +84,7 @@ static int ice_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ice_if_suspend(if_ctx_t ctx); static int ice_if_resume(if_ctx_t ctx); static bool ice_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); +static void ice_init_link(struct ice_softc *sc); static int ice_setup_mirror_vsi(struct ice_mirr_if *mif); static int ice_wire_mirror_intrs(struct ice_mirr_if *mif); static void ice_free_irqvs_subif(struct ice_mirr_if *mif); @@ -833,9 +834,8 @@ ice_if_attach_post(if_ctx_t ctx) /* Get DCBX/LLDP state and start DCBX agent */ ice_init_dcb_setup(sc); - /* Setup link configuration parameters */ - ice_init_link_configuration(sc); - ice_update_link_status(sc, true); + /* Setup link, if PHY FW is ready */ + ice_init_link(sc); /* Configure interrupt causes for the administrative interrupt */ ice_configure_misc_interrupts(sc); @@ -2136,6 +2136,18 @@ ice_poll_for_media_avail(struct ice_softc *sc) struct ice_hw *hw = &sc->hw; struct ice_port_info *pi = hw->port_info; + /* E830 only: There's no interrupt for when the PHY FW has finished loading, + * so poll for the status in the media task here if it's previously + * been detected that it's still loading. + */ + if (ice_is_e830(hw) && + ice_test_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING)) { + if (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M) + ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + else + return; + } + if (ice_test_state(&sc->state, ICE_STATE_NO_MEDIA)) { pi->phy.get_link_info = true; ice_get_link_status(pi, &sc->link_up); @@ -2705,11 +2717,11 @@ ice_rebuild(struct ice_softc *sc) if (hw->port_info->qos_cfg.is_sw_lldp) ice_add_rx_lldp_filter(sc); - /* Refresh link status */ + /* Apply previous link settings and refresh link status, if PHY + * FW is ready. + */ ice_clear_state(&sc->state, ICE_STATE_LINK_STATUS_REPORTED); - sc->hw.port_info->phy.get_link_info = true; - ice_get_link_status(sc->hw.port_info, &sc->link_up); - ice_update_link_status(sc, true); + ice_init_link(sc); /* RDMA interface will be restarted by the stack re-init */ @@ -2795,12 +2807,23 @@ ice_handle_reset_event(struct ice_softc *sc) * resetting. */ IFLIB_CTX_UNLOCK(sc); + +#define ICE_EMPR_ADDL_WAIT_MSEC_SLOW 20000 + if ((ice_is_e830(hw) || ice_is_e825c(hw)) && + (((rd32(hw, GLGEN_RSTAT) & GLGEN_RSTAT_RESET_TYPE_M) >> + GLGEN_RSTAT_RESET_TYPE_S) == ICE_RESET_EMPR)) + ice_msec_pause(ICE_EMPR_ADDL_WAIT_MSEC_SLOW); + status = ice_check_reset(hw); IFLIB_CTX_LOCK(sc); if (status) { device_printf(dev, "Device never came out of reset, err %s\n", ice_status_str(status)); + ice_set_state(&sc->state, ICE_STATE_RESET_FAILED); + ice_clear_state(&sc->state, ICE_STATE_RESET_PFR_REQ); + ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET); + device_printf(dev, "Reset failed; please reload the device driver\n"); return; } @@ -2888,16 +2911,8 @@ ice_init_device_features(struct ice_softc *sc) if (ice_is_e810(hw)) ice_set_bit(ICE_FEATURE_PHY_STATISTICS, sc->feat_en); - /* Set capabilities based on device */ - switch (hw->device_id) { - case ICE_DEV_ID_E825C_BACKPLANE: - case ICE_DEV_ID_E825C_QSFP: - case ICE_DEV_ID_E825C_SFP: + if (ice_is_e825c(hw)) ice_set_bit(ICE_FEATURE_DUAL_NAC, sc->feat_cap); - break; - default: - break; - } /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); @@ -3303,6 +3318,38 @@ ice_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event) } } +/** + * ice_init_link - Do link configuration and link status reporting + * @sc: driver private structure + * + * Contains an extra check that skips link config when an E830 device + * does not have the "FW_LOADING"/"PHYBUSY" bit set in GL_MNG_FWSM set. + */ +static void +ice_init_link(struct ice_softc *sc) +{ + struct ice_hw *hw = &sc->hw; + device_t dev = sc->dev; + + /* Check if FW is ready before setting up link; defer setup to the + * admin task if it isn't. + */ + if (ice_is_e830(hw) && + (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M)) { + ice_set_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + device_printf(dev, + "Link initialization is blocked by PHY FW initialization.\n"); + device_printf(dev, + "Link initialization will continue after PHY FW initialization completes.\n"); + /* Do not access PHY config while PHY FW is busy initializing */ + } else { + ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); + ice_init_link_configuration(sc); + ice_update_link_status(sc, true); + } + +} + extern struct if_txrx ice_subif_txrx; /** From nobody Wed Oct 30 20:57:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xdzw911l1z5c1tv; Wed, 30 Oct 2024 20:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xdzw86Mqtz4pp6; Wed, 30 Oct 2024 20:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Zkp8ZUlq0FN2ZgcrnVdvlID4UOSuv4GDyVH/HIYOM0=; b=BnBywAQqkujd49Obv6gE9/a9rvwPFQO3JsaJXpMNuQGhnH//8fJ/TgcMTsvJUb/MRYj2au DOp3ucB8NLX4UCaXn3+/B4xWv4Q3w+rfxJNisw+DAaUtObYyK1blqMQ6KIe8Ij+ur2fqZJ GQ2VO+Ly0E5e9WK6Caxd88tDH+/RIygYNfLF54jqxs+g251mGNj7ZQd9FS3GiqNmHgcEMG W9tzHoWlSzXT/xekFdwoqNfZyfIbaxHmoZ6yeqYS0fMWWgnkUQ4NXqe8GdE+3A8hFAxbVE iCaa9mIoxgsZeZKgSi+78ZYXDTVyzhkZQGndr1H0BDTEExjtO0Vb9dOgdDGkjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730321848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Zkp8ZUlq0FN2ZgcrnVdvlID4UOSuv4GDyVH/HIYOM0=; b=eT524FLJiYIy4NAHk3CAXw+ygd2i8nlqOFcWh2QJb6JRFhNVTAlW2n2DdaMBNZH/I2M3nM stAl2QUbyZWINt4UOmKkVJudD5wTPLzxMXzVPJiMWEyCM6Y8ASD3f5ZswOd5MkHLvyylgq /QKvCqhrzjSBHZAVUIcmG6VojAETFia0oNnAqMKOCQyO1BooWviEcpBSGCKuuF2vV6lKRM C65bKyLigS077l/aOKvg7GNUhB8OjkJ8hdtxz2uJKD6md1RQj8r45O8iTn1hwyX96uimgw d1ca+rr18KSxD4Njj7Y3wjSDGg3+Yv5E04MPlbkve/5iT2ZWgOMgEPIBwwv1lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730321848; a=rsa-sha256; cv=none; b=tyKjGNt1O3F9XwEgOdnyru+LV8FwGigfWf1WjOu+T0whE7K4sk5FJz4sxSa9eb+XjpX5od x7wwyb2Yj/5C7aFB7BkxSiC/s0xVfR5a9jzyrQfgCbuvVlBO03jvwHSAEnX+wMWdSZaMwG dlk7WmNI4c9RYYDppDv9hhIOpnDiyWdS7Lsct5Iv/VI3szyZ6vVx44mz6ZjbE8SBbpDIkz oym24VxARdC5bJiYiWo+Lvw082ous6p0f3ChLhKGB8XMuYqBDDNWQjglY9ynEo/X9QcDUf bfIkgmvIYUAl9ZLO3C63bUkqsMzUjn8knY5y8B3xSTtgMLo7OgrLWq/J8FitLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xdzw85xrDz1MdC; Wed, 30 Oct 2024 20:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UKvSKQ033644; Wed, 30 Oct 2024 20:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UKvSTj033641; Wed, 30 Oct 2024 20:57:28 GMT (envelope-from git) Date: Wed, 30 Oct 2024 20:57:28 GMT Message-Id: <202410302057.49UKvSTj033641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 25ad37c9532b - stable/14 - ice: Remove RDMA feature block on E830 devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 25ad37c9532b8c0d753c55347e7e150b40b4929a Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=25ad37c9532b8c0d753c55347e7e150b40b4929a commit 25ad37c9532b8c0d753c55347e7e150b40b4929a Author: Eric Joyner AuthorDate: 2024-10-30 20:35:40 +0000 Commit: Eric Joyner CommitDate: 2024-10-30 20:53:03 +0000 ice: Remove RDMA feature block on E830 devices The decision to disable RDMA on E830 devices has been reversed; some SKUs will officially launch with RDMA support. This reverts a change introduced in "ice: Update to 1.42.5-k". Signed-off-by: Eric Joyner Sponsored by: Intel Corporation (cherry picked from commit 03e1f25dcb200edbd6553ffc2748e7410b9ff264) --- sys/dev/ice/if_ice_iflib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 9b3f38f885b9..e60ee0f1c5c3 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -2916,8 +2916,7 @@ ice_init_device_features(struct ice_softc *sc) /* Disable features due to hardware limitations... */ if (!hw->func_caps.common_cap.rss_table_size) ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap); - if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma || - ice_is_e830(hw)) + if (!hw->func_caps.common_cap.iwarp || !ice_enable_irdma) ice_clear_bit(ICE_FEATURE_RDMA, sc->feat_cap); if (!hw->func_caps.common_cap.dcb) ice_clear_bit(ICE_FEATURE_DCB, sc->feat_cap); From nobody Wed Oct 30 21:08:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09L4BCfz5c2Yg; Wed, 30 Oct 2024 21:08:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09L3f7Vz4ssR; Wed, 30 Oct 2024 21:08:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uFi5NQytJz3MOVOp1CBVFo5Ohbek9hLGcwKXIip3D70=; b=SEcB31c8/PLoWhd0C5I7tpbEWh+yu7+aq5+T1fsXrrK8rFB6Uc0aAx20LV3NaA9pxZsFMb 5kFvwdIvpg4++ColRPcA4bp7lmw9UWg4GKyZ9VbSp0r51uu70a9/XVGIoOfE1eS+NNB9yX 5gtMRXnu8L37v/0Jzs/kbj/lJt1zn22vD41spxbvpwH3bms+bgmWcheS9Z0GUG0ODp2j07 pumZcarz60PxAEBiuJc5ZrF2a8ADTu3b7pseMIfGN4yniKAeJRt45JkhQ/l9sezFtGB0w1 jbHaMNG+36l2TjSc+WCvc2RJRWTiM0pprLxhzSxzkUsYS9nGunLU8Lo8zHX45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uFi5NQytJz3MOVOp1CBVFo5Ohbek9hLGcwKXIip3D70=; b=lWl+cz1y46drxe2xcwfy2BLNlfSPqLLpkjalkwHX09cUD1vVEWEMgu6UyFFKi3wmkvbqaH ZfgLO+ln+T9PwdFgD9Vhe1tgzw0ozoTAnSOjCCEKEQJX8IduG3Cp0M4YMkuDwD8beXMDw7 Qp7IuJB618OwjHyAHuzWH107btKgzsesf76fszSfb+gas427MDQhC6Nlu51cyzRjK7Kvwd NDWhrPQzvxYcLWi8SKH9bYj2yrfwEqs/1i7oTmZ6Bk75oUrIpAGpPFRmJsFrOR+U3HyDaS qJw6COMb8nmLpgISnn9p3y3DJUXHDOnoQmC9DaJwWWSA32nWdjMbjmsunD7xKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322534; a=rsa-sha256; cv=none; b=l3nW+rvo6FTdymsu2rmO5LnmYM33+ufSCb/DZ9fDVTKJ5JjEIQk7jc4QqbGrtN6MYKgaBl rJuPDTTJlDPtqHipQ7BMqYqTVFenkgcfmvnHR886IOPzI6AYIV/dQSEhV4t7uierOUz8lB OCAVWfrhsR/JyiuaweEC+4rwxj/oxybSBOXlyYQdzBQCeim2LqubsXhJBoHQclC2LHsVoO ZewMVYaT0rouqK3SCY3XZXq27UCoO/9CtpJkN9VqgxOcY8gumDvtfNdNRIdFnWnDDylo4g de7P5ZAN6gRM0XQMCRgSY865PWgB5jPf1je4/YlhnGQQSGBvVDejgWJVwS/T1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09L39gVz1N8h; Wed, 30 Oct 2024 21:08:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8sPe053583; Wed, 30 Oct 2024 21:08:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8snB053580; Wed, 30 Oct 2024 21:08:54 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:54 GMT Message-Id: <202410302108.49UL8snB053580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d6bc956e143b - main - sysent.mk: remove CAPABILITIES_CONF support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6bc956e143b194c221a9e697cd45a8a62028e86 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d6bc956e143b194c221a9e697cd45a8a62028e86 commit d6bc956e143b194c221a9e697cd45a8a62028e86 Author: Brooks Davis AuthorDate: 2024-10-22 17:39:20 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:30 +0000 sysent.mk: remove CAPABILITIES_CONF support The last consumer was removed with a switch to generating freebsd32's syscall files from sys/kern/syscalls.master in commit be67ea40c5a0. This followed prior work to use CAPENABLED flags in syscalls.master instead of capabilities.conf in commit df501bac6939. --- sys/conf/sysent.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/conf/sysent.mk b/sys/conf/sysent.mk index 6794d870fcde..7dfd7c1f21d9 100644 --- a/sys/conf/sysent.mk +++ b/sys/conf/sysent.mk @@ -21,12 +21,6 @@ SYSENT_CONF?= syscalls.conf SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} -# Ensure that the target gets updated if the capabilities file is modified, -# even though it is not an explicit input to makesyscalls.lua. For some -# targets, like Linux system calls, this is unnecessary, but a spurious rebuild -# is both rare and harmless. -SRCS+= ${CAPABILITIES_CONF} - MAKESYSCALLS_INTERP?= ${LUA} MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/makesyscalls.lua MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} From nobody Wed Oct 30 21:08:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09M6PRbz5c2Yh; Wed, 30 Oct 2024 21:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09M4Sf7z4ssS; Wed, 30 Oct 2024 21:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322535; h=from:from:reply-to:subject:subject: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+lTrBSuD+POMJqslc/Lyf1ES7ONzyJCeAE9bgvllic=; b=nAM1a3SfYX9SFhJPtAjRQTcP4kwXwIaUDhvXcR/2j8JDyA8EoB6UyzQ61oU77FkgbiFbMB t7eGZhLWdAwkpC7OQJT4wHDBRAruYPDJWYq7ZKlM+tCxfaC+VfAKC/9HlcT6PmaZvI9Thb jQPvUOLP9Nkb05uWtXOm9yPCGEwKaY1FMoCU0yYRK2VpxKeTYcNW0wGmMqxSCIFf3TSWyP Ri67abufA5alQx7bimm2fbvkpwVlEM7WD+1bZ5yL9T8k2Q54QspJQdq1AaKuRsypi0S1vK hujUnfGA7/B1JD7l+y+jU5EpvOHIOgV34ycotsh9dLhR6qNDWiZ834PWXmwBGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322535; h=from:from:reply-to:subject:subject: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+lTrBSuD+POMJqslc/Lyf1ES7ONzyJCeAE9bgvllic=; b=jYJa1NeCBD5gWwS25y4TYXFPp1WTIxdOKHPYFCNZhLb7glZLRioDe0RCKYyfl3+NCllCTT PEqaRXVuWekDv/tbJdqn+FcBDfi1hgqHXCs0lvdYXlrCZJWFc5jYrOpu6QT8NbHi3PpR6i nF+dkmZDCcVsC0rPAPF+zRwW3BGsWA230XYHU7sFNQl38nGraymVNMmz+EHYSiE1C0qozl K/kyxq+20IQORt7DmQt8xL9SbKgcBvihYIpZZVRudxo0mZiT8/d1iVnIcE1oxt3QxSwCUJ 3Q17fb+Q4hW9vwrAZHAeMYcbrCkGJCLRWIrB+Uqn1iuSowLXXsktNzyeZUjJrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322535; a=rsa-sha256; cv=none; b=XbWrvOmB1uwhx7g7iEKUcL9EIjNpnKw+obrubPvrD8/c5OiGciMI6/5Q899XUbaxnXqZ2Q 3szFMWZDtl1XvrhKZQiU+WHe2DebnNK7Wocn8DUGqH/2E9KMjzGLq4/wXtaIDp12M9YTf+ yDU5K4nvB2KonueqdvKhtAt6FZqTOOpkvBrDY1hA8R9GQv4b46VZ2ktQL3ekQXNPPSdj9H zG6KOWlFim29zZtrzrrpZM/RgTWJgyvyWCL7fqkUzRrRgJh0zsBmHq3nQWTy6nw8ApjegY 1p6W0DhsSxKhrLdzyJO2TvJ9YJEOmZNY2B5sgl5KwtIZDRPNsFhXyVJeTD45Tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09M3gPvz1N8j; Wed, 30 Oct 2024 21:08:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8tOl053625; Wed, 30 Oct 2024 21:08:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8tGl053622; Wed, 30 Oct 2024 21:08:55 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:55 GMT Message-Id: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ded074e875c29cb92d5f643801990d7bb23cca4 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 commit 9ded074e875c29cb92d5f643801990d7bb23cca4 Author: agge3 AuthorDate: 2024-10-21 21:42:13 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:30 +0000 Refactor makesyscalls.lua into a library * main.lua replicates the functionality of makesyscalls.lua * Individual files are generated by their associated module * Modules can be called as standalone scripts to generate a specific file * Data and procedures are performed by objects instead of procedual code * Bitmasks are replaced by declarative types * Temporary files are no longer produced, writing is stored in memory * Comments provide explanation to functions and semantics Google Summer of Code 2024 Final Work Product Co-authored-by: Warner Losh Co-authored-by: Kyle Evans Co-authored-by: Brooks Davis Sponsored by: Google (GSoC 24) Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 Signed-off-by: agge3 --- sys/tools/syscalls/README.md | 49 +++ sys/tools/syscalls/config.lua | 312 +++++++++++++++++ sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ sys/tools/syscalls/core/scarg.lua | 163 +++++++++ sys/tools/syscalls/core/scret.lua | 45 +++ sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ sys/tools/syscalls/main.lua | 64 ++++ sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ sys/tools/syscalls/tools/generator.lua | 113 ++++++ sys/tools/syscalls/tools/util.lua | 194 +++++++++++ 17 files changed, 2768 insertions(+) diff --git a/sys/tools/syscalls/README.md b/sys/tools/syscalls/README.md new file mode 100644 index 000000000000..7ae6519360ba --- /dev/null +++ b/sys/tools/syscalls/README.md @@ -0,0 +1,49 @@ +# System call creation library +Parses `syscalls.master` and packages information into objects with methods. +Modules reproduce the previous file auto-generation of `makesyscalls.lua`. + +We generally assume that this script will be run by flua, however we've +carefully crafted modules for it that mimic interfaces provided by modules +available in ports. Currently, this script is compatible with lua from +ports along with the compatible luafilesystem and lua-posix modules. + +## Usage +`main.lua` generates all files. +Files are associated with their respective modules, and modules can be run as +standalone scripts to generate specific files. + +### Examples +**All files:** +`# /usr/libexec/flua /usr/src/sys/tools/syscalls/main.lua /usr/src/sys/kern/syscalls.master` +
+**syscalls.h:** +`# /usr/libexec/flua /usr/src/sys/tools/syscalls/scripts/syscalls.h /usr/src/sys/kern/syscalls.master` + +## Organization +* `root` + * `main.lua` - Main entry point that calls all scripts. + * `config.lua` - Contains the global configuration table and associated + configuration functions. + + * `core` (Core Classes) + * `syscall.lua` - Packages each system call entry from `syscalls.master` + into a system call object. + * `scarg.lua` - Packages each argument for the system call into an argument + object. + * `scret.lua` - An object for the return value of the system call. + * `freebsd-syscall.lua` - Contains the master system call table after + processing. + + * `scripts` + * `init_sysent.lua` - Generates `init_sysent.c`. + * `libsys_h.lua` - Generates `lib/libsys/_libsys.h`. + * `syscall_h.lua` - Generates `syscall.h`. + * `syscall_mk.lua` - Generates `syscall.mk`. + * `syscalls.lua` - Generates `syscalls.c`. + * `syscalls_map.lua` - Generates `lib/libsys/syscalls.map`. + * `sysproto_h.lua` - Generates `sysproto.h`. + * `systrace_args.lua` - Generates `systrace_args.c`. + + * `tools` + * `util.lua` - Contains utility functions. + * `generator.lua` - Handles file generation for the library. diff --git a/sys/tools/syscalls/config.lua b/sys/tools/syscalls/config.lua new file mode 100644 index 000000000000..92098a709854 --- /dev/null +++ b/sys/tools/syscalls/config.lua @@ -0,0 +1,312 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2021-2024 SRI International +-- Copyright (c) 2024 Tyler Baxter +-- Copyright (c) 2023 Warner Losh +-- Copyright (c) 2019 Kyle Evans +-- + +-- +-- Code to read in the config file that drives this. Since we inherit from the +-- FreeBSD makesyscall.sh legacy, all config is done through a config file that +-- sets a number of variables (as noted below); it used to be a .sh file that +-- was sourced in. This dodges the need to write a command line parser. +-- + +local util = require("tools.util") + +-- +-- Global config map. +-- Default configuration is native. Any of these may get replaced by an +-- optionally specified configuration file. +-- +local config = { + sysnames = "syscalls.c", + syshdr = "../sys/syscall.h", + sysmk = "/dev/null", + syssw = "init_sysent.c", + systrace = "systrace_args.c", + sysproto = "../sys/sysproto.h", + libsysmap = "/dev/null", + libsys_h = "/dev/null", + sysproto_h = "_SYS_SYSPROTO_H_", + syscallprefix = "SYS_", + switchname = "sysent", + namesname = "syscallnames", + abi_flags = {}, + abi_func_prefix = "", + abi_type_suffix = "", + abi_long = "long", + abi_u_long = "u_long", + abi_semid_t = "semid_t", + abi_size_t = "size_t", + abi_ptr_array_t = "", + abi_headers = "", + abi_intptr_t = "intptr_t", + ptr_intptr_t_cast = "intptr_t", + obsol = {}, + unimpl = {}, + capabilities_conf = "capabilities.conf", + compat_set = "native", + mincompat = 0, + capenabled = {}, + -- System calls that require ABI-specific handling. + syscall_abi_change = {}, + -- System calls that appear to require handling, but don't. + syscall_no_abi_change = {}, + -- Keep track of modifications if there are. + modifications = {}, + -- Stores compat_sets from syscalls.conf; config.mergeCompat() + -- instantiates. + compat_options = {}, +} + +-- +-- For each entry, the ABI flag is the key. One may also optionally provide an +-- expr, which are contained in an array associated with each key; expr gets +-- applied to each argument type to indicate whether this argument is subject to +-- ABI change given the configured flags. +-- +config.known_abi_flags = { + long_size = { + "_Contains[a-z_]*_long_", + "^long [a-z0-9_]+$", + "long [*]", + "size_t [*]", + -- semid_t is not included because it is only used + -- as an argument or written out individually and + -- said writes are handled by the ksem framework. + -- Technically a sign-extension issue exists for + -- arguments, but because semid_t is actually a file + -- descriptor negative 32-bit values are invalid + -- regardless of sign-extension. + }, + time_t_size = { + "_Contains[a-z_]*_timet_", + }, + pointer_args = { + -- no expr + }, + pointer_size = { + "_Contains[a-z_]*_ptr_", + "[*][*]", + }, + pair_64bit = { + "^dev_t[ ]*$", + "^id_t[ ]*$", + "^off_t[ ]*$", + }, +} + +-- All compat option entries should have five entries: +-- definition: The preprocessor macro that will be set for this. +-- compatlevel: The level this compatibility should be included at. This +-- generally represents the version of FreeBSD that it is compatible +-- with, but ultimately it's just the level of mincompat in which it's +-- included. +-- flag: The name of the flag in syscalls.master. +-- prefix: The prefix to use for _args and syscall prototype. This will be +-- used as-is, without "_" or any other character appended. +-- descr: The description of this compat option in init_sysent.c comments. +-- The special "stdcompat" entry will cause the other five to be autogenerated. +local compat_option_sets = { + native = { + { + definition = "COMPAT_43", + compatlevel = 3, + flag = "COMPAT", + prefix = "o", + descr = "old", + }, + { stdcompat = "FREEBSD4" }, + { stdcompat = "FREEBSD6" }, + { stdcompat = "FREEBSD7" }, + { stdcompat = "FREEBSD10" }, + { stdcompat = "FREEBSD11" }, + { stdcompat = "FREEBSD12" }, + { stdcompat = "FREEBSD13" }, + { stdcompat = "FREEBSD14" }, + }, +} + +-- +-- config looks like a shell script; in fact, the previous makesyscalls.sh +-- script actually sourced it in. It had a pretty common format, so we should +-- be fine to make various assumptions. +-- +-- This function processes config to be merged into our global config map with +-- config.merge(). It aborts if there's malformed lines and returns NIL and a +-- message if no file was provided. +-- +function config.process(file) + local cfg = {} + local comment_line_expr = "^%s*#.*" + -- We capture any whitespace padding here so we can easily advance to + -- the end of the line as needed to check for any trailing bogus bits. + -- Alternatively, we could drop the whitespace and instead try to + -- use a pattern to strip out the meaty part of the line, but then we + -- would need to sanitize the line for potentially special characters. + local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]*[`\"]?)" + + if not file then + return nil, "No file given" + end + + local fh = assert(io.open(file)) + + for nextline in fh:lines() do + -- Strip any whole-line comments. + nextline = nextline:gsub(comment_line_expr, "") + -- Parse it into key, value pairs. + local key, value = nextline:match(line_expr) + if key ~= nil and value ~= nil then + local kvp = key .. "=" .. value + key = util.trim(key) + value = util.trim(value) + local delim = value:sub(1,1) + if delim == '"' then + local trailing_context + + -- Strip off the key/value part. + trailing_context = nextline:sub(kvp:len() + 1) + -- Strip off any trailing comment. + trailing_context = trailing_context:gsub("#.*$", + "") + -- Strip off leading/trailing whitespace. + trailing_context = util.trim(trailing_context) + if trailing_context ~= "" then + print(trailing_context) + util.abort(1, + "Malformed line: " .. nextline) + end + + value = util.trim(value, delim) + else + -- Strip off potential comments. + value = value:gsub("#.*$", "") + -- Strip off any padding whitespace. + value = util.trim(value) + if value:match("%s") then + util.abort(1, + "Malformed config line: " .. + nextline) + end + end + cfg[key] = value + elseif not nextline:match("^%s*$") then + -- Make sure format violations don't get overlooked + -- here, but ignore blank lines. Comments are already + -- stripped above. + util.abort(1, "Malformed config line: " .. nextline) + end + end + + assert(fh:close()) + return cfg +end + +-- Merges processed configuration file into the global config map (see above), +-- or returns NIL and a message if no file was provided. +function config.merge(fh) + if not fh then + return nil, "No file given" + end + + local res = assert(config.process(fh)) + + for k, v in pairs(res) do + if v ~= config[k] then + -- Handling of string lists: + if k:find("abi_flags") then + -- Match for pipe, that's how abi_flags + -- is formatted. + config[k] = util.setFromString(v, "[^|]+") + elseif k:find("capenabled") or + k:find("syscall_abi_change") or + k:find("syscall_no_abi_change") or + k:find("obsol") or + k:find("unimpl") then + -- Match for space, that's how these + -- are formatted. + config[k] = util.setFromString(v, "[^ ]+") + else + config[k] = v + end + -- Construct config modified table as config + -- is processed. + config.modifications[k] = true + else + -- config wasn't modified. + config.modifications[k] = false + end + end +end + +-- Returns TRUE if there are ABI changes from native for the provided ABI flag. +function config.abiChanges(name) + if config.known_abi_flags[name] == nil then + util.abort(1, "abi_changes: unknown flag: " .. name) + end + return config.abi_flags[name] ~= nil +end + +-- Instantiates config.compat_options. +function config.mergeCompat() + if config.compat_set ~= "" then + if not compat_option_sets[config.compat_set] then + util.abort(1, "Undefined compat set: " .. + config.compat_set) + end + + config.compat_options = compat_option_sets[config.compat_set] + end +end + +-- Parses the provided capabilities.conf. Returns a string (comma separated +-- list) as its formatted in capabilities.conf, or NIL and a message if no file +-- was provided. +local function grabCapenabled(file, open_fail_ok) + local capentries = {} + local commentExpr = "#.*" + + if file == nil then + return nil, "No file given" + end + + local fh, msg, errno = io.open(file) + if fh == nil then + if not open_fail_ok then + util.abort(errno, msg) + end + return nil, msg + end + + for nextline in fh:lines() do + -- Strip any comments. + nextline = nextline:gsub(commentExpr, "") + if nextline ~= "" then + capentries[nextline] = true + end + end + + assert(fh:close()) + return capentries +end + +-- Merge capability (Capsicum) configuration into the global config. +function config.mergeCapability() + -- We ignore errors here if we're relying on the default configuration. + if not config.modifications.capenabled then + config.capenabled = grabCapenabled(config.capabilities_conf, + config.modifications.capabilities_conf == nil) + elseif config.capenabled ~= "" then + -- We have a comma separated list from the format of + -- capabilities.conf, split it into a set with boolean values + -- for each key. + config.capenabled = util.setFromString(config.capenabled, + "[^,]+") + end +end + +return config diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua new file mode 100644 index 000000000000..193b1e43563c --- /dev/null +++ b/sys/tools/syscalls/core/freebsd-syscall.lua @@ -0,0 +1,147 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2024 Tyler Baxter +-- Copyright (c) 2023 Warner Losh +-- Copyright (c) 2019 Kyle Evans +-- + +local syscall = require("core.syscall") +local util = require("tools.util") + +local FreeBSDSyscall = {} + +FreeBSDSyscall.__index = FreeBSDSyscall + +-- For each compat option in the provided config table, process them and insert +-- them into known_flags for class syscall. +function FreeBSDSyscall:processCompat() + for _, v in pairs(self.config.compat_options) do + if v.stdcompat ~= nil then + local stdcompat = v.stdcompat + v.definition = "COMPAT_" .. stdcompat:upper() + v.compatlevel = tonumber(stdcompat:match("([0-9]+)$")) + v.flag = stdcompat:gsub("FREEBSD", "COMPAT") + v.prefix = stdcompat:lower() .. "_" + v.descr = stdcompat:lower() + end + + -- Add compat option to syscall.known_flags. + table.insert(syscall.known_flags, v.flag) + end +end + +function FreeBSDSyscall:parseSysfile() + local file = self.sysfile + local config = self.config + local commentExpr = "^%s*;.*" + + if file == nil then + return nil, "No file given" + end + + self.syscalls = {} + + local fh, msg = io.open(file) + if fh == nil then + return nil, msg + end + + local incs = "" + local defs = "" + local s + for line in fh:lines() do + line = line:gsub(commentExpr, "") -- Strip any comments. + -- NOTE: Can't use pure pattern matching here because of + -- the 's' test and this is shorter than a generic pattern + -- matching pattern. + if line == nil or line == "" then + goto skip -- Blank line, skip this line. + elseif s ~= nil then + -- If we have a partial system call object s, + -- then feed it one more line. + if s:add(line) then + -- Append to system call list. + for t in s:iter() do + if t:validate(t.num - 1) then + table.insert(self.syscalls, t) + else + util.abort(1, + "Skipped system call " .. + "at number " .. t.num) + end + end + s = nil + end + elseif line:match("^#%s*include") then + incs = incs .. line .. "\n" + elseif line:match("%%ABI_HEADERS%%") then + local h = self.config.abi_headers + if h ~= nil and h ~= "" then + incs = incs .. h .. "\n" + end + elseif line:match("^#%s*define") then + defs = defs .. line.. "\n" + elseif line:match("^#") then + util.abort(1, "Unsupported cpp op " .. line) + else + s = syscall:new() + if s:add(line) then + -- Append to system call list. + for t in s:iter() do + if t:validate(t.num - 1) then + table.insert(self.syscalls, t) + else + util.abort(1, + "Skipped system call " .. + "at number " .. t.num) + end + end + s = nil + end + end + ::skip:: + end + + -- Special handling for linux nosys. + if config.syscallprefix:find("LINUX") ~= nil then + s = nil + end + + if s ~= nil then + util.abort(1, "Dangling system call at the end") + end + + assert(fh:close()) + self.includes = incs + self.defines = defs +end + +function FreeBSDSyscall:findStructs() + self.structs = {} + + for _, s in pairs(self.syscalls) do + if s:native() and not s.type.NODEF then + for _, v in ipairs(s.args) do + local name = util.structName(v.type) + if name ~= nil then + self.structs[name] = name + end + end + end + end +end + +function FreeBSDSyscall:new(obj) + obj = obj or {} + setmetatable(obj, self) + self.__index = self + + obj:processCompat() + obj:parseSysfile() + obj:findStructs() + + return obj +end + +return FreeBSDSyscall diff --git a/sys/tools/syscalls/core/scarg.lua b/sys/tools/syscalls/core/scarg.lua new file mode 100644 index 000000000000..7ffbf15b3a80 --- /dev/null +++ b/sys/tools/syscalls/core/scarg.lua @@ -0,0 +1,163 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2021-2024 SRI International +-- Copyright (c) 2024 Tyler Baxter +-- Copyright (c) 2023 Warner Losh +-- Copyright (c) 2019 Kyle Evans +-- + +local config = require("config") +local util = require("tools.util") + +local scarg = {} + +scarg.__index = scarg + +-- Check this argument against config for ABI changes from native. Return TRUE +-- if there are. +local function checkAbiChanges(arg) + for k, v in pairs(config.known_abi_flags) do + if config.abiChanges(k) and v ~= nil then + for _, e in pairs(v) do + if arg:find(e) then + return true + end + end + end + end + return false +end + +-- Strips the Microsoft(R) SAL annotations from this argument. +local function stripArgAnnotations(arg) + arg = arg:gsub("_Contains_[^ ]*[_)] ?", "") + arg = arg:gsub("_In[^ ]*[_)] ?", "") + arg = arg:gsub("_Out[^ ]*[_)] ?", "") + return util.trim(arg) +end + +-- Preprocessing of this argument. +function scarg:init(line) + -- Trim whitespace and trailing comma. We don't want them here; + -- these can mess with our processing of this argument. + line = util.trim(line) -- This provides a clearer abort error. + self.scarg = util.trim(line, ',') + + self.arg_abi_change = checkAbiChanges(self.scarg) + self.changes_abi = self.arg_abi_change + self.scarg = stripArgAnnotations(self.scarg) + + self.name = self.scarg:match("([^* ]+)$") + -- Our pattern might produce a Lua pattern sequence; that's a malformed + -- declaration. + local status, type = pcall(function() + return util.trim(self.scarg:gsub(self.name .. "$", ""), nil) + end) + if not status then + util.abort(1, "Malformed argument line: " .. line) + end + self.type = type +end + +-- Processes this argument. +-- Flags if there's ABI changes from native, converts this argument to the +-- target ABI, and handles 64-bit argument pairing. +-- Returns TRUE if this argument is processed and ready to add. +-- Returns FALSE if it shouldn't be added (the argument type is void). +function scarg:process() + if self.type ~= "" and self.name ~= "void" then + -- util.is64bitType() needs a bare type so check it after + -- argname is removed. + self.changes_abi = self.changes_abi or + (config.abiChanges("pair_64bit") and + util.is64bitType(self.type)) + + self.type = self.type:gsub("intptr_t", config.abi_intptr_t) + self.type = self.type:gsub("semid_t", config.abi_semid_t) + + if util.isPtrType(self.type) then + self.type = self.type:gsub("size_t", config.abi_size_t) + self.type = self.type:gsub("^long", config.abi_long) + self.type = self.type:gsub("^u_long", config.abi_u_long) + self.type = self.type:gsub("^const u_long", "const " .. + config.abi_u_long) + elseif self.type:find("^long$") then + self.type = config.abi_long + end + + if util.isPtrArrayType(self.type) and + config.abi_ptr_array_t ~= "" then + -- `* const *` -> `**` + self.type = self.type:gsub("[*][ ]*const[ ]*[*]", "**") + -- e.g., `struct aiocb **` -> `uint32_t *` + self.type = self.type:gsub("[^*]*[*]", + config.abi_ptr_array_t .. " ", 1) + end + + if self.arg_abi_change then + self.type = self.type:gsub("(struct [^ ]*)", "%1" .. + config.abi_type_suffix) + self.type = self.type:gsub("(union [^ ]*)", "%1" .. + config.abi_type_suffix) + end + return true + end + return false +end + +-- For pairing 64-bit arguments, pad if necessary. +-- Returns TRUE if this argument was padded. +local function pad(tbl) + if #tbl % 2 == 1 then + table.insert(tbl, { + type = "int", + name = "_pad", + }) + return true + end + return false +end + +-- To append to a system call's argument table. Appends to the end. +function scarg:append(tbl) + if config.abiChanges("pair_64bit") and util.is64bitType(self.type) then + pad(tbl) -- Needs argument padding. + table.insert(tbl, { + type = "uint32_t", + name = self.name .. "1", + }) + table.insert(tbl, { + type = "uint32_t", + name = self.name .. "2", + }) + else + table.insert(tbl, { + type = self.type, + name = self.name, + }) + end +end + +-- Returns TRUE if this argument has ABI changes from native. +-- EXAMPLE: 32-bit argument for freebsd32. +function scarg:changesAbi() + return self.changes_abi +end + +function scarg:new(obj, line) + obj = obj or { } + setmetatable(obj, self) + self.__index = self + + -- ABI changes that we only want in this scope. + self.arg_abi_change = false + -- ABI changes that we want the system call object to see. + self.changes_abi = false + + obj:init(line) + + return obj +end + +return scarg diff --git a/sys/tools/syscalls/core/scret.lua b/sys/tools/syscalls/core/scret.lua new file mode 100644 index 000000000000..25522b4c830e --- /dev/null +++ b/sys/tools/syscalls/core/scret.lua @@ -0,0 +1,45 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2024 Tyler Baxter +-- Copyright (c) 2023 Warner Losh +-- Copyright (c) 2019 Kyle Evans +-- + +local util = require("tools.util") + +local scret = {} + +scret.__index = scret + +-- Processes this return type. +function scret:process() + local words = util.split(self.scret, "%S+") + self.scret = words[1] + -- Pointer incoming. + if words[2]:sub(1,1) == "*" then + self.scret = self.scret .. " " + end + while words[2]:sub(1,1) == "*" do + words[2] = words[2]:sub(2) + self.scret = self.scret .. "*" + end +end + +-- To add this return type to the system call. +function scret:add() + self:process() + return self.scret +end + +function scret:new(obj, line) + obj = obj or { } + setmetatable(obj, self) + self.__index = self + + self.scret = line + + return obj +end + +return scret diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua new file mode 100644 index 000000000000..7e8c562dad8a --- /dev/null +++ b/sys/tools/syscalls/core/syscall.lua @@ -0,0 +1,497 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2024 Tyler Baxter +-- Copyright (c) 2023 Warner Losh +-- Copyright (c) 2019 Kyle Evans +-- + +local config = require("config") +local scarg = require("core.scarg") +local scret = require("core.scret") +local util = require("tools.util") + +local syscall = {} + +syscall.__index = syscall + +syscall.known_flags = util.set { + "STD", + "OBSOL", + "RESERVED", + "UNIMPL", + "NODEF", + "NOARGS", + "NOPROTO", + "NOSTD", + "NOTSTATIC", + "CAPENABLED", + "SYSMUX", +} + +-- Native is an arbitrarily large number to have a constant and not +-- interfere with compat numbers. +local native = 1000000 + +-- Processes and assigns the appropriate thread flag for this system call. +function syscall:processThr() + self.thr = "SY_THR_STATIC" + for k, _ in pairs(self.type) do + if k == "NOTSTATIC" then + self.thr = "SY_THR_ABSENT" + end + end +end + +-- Processes and assigns the appropriate capability flag for this system call. +-- "SYF_CAPENABLED" for capability enabled; "0" for NOT capability enabled. +function syscall:processCap() + self.cap = "0" + local stripped = util.stripAbiPrefix(self.name, self.prefix) + if config.capenabled ~= nil and (config.capenabled[self.name] ~= nil or + config.capenabled[stripped] ~= nil) then + self.cap = "SYF_CAPENABLED" + else + for k, _ in pairs(self.type) do + if k == "CAPENABLED" then + self.cap = "SYF_CAPENABLED" + end + end + end +end + +-- Check that this system call has a known type. +local function checkType(type) + for k, _ in pairs(type) do + if not syscall.known_flags[k] and not + k:match("^COMPAT") then + util.abort(1, "Bad type: " .. k) + end + end +end + +-- If there are ABI changes from native, process this system call to match the +-- target ABI. +function syscall:processChangesAbi() + -- First, confirm we want to uphold our changes_abi flag. + if config.syscall_no_abi_change[self.name] then + self.changes_abi = false + end + self.noproto = not util.isEmpty(config.abi_flags) and + not self.changes_abi + if config.abiChanges("pointer_args") then + for _, v in ipairs(self.args) do + if util.isPtrType(v.type, config.abi_intptr_t) then + if config.syscall_no_abi_change[self.name] then + print("WARNING: " .. self.name .. + " in syscall_no_abi_change, " .. + "but pointers args are present") + end + self.changes_abi = true + goto ptrfound + end + end + ::ptrfound:: + end + if config.syscall_abi_change[self.name] then + self.changes_abi = true + end + if self.changes_abi then + self.noproto = false + end +end + +-- Final processing of flags. Process any flags that haven't already been +-- processed (e.g., dictionaries from syscalls.conf). +function syscall:processFlags() + if config.obsol[self.name] or (self:compatLevel() > 0 and + self:compatLevel() < tonumber(config.mincompat)) then + self.args = nil + self.type.OBSOL = true + -- Don't apply any ABI handling, declared as obsolete. + self.changes_abi = false + end + if config.unimpl[self.name] then + self.type.UNIMPL = true + end + if self.noproto or self.type.SYSMUX then + self.type.NOPROTO = true + end + if self.type.NODEF then + self.audit = "AUE_NULL" + end +end + +-- Returns TRUE if prefix and arg_prefix are assigned; FALSE if they're left +-- unassigned. Relies on a valid changes_abi flag, so should be called AFTER +-- processChangesAbi(). +function syscall:processPrefix() + -- If there are ABI changes from native, assign the correct prefixes. + if self.changes_abi then + self.arg_prefix = config.abi_func_prefix + self.prefix = config.abi_func_prefix + return true + end + return false +end + +-- Validate that we're not skipping system calls by comparing this system call +-- number to the previous system call number. Called higher up the call stack +-- by class FreeBSDSyscall. +function syscall:validate(prev) + return prev + 1 == self.num +end + +-- Return the compat prefix for this system call. +function syscall:compatPrefix() + local c = self:compatLevel() + if self.type.OBSOL then + return "obs_" + end + if self.type.RESERVED then + return "reserved #" + end + if self.type.UNIMPL then + return "unimp_" + end + if c == 3 then + return "o" + end + if c < native then + return "freebsd" .. tostring(c) .. "_" + end + return "" +end + +-- Return the symbol name for this system call. +function syscall:symbol() + return self:compatPrefix() .. self.name +end + +-- +-- Return the compatibility level for this system call. +-- 0 is obsolete. +-- < 0 is this isn't really a system call we care about. +-- 3 is 4.3BSD in theory, but anything before FreeBSD 4. +-- >= 4 is FreeBSD version, this system call was replaced with a new +-- version. +-- +function syscall:compatLevel() + if self.type.UNIMPL or self.type.RESERVED then + return -1 + elseif self.type.OBSOL then + return 0 + elseif self.type.COMPAT then + return 3 *** 1933 LINES SKIPPED *** From nobody Wed Oct 30 21:08:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09N6fWYz5c2mV; Wed, 30 Oct 2024 21:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09N5SsMz4t7Q; Wed, 30 Oct 2024 21:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XonlD5Z1paIIEfq9afLuMQ0vC9MzlhOmgYdcLPDBq9I=; b=cru0RbWug6BBw6JPRl5VjDP1DLjV4S2OkW5EZuVkrm/4U5vd9H5VdcTHE96RsTWXySkjoK 9akUSovxgidaIt1f1dt+bU0Ewh+tEmHnTD9PY5mrDI0XdwfSxemeDRrC3+I93gGMlliTdT MFubTENxVSqA7hzjwqJXM9ufkMUaPgcRP3Lsf5L8ldudKm3XqU5KNWJxZqKL9O7g7bBdln U9NrVSQlRZ/WbGLAAHJZO7z3YXkkavCVAaLtPhhu6RYKpG7aEeBQaARP2sVbNw1tZjaSxb q67nd/tmHm8PAUokHdUSvbagP3DHnuXp889STjXhW5ZDDxhI24r6n/0htTf6CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XonlD5Z1paIIEfq9afLuMQ0vC9MzlhOmgYdcLPDBq9I=; b=PfFOAi5sAKM9svA+bHxzYObgdRf/RO91JMeS5mJcV4aWrG1pAJJbutL7r/5vUndIm9xsQJ +OvUN1XIdcFaiYt6AvpsFm52Bfd2ckZVDt8cPS+qcdFCGaflZmfPpQ28BwH8tXeMDSgBiN GCK/q3xhLu7a0ZiJ5W8VHhy4LlRlMQzm5k0x89Usw5vc7rfgb+1CmFxvTiWR1mNvZzrCtE L/oHbj9cwgh0i8/CoE28/KewAnl0gY3ve5axou4IbhfqzYs1n9OFDPRVIIQHJ1hd6FiQPD mt2z6CLB0w7rGr9ZZxxIaGYTjiF+LNHxrnMMiwMz3/e7AIlwnvG3e3YJx+5+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322536; a=rsa-sha256; cv=none; b=Ly5ZJPMVEHf6e4plj17FF0OT/XtMs275esqFF/QKdy0q576AfTfFzdN/j4DIA1On+c9jjh yAawBQeXWAQMQMarpXUHMa6CFVkB7L6Z/8NGGP0hzIxZDQAGxLuIxmxCVzipvPQwj3g4h5 o964Jy+Emyqr9qoTa8qRbDAclkHC9f7chDtzZ9aRubeIGcJtcW8kLO747lPC+zLpID7z4N wJ+3CP5aGbHsnU5tzEZlufWOW9od20IX1b0ffk5F4978BTyY/XEWGPwmJFJDHLSZdQ45gP AOU9l2k/d+RBN81vd1AU3gTH7++ipsKykiULtkLOI+WeyV19hBpKdf1sDUhdzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09N4jL8z1N8k; Wed, 30 Oct 2024 21:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8ufA053667; Wed, 30 Oct 2024 21:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8u8p053664; Wed, 30 Oct 2024 21:08:56 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:56 GMT Message-Id: <202410302108.49UL8u8p053664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 204d065dac81 - main - sysent: switch to refactored makesyscalls.lua List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 204d065dac81d6b4893054aa9124feb4ee51bf87 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=204d065dac81d6b4893054aa9124feb4ee51bf87 commit 204d065dac81d6b4893054aa9124feb4ee51bf87 Author: Brooks Davis AuthorDate: 2024-10-21 21:42:13 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 sysent: switch to refactored makesyscalls.lua --- sys/conf/sysent.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/sysent.mk b/sys/conf/sysent.mk index 7dfd7c1f21d9..54531a52e151 100644 --- a/sys/conf/sysent.mk +++ b/sys/conf/sysent.mk @@ -22,7 +22,7 @@ SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} MAKESYSCALLS_INTERP?= ${LUA} -MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/syscalls/main.lua MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} all: From nobody Wed Oct 30 21:08:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09R4hFSz5c2jB; Wed, 30 Oct 2024 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09P6lNDz4ssZ; Wed, 30 Oct 2024 21:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lncz0ShzxjwVlKu/1nzWui3co9RXUsvbs1jPzZ9QewE=; b=E3WqUy58NknbUsXi5kmpYogxY7m0JR8L2PvjSgNoeY6vn0jjOQu/W0eDSqUOyP9PbM/xiq 09MMmyFzt76YrZabHEVIlR1wAH4i7q3xuBDAsAsQOke6/OyGIY4jQOyz/gjGsBThRA33Sx +2WU5HmucAK37liaOaF+fOMWEaCNCD1s++fOxeaj7fWbPtK6cIReRXdNG1BNxWoHl5Dvz7 nvDY2MTmE2/fGkryGmaoCEpSXwgmKkZwXexdsffLRGOkafM48IYQzMAhkqjIfL3xJyhSkZ ZM9OqyKzBiYfhzLuXV9f4u2EjsZXFzWetJ9H1SGHlHbxNJ6k36qwH2/BXhH/IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lncz0ShzxjwVlKu/1nzWui3co9RXUsvbs1jPzZ9QewE=; b=OO0GzqAc+lZlO87k6+CxTlmKmLnlZvqP+viyfrbDPfsI2ZeU20aWEgJoldHQf4wwekb8kB RSzrd+SCsrCwL/ym/LY++R7M488WdRf8SvBjjY3rFP0yseVOuFW77hznJGKnnrDEAvmXxX 7JDuNSC8e6/9Qs3YWm9SogMR+7sUwgF8sNqOpYL9DeC2lEVCvAZBXMrzauRtxm3nv7CFRw UPG9WaeotwrsexpFGBZLRIUIvL6V8eXRXSzOaXyWrte5/PsX4G2WCtHQPyuA5W1735o8Uw PK2acv0McKzdtJF6FGVN2PTaw9s6KD30USjkk41snEF4NdZBf6N48eXJdLj4BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322537; a=rsa-sha256; cv=none; b=ZqAI3FgrjP/Gjb61UGsb+ACdEdJlBX2DLuvcLhakCKxvF40m9ll/lWWO7gdTT/NRFn6fnz PJuOcqDeNO2oJ3g3Bp+UvnTj+2C3cCLAiU8X2x2Ego+wQzVL7+8UMJ/YPxDhFLhqYL3sAK BdAN4FubtRzFrDVv4DHqpNpD5gs08NLXqw9JID/w07Qo+I/Ffq0QOGoLdSnh5SFtCO4N5C e6Cjpv+rj0yWoxtsGay2P3d3QPgHKI+HLrdlx1+EzxsBPM/dBHdPh4to4k01obs+d+o2uM +fu7d+SrWvP+sPp6yM+nzsiKrJH+YahRDTyRk/NwWPRVggnq+nfJN/SmYoIFDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09P58FTz1Mdt; Wed, 30 Oct 2024 21:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8vNu053713; Wed, 30 Oct 2024 21:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8vbI053710; Wed, 30 Oct 2024 21:08:57 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:57 GMT Message-Id: <202410302108.49UL8vbI053710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 74231c817202 - main - sysent: regen with refactored code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74231c81720235c413cca2443e3e87b3761bf141 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=74231c81720235c413cca2443e3e87b3761bf141 commit 74231c81720235c413cca2443e3e87b3761bf141 Author: Brooks Davis AuthorDate: 2024-10-21 21:42:13 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 sysent: regen with refactored code All changes are no-ops and are one of: - Name changes of obsolete system calls in comments - Correct prefixes on unimplemented freebsd32 system calls - Currently unused macros for FreeBSD 14 compatablity --- sys/compat/freebsd32/freebsd32_syscall.h | 4 ++-- sys/compat/freebsd32/freebsd32_syscalls.c | 4 ++-- sys/compat/freebsd32/freebsd32_sysent.c | 40 ++++++++++++++++++------------- sys/kern/init_sysent.c | 6 +++++ 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index b3c5c46bd586..44f55fb7d13b 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -67,7 +67,7 @@ #define FREEBSD32_SYS_umask 60 #define FREEBSD32_SYS_chroot 61 /* 62 is old freebsd32_fstat */ - /* 63 is obsolete ogetkerninfo */ + /* 63 is obsolete getkerninfo */ /* 64 is old getpagesize */ #define FREEBSD32_SYS_msync 65 #define FREEBSD32_SYS_vfork 66 @@ -140,7 +140,7 @@ #define FREEBSD32_SYS_mkdir 136 #define FREEBSD32_SYS_rmdir 137 #define FREEBSD32_SYS_freebsd32_utimes 138 - /* 139 is obsolete sigreturn */ + /* 139 is obsolete freebsd32_sigreturn */ #define FREEBSD32_SYS_freebsd32_adjtime 140 /* 141 is old getpeername */ /* 142 is old gethostid */ diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 264a1f17db3b..0dee48aa564a 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -68,7 +68,7 @@ const char *freebsd32_syscallnames[] = { "umask", /* 60 = umask */ "chroot", /* 61 = chroot */ "compat.freebsd32_fstat", /* 62 = old freebsd32_fstat */ - "obs_getkerninfo", /* 63 = obsolete ogetkerninfo */ + "obs_getkerninfo", /* 63 = obsolete getkerninfo */ "compat.getpagesize", /* 64 = old getpagesize */ "msync", /* 65 = msync */ "vfork", /* 66 = vfork */ @@ -144,7 +144,7 @@ const char *freebsd32_syscallnames[] = { "mkdir", /* 136 = mkdir */ "rmdir", /* 137 = rmdir */ "freebsd32_utimes", /* 138 = freebsd32_utimes */ - "obs_freebsd32_sigreturn", /* 139 = obsolete sigreturn */ + "obs_freebsd32_sigreturn", /* 139 = obsolete freebsd32_sigreturn */ "freebsd32_adjtime", /* 140 = freebsd32_adjtime */ "compat.getpeername", /* 141 = old getpeername */ "compat.gethostid", /* 142 = old gethostid */ diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index f95f00308624..386650e5afea 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -59,6 +59,12 @@ #define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD14 +#define compat14(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd14_, name) +#else +#define compat14(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 0 = syscall */ @@ -124,7 +130,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(umask_args), .sy_call = (sy_call_t *)sys_umask, .sy_auevent = AUE_UMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 60 = umask */ { .sy_narg = AS(chroot_args), .sy_call = (sy_call_t *)sys_chroot, .sy_auevent = AUE_CHROOT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 61 = chroot */ { compat(AS(ofreebsd32_fstat_args),freebsd32_fstat), .sy_auevent = AUE_FSTAT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 62 = old freebsd32_fstat */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 63 = obsolete ogetkerninfo */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 63 = obsolete getkerninfo */ { compat(0,getpagesize), .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 64 = old getpagesize */ { .sy_narg = AS(msync_args), .sy_call = (sy_call_t *)sys_msync, .sy_auevent = AUE_MSYNC, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 65 = msync */ { .sy_narg = 0, .sy_call = (sy_call_t *)sys_vfork, .sy_auevent = AUE_VFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 66 = vfork */ @@ -200,7 +206,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(mkdir_args), .sy_call = (sy_call_t *)sys_mkdir, .sy_auevent = AUE_MKDIR, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 136 = mkdir */ { .sy_narg = AS(rmdir_args), .sy_call = (sy_call_t *)sys_rmdir, .sy_auevent = AUE_RMDIR, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 137 = rmdir */ { .sy_narg = AS(freebsd32_utimes_args), .sy_call = (sy_call_t *)freebsd32_utimes, .sy_auevent = AUE_UTIMES, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 138 = freebsd32_utimes */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 139 = obsolete sigreturn */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 139 = obsolete freebsd32_sigreturn */ { .sy_narg = AS(freebsd32_adjtime_args), .sy_call = (sy_call_t *)freebsd32_adjtime, .sy_auevent = AUE_ADJTIME, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 140 = freebsd32_adjtime */ { compat(AS(ogetpeername_args),getpeername), .sy_auevent = AUE_GETPEERNAME, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 141 = old getpeername */ { compat(0,gethostid), .sy_auevent = AUE_SYSCTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 142 = old gethostid */ @@ -215,7 +221,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 151 = reserved for local use */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 152 = reserved for local use */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 153 = reserved for local use */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 154 = nlm_syscall */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 154 = freebsd32_nlm_syscall */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 155 = nfssvc */ { compat(AS(ofreebsd32_getdirentries_args),freebsd32_getdirentries), .sy_auevent = AUE_GETDIRENTRIES, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 156 = old freebsd32_getdirentries */ { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 157 = freebsd4 freebsd32_statfs */ @@ -309,7 +315,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 245 = reserved for local use */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 246 = reserved for local use */ { .sy_narg = AS(freebsd32_clock_getcpuclockid2_args), .sy_call = (sy_call_t *)freebsd32_clock_getcpuclockid2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 247 = freebsd32_clock_getcpuclockid2 */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 248 = ntp_gettime */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 248 = freebsd32_ntp_gettime */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 249 = reserved for local use */ { .sy_narg = AS(minherit_args), .sy_call = (sy_call_t *)sys_minherit, .sy_auevent = AUE_MINHERIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 250 = minherit */ { .sy_narg = AS(rfork_args), .sy_call = (sy_call_t *)sys_rfork, .sy_auevent = AUE_RFORK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 251 = rfork */ @@ -398,7 +404,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(freebsd32_sched_rr_get_interval_args), .sy_call = (sy_call_t *)freebsd32_sched_rr_get_interval, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 334 = freebsd32_sched_rr_get_interval */ { .sy_narg = AS(utrace_args), .sy_call = (sy_call_t *)sys_utrace, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), .sy_auevent = AUE_SENDFILE, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 337 = kldsym */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 337 = freebsd32_kldsym */ { .sy_narg = AS(freebsd32_jail_args), .sy_call = (sy_call_t *)freebsd32_jail, .sy_auevent = AUE_JAIL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 338 = freebsd32_jail */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ { .sy_narg = AS(sigprocmask_args), .sy_call = (sy_call_t *)sys_sigprocmask, .sy_auevent = AUE_SIGPROCMASK, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 340 = sigprocmask */ @@ -438,19 +444,19 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(__setugid_args), .sy_call = (sy_call_t *)sys___setugid, .sy_auevent = AUE_SETUGID, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 374 = __setugid */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 375 = obsolete nfsclnt */ { .sy_narg = AS(eaccess_args), .sy_call = (sy_call_t *)sys_eaccess, .sy_auevent = AUE_EACCESS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 376 = eaccess */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 377 = afs3_syscall */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 377 = freebsd32_afs3_syscall */ { .sy_narg = AS(freebsd32_nmount_args), .sy_call = (sy_call_t *)freebsd32_nmount, .sy_auevent = AUE_NMOUNT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 378 = freebsd32_nmount */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 379 = obsolete kse_exit */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 380 = obsolete kse_wakeup */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 381 = obsolete kse_create */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 382 = obsolete kse_thr_interrupt */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 383 = obsolete kse_release */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 384 = __mac_get_proc */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 385 = __mac_set_proc */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 386 = __mac_get_fd */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 387 = __mac_get_file */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 388 = __mac_set_fd */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 389 = __mac_set_file */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 384 = freebsd32___mac_get_proc */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 385 = freebsd32___mac_set_proc */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 386 = freebsd32___mac_get_fd */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 387 = freebsd32___mac_get_file */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 388 = freebsd32___mac_set_fd */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 389 = freebsd32___mac_set_file */ { .sy_narg = AS(kenv_args), .sy_call = (sy_call_t *)sys_kenv, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 390 = kenv */ { .sy_narg = AS(lchflags_args), .sy_call = (sy_call_t *)sys_lchflags, .sy_auevent = AUE_LCHFLAGS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 391 = lchflags */ { .sy_narg = AS(uuidgen_args), .sy_call = (sy_call_t *)sys_uuidgen, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 392 = uuidgen */ @@ -470,13 +476,13 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(ksem_unlink_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 406 = ksem_unlink */ { .sy_narg = AS(ksem_getvalue_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 407 = ksem_getvalue */ { .sy_narg = AS(ksem_destroy_args), .sy_call = (sy_call_t *)lkmressys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 408 = ksem_destroy */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 409 = __mac_get_pid */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 410 = __mac_get_link */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 411 = __mac_set_link */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 409 = freebsd32___mac_get_pid */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 410 = freebsd32___mac_get_link */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 411 = freebsd32___mac_set_link */ { .sy_narg = AS(extattr_set_link_args), .sy_call = (sy_call_t *)sys_extattr_set_link, .sy_auevent = AUE_EXTATTR_SET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 412 = extattr_set_link */ { .sy_narg = AS(extattr_get_link_args), .sy_call = (sy_call_t *)sys_extattr_get_link, .sy_auevent = AUE_EXTATTR_GET_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 413 = extattr_get_link */ { .sy_narg = AS(extattr_delete_link_args), .sy_call = (sy_call_t *)sys_extattr_delete_link, .sy_auevent = AUE_EXTATTR_DELETE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 414 = extattr_delete_link */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = __mac_execve */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 415 = freebsd32___mac_execve */ { .sy_narg = AS(freebsd32_sigaction_args), .sy_call = (sy_call_t *)freebsd32_sigaction, .sy_auevent = AUE_SIGACTION, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 416 = freebsd32_sigaction */ { .sy_narg = AS(freebsd32_sigreturn_args), .sy_call = (sy_call_t *)freebsd32_sigreturn, .sy_auevent = AUE_SIGRETURN, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 417 = freebsd32_sigreturn */ { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 418 = reserved for local use */ @@ -491,7 +497,7 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(__acl_delete_link_args), .sy_call = (sy_call_t *)sys___acl_delete_link, .sy_auevent = AUE_ACL_DELETE_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 427 = __acl_delete_link */ { .sy_narg = AS(__acl_aclcheck_link_args), .sy_call = (sy_call_t *)sys___acl_aclcheck_link, .sy_auevent = AUE_ACL_CHECK_LINK, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ { .sy_narg = AS(sigwait_args), .sy_call = (sy_call_t *)sys_sigwait, .sy_auevent = AUE_SIGWAIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 429 = sigwait */ - { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 430 = thr_create */ + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 430 = freebsd32_thr_create */ { .sy_narg = AS(thr_exit_args), .sy_call = (sy_call_t *)sys_thr_exit, .sy_auevent = AUE_THR_EXIT, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 431 = thr_exit */ { .sy_narg = AS(thr_self_args), .sy_call = (sy_call_t *)sys_thr_self, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 432 = thr_self */ { .sy_narg = AS(thr_kill_args), .sy_call = (sy_call_t *)sys_thr_kill, .sy_auevent = AUE_THR_KILL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 433 = thr_kill */ diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 9d28b1e9609f..8b0f50c8d7e1 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -58,6 +58,12 @@ #define compat13(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD14 +#define compat14(n, name) .sy_narg = n, .sy_call = (sy_call_t *)__CONCAT(freebsd14_, name) +#else +#define compat14(n, name) .sy_narg = 0, .sy_call = (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent sysent[] = { { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 0 = syscall */ From nobody Wed Oct 30 21:08:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09S2VYVz5c2lV; Wed, 30 Oct 2024 21:09:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09R54F1z4t3c; Wed, 30 Oct 2024 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMe4PJZZywlhdeQnKt8t5xxTkYpY8R5U7PDpY6YnhBk=; b=pr3AM/uEIVohN07lX5su1dAjzeOUrtB64k9/C6ve7AEFUJWSr/sBSFpMJij3xDqf+Yx2ET NaJVvgywBDGfydIu/POMBqm9WdlRR/bOrSRTzDPKW0nGvuYskHue6mexPTXIkVAJSirzIk pD9OHa/OxyDM0jnw1TqJLdMtWCocfDLlQm4N9JVr4m6FL7ym3IAY80/lmoYIJH2V7vtJzq BlXSi2FWQEDBkUpD3Fj6mEM/gv7+N36ZYT7qglwzPwOze06JXh3cYvZKIP3+RyEtFGuJCT XtCX+WnDIcCLp3RPAstSn1RxBeTakRdYXFNR9kuDU5wW9h3PLy7FUHjBF3KVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMe4PJZZywlhdeQnKt8t5xxTkYpY8R5U7PDpY6YnhBk=; b=sNx5lDdIQ5Wnfh/Ea/kXOZ7XiE6BtGce2w6RUUEnPm6DRE4D3ULQM5fgXkqLN44ZG+4YY8 0QjkkLSX5JW+H3fCULsR9Ji5Pm3gpwmEcBsuSot4ZRM4xby7Tml9A6GvihFdlU8v4ZyOzG Sa7ZqPBLVMZlC5t/Rtct9boDDJLbULIxgYEy0igwDFEkDbX9e+2re7BCZcRPLnr+yG8xDP gOyyb1cPdnhBgXzEqEwcPnD9fDRyvI/U6b1hw5yy66Og56Q4tmMLG3GxScP/Uao8+9bqT6 rDzzf+9jR63L+i1AQ+kqAETLlfHjS5LBpMw3T+3LrscTtcx6vfiVw/jz+PvvgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322539; a=rsa-sha256; cv=none; b=MmVqfj0qBEfyWE2tP9KFXszK7l62fcJxV0CHIsMpBXvV4yLQFnCkltj01WZ+tV+NB1wLs9 r79LOJYVxr2r+9KLhFqbizX3hS/fKInoM5BkeksF9Rwx0o8Nrd2YG/C4UODYvtkXSJVJl3 hGIJaLmlY05CrP7S01eTKJbO/9i1cdvUXSzPO6LjL4sGpgOHE/10yOd3eBAGeoLmqdRddA G6XzhX1o67XMVwtRUAdt+XxX8ui00t5o/Cl/Z314Kt6ag5BNovh6aW0dS7Da3nQv7tebxB xgl00Fv+oltMjbSpOywM88SHVc0RSyzpWcHeTYMIqu/qriO0xywY2s6U6TFA2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09R0mnGz1Mrj; Wed, 30 Oct 2024 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8wrt053756; Wed, 30 Oct 2024 21:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8whK053753; Wed, 30 Oct 2024 21:08:58 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:58 GMT Message-Id: <202410302108.49UL8whK053753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: ec86d763d1c9 - main - sys/tools/syscalls: desupport capabilities.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec86d763d1c94648419aeb931683dcb37bf72656 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ec86d763d1c94648419aeb931683dcb37bf72656 commit ec86d763d1c94648419aeb931683dcb37bf72656 Author: Brooks Davis AuthorDate: 2024-10-22 17:59:23 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 sys/tools/syscalls: desupport capabilities.conf We haven't used this since commit be67ea40c5a0 in 2021 so stop carrying it forward. Also remove support for setting the list in syscalls.conf via the capenabled variable. This was last used by cloudabi (removed in 2021 by commit cf0ee8738e31). --- sys/tools/syscalls/config.lua | 51 +--------------------------- sys/tools/syscalls/core/syscall.lua | 11 ++---- sys/tools/syscalls/main.lua | 1 - sys/tools/syscalls/scripts/init_sysent.lua | 1 - sys/tools/syscalls/scripts/libsys_h.lua | 1 - sys/tools/syscalls/scripts/syscall_h.lua | 1 - sys/tools/syscalls/scripts/syscall_mk.lua | 1 - sys/tools/syscalls/scripts/syscalls.lua | 1 - sys/tools/syscalls/scripts/syscalls_map.lua | 1 - sys/tools/syscalls/scripts/sysproto_h.lua | 1 - sys/tools/syscalls/scripts/systrace_args.lua | 1 - 11 files changed, 4 insertions(+), 67 deletions(-) diff --git a/sys/tools/syscalls/config.lua b/sys/tools/syscalls/config.lua index 92098a709854..fcf4c2217959 100644 --- a/sys/tools/syscalls/config.lua +++ b/sys/tools/syscalls/config.lua @@ -47,10 +47,8 @@ local config = { ptr_intptr_t_cast = "intptr_t", obsol = {}, unimpl = {}, - capabilities_conf = "capabilities.conf", compat_set = "native", mincompat = 0, - capenabled = {}, -- System calls that require ABI-specific handling. syscall_abi_change = {}, -- System calls that appear to require handling, but don't. @@ -222,8 +220,7 @@ function config.merge(fh) -- Match for pipe, that's how abi_flags -- is formatted. config[k] = util.setFromString(v, "[^|]+") - elseif k:find("capenabled") or - k:find("syscall_abi_change") or + elseif k:find("syscall_abi_change") or k:find("syscall_no_abi_change") or k:find("obsol") or k:find("unimpl") then @@ -263,50 +260,4 @@ function config.mergeCompat() end end --- Parses the provided capabilities.conf. Returns a string (comma separated --- list) as its formatted in capabilities.conf, or NIL and a message if no file --- was provided. -local function grabCapenabled(file, open_fail_ok) - local capentries = {} - local commentExpr = "#.*" - - if file == nil then - return nil, "No file given" - end - - local fh, msg, errno = io.open(file) - if fh == nil then - if not open_fail_ok then - util.abort(errno, msg) - end - return nil, msg - end - - for nextline in fh:lines() do - -- Strip any comments. - nextline = nextline:gsub(commentExpr, "") - if nextline ~= "" then - capentries[nextline] = true - end - end - - assert(fh:close()) - return capentries -end - --- Merge capability (Capsicum) configuration into the global config. -function config.mergeCapability() - -- We ignore errors here if we're relying on the default configuration. - if not config.modifications.capenabled then - config.capenabled = grabCapenabled(config.capabilities_conf, - config.modifications.capabilities_conf == nil) - elseif config.capenabled ~= "" then - -- We have a comma separated list from the format of - -- capabilities.conf, split it into a set with boolean values - -- for each key. - config.capenabled = util.setFromString(config.capenabled, - "[^,]+") - end -end - return config diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua index 7e8c562dad8a..402595b998da 100644 --- a/sys/tools/syscalls/core/syscall.lua +++ b/sys/tools/syscalls/core/syscall.lua @@ -48,14 +48,9 @@ end function syscall:processCap() self.cap = "0" local stripped = util.stripAbiPrefix(self.name, self.prefix) - if config.capenabled ~= nil and (config.capenabled[self.name] ~= nil or - config.capenabled[stripped] ~= nil) then - self.cap = "SYF_CAPENABLED" - else - for k, _ in pairs(self.type) do - if k == "CAPENABLED" then - self.cap = "SYF_CAPENABLED" - end + for k, _ in pairs(self.type) do + if k == "CAPENABLED" then + self.cap = "SYF_CAPENABLED" end end end diff --git a/sys/tools/syscalls/main.lua b/sys/tools/syscalls/main.lua index 8f791eec0943..b15eec095f9c 100755 --- a/sys/tools/syscalls/main.lua +++ b/sys/tools/syscalls/main.lua @@ -40,7 +40,6 @@ local sysfile, configfile = arg[1], arg[2] config.merge(configfile) config.mergeCompat() -config.mergeCapability() local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/init_sysent.lua b/sys/tools/syscalls/scripts/init_sysent.lua index 106c51be5f8a..66683250b482 100755 --- a/sys/tools/syscalls/scripts/init_sysent.lua +++ b/sys/tools/syscalls/scripts/init_sysent.lua @@ -180,7 +180,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed syscall table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/libsys_h.lua b/sys/tools/syscalls/scripts/libsys_h.lua index 18ffc68fded6..75627f08750f 100755 --- a/sys/tools/syscalls/scripts/libsys_h.lua +++ b/sys/tools/syscalls/scripts/libsys_h.lua @@ -98,7 +98,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed syscall table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/syscall_h.lua b/sys/tools/syscalls/scripts/syscall_h.lua index ce5ffcec4b94..5f8d8fb66889 100755 --- a/sys/tools/syscalls/scripts/syscall_h.lua +++ b/sys/tools/syscalls/scripts/syscall_h.lua @@ -84,7 +84,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed system call table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index d4347a050cf1..68438ee8d90c 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -77,7 +77,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed syscall table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/syscalls.lua b/sys/tools/syscalls/scripts/syscalls.lua index b1a3d1020f88..38ed396a73ae 100755 --- a/sys/tools/syscalls/scripts/syscalls.lua +++ b/sys/tools/syscalls/scripts/syscalls.lua @@ -96,7 +96,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed syscall table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua index 4108d9f46fcf..57bb5e9da93b 100755 --- a/sys/tools/syscalls/scripts/syscalls_map.lua +++ b/sys/tools/syscalls/scripts/syscalls_map.lua @@ -61,7 +61,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed syscall table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/sysproto_h.lua b/sys/tools/syscalls/scripts/sysproto_h.lua index d4fc30c31292..6770e0548899 100755 --- a/sys/tools/syscalls/scripts/sysproto_h.lua +++ b/sys/tools/syscalls/scripts/sysproto_h.lua @@ -229,7 +229,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed system call table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} diff --git a/sys/tools/syscalls/scripts/systrace_args.lua b/sys/tools/syscalls/scripts/systrace_args.lua index abd5d284d46e..88170b85e737 100755 --- a/sys/tools/syscalls/scripts/systrace_args.lua +++ b/sys/tools/syscalls/scripts/systrace_args.lua @@ -255,7 +255,6 @@ if script then config.merge(configfile) config.mergeCompat() - config.mergeCapability() -- The parsed system call table. local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} From nobody Wed Oct 30 21:08:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09S6qZ8z5c2qf; Wed, 30 Oct 2024 21:09:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09S2sgTz4t1K; Wed, 30 Oct 2024 21:09:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDlelTvfSZIlPsyjsfEFzX88+HcxyYVFofUqPM5YTaM=; b=evMmOQkZwtFr7xnf5CmmETTuvh7YWfraoVSXzQyERPuoiTkctaiRHz+GnsS4BN1GFq57l8 WxRHo0szrtXHDsN3gtw+iCOmmSWkxAiRzYZtkUsiucy1ygAzZWgEoK0kLqwTY7lbRMrYJT ETia9C5MiGLenNi56Bp2xbCAm6DWmylIwpTeiQqC9tbIJozIt5X9bxxjDDiOZSnbvfvWI9 Z6pLPDzs+bFflV8Pearh8En8gn3YKN6elKQgLs1oLOBqWOOLWgOOydPD//j1J0EWdcxFBN gle8TVEe+Jla7r3G/nKF2xxEavdLLKJ+dgi8IRcwnBvfhCNV50NU/wNaMDfxQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDlelTvfSZIlPsyjsfEFzX88+HcxyYVFofUqPM5YTaM=; b=Sjs/keS3vKgekvmIlpn+ErpxvGop+rzV2agvK0r8qhQpQ9IhOLQ8edx1533S2eb4BBWuii gStT1I5H5l0DegWcfNRgNC2Lzll+qJa2MeNJctiA/Ta9k7jPiOgDR17gnLt6zA6Q+/KTQ+ NkIFiVNrtL8Hk8JUoLs3i900vMYw5l6FKuzJ/xXDIvbKGb1wYnBIXgVWf658bnACYBuq6y S3DJb1DjFIayMg3Nv3/PdCD7rB7EUjKwc8Qvu+hxhzF6e0lztnszRoK+AjvmiSXtFg4aRQ YVPyfPUOJwGgDM0BBGnwQ/YYS3xS671CcihWFLEkfcf9EB3qVFWi9iNaNEuLUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322540; a=rsa-sha256; cv=none; b=ICorpZxF8HRz3GCxYe7yGVwK1y5svSHw4qBRv7IG2+qPJlauIUgLxdRKsN/k/Jol2RVhVa vxbww9LSP8Q/X6ptxV90tQqaWATHeZ+FeqoJVAY7IzNiqOhr27I3SvaGwlUjGCVPTgPUap BKPTEMjl2tU3c2PijCPGksqkEouVoH47On622mGCfBR3qEGh29AogLsIOnZ+al12rkLrgo EfBV4g4DEHg9vER3NjcJqqHSHDXoKlbKn5z1zbCCJorp4XXWUEc1DQbd9drHCbFZzmt1ym b1RyQ0YgegQ9pLE+7xF+WQF6EvVEjl5PpnpQiaEyIF59VYT6w/Gzx4MsMO4SYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09S0Nkpz1N2H; Wed, 30 Oct 2024 21:09:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8xEZ053796; Wed, 30 Oct 2024 21:08:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8xlH053793; Wed, 30 Oct 2024 21:08:59 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:59 GMT Message-Id: <202410302108.49UL8xlH053793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 913bfd86c1b2 - main - Update mentions of makesyscalls.lua List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 913bfd86c1b2a161c21fccaef63c1e1702560366 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=913bfd86c1b2a161c21fccaef63c1e1702560366 commit 913bfd86c1b2a161c21fccaef63c1e1702560366 Author: Brooks Davis AuthorDate: 2024-10-22 17:38:11 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 Update mentions of makesyscalls.lua It is obsolete and will be removed in a followup commit. --- sys/cddl/dev/systrace/systrace.c | 4 ++-- sys/compat/freebsd32/syscalls.conf | 8 ++++---- sys/conf/sysent.mk | 5 ++--- sys/kern/syscalls.master | 6 +++--- sys/tools/syscalls/README.md | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index 4969343ed06e..c14a663d1995 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -92,7 +92,7 @@ extern struct sysent linux32_sysent[]; #elif defined(FREEBSD32_SYSTRACE) /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/tools/makesyscalls.lua. + * using a generated function. See sys/tools/syscalls/README.md. */ #include #include @@ -106,7 +106,7 @@ extern const char *freebsd32_syscallnames[]; #else /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/tools/makesyscalls.lua. + * using a generated function. See sys/tools/syscalls/README.md. */ #include #include diff --git a/sys/compat/freebsd32/syscalls.conf b/sys/compat/freebsd32/syscalls.conf index a6e47cf470f1..72006631c89e 100644 --- a/sys/compat/freebsd32/syscalls.conf +++ b/sys/compat/freebsd32/syscalls.conf @@ -18,10 +18,10 @@ abi_ptr_array_t="uint32_t" abi_headers="#include " # -# Variables below this line are exceptions to the ABI changes programmatically -# detected by makesyscalls.lua. New system calls should not require an entry -# here in nearly virtually all cases. New entries are almost certainly -# representative of badly designed interfaces. +# Variables below this line are exceptions to the ABI changes +# programmatically detected by sys/tools/syscalls. New system calls +# should not require an entry here in virtually all cases. New entries +# are almost certainly representative of badly designed interfaces. # # System calls that require freebsd32-specific handling: diff --git a/sys/conf/sysent.mk b/sys/conf/sysent.mk index 54531a52e151..66897d3b6b0a 100644 --- a/sys/conf/sysent.mk +++ b/sys/conf/sysent.mk @@ -33,9 +33,8 @@ all: .ORDER: ${GENERATED} sysent: ${GENERATED} -# We slap a .PHONY on makesyscalls.lua so that we regenerate every single time, -# for now, which can be less painful across rebases or other things that may -# have odd effects on mtimes. +# We slap a .PHONY on MAKESYSCALLS_SCRIPT so that we regenerate every +# single time rather than tracking all internal dependencies for now. ${MAKESYSCALLS_SCRIPT}: .PHONY ${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS} diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 849e5ee2f13b..7a7530697e59 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -58,10 +58,10 @@ ; - Use u_int and u_long rather than "unsigned (int|long)". ; - size_t is allowed. ; - typedefs are allowed, but new signed types that vary between 32- and -; 64-bit ABIs must be added to makesyscalls.lua so it knows they require -; handling. +; 64-bit ABIs must be added to config.known_abi_flags in +; sys/tools/syscalls/config.lua so it knows they require handling. ; - Always-64-bit types other than dev_t, id_t, and off_t must be added to -; makesyscalls.lua. +; util.is64bitType in sys/tools/syscalls/tools/util.lua. ; For pointers: ; - Prefer structs to typedefs so an ABI-specific suffix (e.g., "32") can ; be prepended (e.g., ucontext_t -> struct ucontext -> struct ucontext32). diff --git a/sys/tools/syscalls/README.md b/sys/tools/syscalls/README.md index 7ae6519360ba..1797411f1aa0 100644 --- a/sys/tools/syscalls/README.md +++ b/sys/tools/syscalls/README.md @@ -1,6 +1,6 @@ # System call creation library Parses `syscalls.master` and packages information into objects with methods. -Modules reproduce the previous file auto-generation of `makesyscalls.lua`. +Modules reproduce the previously monolithic file auto-generation. We generally assume that this script will be run by flua, however we've carefully crafted modules for it that mimic interfaces provided by modules From nobody Wed Oct 30 21:09:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09Y3DJHz5c2jG; Wed, 30 Oct 2024 21:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09T6wdhz4t1Q; Wed, 30 Oct 2024 21:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xBsKt2ORqDTwOMusLYxXgF4mMC4jFWtmDxinW5GGFHw=; b=NzRRVT47CLUZlx0OatG0Hk56sS5P3CyumAK21xqSQuV1+toRUA0gq9XFRytIBev+WuFDqN sjCxnMPghGkhnArfnk25p6uK2fF2J3LQluse0jv32mBwXNbKiR6sSM0QiqGtP8/8/1TbY4 aVWYIUQ8MF9HCRk+fXg6zZosbgBQRtM95ShoGpoNNJMiuZb+2DmDp7AVrYixLS6TmRJxIO 5Z935D1w3ogqzkLjHaqLMhuMOfWIE7+X4clOgxBcVqI+Ih5C046508PYuGlx7oSPm3Cq94 fUKaGM4DTSc8kTEEwesqqrG6W9K1MDGrMSq5rRsWynv+tItS3F3eY5Xg/WVc3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xBsKt2ORqDTwOMusLYxXgF4mMC4jFWtmDxinW5GGFHw=; b=GUQRnMdRqn0kY5ubQKmP+5VQT1A1O0kMUFISUotsDhbbdeOrRhuuNe3ZZ3SBgfDnArYm16 EpKP15MmmTu6j7EaNwOAtPPyeORQsRffVkTThfbIZeLtRXp9w71eE7QldzXdfScknBLIev 6zMW74oJ2v9y0djYw7XCkpTullfhaXxiKkS4kmmkLpMKOWlR0cPgsY1s6UAKapbchaGeP6 AN7IEEeKQ7Xlqj7m4FanVb9Cje+8GEU2kMfmifv8O37bLZ5B0At1JfBzJnXWNJ0rrov7Sk 6dickW8pyXe/UohgjtQyrrDs+QuNGeqp0nEMdqJd+GPXlUR7bEdYlprdDb0q+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322542; a=rsa-sha256; cv=none; b=dQtGFiKvR6iQFeRG+DnRs97HwBMHON/ojfRM6VYMB8CfX7WgPmehA7EYbXrjTNNflmlYU/ wU5EYrgp3aQ1SxEPU7V68q9OVK2wwAlNY1/+TgYby4z8G0CiDprNtIE8cQRcKmqgZQN4Xh ps6RS4+K4dAEvo7GlBGbPziYeNcIXdKLCRCrYB6fEPAWbyo+HwW5cPkUlgpim0rG9kCwQc eENk5o+s7kpH0SIdtEgcawSZqtLDU02mA5icjM0anNp4CcjfhFqLtx0pwGXRKceRR/NrYZ qpz8iA1whDqc1tFe0HeWMtaZSuHT7XZRrzpwYfuxGwKBOPAhhtYBDdjQdmRn6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09T2SLcz1N3W; Wed, 30 Oct 2024 21:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL915i053844; Wed, 30 Oct 2024 21:09:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL91Hr053841; Wed, 30 Oct 2024 21:09:01 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:09:01 GMT Message-Id: <202410302109.49UL91Hr053841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 5212b9500116 - main - sysent: GC sys/tools/makesyscalls.lua List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5212b9500116523828fc94d84a951949d408a1a4 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5212b9500116523828fc94d84a951949d408a1a4 commit 5212b9500116523828fc94d84a951949d408a1a4 Author: Brooks Davis AuthorDate: 2024-10-21 21:42:13 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 sysent: GC sys/tools/makesyscalls.lua System call entry generation now lives in sys/tools/syscalls/* --- sys/tools/makesyscalls.lua | 1710 -------------------------------------------- 1 file changed, 1710 deletions(-) diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua deleted file mode 100644 index 7e3116107483..000000000000 --- a/sys/tools/makesyscalls.lua +++ /dev/null @@ -1,1710 +0,0 @@ --- --- SPDX-License-Identifier: BSD-2-Clause --- --- Copyright (c) 2019 Kyle Evans --- --- 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. --- - - --- We generally assume that this script will be run by flua, however we've --- carefully crafted modules for it that mimic interfaces provided by modules --- available in ports. Currently, this script is compatible with lua from ports --- along with the compatible luafilesystem and lua-posix modules. -local lfs = require("lfs") -local unistd = require("posix.unistd") - -local savesyscall = -1 -local maxsyscall = -1 -local structs = {} -local generated_tag = "@" .. "generated" - --- Default configuration; any of these may get replaced by a configuration file --- optionally specified. -local config = { - os_id_keyword = "FreeBSD", -- obsolete, ignored on input, not generated - abi_func_prefix = "", - libsysmap = "/dev/null", - libsys_h = "/dev/null", - sysnames = "syscalls.c", - sysproto = "../sys/sysproto.h", - sysproto_h = "_SYS_SYSPROTO_H_", - syshdr = "../sys/syscall.h", - sysmk = "/dev/null", - syssw = "init_sysent.c", - syscallprefix = "SYS_", - switchname = "sysent", - namesname = "syscallnames", - systrace = "systrace_args.c", - capabilities_conf = "capabilities.conf", - capenabled = {}, - compat_set = "native", - mincompat = 0, - abi_type_suffix = "", - abi_flags = "", - abi_flags_mask = 0, - abi_headers = "", - abi_intptr_t = "intptr_t", - abi_size_t = "size_t", - abi_u_long = "u_long", - abi_long = "long", - abi_semid_t = "semid_t", - abi_ptr_array_t = "", - ptr_intptr_t_cast = "intptr_t", - syscall_abi_change = "", - sys_abi_change = {}, - syscall_no_abi_change = "", - sys_no_abi_change = {}, - obsol = "", - obsol_dict = {}, - unimpl = "", - unimpl_dict = {}, -} - -local config_modified = {} -local cleantmp = true -local tmpspace = "/tmp/sysent." .. unistd.getpid() .. "/" - -local output_files = { - "sysnames", - "syshdr", - "sysmk", - "libsysmap", - "libsys_h", - "syssw", - "systrace", - "sysproto", -} - --- These ones we'll create temporary files for; generation purposes. -local temp_files = { - "libsys_h_type", - "libsys_h_func", - "sysaue", - "sysdcl", - "syscompat", - "syscompatdcl", - "sysent", - "sysinc", - "sysarg", - "sysprotoend", - "systracetmp", - "systraceret", -} - --- Opened files -local files = {} - -local function cleanup() - for _, v in pairs(files) do - assert(v:close()) - end - if cleantmp then - if lfs.dir(tmpspace) then - for fname in lfs.dir(tmpspace) do - if fname ~= "." and fname ~= ".." then - assert(os.remove(tmpspace .. "/" .. - fname)) - end - end - end - - if lfs.attributes(tmpspace) and not lfs.rmdir(tmpspace) then - assert(io.stderr:write("Failed to clean up tmpdir: " .. - tmpspace .. "\n")) - end - else - assert(io.stderr:write("Temp files left in " .. tmpspace .. - "\n")) - end -end - -local function abort(status, msg) - assert(io.stderr:write(msg .. "\n")) - cleanup() - os.exit(status) -end - --- Each entry should have a value so we can represent abi flags as a bitmask --- for convenience. One may also optionally provide an expr; this gets applied --- to each argument type to indicate whether this argument is subject to ABI --- change given the configured flags. -local known_abi_flags = { - long_size = { - value = 0x00000001, - exprs = { - "_Contains[a-z_]*_long_", - "^long [a-z0-9_]+$", - "long [*]", - "size_t [*]", - -- semid_t is not included because it is only used - -- as an argument or written out individually and - -- said writes are handled by the ksem framework. - -- Technically a sign-extension issue exists for - -- arguments, but because semid_t is actually a file - -- descriptor negative 32-bit values are invalid - -- regardless of sign-extension. - }, - }, - time_t_size = { - value = 0x00000002, - exprs = { - "_Contains[a-z_]*_timet_", - }, - }, - pointer_args = { - value = 0x00000004, - }, - pointer_size = { - value = 0x00000008, - exprs = { - "_Contains[a-z_]*_ptr_", - "[*][*]", - }, - }, - pair_64bit = { - value = 0x00000010, - exprs = { - "^dev_t[ ]*$", - "^id_t[ ]*$", - "^off_t[ ]*$", - }, - }, -} - -local known_flags = { - STD = 0x00000001, - OBSOL = 0x00000002, - RESERVED = 0x00000004, - UNIMPL = 0x00000008, - NODEF = 0x00000010, - NOARGS = 0x00000020, - NOPROTO = 0x00000040, - NOSTD = 0x00000080, - NOTSTATIC = 0x00000100, - CAPENABLED = 0x00000200, - SYSMUX = 0x00000400, - - -- Compat flags start from here. We have plenty of space. -} - --- All compat option entries should have five entries: --- definition: The preprocessor macro that will be set for this --- compatlevel: The level this compatibility should be included at. This --- generally represents the version of FreeBSD that it is compatible --- with, but ultimately it's just the level of mincompat in which it's --- included. --- flag: The name of the flag in syscalls.master. --- prefix: The prefix to use for _args and syscall prototype. This will be --- used as-is, without "_" or any other character appended. --- descr: The description of this compat option in init_sysent.c comments. --- The special "stdcompat" entry will cause the other five to be autogenerated. -local compat_option_sets = { - native = { - { - definition = "COMPAT_43", - compatlevel = 3, - flag = "COMPAT", - prefix = "o", - descr = "old", - }, - { stdcompat = "FREEBSD4" }, - { stdcompat = "FREEBSD6" }, - { stdcompat = "FREEBSD7" }, - { stdcompat = "FREEBSD10" }, - { stdcompat = "FREEBSD11" }, - { stdcompat = "FREEBSD12" }, - { stdcompat = "FREEBSD13" }, - { stdcompat = "FREEBSD14" }, - }, -} - --- compat_options will be resolved to a set from the configuration. -local compat_options - -local function trim(s, char) - if s == nil then - return nil - end - if char == nil then - char = "%s" - end - return s:gsub("^" .. char .. "+", ""):gsub(char .. "+$", "") -end - --- config looks like a shell script; in fact, the previous makesyscalls.sh --- script actually sourced it in. It had a pretty common format, so we should --- be fine to make various assumptions -local function process_config(file) - local cfg = {} - local comment_line_expr = "^%s*#.*" - -- We capture any whitespace padding here so we can easily advance to - -- the end of the line as needed to check for any trailing bogus bits. - -- Alternatively, we could drop the whitespace and instead try to - -- use a pattern to strip out the meaty part of the line, but then we - -- would need to sanitize the line for potentially special characters. - local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]*[`\"]?)" - - if not file then - return nil, "No file given" - end - - local fh = assert(io.open(file)) - - for nextline in fh:lines() do - -- Strip any whole-line comments - nextline = nextline:gsub(comment_line_expr, "") - -- Parse it into key, value pairs - local key, value = nextline:match(line_expr) - if key ~= nil and value ~= nil then - local kvp = key .. "=" .. value - key = trim(key) - value = trim(value) - local delim = value:sub(1,1) - if delim == '"' then - local trailing_context - - -- Strip off the key/value part - trailing_context = nextline:sub(kvp:len() + 1) - -- Strip off any trailing comment - trailing_context = trailing_context:gsub("#.*$", - "") - -- Strip off leading/trailing whitespace - trailing_context = trim(trailing_context) - if trailing_context ~= "" then - print(trailing_context) - abort(1, "Malformed line: " .. nextline) - end - - value = trim(value, delim) - else - -- Strip off potential comments - value = value:gsub("#.*$", "") - -- Strip off any padding whitespace - value = trim(value) - if value:match("%s") then - abort(1, "Malformed config line: " .. - nextline) - end - end - cfg[key] = value - elseif not nextline:match("^%s*$") then - -- Make sure format violations don't get overlooked - -- here, but ignore blank lines. Comments are already - -- stripped above. - abort(1, "Malformed config line: " .. nextline) - end - end - - assert(io.close(fh)) - return cfg -end - -local function grab_capenabled(file, open_fail_ok) - local capentries = {} - local commentExpr = "#.*" - - if file == nil then - print "No file" - return {} - end - - local fh = io.open(file) - if fh == nil then - if not open_fail_ok then - abort(1, "Failed to open " .. file) - end - return {} - end - - for nextline in fh:lines() do - -- Strip any comments - nextline = nextline:gsub(commentExpr, "") - if nextline ~= "" then - capentries[nextline] = true - end - end - - assert(io.close(fh)) - return capentries -end - -local function process_compat() - local nval = 0 - for _, v in pairs(known_flags) do - if v > nval then - nval = v - end - end - - nval = nval << 1 - for _, v in pairs(compat_options) do - if v.stdcompat ~= nil then - local stdcompat = v.stdcompat - v.definition = "COMPAT_" .. stdcompat:upper() - v.compatlevel = tonumber(stdcompat:match("([0-9]+)$")) - v.flag = stdcompat:gsub("FREEBSD", "COMPAT") - v.prefix = stdcompat:lower() .. "_" - v.descr = stdcompat:lower() - end - - local tmpname = "sys" .. v.flag:lower() - local dcltmpname = tmpname .. "dcl" - files[tmpname] = io.tmpfile() - files[dcltmpname] = io.tmpfile() - v.tmp = tmpname - v.dcltmp = dcltmpname - - known_flags[v.flag] = nval - v.mask = nval - nval = nval << 1 - - v.count = 0 - end -end - -local function process_abi_flags() - local flags, mask = config.abi_flags, 0 - for txtflag in flags:gmatch("([^|]+)") do - if known_abi_flags[txtflag] == nil then - abort(1, "Unknown abi_flag: " .. txtflag) - end - - mask = mask | known_abi_flags[txtflag].value - end - - config.abi_flags_mask = mask -end - -local function process_obsol() - local obsol = config.obsol - for syscall in obsol:gmatch("([^ ]+)") do - config.obsol_dict[syscall] = true - end -end - -local function process_unimpl() - local unimpl = config.unimpl - for syscall in unimpl:gmatch("([^ ]+)") do - config.unimpl_dict[syscall] = true - end -end - -local function process_syscall_abi_change() - local changes_abi = config.syscall_abi_change - for syscall in changes_abi:gmatch("([^ ]+)") do - config.sys_abi_change[syscall] = true - end - - local no_changes = config.syscall_no_abi_change - for syscall in no_changes:gmatch("([^ ]+)") do - config.sys_no_abi_change[syscall] = true - end -end - -local function abi_changes(name) - if known_abi_flags[name] == nil then - abort(1, "abi_changes: unknown flag: " .. name) - end - - return config.abi_flags_mask & known_abi_flags[name].value ~= 0 -end - -local function strip_abi_prefix(funcname) - local abiprefix = config.abi_func_prefix - local stripped_name - if funcname == nil then - return nil - end - if abiprefix ~= "" and funcname:find("^" .. abiprefix) then - stripped_name = funcname:gsub("^" .. abiprefix, "") - else - stripped_name = funcname - end - - return stripped_name -end - -local function read_file(tmpfile) - if files[tmpfile] == nil then - print("Not found: " .. tmpfile) - return - end - - local fh = files[tmpfile] - assert(fh:seek("set")) - return assert(fh:read("a")) -end - -local function write_line(tmpfile, line) - if files[tmpfile] == nil then - print("Not found: " .. tmpfile) - return - end - assert(files[tmpfile]:write(line)) -end - -local function write_line_pfile(tmppat, line) - for k in pairs(files) do - if k:match(tmppat) ~= nil then - assert(files[k]:write(line)) - end - end -end - --- Check both literal intptr_t and the abi version because this needs --- to work both before and after the substitution -local function isptrtype(type) - return type:find("*") or type:find("caddr_t") or - type:find("intptr_t") or type:find(config.abi_intptr_t) -end - -local function isptrarraytype(type) - return type:find("[*][*]") or type:find("[*][ ]*const[ ]*[*]") -end - --- Find types that are always 64-bits wide -local function is64bittype(type) - return type:find("^dev_t[ ]*$") or type:find("^id_t[ ]*$") or type:find("^off_t[ ]*$") -end - -local process_syscall_def - --- These patterns are processed in order on any line that isn't empty. -local pattern_table = { - { - -- To be removed soon - pattern = "%s*$" .. config.os_id_keyword, - process = function(_, _) - -- Ignore... ID tag - end, - }, - { - dump_prevline = true, - pattern = "^#%s*include", - process = function(line) - line = line .. "\n" - write_line("sysinc", line) - end, - }, - { - dump_prevline = true, - pattern = "^#", - process = function(line) - if line:find("^#%s*if") then - savesyscall = maxsyscall - elseif line:find("^#%s*else") then - maxsyscall = savesyscall - end - line = line .. "\n" - write_line("sysent", line) - write_line("sysdcl", line) - write_line("sysarg", line) - write_line_pfile("syscompat[0-9]*$", line) - write_line("sysnames", line) - write_line_pfile("systrace.*", line) - end, - }, - { - dump_prevline = true, - pattern = "%%ABI_HEADERS%%", - process = function() - if config.abi_headers ~= "" then - local line = config.abi_headers .. "\n" - write_line("sysinc", line) - end - end, - }, - { - -- Buffer anything else - pattern = ".+", - process = function(line, prevline) - local incomplete = line:find("\\$") ~= nil - -- Lines that end in \ get the \ stripped - -- Lines that start with a syscall number, prepend \n - line = trim(line):gsub("\\$", "") - if line:find("^[0-9]") and prevline then - process_syscall_def(prevline) - prevline = nil - end - - prevline = (prevline or '') .. line - incomplete = incomplete or prevline:find(",$") ~= nil - incomplete = incomplete or prevline:find("{") ~= nil and - prevline:find("}") == nil - if prevline:find("^[0-9]") and not incomplete then - process_syscall_def(prevline) - prevline = nil - end - - return prevline - end, - }, -} - -local function process_sysfile(file) - local capentries = {} - local commentExpr = "^%s*;.*" - - if file == nil then - print "No file" - return {} - end - - local fh = io.open(file) - if fh == nil then - print("Failed to open " .. file) - return {} - end - - local function do_match(nextline, prevline) - local pattern, handler, dump - for _, v in pairs(pattern_table) do - pattern = v.pattern - handler = v.process - dump = v.dump_prevline - if nextline:match(pattern) then - if dump and prevline then - process_syscall_def(prevline) - prevline = nil - end - - return handler(nextline, prevline) - end - end - - abort(1, "Failed to handle: " .. nextline) - end - - local prevline - for nextline in fh:lines() do - -- Strip any comments - nextline = nextline:gsub(commentExpr, "") - if nextline ~= "" then - prevline = do_match(nextline, prevline) - end - end - - -- Dump any remainder - if prevline ~= nil and prevline:find("^[0-9]") then - process_syscall_def(prevline) - end - - assert(io.close(fh)) - return capentries -end - -local function get_mask(flags) - local mask = 0 - for _, v in ipairs(flags) do - if known_flags[v] == nil then - abort(1, "Checking for unknown flag " .. v) - end - - mask = mask | known_flags[v] - end - - return mask -end - -local function get_mask_pat(pflags) - local mask = 0 - for k, v in pairs(known_flags) do - if k:find(pflags) then - mask = mask | v - end - end - - return mask -end - -local function strip_arg_annotations(arg) - arg = arg:gsub("_Contains_[^ ]*[_)] ?", "") - arg = arg:gsub("_In[^ ]*[_)] ?", "") - arg = arg:gsub("_Out[^ ]*[_)] ?", "") - return trim(arg) -end - -local function check_abi_changes(arg) - for k, v in pairs(known_abi_flags) do - local exprs = v.exprs - if abi_changes(k) and exprs ~= nil then - for _, e in pairs(exprs) do - if arg:find(e) then - return true - end - end - end - end - - return false -end - -local function process_args(args) - local funcargs = {} - local changes_abi = false - - for arg in args:gmatch("([^,]+)") do - local arg_abi_change = check_abi_changes(arg) - changes_abi = changes_abi or arg_abi_change - - arg = strip_arg_annotations(arg) - - local argname = arg:match("([^* ]+)$") - - -- argtype is... everything else. - local argtype = trim(arg:gsub(argname .. "$", ""), nil) - - if argtype == "" and argname == "void" then - goto out - end - - -- is64bittype() needs a bare type so check it after argname - -- is removed - changes_abi = changes_abi or (abi_changes("pair_64bit") and is64bittype(argtype)) - - argtype = argtype:gsub("intptr_t", config.abi_intptr_t) - argtype = argtype:gsub("semid_t", config.abi_semid_t) - if isptrtype(argtype) then - argtype = argtype:gsub("size_t", config.abi_size_t) - argtype = argtype:gsub("^long", config.abi_long); - argtype = argtype:gsub("^u_long", config.abi_u_long); - argtype = argtype:gsub("^const u_long", "const " .. config.abi_u_long); - elseif argtype:find("^long$") then - argtype = config.abi_long - end - if isptrarraytype(argtype) and config.abi_ptr_array_t ~= "" then - -- `* const *` -> `**` - argtype = argtype:gsub("[*][ ]*const[ ]*[*]", "**") - -- e.g., `struct aiocb **` -> `uint32_t *` - argtype = argtype:gsub("[^*]*[*]", config.abi_ptr_array_t .. " ", 1) - end - - -- XX TODO: Forward declarations? See: sysstubfwd in CheriBSD - if arg_abi_change then - local abi_type_suffix = config.abi_type_suffix - argtype = argtype:gsub("(struct [^ ]*)", "%1" .. - abi_type_suffix) - argtype = argtype:gsub("(union [^ ]*)", "%1" .. - abi_type_suffix) - end - - if abi_changes("pair_64bit") and is64bittype(argtype) then - if #funcargs % 2 == 1 then - funcargs[#funcargs + 1] = { - type = "int", - name = "_pad", - } - end - funcargs[#funcargs + 1] = { - type = "uint32_t", - name = argname .. "1", - } - funcargs[#funcargs + 1] = { - type = "uint32_t", - name = argname .. "2", - } - else - funcargs[#funcargs + 1] = { - type = argtype, - name = argname, - } - end - end - - ::out:: - return funcargs, changes_abi -end - -local function handle_noncompat(sysnum, thr_flag, flags, sysflags, rettype, - auditev, syscallret, funcname, funcalias, funcargs, argalias) - local argssize - - if flags & known_flags.SYSMUX ~= 0 then - argssize = "0" - elseif #funcargs > 0 or flags & known_flags.NODEF ~= 0 then - argssize = "AS(" .. argalias .. ")" - else - argssize = "0" - end - - write_line("systrace", string.format([[ - /* %s */ - case %d: { -]], funcname, sysnum)) - write_line("systracetmp", string.format([[ - /* %s */ - case %d: -]], funcname, sysnum)) - write_line("systraceret", string.format([[ - /* %s */ - case %d: -]], funcname, sysnum)) - - if #funcargs > 0 and flags & known_flags.SYSMUX == 0 then - write_line("systracetmp", "\t\tswitch (ndx) {\n") - write_line("systrace", string.format( - "\t\tstruct %s *p = params;\n", argalias)) - - - local argtype, argname, desc, padding - padding = "" - for idx, arg in ipairs(funcargs) do - argtype = arg.type - argname = arg.name - - argtype = trim(argtype:gsub("__restrict$", ""), nil) - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - write_line("systracetmp", "#ifdef PAD64_REQUIRED\n") - end - -- Pointer arg? - if argtype:find("*") then - desc = "userland " .. argtype - else - desc = argtype; - end - write_line("systracetmp", string.format( - "\t\tcase %d%s:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", - idx - 1, padding, desc)) - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - padding = " - _P_" - write_line("systracetmp", "#define _P_ 0\n#else\n#define _P_ 1\n#endif\n") - end - - if isptrtype(argtype) then - write_line("systrace", string.format( - "\t\tuarg[a++] = (%s)p->%s; /* %s */\n", - config.ptr_intptr_t_cast, - argname, argtype)) - elseif argtype == "union l_semun" then - write_line("systrace", string.format( - "\t\tuarg[a++] = p->%s.buf; /* %s */\n", - argname, argtype)) - elseif argtype:sub(1,1) == "u" or argtype == "size_t" then - write_line("systrace", string.format( - "\t\tuarg[a++] = p->%s; /* %s */\n", - argname, argtype)) - else - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - write_line("systrace", "#ifdef PAD64_REQUIRED\n") - end - write_line("systrace", string.format( - "\t\tiarg[a++] = p->%s; /* %s */\n", - argname, argtype)) - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - write_line("systrace", "#endif\n") - end - end - end - - write_line("systracetmp", - "\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") - if padding ~= "" then - write_line("systracetmp", "#undef _P_\n\n") - end - - write_line("systraceret", string.format([[ - if (ndx == 0 || ndx == 1) - p = "%s"; - break; -]], syscallret)) - end - local n_args = #funcargs - if flags & known_flags.SYSMUX ~= 0 then - n_args = 0 - end - write_line("systrace", string.format( - "\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", n_args)) - write_line("systracetmp", "\t\tbreak;\n") - - local nargflags = get_mask({"NOARGS", "NOPROTO", "NODEF"}) - if flags & nargflags == 0 then - if #funcargs > 0 then - write_line("sysarg", string.format("struct %s {\n", - argalias)) - for _, v in ipairs(funcargs) do - local argname, argtype = v.name, v.type - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - write_line("sysarg", "#ifdef PAD64_REQUIRED\n") - end - write_line("sysarg", string.format( - "\tchar %s_l_[PADL_(%s)]; %s %s; char %s_r_[PADR_(%s)];\n", - argname, argtype, - argtype, argname, - argname, argtype)) - if argtype == "int" and argname == "_pad" and abi_changes("pair_64bit") then - write_line("sysarg", "#endif\n") - end - end - write_line("sysarg", "};\n") - else - write_line("sysarg", string.format( - "struct %s {\n\tsyscallarg_t dummy;\n};\n", argalias)) - end - end - - local protoflags = get_mask({"NOPROTO", "NODEF"}) - if flags & protoflags == 0 then - local sys_prefix = "sys_" - if funcname == "nosys" or funcname == "lkmnosys" or - funcname == "sysarch" or funcname:find("^freebsd") or - funcname:find("^linux") then - sys_prefix = "" - end - write_line("sysdcl", string.format( - "%s\t%s%s(struct thread *, struct %s *);\n", - rettype, sys_prefix, funcname, argalias)) - write_line("sysaue", string.format("#define\t%sAUE_%s\t%s\n", - config.syscallprefix, funcalias, auditev)) - end - - write_line("sysent", - string.format("\t{ .sy_narg = %s, .sy_call = (sy_call_t *)", argssize)) - - if flags & known_flags.SYSMUX ~= 0 then - write_line("sysent", string.format( - "nosys, .sy_auevent = AUE_NULL, " .. - ".sy_flags = %s, .sy_thrcnt = SY_THR_STATIC },", - sysflags)) - elseif flags & known_flags.NOSTD ~= 0 then - write_line("sysent", string.format( - "lkmressys, .sy_auevent = AUE_NULL, " .. - ".sy_flags = %s, .sy_thrcnt = SY_THR_ABSENT },", - sysflags)) - else - if funcname == "nosys" or funcname == "lkmnosys" or - funcname == "sysarch" or funcname:find("^freebsd") or - funcname:find("^linux") then - write_line("sysent", string.format( - "%s, .sy_auevent = %s, .sy_flags = %s, .sy_thrcnt = %s },", - funcname, auditev, sysflags, thr_flag)) - else - write_line("sysent", string.format( - "sys_%s, .sy_auevent = %s, .sy_flags = %s, .sy_thrcnt = %s },", - funcname, auditev, sysflags, thr_flag)) - end - end - - write_line("sysent", string.format("\t/* %d = %s */\n", - sysnum, funcalias)) - write_line("sysnames", string.format("\t\"%s\",\t\t\t/* %d = %s */\n", - funcalias, sysnum, funcalias)) - - if flags & known_flags.NODEF == 0 then - write_line("syshdr", string.format("#define\t%s%s\t%d\n", - config.syscallprefix, funcalias, sysnum)) - write_line("sysmk", string.format(" \\\n\t%s.o", - funcalias)) - -- yield has never been exposed as a syscall - if funcalias == "yield" then - return - end - if funcalias ~= "exit" and funcalias ~= "vfork" then - write_line("libsysmap", string.format("\t_%s;\n", - funcalias)) - end - write_line("libsysmap", string.format("\t__sys_%s;\n", - funcalias)) - - if flags & known_flags.SYSMUX == 0 then - local argstr_type = "" - local argstr_var = "" - local comma = "" - if #funcargs == 0 then - argstr_type = "void" - argstr_var = "void" - end - for _, v in ipairs(funcargs) do - local argname, argtype = v.name, v.type - argstr_type = argstr_type .. comma .. argtype - argstr_var = argstr_var .. comma .. argtype .. " " .. argname - comma = ", " - - -- Accumulate a list of struct types for - -- forward decls. We can't do this in - -- process_args because we don't want compat - -- types in userspace even as no-op. - if isptrtype(argtype) then - local is_struct = false - for word in argtype:gmatch("[^ *]+") do - if is_struct then - structs[word] = word - break - end - if word == "struct" then - is_struct = true - -- next word is the name - end - end - end - end - write_line("libsys_h_type", - string.format("typedef %s (__sys_%s_t)(%s);\n", - syscallret, funcalias, argstr_type)) - write_line("libsys_h_func", - string.format("%s __sys_%s(%s);\n", *** 746 LINES SKIPPED *** From nobody Thu Oct 31 00:41:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf4tr05lwz5Zd1j; Thu, 31 Oct 2024 00:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf4tq6l0Xz4Zv0; Thu, 31 Oct 2024 00:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7kYkb74VxoQll2dXoROfqqgO5nN4OTFza9mhYivvwo=; b=nGxcHFYlBYLWXPY5tw7ueDuMaZxey3PToHvjIz0TcWtQ0ZsG9T1etONLjsq4UfEiyQx01K PNRxYJXKxZhIQyaCdNCv/Y4XD01CpHoig0+5pE+BdYFlnkDHGetwy9EXQUit8jR3heWz1n SZe60dEY3seVAapjX8Tjk1Y1F+R6SoDGwux/37t4uxWCK3QZjuIKsYF0ELQRWdOrfdYlEM WoSnB/sjv08hZXVfNJn60+fQiv3QWHlPllR/rQ1C6WhoJl6aBaOnnIZ7tR5wNOR+9P/re1 SYHbUn72+PaphYM67N4QtFJyaAdx5Alvio5/DRLuisozSqs3xVTsZgC9a2o/vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7kYkb74VxoQll2dXoROfqqgO5nN4OTFza9mhYivvwo=; b=YKTbHWCVISl7LAQkeSekF9/sx9IPnroIETEMnv2cry7oVSXWscdkCNgoDe0NGR51SE75gS N5kaPD9Gm32h6FB4iVlVy0SX015Z5FHy+++9AfekOtW5VwLwFIobHOIe2mNS8Z06Q12JK+ Xp+4TzHI4yyLEsvPrJSHJ+676QUcplY+kzEmTvYncyD1zOl6+Mqo7MKh7I/iQCtZnesRbR pkHNHzufZ4PXWrs4fQXWDpIcS8pU/jw7F/+5FyBmhxC9rW5gowlXrDGBKjH5Gig+ceAHiP 48LNj7zx8GcXXplbG/tDmwDoqFIOMYXmqpxyPZl/Lc2oTK+OHUH3HjrZlR8H6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335299; a=rsa-sha256; cv=none; b=BPtqsaZENnDVFNcOGuRNaue4CWN0BWLNFfVAS/Z43eaaC4iZ5WIgYo1rqKyDKJxzx3kjf6 fY6Fj5OLFrymmlGPtBCaJcpl+IlSjc4jLdwUOZ2Glw+xVtv86xGB3fhsJK4H0Jmc/wxIVJ vGAh8mIvwiSfnhux/T50MCimXU/N0gPc4StDKhBqSTttvxVPfJYTYBLrckY05/uM54i3+V UiJpRYYObENCeQxXteu/f7xkhpSsdNKpYaexrFvREonJCQS6lOi40K+FdEZRGsTlh/piHU saXAyarhBGujdEFWC4pDu7R0CGb5GrgkEF8Mi3C0OB6OwYLpfNm0R33qTTxiGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf4tq6L5BzFP1; Thu, 31 Oct 2024 00:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0fdQY055565; Thu, 31 Oct 2024 00:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0fdvW055560; Thu, 31 Oct 2024 00:41:39 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:41:39 GMT Message-Id: <202410310041.49V0fdvW055560@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: d0f9b0bd19bf - main - malloc(9): assert wait flags. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: d0f9b0bd19bf5dc4031164fd26c5bbc4bab1cc74 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d0f9b0bd19bf5dc4031164fd26c5bbc4bab1cc74 commit d0f9b0bd19bf5dc4031164fd26c5bbc4bab1cc74 Author: Dag-Erling Smørgrav AuthorDate: 2024-10-31 00:19:48 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-10-31 00:19:48 +0000 malloc(9): assert wait flags. The check introduced in d3c11994e1e3 was bogus, combining a non-atomic “once” flag with an equally non-thread-safe ppsratecheck. Rather than fix it, just assert what it attempts to enforce: that the malloc flags must include exactly one of M_WAITOK and M_NOWAIT. Fixes: d3c11994e1e3de7445305abd0d41dce2b8d3e6dc Sponsored by: Klara, Inc. Reviewed by: olce, kevans Differential Revision: https://reviews.freebsd.org/D47309 --- sys/kern/kern_malloc.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 9d7e0464e0f7..b1347b15e651 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -524,27 +524,13 @@ static int malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, int flags) { -#ifdef INVARIANTS - int indx; - KASSERT(mtp->ks_version == M_VERSION, ("malloc: bad malloc type version")); - /* - * Check that exactly one of M_WAITOK or M_NOWAIT is specified. - */ - indx = flags & (M_WAITOK | M_NOWAIT); - if (indx != M_NOWAIT && indx != M_WAITOK) { - static struct timeval lasterr; - static int curerr, once; - if (once == 0 && ppsratecheck(&lasterr, &curerr, 1)) { - printf("Bad malloc flags: %x\n", indx); - kdb_backtrace(); - flags |= M_WAITOK; - once++; - } - } + KASSERT((flags & (M_WAITOK | M_NOWAIT)) != 0, + ("malloc: flags must include either M_WAITOK or M_NOWAIT")); + KASSERT((flags & (M_WAITOK | M_NOWAIT)) != (M_WAITOK | M_NOWAIT), + ("malloc: flags may not include both M_WAITOK and M_NOWAIT")); KASSERT((flags & M_NEVERFREED) == 0, ("malloc: M_NEVERFREED is for internal use only")); -#endif #ifdef MALLOC_MAKE_FAILURES if ((flags & M_NOWAIT) && (malloc_failure_rate != 0)) { atomic_add_int(&malloc_nowait_count, 1); From nobody Thu Oct 31 00:50:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf54n1yqmz5Zds5; Thu, 31 Oct 2024 00:50:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf54m6Thkz4bVT; Thu, 31 Oct 2024 00:50:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9DwGQNcv6suPFh224PYtjHuhYS5Qk+Jmcono9jOjpo=; b=Exc3nsQkk51jhE30xpDvM2kYKHp2sEWb+uCdT0j3dbmz+nHrRsHd5f/gPOLpexgDXKeBjh 0lt+zMKj0G3hNq3Xr4jhkS7tzDouHqfTAlhLNcG7RfbX99DDgHnbKIQvx+Zksb/jWiuzY0 Y7hNTVf3/0k3izDz7UYf02Ubr5661gxNDyFT4XSJNnFfCukle3OglA7oqzngxJ8ZN7K4aM jz5lFIwQk91aQ8msFoErr/LZOubBg16tIlb4oOI+eTSU4Dbwbw3SYoGf6qHiB7bsELv1QW PopA8696cAqSY1DRaZwjF6xearw/iUFNwCDPY8ovbr97lyQFdt0uekBdfxYzZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9DwGQNcv6suPFh224PYtjHuhYS5Qk+Jmcono9jOjpo=; b=vRUF2EvhLsVfPeQQxy3l8AiC0hBtRCwBW3HKdao4AXIAfdsfwNMgYvsiRg9cUkoJV9yNoV NORi0Zqs00X5owqBk3qIlgBB6qX6hFsIgbPQIbi6jLnukttY4JUAwdLEZSBd8EztEySMLV VXe/RIvaXeshuc00LwtwMYOeIyDJu383VfXDNnV4peribY4fAk+jFmS5B2uTZ+HVhtnW3+ iSX4LS3C7QeeoXKW/UIXOvVd49sceC7KZ4z4dxj2yExukgAqP8knBiHJu++hLFk43/KlKJ JMh8KuEAOgy31j+UN/KOBC4knHSL2QU19mLBv6Hc9hDMrQdInW77OQwMF77K7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335816; a=rsa-sha256; cv=none; b=bAn7RmtHX5re8j9Ohn1sJc1dwVUDl6UuEjES92xuhf/lQTDAxNZcouEQJgMekX1/3YaFIb FgFxa38srn4Qk+6rlsZ6cn8MHyex0Exd2h2bUG0RTu29BEzP0O2O0pRbAspd/WTBCZOz0Q HSGzVhtyetLzJ1VOCQ7qtdoeprORgGxSdB/sg67urfdjsymRp+uj5ECeFf+PsM4vN+gdTg p46573VUsC4oqLvcFPYrSrC6zFYSFbDAfevOK99uizLbFW/DDUzneoecPY3UYk/d76l0FY Yze8zuUNC+AbrxAqsVzws1JfkW/vNx3hdjW6+BDbPLrZ14mKk1cc7oI/f2YhXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf54m5nfFzFSt; Thu, 31 Oct 2024 00:50:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0oGna068468; Thu, 31 Oct 2024 00:50:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0oG72068460; Thu, 31 Oct 2024 00:50:16 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:50:16 GMT Message-Id: <202410310050.49V0oG72068460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0658879d03d1 - stable/14 - ixl.4 + ice.4: intro sentence for HARDWARE notes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0658879d03d1cfb05da7f1bc497b2120a997cb0f Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=0658879d03d1cfb05da7f1bc497b2120a997cb0f commit 0658879d03d1cfb05da7f1bc497b2120a997cb0f Author: Alexander Ziaee AuthorDate: 2024-10-27 07:16:19 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:49:16 +0000 ixl.4 + ice.4: intro sentence for HARDWARE notes Pull Request: https://github.com/freebsd/freebsd-src/pull/1495 (cherry picked from commit f4bd011a382269965a4f75aa01b6e6b1ce2a3eba) --- share/man/man4/ice.4 | 5 ++++- share/man/man4/ixl.4 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 index da46c758479c..63fdb244f3ed 100644 --- a/share/man/man4/ice.4 +++ b/share/man/man4/ice.4 @@ -114,7 +114,10 @@ Update Utility for Intel Network Adapter 800 series; installed by the package. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +The +.Nm +driver supports the Intel Ethernet 800 series. +Most adapters in this series with SFP28/QSFP28 cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index bd183be48cd2..fb9d519b22a8 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -116,7 +116,10 @@ kernel; install the package for the latest driver. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 700 Series with SFP+/SFP28/QSFP+ cages +The +.Nm +driver supports the Intel Ethernet 700 series. +Most adapters in this series with SFP+/SFP28/QSFP+ cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. From nobody Thu Oct 31 00:50:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf54m0Qwcz5Zdgn; Thu, 31 Oct 2024 00:50:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf54l5jpTz4bZT; Thu, 31 Oct 2024 00:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LFP5e4RsdSauDhsjghHnaNQPYXw4m/qAWUTgTFhBepY=; b=ykbsfRQP6gLAiI0gs++/aYHlL9bUYlc/LgrOEEupN8geuS5TZ3uVVW8pOLVClKWy4vkSQH MIgEyyT/GFoA+vC/TWDNk9JSictU830AUwuP/iNhZXqzxIQCoN8qsbAEFfO4NQPmuSiRSI 1XEZkh3F+jPhcV4mQyz97p3EqQ4CNMImTYDZY80JKQFPmGDigm4JzJdycGsE845dQ06Qzb Hd4C7Rq7uicwTJmpkNgzjLyAp+R3fVqxuSOEU0fBW625NFcnsSl5qrAhzAfyPhbyojqvMO t3ttrOw+Ll2rAZIJwx7ty3aIzI1kdECYS6rB/Reue2TflNWZ/FlMlcmRQ7I6ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LFP5e4RsdSauDhsjghHnaNQPYXw4m/qAWUTgTFhBepY=; b=Kt1mw2TjD4a1rgX6Np7INEsVFA/VcKwBkKs4OK0yVPvBfsFKV6Mb+qAnQt3VxGSw0d/TpJ 4OHaDgb4wGz5uRMAtlMxRVgXTzH5sTSG2XVFfezeetuUBc6bhfxeYB31TKRP7mwOfog1j6 XOATa+dwkK7rUXaixvb+8mhNUV/66w3+jycBA9a3mJUpooqL+zYPXATJLGE8NvgPIqvpLz +/CGcukcyNPsHUQWARDEsa1nOMwkaJMBJ8BZm0cMqc4Mm401EmHUun4LiIPAgS0yyI523g I9qh5S2yEdr3BUTOW/w1BRPNpPGeYreZ2N/QgmtZLfxL2Hwmsx5kgIx09P5iWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335815; a=rsa-sha256; cv=none; b=wJLhK4ZRZeJ8pbbYTf64OQKb+xz+IvNqf+yj7ESjR+I8pRwk6KJ/DQsMGc+5Ehe6Sua1M4 XH2dcVS1CiFs23cBt3JVmELzIXa7HZhPbkkBjUKYaCX93Y+67isDxtSyrj/mO+vrfTccHz KFrKHWAXmU4ghJaY2wFEcaAl49NCQ8PeK3nCh/ZQVh4anzCnllGZmJjn3oyEzneLOhal/u vPFe4jN5RsiFgXLXJVTEbKnSkCO7XqT/R6IGkSE5lR6mnJWma+CvxOVorfbxU7yQeTC8gt GvwyrTdp/5hIrc6fUxQsGduVSaBaeg615pHdJu4pkiLX8GbV+Tr/xxtnH5NCzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf54l5GjjzFQP; Thu, 31 Oct 2024 00:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0oFGD067788; Thu, 31 Oct 2024 00:50:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0oFDM067783; Thu, 31 Oct 2024 00:50:15 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:50:15 GMT Message-Id: <202410310050.49V0oFDM067783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b488667a1072 - stable/14 - liquidio.4: remove extra search keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b488667a107283807edef3598c3c9efa9fd78c20 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b488667a107283807edef3598c3c9efa9fd78c20 commit b488667a107283807edef3598c3c9efa9fd78c20 Author: Alexander Ziaee AuthorDate: 2024-10-27 17:26:02 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:49:03 +0000 liquidio.4: remove extra search keywords Approved by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1500 (cherry picked from commit a1d1b9049bcbe02a49f0f143ca9ecdc54ea31d3b) --- share/man/man4/liquidio.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/liquidio.4 b/share/man/man4/liquidio.4 index 4713863c398f..27372e606212 100644 --- a/share/man/man4/liquidio.4 +++ b/share/man/man4/liquidio.4 @@ -34,7 +34,7 @@ .Os .Sh NAME .Nm liquidio -.Nd "Cavium 10Gb/25Gb Ethernet driver for the FreeBSD operating system" +.Nd Cavium 10Gb/25Gb Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your From nobody Thu Oct 31 00:50:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf54p3PBFz5Zdpc; Thu, 31 Oct 2024 00:50: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf54p04HKz4bjF; Thu, 31 Oct 2024 00:50:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JwKuSv4P30ouGuJq4z1pcxDY4YZhKfsDWJSxzOFJJjU=; b=P27W1c1hqvo8dGBblgYHaM5RISZ0KB07Kp0NqZlxbX75VeupTuqdmUytxfkD6PJCtORtd9 bShIkq1kHwOkbv92oBnlUdyaTjI2ETTbdUguiVKpOZo/a7RZQp+tiNDkontK1KJtOo9cj7 4+tUotXLK/5lHKHmP+E7fiaiVvcu31EqC3yfFKJr6aQfTAJ0nRPTU1knHKbQb4MVUqimKo 1jrMOVHZXtwmWkeoVZNaaLjlrgZRUpO93a/Axqr3g41O5ZJsil3vo77QZ6OB6+fvnYecfW gdCA2C3GaqLiyskt3xFRci+73MzAv4pKhn3XVvGLjBXwwMyp7UFzQmQpeAYS6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JwKuSv4P30ouGuJq4z1pcxDY4YZhKfsDWJSxzOFJJjU=; b=xUqzkk/NaEAioQLZfUrc7ptB9cKdo2QS6p2yH25V3j3zOSW5uqQLEmx3WaljhQruFNNb6z T0A/V3j192WB8ZZAwo5nTfogtxiU9qkZqmPMKam06B0ok6me84QsO657rFx5H0CxlpmOgG ybaRMm5bLRt7yA0SAbG/ajsEtLZmtdEzdBlDTIfwkooUuhmYtjUsjVw0SmX6525BO0B+fi xpm1nFrhGzw9+C/Lc3mvfvqMFTNMB0PfubUK1LDJZphEn5iLVmRgsDb1OADE7RBQTiA1xu +zdQDSC9UIqfEPBNJBjr8zMSrVNdzLF3FUhF0Nk+pZHXdD1wPoAr9BFXRmMd+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335818; a=rsa-sha256; cv=none; b=EWhhcH7X4jeQqjwH9OXNv3eKEztXsqnETn/QmWH+mWmS9schG/UWxvnEts7m/2g8AOZlDo faEFEhM6uxXX7sRSiSSPGT5QfSYVWEVhnaSi5q7Z+XZ05ZJ3sK1Eeyht2zllpQergr2xF/ zlFvxJULnH1i91RH2C1Vmmp70ky3ptV5tz4c84sK/vEItkgVEpPiK1DWm04Asn8lDvVHzT 6IRb9TPBxYMDSXvoUH3DirRTE0tKA8p1PMAtl+DM+e4AsC8FbM43Fp/HNgcyRW/jL1PLlC /XwucXFU/PKh5+UnXXL8LRqdMt0juXcayZVcV9E5KX6g7QPUgfulp1zuh5BgOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf54n6mfzzDvP; Thu, 31 Oct 2024 00:50:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0oHLj069082; Thu, 31 Oct 2024 00:50:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0oHT3069079; Thu, 31 Oct 2024 00:50:17 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:50:17 GMT Message-Id: <202410310050.49V0oHT3069079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: bba78206c51d - stable/14 - if_ffec: fix imx6sx compatible flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bba78206c51d474825edd1ee9417757c0a6af290 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=bba78206c51d474825edd1ee9417757c0a6af290 commit bba78206c51d474825edd1ee9417757c0a6af290 Author: Gary Bisson AuthorDate: 2024-10-17 09:55:54 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:49:30 +0000 if_ffec: fix imx6sx compatible flags The i.MX 6 SoloX does support Gigabit and AVB features as can be seen in its technical reference manual [1] or even Linux kernel [2]. Fixes: 94bc2117b4a ("Add i.MX 8M Quad support") [1] https://www.nxp.com/webapp/Download?colCode=IMX6SXRM [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/freescale/fec_main.c?h=linux-6.6.y#n206 Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson (cherry picked from commit c222619cd4807e9e0274e6fadcbe259cf5cabc26) --- sys/dev/ffec/if_ffec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 1a1993c22be7..1a562b149f61 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -121,7 +121,8 @@ static struct ofw_compat_data compat_data[] = { {"fsl,imx53-fec", FECTYPE_IMX53}, {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE }, {"fsl,imx6ul-fec", FECTYPE_IMX6 | FECFLAG_RACC }, - {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC }, + {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | + FECFLAG_AVB }, {"fsl,imx7d-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | FECFLAG_AVB }, {"fsl,mvf600-fec", FECTYPE_MVF | FECFLAG_RACC }, From nobody Thu Oct 31 00:50:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf54q3P1rz5Zdm9; Thu, 31 Oct 2024 00:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf54q0WvTz4bXM; Thu, 31 Oct 2024 00:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7sD6s6OOdDPe1itSDm9elwQQAbzDnmhYIDyCeA+Onw=; b=ywRKtmo8YEREyH+8DrwKeP7cyx5zZ4+z0a/4VK8QTWjnDiv7KGVQwpp+mxh8xwzHTl0ZhK IRqsLnNHoxIotm1m4i38byLjIm137rVyHqbuPHQQTAdHcHal0WyEYK0kEabpKeAAvRyq2B FPF4iTIzncRXSVJAI9HJz8QPZjOCnE+uZ8OcogkbXI5dQZgFMI+tZKjCLaicdIjSZ1CcTq FuyrQeWw2l19G9e0b1YxNn3LZflXM9mtLks1tdqL32fntBeBWS0UXwkcvgrp785bpy5E84 rOQo4QQScNFyE5L09ZDl1iRL39n3urGe2oADcKqtWbC1LdXmnHBiI20MizY9xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7sD6s6OOdDPe1itSDm9elwQQAbzDnmhYIDyCeA+Onw=; b=XS0mGg5fPai3tpfm8tPaTlGzapy5Tnv4yikxrWomoazKkwnTj4Kf5LX1TOG/bFUoXIeKUf LpTSiAbz6ly1pJDfUTUjgwyQge5qzyV4ZgSvkY0jiX+BVrjAD5BdhE3TC+eoGGOs4YaaaU EZqOrGfi60Kltner0GqVGNJd4vEJkrOgPKz6SUYVJcwofjZy5rwfLR9SuvvNcQPy5vPE/f qbVNQLdcYipOUhRYrxlCMEgbnORJ5DpIZZt0tg7Ci0WmdBZnbF9iFxcjqa3E68uyU9LlPA MC7IGNR/v/Jbuj91/aH7UZ8aEQTAF89ItXeSSYyqzNA2wrJX2/TNjTLB2P5Lxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335819; a=rsa-sha256; cv=none; b=Y9Qc6Dx+JEPMFTRS35EtllqiPlhSwfuE98SZaYOsKyXBm/Y131yBcN3gbl4BeZVz+zoRW1 PhQ/x22lGKigSLRygSloxOPvPgrOKtA0GQbdfmhXVUjEO1jdhcSmBKI1S4nBxaPn7Dzyy2 UImEPvXwmjJgwtr0iH7RlnJqkd0wcIIe/S9FUCQZNX2bhYuVyBreMPRviRnK81B0ZkMl8G pyp8eL1mko0HmxtXvtFngiq362gfc6vttUEJFyH1EtMe8Jr3RlHMAyBMsJyeB1gi3eMBXq Yh9IZ3Bcnd4CUqCKdvTuyTto2SXlXBJ6qlDUfjnwR1gXu6m7XjFucBEGoKqvDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf54q075XzFSv; Thu, 31 Oct 2024 00:50:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0oImM069129; Thu, 31 Oct 2024 00:50:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0oIrC069126; Thu, 31 Oct 2024 00:50:18 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:50:18 GMT Message-Id: <202410310050.49V0oIrC069126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b99bb1c7adbe - stable/14 - if_ffec: fix MAC address bootverbose print List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b99bb1c7adbe569c4b6bc454bb2d5a80ecc65773 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b99bb1c7adbe569c4b6bc454bb2d5a80ecc65773 commit b99bb1c7adbe569c4b6bc454bb2d5a80ecc65773 Author: Gary Bisson AuthorDate: 2024-10-17 10:02:48 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:49:45 +0000 if_ffec: fix MAC address bootverbose print Remove extraneous colon at the end. Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson (cherry picked from commit 6a7aa5530c0d860c98c982968ac27728daaac7aa) --- sys/dev/ffec/if_ffec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 1a562b149f61..17fab283fc81 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -968,7 +968,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, uint8_t *hwaddr) if (bootverbose) { device_printf(sc->dev, - "MAC address %02x:%02x:%02x:%02x:%02x:%02x:\n", + "MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); } From nobody Thu Oct 31 00:50:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf54r3Cn4z5Zddf; Thu, 31 Oct 2024 00:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf54r1jNfz4bVl; Thu, 31 Oct 2024 00:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nV3yFVniWevhNiQhMbWvyhh2pm+QGDwe7wgFwj3/Dwo=; b=uYzejBjvhYBCQQQ+yTIezyMrt4sEcpmOgvbMcGnHudVMiIp39pV1EShLsO0YhVURjPvrnU mN+TNKP2QqucJpMHVCBwGLy62j35D10/f3PnRxUMVQUJVoQzGiliTV9XQIr47RSkIBTCOC cPRUfFl0bHcOQ0SKE8PnG3YtFdV+XxOyAtvPPcJ1axVQCR2Us8zZZFASYwO+W7lhgLmj7J psjODmKXPiz2cpqn5iRArjxV3Qy8JtsY0TFqkxv3h8kDW5a/4Ffxpv6DWQt4p4xyRMb+gU UB+WAaFsPuQIvTsUYY8+yd28b9+Drdok7H4FNFU/vO8d+Qb7KEsehYtW+GagoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730335820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nV3yFVniWevhNiQhMbWvyhh2pm+QGDwe7wgFwj3/Dwo=; b=cwdGh/9WYPMofxpwzYLZ9iH83UTzqP5GWzxBJPVmfkqzy5yZdy9Z8QCf8qLN63xG8LafDz cAonB4yxeXadQQ1e3IsotmLrlK/8M2egJpqVltCJJqP/P7sojq6j5sbwoGRoHMH95Pbi76 6AR6bG6B/zmwMlekGjDs9WT3JfmgGzcAi9558eJD5Bm1MteDKYdsF1Xj4SPGBHM6sWas7R zrFW0PL8rwz09yB0LQhE5YgaU/TfJd4zhnaJJlcmvymsOn36F+fBPC7xtT7mOK2ozhMdGa veIyCBmLGS3/TPFx+qwPVOfveK8sTzhU6iA69v9IK/2Vi3L7sF+A19mEzhvfVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730335820; a=rsa-sha256; cv=none; b=yCJxF0N9U/wvOpjfGA04VrODY/LBDflqZdanwyxJfS4QHYl44DKE0Ip1Z2bhD//OLO6R/e ANFYNxTB/r4lxEkKn5kme4zIO+7a1ZfRwkNcTbczpCFRY3XvY2iGNuVz0zQ9JpDkJz0IF/ flrZf8rY0q5OYojdt1CXomCGxwAluKj/tGsIwPAQa7+fBnwTJ8BzDZjubjf6u+HxSqjxqo n0FQtPLUfZYP3jInG7KvQAa7necO5l2SWeZtxUBtd/+iFta5LqYfpSeCfd70mXNfre4YXn YJ6tPl/b2+xjYviivlSEK7JWO3QmvetlxwCzsbPhUP2815aBqYLp5WghW/MeNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf54r1K6RzDvQ; Thu, 31 Oct 2024 00:50:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0oKNH069169; Thu, 31 Oct 2024 00:50:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0oKfX069166; Thu, 31 Oct 2024 00:50:20 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:50:20 GMT Message-Id: <202410310050.49V0oKfX069166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 6fb03ddbce07 - stable/14 - libexec/rc/rc.d/netif: Typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6fb03ddbce076a24808f95846ddfcf0f2b7508bb Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=6fb03ddbce076a24808f95846ddfcf0f2b7508bb commit 6fb03ddbce076a24808f95846ddfcf0f2b7508bb Author: Robert William Vesterman AuthorDate: 2024-10-18 02:54:39 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:49:57 +0000 libexec/rc/rc.d/netif: Typo fix Just fixing a typo ("configuriing" => "configuring"). Pull Request: https://github.com/freebsd/freebsd-src/pull/1484 (cherry picked from commit 65691b2dafda23691c3989749def755a98e731ec) --- libexec/rc/rc.d/netif | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 3da296e97384..f9858ac8d865 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -151,7 +151,7 @@ vnet_down() # netif_common routine # Common configuration subroutine for network interfaces. This -# routine takes all the preparatory steps needed for configuriing +# routine takes all the preparatory steps needed for configuring # an interface and then calls $routine. netif_common() { From nobody Thu Oct 31 00:58:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf5GZ1dwcz5ZfhX; Thu, 31 Oct 2024 00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf5GZ10pbz4f21; Thu, 31 Oct 2024 00:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WWwlQv3/rnuajrHBtf4lZb9YXoaZpP4H0G5OHuGVpTo=; b=uTLt2qqLm/lUSOrUORB4W6QkNFKXvE9GGij2p6wPT5sTK7KZLcygFd4gO6BjpL6HjMViOt JdEcdc5kR5fdtmPQ9mjd6EaH/QIwMmGJD+3j0mxs8QVql5MRofK/HiBYIp97jbx3nupvXq SvqsmrYs+/MGKouArJEX00CIi+CK/WOt7ZTm7bAzEHizaz7RLmuI5DUof/dEYpjL+C5Dyd RZ0TJfNHIXzgBWDnLAqrrzCDBqu0k2sTc7WqU43+OB+akb+43Jg7Q27bzUR0agVNbb1yN/ NpWtQ5S1U49TopTH/n1ZVZrhmucJpLdpsM4dixapAUfoWDmLxjsohx20V41Zpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WWwlQv3/rnuajrHBtf4lZb9YXoaZpP4H0G5OHuGVpTo=; b=QI21hvGgFOV45EcRng1Fm3vxoNLuLki1/4AsVV+K0NOvP/TCYBoad9x3lmUAj5ILSFc0U/ tvmN22cnl4kOLPQNZ3Ov0jtexzJD0YQItJJ2WMCLvBDdQ2IOhYWVEbM6G0de6oBEaH+CwG YLjcj2M6vDyzrdc8iS/xg6aBd/SGd0LBM8rz3r7GPpuHpqBURiIs5vUSFeXiQbf/SsecEj r6Yi0owN/8ztYQ1AFWh9OyuAJ3TSrOFMRQQ76067BdMuLgSg5JSBgKlst04Ge+AvA4kOZs q+HVECuuTAj6V5p0z1240h0/OdAnxO7U7swj2uZGVWgkmWonZZzkLjmAN+f8fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730336326; a=rsa-sha256; cv=none; b=U48TPUUGGnLA1vBr9pM8/uFrixMvws2AfOrTTK/rAGKC5dvLUXk3WQEURx3WuK0wwoe7hP sFWQnEf+dgKhJSXMgHd5NLIzENvGmjDgFk9YaCv4fn0/bW7rMXBKU0PeXKaI3hB1s15bMe XspZoAV/Z2BXrlhcfCbrK9dlpxerfT8P/J5ShsPd5zOrmtB3hFsLcRRZNSgdxcT492xmvl zq/nx89QvngX7Br/LwoLv7y6LpHyS4YMU+Gw3HTh5/FZDbaySuBuN/rtse1NkRSb5D6pID 3yUyBovbDb2upih4nrz0DBZrGL1hkMI4zgn/Cv1yEaQzixksEg6Su9UEYCDkXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf5GZ0TpWzFTm; Thu, 31 Oct 2024 00:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0wjUI079008; Thu, 31 Oct 2024 00:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0wj5N079005; Thu, 31 Oct 2024 00:58:45 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:58:45 GMT Message-Id: <202410310058.49V0wj5N079005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ef0908fd91a0 - stable/13 - liquidio.4: remove extra search keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ef0908fd91a0a4885e075f20c3c923c5ba86229a Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0908fd91a0a4885e075f20c3c923c5ba86229a commit ef0908fd91a0a4885e075f20c3c923c5ba86229a Author: Alexander Ziaee AuthorDate: 2024-10-27 17:26:02 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:57:29 +0000 liquidio.4: remove extra search keywords Approved by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1500 (cherry picked from commit a1d1b9049bcbe02a49f0f143ca9ecdc54ea31d3b) --- share/man/man4/liquidio.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/liquidio.4 b/share/man/man4/liquidio.4 index 8cbe3620f0ad..6b5436f836e7 100644 --- a/share/man/man4/liquidio.4 +++ b/share/man/man4/liquidio.4 @@ -34,7 +34,7 @@ .Os .Sh NAME .Nm liquidio -.Nd "Cavium 10Gb/25Gb Ethernet driver for the FreeBSD operating system" +.Nd Cavium 10Gb/25Gb Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your From nobody Thu Oct 31 00:58:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf5Gb34wcz5ZfhY; Thu, 31 Oct 2024 00:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf5Gb1VdZz4dtJ; Thu, 31 Oct 2024 00:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQ9w5TLSyZMUXlLPS6nHj+BlUeoGXXCx4ChQphRNSto=; b=RASD7jkYFcSW7yBciwvA+KD81TilwU1qpmtzGO20bDfhPZjO4SiKZbSm2xxU6pVOWwd7ky w4d7GiHSQNu52VpMy6JgyGivPJxqfhJmt6G+QfIJjDxmiCQ/qJ1cx8eYPZ6p3pbzB6DDx2 WYxft0R2tUVhVzRTOfacRfk09HoZR5FRZENWv009g2WquqQ8/P9WAD5zRNH7F0u5Y3kfdm BIHq/tj97BuQ0owHe2lo/L3AUMOe5Dog5+HhhHU32YxZTvxaTD/OwP9b9IGJjnRmwxDbc+ zm6oGEKTiP51n186fTZO12DFaPwGY6SMWAeBOP7J/wUe1llzri9C2xtcW/Stbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQ9w5TLSyZMUXlLPS6nHj+BlUeoGXXCx4ChQphRNSto=; b=p74JlPKqr1pS3E4/zIToT3N3S3K4BbyvcuMQ9VSNpdpO+YfqFseJU6IKh+an0ZR7Xxsj+x NWDq61jghlJETzms1Gdwwagb6W6uM+eBA0bxumY1rMxlxc1ea+cFAEdLkDaFbMLQAQ1tAS 2R2ZpDaErF3Repa6Zc5+SnLRca2qmRpk0AHvCaN7UF7M9ei6rbqyOgEpgNiFaes1kxzSbM +afbu2wwWDRytejEg2gmFSHPgEgO5FOaMf4o1DN2Ha6VAqC7hzxOKhVskMIboaTlR/1HBA mPvxlSEsQPzvQiy7AprvVFMdMnFSN3gdGiQ+S5M6CzfNXPHBPv0F26xiWjERyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730336327; a=rsa-sha256; cv=none; b=u2HtMxg7ozWooMAfqyAXHbRHZ0DLwLCnHECP0BvfnAXJTOO0nX6f1acyPW4qB37s/Z07ln scFpgL2WTPwNOf4gtLJitGQM+b6EcRvynSEEIXQx2vNCrGHDdubCvbDiIsXnvOu9iwIMP1 S0MDNzAJEnYzHuPcXs8rRlZrjZQk/LvJKpA+YjIwWXEROeubpMUD4axy9HOZTmBqVDtJaE +CqavRkZ8JMksJWW0UIFkT8dbH1aH7A83GW56i0/4IfeZ59R2HE7MQX6Qqumzfv7DTVrmr uNhG1OncJnjzzSG/5P76JH+4D5yhQVj5Z+8+J+ONQkVFBoVA+xKwHTeV5D2jKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf5Gb16RtzFTn; Thu, 31 Oct 2024 00:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0wlUe079066; Thu, 31 Oct 2024 00:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0wlgI079063; Thu, 31 Oct 2024 00:58:47 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:58:47 GMT Message-Id: <202410310058.49V0wlgI079063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1fc87bcb827f - stable/13 - ixl.4 + ice.4: intro sentence for HARDWARE notes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fc87bcb827fcb6c1e4000bcfe4a25306cbc5cb3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc87bcb827fcb6c1e4000bcfe4a25306cbc5cb3 commit 1fc87bcb827fcb6c1e4000bcfe4a25306cbc5cb3 Author: Alexander Ziaee AuthorDate: 2024-10-27 07:16:19 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:57:41 +0000 ixl.4 + ice.4: intro sentence for HARDWARE notes Pull Request: https://github.com/freebsd/freebsd-src/pull/1495 (cherry picked from commit f4bd011a382269965a4f75aa01b6e6b1ce2a3eba) --- share/man/man4/ice.4 | 5 ++++- share/man/man4/ixl.4 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 index da46c758479c..63fdb244f3ed 100644 --- a/share/man/man4/ice.4 +++ b/share/man/man4/ice.4 @@ -114,7 +114,10 @@ Update Utility for Intel Network Adapter 800 series; installed by the package. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +The +.Nm +driver supports the Intel Ethernet 800 series. +Most adapters in this series with SFP28/QSFP28 cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index bd183be48cd2..fb9d519b22a8 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -116,7 +116,10 @@ kernel; install the package for the latest driver. .El .Sh HARDWARE -Most adapters in the Intel Ethernet 700 Series with SFP+/SFP28/QSFP+ cages +The +.Nm +driver supports the Intel Ethernet 700 series. +Most adapters in this series with SFP+/SFP28/QSFP+ cages have firmware that requires that Intel qualified modules are used; these qualified modules are listed below. This qualification check cannot be disabled by the driver. From nobody Thu Oct 31 00:58:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf5Gc4qPhz5Zfhd; Thu, 31 Oct 2024 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf5Gc2Tm7z4dpY; Thu, 31 Oct 2024 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oICU//wJvmPYEZ3oFN23FShVvps2jY7WwDmxZwBcs9U=; b=ggyU8JmBa+aNUfoNxwhc48wm6Eus2+jaNvraz2em4GZHI4VgUxJPu2WxhxiLCOTy/q9im2 ZuUpf1CtZAB5hLhKuve216O5j9lQxxO3oUGZcHtrowC9d7+tNhvDOENq5HUQ+73ahvvua1 YwpOnym2RY7qSlqIRA4zZkJITpNSRdcO7rFZk3+0C+6g51vmz+w5vlLOurlwlu+XTQuIQb Xvfunco9nCFTTY2leoPKfIlishkBfG/Kbkr8jyr9hjiIqQoWgGZMXg430dZLAzpSx3EdMK 4QLbRWf/XnyihZPssaI9sA+JG3x9IpfTCq6Ai5+v4XPLkHGbJNXEMLXIAC/2Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oICU//wJvmPYEZ3oFN23FShVvps2jY7WwDmxZwBcs9U=; b=MQpQD3UqOAXka3iHPUio+RVrdaJUuof8gUh3f0OOVRgQVdmk3nLWCqR5vdNPQh+b2nHvby J5G4LRq22z0V22I/BiHLx4WbNxmhbRGYy+Jt79ydjDJzbXeB6zaZXZlFcsVIR26ZXH+EN4 706ITxNSVMxdFu0q5KvEzFQss0bcaHJxBEaSFFFb4bjuXCQbe1ETbjfhfzAiYEjeKUBumq oH2bWZmUbgHw1Veq596vlcohjQ2+VvhlDYWqXxq3Dx//EzGQAKhIi6tYdrfa4pIxGIBL36 UkJQUD551Trh+7ghlVSBTFo76Ypbt8IW2/qPy7pws27TF53M1SIVSqT5BcsMBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730336328; a=rsa-sha256; cv=none; b=JQUJwoa4kG0L8ZJEfSmF06ylW1RzzuEPwgkJic6DzIXQ4sPmNE1dk490AOTiFDuanCw4Pq NDAvIaY/+q45ApI4IuMmweqIXLJ7bx9+x9PUdtCAQePvuuPoEXHGMRCYAVGn4JO9lEo9Ki pwdxULh26QrOe71zyAPjM1M7XovQ87FIPOBrAiw7VpJZZ096pYb1lgd5/YE/y38GAoTz4T MHokai6sRU4aYsIPAqjM0rCX6T2SiDBMg6r54S3YEdPbmlEHCEYOcVPlM2pGJNS6Z0SGyj xkXH0RMps6Q0M9IjNaBgvWgQaZ0PqCYzutL/VoLbI8vCPu3Uc7tA2n+mbUxRTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf5Gc26KKzFWs; Thu, 31 Oct 2024 00:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0wmYk079126; Thu, 31 Oct 2024 00:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0wmli079123; Thu, 31 Oct 2024 00:58:48 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:58:48 GMT Message-Id: <202410310058.49V0wmli079123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: a83b4361b363 - stable/13 - if_ffec: fix imx6sx compatible flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a83b4361b363b521447a9425da98fbed69362def Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a83b4361b363b521447a9425da98fbed69362def commit a83b4361b363b521447a9425da98fbed69362def Author: Gary Bisson AuthorDate: 2024-10-17 09:55:54 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:57:52 +0000 if_ffec: fix imx6sx compatible flags The i.MX 6 SoloX does support Gigabit and AVB features as can be seen in its technical reference manual [1] or even Linux kernel [2]. Fixes: 94bc2117b4a ("Add i.MX 8M Quad support") [1] https://www.nxp.com/webapp/Download?colCode=IMX6SXRM [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/freescale/fec_main.c?h=linux-6.6.y#n206 Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson (cherry picked from commit c222619cd4807e9e0274e6fadcbe259cf5cabc26) --- sys/dev/ffec/if_ffec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index d494e832124a..288590a71dcd 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -121,7 +121,8 @@ static struct ofw_compat_data compat_data[] = { {"fsl,imx53-fec", FECTYPE_IMX53}, {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE }, {"fsl,imx6ul-fec", FECTYPE_IMX6 | FECFLAG_RACC }, - {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC }, + {"fsl,imx6sx-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | + FECFLAG_AVB }, {"fsl,imx7d-fec", FECTYPE_IMX6 | FECFLAG_RACC | FECFLAG_GBE | FECFLAG_AVB }, {"fsl,mvf600-fec", FECTYPE_MVF | FECFLAG_RACC }, From nobody Thu Oct 31 00:58:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf5Gd4WMGz5ZffG; Thu, 31 Oct 2024 00:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf5Gd3951z4f2Y; Thu, 31 Oct 2024 00:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TIkYUQh7YumwEytZqOeAdeweEAjJo3T2X/e2QzKZsiw=; b=oi8zngip7iEkbfPaZ7ULmjjHEKBjoYrMlunEHL/XfTk364/6gjb1ZtSjxWZiDt7l5diFW7 mBHcKmI4NWZEcNsoUkkt7Ze3av0xfa3/mPHrbBjndqo5GlLfxw7vWydsFFpHYq9YJeyrb4 zuOYStBA3/Afkf70zLPT/RHQImZz3vkaxS5KaDpmQSiEh4053NGh6UOYSUufdGj50zYOwl E/hBVtkEeORU/zl0qRwgboMBR9y4mOFFrvi0KZIlwQb1pKnbAoDstr2EsfcFhmsS4m9vZx utg+VWJgqrsbwZou1EesD6xzOa+cpA7PcmumGdWDJkOR3CS23Zz3ZTGmvSy+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TIkYUQh7YumwEytZqOeAdeweEAjJo3T2X/e2QzKZsiw=; b=u/gDHzy40CXO7Tbf/vsxUWcq1OiBufRntSEXXFJUCsBW1w+ylLi5+Wye7s85WHG7RyFFKB Jxg+VSR62jUg4wJYmDJHVMxLPbeklEy5E5h1RwCJO2NBQJoMZgrGXPwoz1VNFMo6H/Nsb7 VzRoMd5jZdR5gRtRdTnlenjKVhBZkJE9RVVzLYkO6GH5KFPiCV7rw6HtSjCPZjXekwbX6l RCvRSEE3bDJiUHmaILcMrP5rmzJuzu6Bkp0ztwuFl9DP5tdBp7ecnNNf98B3mdxGA7cRyj hYyMbIhSw56pkG6zoLhdj23heYiYKubs76cnrDKN85ymr9NpXLMd+KJidq16dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730336329; a=rsa-sha256; cv=none; b=NqGJsq4vyfm0eI+tAaYShTKT45vhmsp3ebxNyozhM5TJ/nTFQaTj44bGdw9wzji9Q4BBc7 B823a7WVA7drwLeRVfS/511w5sQFtec6Ipk7LQLUr/jp6Rf9A/gwgYlDCSRGzAV7x00k7m rngRGmjWtG4LRDsaF45JpDvhgkNc9AVH5RJRvD7JBlPsyznjJC9Ds3UrV4sO4b7UXvTDQI FeArtDvgGdzVqlHgGERAoWcARCthp4vOd5stteK3qzpB7RQvNMOdXijKu6YIkMk5cDXE/s Htyb3MCw6mdKupQDnkLTd1T0iE5JeRtBCfEa6nyA2zH68W2dHGnULmLuMMIj7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf5Gd2nbTzFWt; Thu, 31 Oct 2024 00:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0wnwa079171; Thu, 31 Oct 2024 00:58:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0wn7q079168; Thu, 31 Oct 2024 00:58:49 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:58:49 GMT Message-Id: <202410310058.49V0wn7q079168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2dfe93f8bcd3 - stable/13 - if_ffec: fix MAC address bootverbose print List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2dfe93f8bcd347d16899d9048bcaa0194fcf5d11 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2dfe93f8bcd347d16899d9048bcaa0194fcf5d11 commit 2dfe93f8bcd347d16899d9048bcaa0194fcf5d11 Author: Gary Bisson AuthorDate: 2024-10-17 10:02:48 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:58:07 +0000 if_ffec: fix MAC address bootverbose print Remove extraneous colon at the end. Pull Request: https://github.com/freebsd/freebsd-src/pull/1479 Signed-off-by: Gary Bisson (cherry picked from commit 6a7aa5530c0d860c98c982968ac27728daaac7aa) --- sys/dev/ffec/if_ffec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ffec/if_ffec.c b/sys/dev/ffec/if_ffec.c index 288590a71dcd..e1eb9d1abe6b 100644 --- a/sys/dev/ffec/if_ffec.c +++ b/sys/dev/ffec/if_ffec.c @@ -968,7 +968,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, uint8_t *hwaddr) if (bootverbose) { device_printf(sc->dev, - "MAC address %02x:%02x:%02x:%02x:%02x:%02x:\n", + "MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); } From nobody Thu Oct 31 00:58:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf5Gf5Q6Wz5ZfYp; Thu, 31 Oct 2024 00:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf5Gf4CYvz4drq; Thu, 31 Oct 2024 00:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ssNU3QKULAlsv85Fg6kdkfkbSpC/SaxwbdKtOKYeYU=; b=LA3kzkw2AsNx5mmc6Lk5qBfAQoyyUch12eaDt8IatMbO3sY8X54VVAPS3N6kPy2+jIYrpA Sy1aXJ3qzWsroUUzTcpmnV2TfvaHfJ8i6nVfR+ft/eHCImbcQwDWfzMKZr4fleYYvvHfGK Pj8EOVcVtNsuxCvUp/yijDDfSdtkAFlHGsYf5z9LJIAVzPraDsOopND7dsr37xDTMyPQLi 5G3ZPNOunM83I2VvqOOLcfU6je4TfGPWV4OGG5IN6gu9xcs6aezJHuF3SUqgnBi1njKGE2 pX+Wgsr3BeYAvXO66K7LLaaunEY/LwI5Hh8f69Ibrbg3+rs8Tx/soOFSidVn7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730336330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9ssNU3QKULAlsv85Fg6kdkfkbSpC/SaxwbdKtOKYeYU=; b=Fcj6GgqgJrWR+gybBLboBQQ7D347H/OSRRTo5LL1aNTyrP5mwJXNbO3uNx2ixktdj7SGj7 OH4PT+1Wl3dLuNM5B8AhFcPK0gos4AGMaRVddKhG6bRkYIyyGSpsCSSwQHpXEe+xiUw3Wv JvOw8Jon2lfQRlw2r1sMihUiIUBuGJ/CVFkUyL0Oo9CUYzA3QoOFnTyv12GrUAmWwMXs83 GV+rT1RgrK1aUSGeBNE9P31asf8zgqg0+VNw2VDIN+s7HwRn9tZvz3mIf2Ic0y5h1yTI/w 9y78nCBjqDj9yJZNhaQK7XnhlgKUmKBaHAaA78/064nBy4qaatUcQzdJZc1Wug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730336330; a=rsa-sha256; cv=none; b=ol0qghEAya3kftptwXFAlDEnffkvwIrypkkWjclIvFNrbgknOvFmYyhVqyCUP8DN6TR2+J WOK1Y7Y0MTJQ7lBL2RgOfgKqayVkkP9kvjq8UF6Xc+PBf1KjyKJnsYTYO9s242bIkvx3au EdKRzKiIyhZ8DQJLpazlRpPEVt0CweBSyEuCAY+igZC4s3IuIuFGysK3PEVaOSnc5c3AZt lbF4YFBtwoNPyaUN99IE4lmNv2Fp+IjELcSbEoy1earYtR5A9P+iYyDpH4vFuj7X7im3Np WNk+Uztq8y57xs1+8qOz5U3QHS+k+EBlrwV/5Tf/LH/8BorVfzOgRiQIzplUWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf5Gf3n7mzFjH; Thu, 31 Oct 2024 00:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V0wo8f079230; Thu, 31 Oct 2024 00:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V0wocb079227; Thu, 31 Oct 2024 00:58:50 GMT (envelope-from git) Date: Thu, 31 Oct 2024 00:58:50 GMT Message-Id: <202410310058.49V0wocb079227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: a151fecbd52d - stable/13 - libexec/rc/rc.d/netif: Typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a151fecbd52d5b2a517286082e66ddbbcb020d20 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a151fecbd52d5b2a517286082e66ddbbcb020d20 commit a151fecbd52d5b2a517286082e66ddbbcb020d20 Author: Robert William Vesterman AuthorDate: 2024-10-18 02:54:39 +0000 Commit: Kevin Bowling CommitDate: 2024-10-31 00:58:21 +0000 libexec/rc/rc.d/netif: Typo fix Just fixing a typo ("configuriing" => "configuring"). Pull Request: https://github.com/freebsd/freebsd-src/pull/1484 (cherry picked from commit 65691b2dafda23691c3989749def755a98e731ec) --- libexec/rc/rc.d/netif | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 6a979c246790..0d441e003713 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -151,7 +151,7 @@ vnet_down() # netif_common routine # Common configuration subroutine for network interfaces. This -# routine takes all the preparatory steps needed for configuriing +# routine takes all the preparatory steps needed for configuring # an interface and then calls $routine. netif_common() { From nobody Thu Oct 31 01:53:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf6V47359z5Zl3K; Thu, 31 Oct 2024 01:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf6V46P9gz4kPM; Thu, 31 Oct 2024 01:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730339628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fLWfth6yiO9vfx07m6yhPRha/NNxQaKfp18G9BnR78I=; b=DAvYiflUr+1jEsHLOggK5FUwPurBixykxLRh9RpYgYPmjhoOjFu1L5LAVbbWT9tChPo3ko K1BCSvBQjVOJtRIQqwmsA12mzayd/iO1fgRhBBHIV1TuPYyeHRVRXu8ullRC3JcWts4TrQ /3EnRj/lQoMB3Nqs7veC60GRNdWW9bmueUsHPWAF5u9/bNM6/WkpncWmCI6B7NbAYT7svl K8LkwddRvXpr9639VYUhpgrgXYPxh5AldQtho3aySrIFcF5q1F6njvj36SC6NKuibEmiOU Hhp3c2MiiMba77n/Odqfyq2fPZHAYQk/5SihPx/fwfxoe5t30RR0G4Tlucrayw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730339628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fLWfth6yiO9vfx07m6yhPRha/NNxQaKfp18G9BnR78I=; b=raQ0Kqu/mDGH8VsHy8wVU0wrf3Us78PJ4b2McRy+9sQQUnYA0wH0wU6ChKeh+UXiTjRVj9 lTYe1+x3xIvRoM1j61+l9uV4TaFOnVZrSp464Oy7rTIF1bPJfdinjnLSIWrHaMNjkt9yk+ 8jPCX7ThDNf9gOeY22vhaVNBt2/og07rB7YR0iFAjIaH4tdr5iSizOiIg8QVS55gnmAawW jM2ExEqlEVgvurtw5rPMMMBzfsADERo994fu9XxK02DUTcVyQOaeb6Y+g5UbHo8w/CJU0/ oP1gwajtZ83px0yP6sgEjQYTlQPTLFHjEkK7DIrTNzw5l2wzovxTjJr8qL2Dgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730339628; a=rsa-sha256; cv=none; b=bt5l7ZAqK0j59+PbJqKMl3c1KilthocEYlKXA3jUBlQtymTiA3ZBG32hir+9quH6wlg7E4 Z98tcO9rN8YHFMm1Wut9OYaiR1Bd5hKTzyF7nmnM5clfc8Qq+MFAp53qlPVw5gtdwe8kDl gCtgZs1Rj0tlqNuvJw/1eRhmBUVowKUrClsuXAnfcH6YD1zIUp7O+RimBbG7pLkGms+EKW XdlJqEq3oa3MZ3TJo4R5zQ5HtIHIDtQE/sEUjn/2IDxuq+GUWlUmXgpmJHjZKw0eigVRse es6aF69R4t06dbOJijw9aHKRxG2FU2lHfTZ94QMsDv+ddGC1kMqjz8UsHjoG+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf6V460KnzH1F; Thu, 31 Oct 2024 01:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V1rmQ5088568; Thu, 31 Oct 2024 01:53:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V1rmDs088565; Thu, 31 Oct 2024 01:53:48 GMT (envelope-from git) Date: Thu, 31 Oct 2024 01:53:48 GMT Message-Id: <202410310153.49V1rmDs088565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 843c1b516019 - stable/14 - cxgb(4): Register ifmedia callbacks before ether_ifattach. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 843c1b516019efec22295234bdda26b838b1e6b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=843c1b516019efec22295234bdda26b838b1e6b7 commit 843c1b516019efec22295234bdda26b838b1e6b7 Author: ScottD AuthorDate: 2024-10-28 20:48:16 +0000 Commit: Navdeep Parhar CommitDate: 2024-10-31 01:09:06 +0000 cxgb(4): Register ifmedia callbacks before ether_ifattach. This prevents a panic that occurs if netlink tries to invoke the driver's media callbacks during ifattach. PR: 282374 Reported by: ScottD (cherry picked from commit f2daf89954a45c7eed22990dd4cf2cf879763dc0) --- sys/dev/cxgb/cxgb_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 4d754aa8b1b7..c159849076c5 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1041,6 +1041,11 @@ cxgb_port_attach(device_t dev) if_sethwassistbits(ifp, 0, CSUM_TSO); } + /* Create a list of media supported by this port */ + ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change, + cxgb_media_status); + cxgb_build_medialist(p); + ether_ifattach(ifp, p->hw_addr); /* Attach driver debugnet methods. */ @@ -1055,11 +1060,6 @@ cxgb_port_attach(device_t dev) return (err); } - /* Create a list of media supported by this port */ - ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change, - cxgb_media_status); - cxgb_build_medialist(p); - t3_sge_init_port(p); return (err); From nobody Thu Oct 31 04:18:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf9j54pWcz5b0Yt; Thu, 31 Oct 2024 04:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf9j548nGz50FT; Thu, 31 Oct 2024 04:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xTOXWCna7Th2NCIhpCYLY9GsU3km3T7L5sf0jpf5OM=; b=YqfU4MKd3xr96P3lg5YonQDfH/bMpTe2VGIn0X1h2qYcm5kQAHUw8kUiHqRP+r59pSdXYT VL26ZVqM3DKBQPOngYRnG+eVsEmfZeDMNbEaq+Spw+gRsNUm13+ZSE4CgB72ohwnS4TmzJ uEai4aXvgkvihAjLnzX+MOFaqX3W2nScWCGECBICn/eZ7S3jCDELfYyC1eG4Zh7LV5h73L peBGp7FqVloSUgzudKr5uXAv6Kd72nFT/wIesFKdjFDdDHNqXoNDwjoRWzEVOP018nqmh2 ZVlgTvJA6BiKJrZEbJJV0/4fe+QGBpacewC9j+wgqJvxx9iBQ10NYm0T5Jy3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xTOXWCna7Th2NCIhpCYLY9GsU3km3T7L5sf0jpf5OM=; b=fNhrHJmSn0SXSak9Mv01piSQwt2Y1uU7YvJlogL7NsvoT0BRGPNe83OarnQ6Ex8rq9N6Qi 4qXvt51RWJVd61I+ID4+utx1QU6kBV5oRSlBATFnG2P5klW2vp5vOVD0IrujkOWYv8TGLy C8QBF47FKlRetOR6/w/cTWuSCLkLDMR4eteK3am0Ojqz4AzYZrtLiZfJRdXuORHV/qCoD9 d1bKgO6UWX6esv04JDbRoESocH59rvhQXoPSeAa/z5iUbnByEpjRg3U7QpICvgFFFuOTm/ XiHS9NKUhTN9fvI/3iTSA1+dtDd+3ZFP22VcJmjz+BtOwEgZppKfuHUsXBpxsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730348313; a=rsa-sha256; cv=none; b=HrH9d1gvnaBk2c9xvVh3uJET2BseP9vbRiG76Mm/aJRRBp05pGG9Dk+4swpLKtLu6mg9iT vd/2Ll5jA+mPkGTUsJdeSKeStcOjSKm3MORt8GSyjuJxjuPzev+Bmjygs54Mg5GhxzyYSc omgBzTwWPFyoxmKkTy+1tFSHkQGsvtrGCBC1+yfkjgSOZBjpwGEIa8MFsho+N1xmvntozI rDlZIJcWRgF1smR6zSmXOjVIGjhl/ALh9LGaLFjDdS/hjmBTO+opQ5ySD9PuGVdoRRqf44 IpglTgZbuCcSl3aSvTleolNsXsciHKzRqoY+dwsL0gVRUHaorVlyu+lrCaqceg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf9j53dsxzLQW; Thu, 31 Oct 2024 04:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4IXWu052390; Thu, 31 Oct 2024 04:18:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4IXNJ052387; Thu, 31 Oct 2024 04:18:33 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:18:33 GMT Message-Id: <202410310418.49V4IXNJ052387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4d3b05a8530e - stable/14 - loader: Change this BIOS tradeoff: Add back zip and use text only List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d3b05a8530e42f7494dd3fbab8d017adb433b14 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4d3b05a8530e42f7494dd3fbab8d017adb433b14 commit 4d3b05a8530e42f7494dd3fbab8d017adb433b14 Author: Warner Losh AuthorDate: 2024-10-25 02:22:25 +0000 Commit: Warner Losh CommitDate: 2024-10-31 04:05:56 +0000 loader: Change this BIOS tradeoff: Add back zip and use text only After talking with a number of people about the removal of some things to make the loader fit, readjust things a little. Add back GZIP and BZIP2 compression support. Many of the downstream MFC packaging systems depend on this. This adds back 20k to the size of the loader. Make the boot loader text-only by default. This saves 40k in size. Net, we're 20k smaller. The graphics loader for BIOS is less useful than the zip functionality: You can still boot w/a text only one it and you can build a custom one if you really want it. It's also the default we use for dual console. This should be merged back into stable/14 and stable/13 so it's in the next release for each of these. That way we have only one release (13.4) with the other defaults. MFC After: 3 days Sponsored by: Netflix Reviewed by: olce, rgrimes, emaste Differential Revision: https://reviews.freebsd.org/D47203 (cherry picked from commit 23dee252daf2ff60e521c9c019e64134b63ce90f) --- share/mk/src.opts.mk | 2 +- stand/i386/loader/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 774b6fffd3df..22373f8c7af1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -129,6 +129,7 @@ __DEFAULT_YES_OPTIONS = \ LLD_IS_LD \ LLVM_COV \ LLVM_CXXFILT \ + LOADER_BIOS_TEXTONLY \ LOADER_GELI \ LOADER_KBOOT \ LOADER_LUA \ @@ -206,7 +207,6 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EXPERIMENTAL \ HESIOD \ - LOADER_BIOS_TEXTONLY \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_ASSERTIONS \ diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index a4aa3a3c4d45..c2037772fc76 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -7,8 +7,8 @@ LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_BZIP2_SUPPORT?= yes .include From nobody Thu Oct 31 04:18:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf9j66pk8z5b0mj; Thu, 31 Oct 2024 04:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf9j64jS9z506L; Thu, 31 Oct 2024 04:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgcMe+JHNyav7iX8yrYTOW4ftf2LuV5cIoIH+vziE7A=; b=k8NvRzvCpTC7T8q5BK6oCWCTiF9IsKQkC7hcAvDrp3iCGaXaZ9ahpcfHmPONzF0pYIozxi /Y6n4NBGqtRcZkQxBv318CM0Yk+hQG2PGFKmPP0PWRMf1bkAUyFlaRrgAlU3dF73csp0G/ B5H0aobow+Tf6OAIbkCX6pya5//Mib/cGdvX925gLTmlHJi0eomCxl9+xRIhrj6N4bW/ZH 1i9hB6tv2uO3cPsbtGz0zP/LbmLhzAgY5AQbtkSFyOwp2sGjwNzhTBTZjgNN6Tkf2/mMU1 ZiXeJrSichgZfRv77JELP5hwbrGlePKJc8ckUvrOqU+ZXweZKOsHAfYgWYte+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgcMe+JHNyav7iX8yrYTOW4ftf2LuV5cIoIH+vziE7A=; b=qyE/wpE9wFsGk48ujhn9BrBgW+MMkUkHiFfX5iqqkGsYt0KLxgFOpCpv/8AtCgV+HKNL/r F50UMGT0HraUSNFY0ak+EjLGNK8mOMPUZRI2qB73C/L4PTAh0D14tF5ALSxliepASRsEwW Klt1OQYgBtH7UraMFbn4+UvLlUT9I123v7VzDjZXZVnRs1NePq33t4QRpiO0y7j48J32lk iHHBNYXQ6BAOMqErvyId+ippttJ63aaaDnrBKqbJoMtxZNVqq8ER0e9eULwBkG7Iw7r896 serhSdiE+oWfZYjVJkC6N4iCyF7SkWrPvnCWOmtETIgQW3fxRvI3/n5CJcU6IQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730348314; a=rsa-sha256; cv=none; b=s+Etf2aNRQjpWFxDvPrXA3gySP5BLwnjvcVCRQDoPncQ760MHqIYNF/lFrm563opM+drhh 5fnl/2hvptnLpzq8ZJHKtMkSqe2DNzfZFcm5TN6JgjUXJCbaibSVhVOX4jbhZheSTbTVzH rSM2UqN6Phzd7JwJnBg2MymEbeVNb6DCg+gcgeAnpnZRXP3eBTjtAC+AcYLq6GyaRHq//s AtnEd4j3ZhaGHmimmlGuO+J6hhh/PmgqRanCiGRK/CTfMMYqgV9hRUz1iyPtInCSnfu9SD yPS4eHO4Rgut6VH4rfVP5NdcHDSA5mzzZIj1eDGsVnxzveXfJ4FwrAb2tRDtjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf9j64K7mzLpC; Thu, 31 Oct 2024 04:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4IYCp052445; Thu, 31 Oct 2024 04:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4IYGA052442; Thu, 31 Oct 2024 04:18:34 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:18:34 GMT Message-Id: <202410310418.49V4IYGA052442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1a37c4e533cb - stable/14 - stand: Ugly hack due to default change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a37c4e533cb1348ce5a85cbd596fc8a744737d9 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a37c4e533cb1348ce5a85cbd596fc8a744737d9 commit 1a37c4e533cb1348ce5a85cbd596fc8a744737d9 Author: Warner Losh AuthorDate: 2024-10-28 16:50:29 +0000 Commit: Warner Losh CommitDate: 2024-10-31 04:07:11 +0000 stand: Ugly hack due to default change So this is a gross hack to fix the 'noclean' build since we changed to text-only loader. We have to fix it in a better way, but for the moment, this will fix non-meta no-clean builds. A better hack is to fix this so we build either vidconsole.c or textvidc.c, but some minor refactoring and variable renaming is needed. Fixes: 23dee252daf2 Sponsored by: Netflix (cherry picked from commit 10c429016a3c5adf2e04cfd1ac97eb24c0e7074c) --- stand/i386/loader/conf.c | 2 +- stand/i386/loader/gfx_bios.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/i386/loader/conf.c b/stand/i386/loader/conf.c index 622812efbb51..bba33a2707d5 100644 --- a/stand/i386/loader/conf.c +++ b/stand/i386/loader/conf.c @@ -134,7 +134,7 @@ extern struct console nullconsole; extern struct console spinconsole; struct console *consoles[] = { -#ifdef BIOS_TEXT_ONLY +#ifdef BIOS_TEXT_ONLY /* Note: We need a forced commit for this */ &textvidc, #else &vidconsole, diff --git a/stand/i386/loader/gfx_bios.c b/stand/i386/loader/gfx_bios.c index a0b08a7cbcde..1581325a81e0 100644 --- a/stand/i386/loader/gfx_bios.c +++ b/stand/i386/loader/gfx_bios.c @@ -22,7 +22,7 @@ #include #endif -#ifdef BIOS_TEXT_ONLY +#ifdef BIOS_TEXT_ONLY /* Note: likely need a forced commits when this changes */ void autoload_font(bool bios); void From nobody Thu Oct 31 04:18:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf9j76vl8z5b0W1; Thu, 31 Oct 2024 04:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf9j75sqVz50C8; Thu, 31 Oct 2024 04:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FqlFG4jyF1uSqvV9aWBNBa7qzFFgpJPyMEldR9GRiRM=; b=tSBusWbaG5LedC4/+4SxBRRDkZGEY/ZL+Tcq7r53CFHBbniNBeV7Kg7UO7dqXn8sbcLNnd xt8TyIbxmZllVAGN4IWN6o7c3/N81uxJN+kOchbnAuZD/pQoT9Oc1edW7IaA8Ry1k55Tjw 9IzipbOswshbL12qrDe6CBSawSTAHovOCat4LJbjymsnp2uJPJznVat40E1Gq1Yqf3s99r oYkOsCBl87t+9gI/dxTAhNSHVj8cFDeLZDjyfts2qeVFNHNAVsx09V+5qkn8pMjN3UI04T IevCFt4WZq962280/5CB0cDC7HcO+MgtgKtUrEZwx4ha2MfIF2xMbXGrg2UOlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730348315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FqlFG4jyF1uSqvV9aWBNBa7qzFFgpJPyMEldR9GRiRM=; b=GSJpovelMgkMTDNstg4e/Bx7j09RnEH9izqC38fK5n0hdfO+Hvv/6qr6cYCTf16DDDch+6 1lJb9Hp7BATRzdcnUJT9uPKN11/OOPVKNVCg8nCYGZxoSurCkrLeGyhjX3QZjSMfbSj4Mj DegPZh3QrEldFhWM6bVeH6rn1HvWDy7pz7knNKm8a5WTIIum9HBUUiO9KEeTRCY1xVu0y0 xhUeANNYvHRRJO7kQRUaCDEigKFx0KAf5a/KQZhZe1A1JLD9+s63XgGIx+gT4iyWueJCWR Pzd34wJ+Wl/s7SHShc2tKJHrIeSAwPRx1qP+teL0sFQgnADErWEZf7B72aSoBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730348315; a=rsa-sha256; cv=none; b=BLaJAzlquenbaJFkHbfUU86XYQv9XW2RjG5aeDkfALeP1SYrOS/GXjI1Z6NUEbLZBEYYKA fnm6XxYTl3921ebXe/rq4JXEbT9JYXCIznbebFW0lr0ITMJEqZ1z3QOL32V7HBAV6F+sLu R34rLN2NHIOWQ+st9xGEDsHjyzzI+9Mi1ejWgQ1rkhhoTn+6H9soUYLG2S7O0uCs3qlr8S Lfu0u34QVnSkYPe6Jpmy09/XJsDbTyIn6J1V/z0EbMGb2Eat5pkl7RqyRwCcxXGgYHXWh7 wBoY1arP0Oq/OBO1km5gdPpkyraEgcjwVRgAbZHQaNke6tgCMha91EqWSPxq4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf9j74wGFzLqV; Thu, 31 Oct 2024 04:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4IZWm052494; Thu, 31 Oct 2024 04:18:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4IZWK052490; Thu, 31 Oct 2024 04:18:35 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:18:35 GMT Message-Id: <202410310418.49V4IZWK052490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 22aed646a5cf - stable/14 - src.conf.5: LOADER_BIOS_TEXTONLY default change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 22aed646a5cf1746b7196297208d7de32cd5c612 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=22aed646a5cf1746b7196297208d7de32cd5c612 commit 22aed646a5cf1746b7196297208d7de32cd5c612 Author: Brooks Davis AuthorDate: 2024-10-30 19:33:51 +0000 Commit: Warner Losh CommitDate: 2024-10-31 04:16:59 +0000 src.conf.5: LOADER_BIOS_TEXTONLY default change WITH_LOADER_BIOS_TEXTONLY is now the default so document WITHOUT_LOADER_BIOS_TEXTONLY. Fixes: 23dee252daf2 loader: Change this BIOS tradeoff... (cherry picked from commit 50b5a37a12d032085276b1f0ebb5f92c0cabed32) --- share/man/man5/src.conf.5 | 9 ++++----- tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY | 2 ++ tools/build/options/WITH_LOADER_BIOS_TEXTONLY | 3 --- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 303854813166..5dd61a50329d 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd September 26, 2024 +.Dd October 30, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1028,10 +1028,9 @@ Do not build LLVM target support for X86. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. -.It Va WITH_LOADER_BIOS_TEXTONLY -Use the old, FreeBSD 12 vidconsole.c. -This only supports text mode without teken, without any graphics, font or video mode support. -This setting only affects the i386 and amd64 BIOS boot loader. +.It Va WITHOUT_LOADER_BIOS_TEXTONLY +Include graphics, font and video mode support in the i386 and amd64 BIOS +boot loader. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 diff --git a/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY b/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY new file mode 100644 index 000000000000..0b243b4276c4 --- /dev/null +++ b/tools/build/options/WITHOUT_LOADER_BIOS_TEXTONLY @@ -0,0 +1,2 @@ +Include graphics, font and video mode support in the i386 and amd64 BIOS +boot loader. diff --git a/tools/build/options/WITH_LOADER_BIOS_TEXTONLY b/tools/build/options/WITH_LOADER_BIOS_TEXTONLY deleted file mode 100644 index 08804c19c691..000000000000 --- a/tools/build/options/WITH_LOADER_BIOS_TEXTONLY +++ /dev/null @@ -1,3 +0,0 @@ -Use the old, FreeBSD 12 vidconsole.c. -This only supports text mode without teken, without any graphics, font or video mode support. -This setting only affects the i386 and amd64 BIOS boot loader. From nobody Thu Oct 31 04:43:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGH3Vhfz5b3Yx; Thu, 31 Oct 2024 04:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGH2VcKz53dr; Thu, 31 Oct 2024 04:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=03159X6m+JfGXhYfbbGxMNgn+qfBMAgAkFOqaBE5Ios=; b=RPBW0/iCp2qBiZQbL4QH7H/vfy9tzFXfDuOl0MHs3fEnUKOYsDbPZYZ7MP8h0Ly/JWcF84 ujHFQWcJSC5G1XQcawOz2LF5pA9N26PmIkvMpEWrzJJh/5Ml551Q3DozDKKXZvroVb0Nkp XkXZeurAKCIU/+Z3cFzCJxcHZtzJVhhIT7d2q6Dd26R1VSU7wWbyvfhmZm24gnB/IQfojp 1g21NpLVRhRD5ko1NoUw7ugQ6U6qkrUTh1bBh7YmlTcH/ySJt9JkwCAKp+Ov5LsE1Z0t/z DhXPobWHUi3RdhPHpLkabPbjYUdBc5xI/GADSRWd/BXVZE5a7RiIcrKKPMZbgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=03159X6m+JfGXhYfbbGxMNgn+qfBMAgAkFOqaBE5Ios=; b=V903cD8NbqnIs7R0LdAdoLdlIGH4xhrw96s9+NxODlcG1DjZNN/sDlaGhdTkC3l0WXREqw Hg6UW5Oq5iQ3gEGxBXJ9mRQbrfgKNkvnYLpVY94JLz1Tx7fRIfMfTxaj3wjXNLGxpIwT1N 3yKKLpi7EVsweWwJqwKYT272G1Qj9zkMQ++o+c23/Sp//13EJH1V/cHYySIIho7cQbKPr6 iNU43zPnBbKweAbijqBVoZ1AybGhY0Xdud5vyOsYj9KylBw1vWbGnPY6ADtSMk2JtaTyO+ IviR/z0wtqEre2Xt9JZPkWUBSpSvhmYO83FsygqICLxjFdUzw+cPIn7qmMQB0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349831; a=rsa-sha256; cv=none; b=xEJPm28OiFJ1v7d3Ab9GTOViWkD32DUXqFYU0dXx773g1DdkW94ElWyELoIHw08ySaLDlG OrJ4ml7PTd8KGYjiYjA1PhXakoiyrRrWAUnlgDtaxUPfikYPcQ5C5SD7A65cT0++Zrci+s aVFtMQYE0QLR8f6lkumvqtE5h/xCPz0Mb2RqDST3e+G+vosVFkhkwu11CjLSR0XhxXEQA8 KuR37txdy1zsw59ZntAlW/grKTBYMIPlNr6QENIMNZomP+eA5Qo2+Bp/58LUrQg5f1USPH YsIRic+NZYcJapIIY9xyRfHmP+d8RJ0fbuV8aDIinYL2ToLWf4CjZBJKNMM2Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGH1xD6zM1W; Thu, 31 Oct 2024 04:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hpB4006449; Thu, 31 Oct 2024 04:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4hpfj006446; Thu, 31 Oct 2024 04:43:51 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:51 GMT Message-Id: <202410310443.49V4hpfj006446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 01f4a503eb0f - stable/14 - ifconfig: Fix wrong indentation for the status of pfsync(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 01f4a503eb0feaacc4cb9bd189dea66344365352 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=01f4a503eb0feaacc4cb9bd189dea66344365352 commit 01f4a503eb0feaacc4cb9bd189dea66344365352 Author: Zhenlei Huang AuthorDate: 2024-10-20 14:06:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:16 +0000 ifconfig: Fix wrong indentation for the status of pfsync(4) The leading tab is always required, regardless of the configuration of `syncdev` or `syncpeer`, as `maxupd`, `defer` and `version` all require it. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47112 (cherry picked from commit 1c95ec17cae22fb76d4e93c9eada78e03ca1bca6) --- sbin/ifconfig/ifpfsync.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c index 33e4e5ac8cd3..264b1ecd5b56 100644 --- a/sbin/ifconfig/ifpfsync.c +++ b/sbin/ifconfig/ifpfsync.c @@ -374,8 +374,7 @@ pfsync_status(if_ctx *ctx) nvlist_destroy(nvl); - if (syncdev[0] != '\0' || syncpeer.ss_family != AF_UNSPEC) - printf("\t"); + printf("\t"); if (syncdev[0] != '\0') printf("syncdev: %s ", syncdev); From nobody Thu Oct 31 04:43:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGK5tPFz5b3s2; Thu, 31 Oct 2024 04:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGK4KJHz53RQ; Thu, 31 Oct 2024 04:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYo4tlc4sor+C1CLSnwmv6YXhMp1v0WgPWbUVjFJpOk=; b=nVDn7a5yJ15VU/Vp99x73AaKL76adnQQ1FUiBMp1ox+5Ri8NXvRTmmZtR5PHqfGA0sxD/9 2Nm9xqDwv6gPvCzVh4vasLwl2eFHnf5Fo4fBlFpJDcWGvQke72mQ6WjWOdA8iV8xhMkMUC 6Vfbrc0LPikTGCZMm6UsmUUOwppioWCQRf6sYE1+2BsYG95qu8FwIqP3qQVz68sFL15fS2 XEuB2p/KjjeCVtLCMv1DxdKdXnzaM5P/clHdwOF4oJubDq4Ee9+nIR8JVqNNEAEi1ys/Rw Y3NN1lrQ4PDktES3pmj+NyQrzT2mbs0wfsyqBvqHVA6hUEqySDkW+QOazqJowA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYo4tlc4sor+C1CLSnwmv6YXhMp1v0WgPWbUVjFJpOk=; b=ZkfCFDISMEJ7IB5u17m55aPfqzmYhtVDMfZI9KzkV6nioiURvmfUxEi19VG8Lq5QOwck/G 2x2FKMEUawgRgVCdc5nINGy6ssEdwBXeVRW9kLYUqPOTvw4aCfym7hdE9syHH4dui29uKS rgRfnz6nTcBQLPcKKUxqZ8z8ROTn6JRID1h0+POhxExwp788agrKxf5+iSsK7YzkAcmBRP 7sVvn9x4UFe6gGLvn3WCPJibF/Mgv1wDKFU8VKy0Qtn8z2zMvtfFBUPiPXOCKiHvr+oFAK rpNpxP3wZuZlkfU0BdWzSSzmhje0kl5FR3MCfdURuSnjVsUNqJ8klqZSrnui7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349833; a=rsa-sha256; cv=none; b=OX1UYvcP2qxgT5nVl/IFeABnEy9wXQF6LvesBNNlK1gYbNnI4b55xZAuSVvPVmhpA5DgNm Nl9CZ2WH/NQCp5sDotNih1+ioJES+5ode/SqiNen4kurSXgGQQNkVdSXtqMD1RmBFHB/8q 8v9Vq9GAx3VnYWzFotagCwr1+BE/SuM4irV029J+B37WPN7yn+kxx5T93zXq3yfVoF8iqj 2ZeGAWc0zgzeWwzPhJQtJktsRB3uHtnQuwkCtt8fCAfrvXJCSov91GE6wHcx1XrVLpx77z GH/xgZLVb4DUkXF2fDLS+37XMnWFBv9lp4vTy1yXBnY6RkBzbufFcUzMro2odA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGK3pxhzMcc; Thu, 31 Oct 2024 04:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hrv8006552; Thu, 31 Oct 2024 04:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4hrBV006549; Thu, 31 Oct 2024 04:43:53 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:53 GMT Message-Id: <202410310443.49V4hrBV006549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 00fa80275f34 - stable/14 - ndp: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00fa80275f34586775e744d83ff94f8f42eaa696 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=00fa80275f34586775e744d83ff94f8f42eaa696 commit 00fa80275f34586775e744d83ff94f8f42eaa696 Author: Zhenlei Huang AuthorDate: 2024-10-17 13:05:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:16 +0000 ndp: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 17120e4bc3e61557816ca0558a60ab969b3df404) --- usr.sbin/ndp/ndp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index a6f30911ddb4..e98e506ee482 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -639,7 +639,7 @@ dump_rtsock(struct sockaddr_in6 *addr, int cflag) xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags"); } xo_open_list("neighbor-cache"); -again:; +again: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; From nobody Thu Oct 31 04:43:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGM3Bgxz5b3t3; Thu, 31 Oct 2024 04:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGM0F2Fz537f; Thu, 31 Oct 2024 04:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OXFqR6iPWE2U8jQGS7IRP2wlRx/BhqbiQ7JIJunpyC8=; b=vsNY3P2nGu43ybKhmM3rXxKeCl8oUGzAA/6Yig/hclCG6sJGTbJ5ZkMWvjXsU0i8ZiqnlB 20OYncWPg5kQ3CT7LLo8HT1PyG/h6BgLqGt/8Tj2b2RnkiO99Lnk/zWR735lSw9R48t61a Ad0kiRctsIIv+6ez++XhnaYBUiP/y86xixjjJVkJzwARVgG3CJBXOhYikPfRMs9IWbzpL2 img7v2Mwox1Aro5EjkxWW0dRrRV+5aPMrIY1Esuo/O2CxT/fbLq8URPcQd9u2mk07p1xlf cGeVIYZUS+KRwvsPzeXnqCr6/bft5p/UETHk0BuTJqC3eRUl2QL+dzUcX3fdnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OXFqR6iPWE2U8jQGS7IRP2wlRx/BhqbiQ7JIJunpyC8=; b=H9JDiQBK6eTKeJjWdcjfHKdJmGdQOyrsqwL3RKouZjsiQ/ltyjlZuV3A3T2Il9m3A/v0Mf FXymQM0Z1NVNHhZND0GUlQXXMPi/BZQjoJTbwErH/hofrvPgkzhD+FW+MUwho6XTU6JC3u pKmge0n583jYBWe+Yi+sSqnoj+oTp0oPS8xHbW3w1yLhihKYYwExJD+r5HJCOTu5RSkDo7 wrC6EUdBKxuxu78PsrrUaR7UiyF9IFKsD8F5MOkwE0WDTX9pQGET9tbUSc7E7mRSHhBz7e jBsZ04MpylzN4TG3/3Dp0pHSIJfUFgvNGhaRnFpfDASt2WrHIvU6t7ZFJQS/Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349835; a=rsa-sha256; cv=none; b=SSVSmfSI5dwC2Vyz6mZJ73pj3W9AGEBUsdCb6UEFNEcYZBqKe/7v2F/rQyjH83sh58Nlpo niy51mDdrWk8WRpCTNq4xCFLneVrZH757HViuVcb1v4azoVORt4YEskJDEEGXkLG7lp5e5 Q04aVyOXDxkQXmYuIR1wjq3Dj0tHgGVGO5wo+zDuTG4OFioZSUpDMF/CmzWtOqmrI8Yw9b OHK1mDU/Az0wtrXECKxRAUjXhSnAdrDfQPQJRKggN+SV+ezJ+8ePTDvtJhaZQwRtfNFu9L HsXvamn2BMtn8zN8uQLA+eaIqrmMtSx4N6jVHdsOgSj82/g1bS5bJlpoErF6Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGL4TpMzMQc; Thu, 31 Oct 2024 04:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hs4D006600; Thu, 31 Oct 2024 04:43:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4hsl0006597; Thu, 31 Oct 2024 04:43:54 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:54 GMT Message-Id: <202410310443.49V4hsl0006597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 57af3009cb29 - stable/14 - config: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57af3009cb2911de5c8b3e09425d764d61c80792 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=57af3009cb2911de5c8b3e09425d764d61c80792 commit 57af3009cb2911de5c8b3e09425d764d61c80792 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:16 +0000 config: Remove a stray semicolon MFC after: 1 week (cherry picked from commit d96ba5a6236566afba05ce542296c589503a8b17) --- usr.sbin/config/mkmakefile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 49990c4a250c..0ee8c8ed9357 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -571,7 +571,7 @@ next: goto nextparam; } match &= negate; -nextparam:; +nextparam: negate = 0; } compile += match; From nobody Thu Oct 31 04:43:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGN0FFyz5b49Q; Thu, 31 Oct 2024 04:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGM6H8kz53fC; Thu, 31 Oct 2024 04:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBsrTF1wJCDXM3xOSDZVUOGmKvDP/yz/uCJ1x37BWIs=; b=v4EfjnJTFoiOWUyxZT92tUpkbqwNUjIT7A8Ab4WsXDxUFryq1qh5liqKIi+1TdbfZBbsGS HatT90Mp5muWfldPJmGFNjuA57rYEs98ylpKW4UIAnZBbdF5Dw4OhKBaYRIALsSD2YO6gU BjYIWyBuPQqQzC7Q6E/I6VzUi1oHY9g9IgvzLRchx9PfgTNFKVpOeWXMzY/UJWgpnEJKN5 1bCZ0ARPVMtdUesInLcw0RgRjDfI4WV18vIfjTTcEOD87YLeqOOOZG6d6LSbDKvD3Qv6eB bBEUZi6tGYwQG8qadCi3sJt6Z6fC+Xa4pNCSQ/MoBErH+qh27N15LpW0fELfQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PBsrTF1wJCDXM3xOSDZVUOGmKvDP/yz/uCJ1x37BWIs=; b=ryrqhhdFLSE7OtEbQulTSpVwrRZfFxFAfSAEJEDc/wkj5CD7lWP0wo5NwFe0TrUn1tgwiE McNXUIphAZD3CD9o3n9G5D9DBa5Ko6tR7iIyn5AB0CsWPXcWxkEBMLMwYB1yQHSMs8BtRL vp29ZO6TAFzME3xkYb3anH1++3N0Jgguavw6N1vWS9yUM71XIsuyT3ywidz9YGQ7n3KCMS NwIbQy/6w8qNKEHLPv8Ku4E1AOF4c+9DHKKGzCBM4LWADqn4P8MYENLasyRBbHrrURjZpj go2LHdfoL9wR+b9IsR4HjY1p9KrKaN12KsPBvteKr+47oZ/xzd/XmI28ap+cZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349835; a=rsa-sha256; cv=none; b=GDltAHpR8WRA78RvoJAxIiLla/tN6yUuv7GvfA7z1XEzSuNwUpqdKPHAOxsgVNmrveHrOE V1D32SQVAAyAMfeQHJe4P2U6FN0xJ+n+2YtAD1Yk/hIOkse07EC/KY6OT39bw+KIERgySt 432VFIat1bxGgRSWyIs9l5gL8AU2s4+FoYu/G4wSuEv4+k017BQ8CnP9P7XaewtXJffzWA 6wXhW/2RIQQRVHubZAr1uu8r3oHLiGUUr04pg/NWd3wuwMPBOppDQghBOpBRzasFZcX81K rkg6eR4cS5iFxPlwrdNjRSubrVvUS6NjJQVuYjUVVercLA4Kx2FLTBjblCXx8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGM5njfzMBs; Thu, 31 Oct 2024 04:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hthG006643; Thu, 31 Oct 2024 04:43:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4htxZ006640; Thu, 31 Oct 2024 04:43:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:55 GMT Message-Id: <202410310443.49V4htxZ006640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 30e256e1faf4 - stable/14 - makefs: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30e256e1faf4da7b89399340520d175fb6f2371d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=30e256e1faf4da7b89399340520d175fb6f2371d commit 30e256e1faf4da7b89399340520d175fb6f2371d Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:17 +0000 makefs: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 56b17de1e8360fe131d425de20b5e75ff3ea897c) --- usr.sbin/makefs/msdos/msdosfs_fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/makefs/msdos/msdosfs_fat.c b/usr.sbin/makefs/msdos/msdosfs_fat.c index e00ce9ef7b97..16e2ce44084d 100644 --- a/usr.sbin/makefs/msdos/msdosfs_fat.c +++ b/usr.sbin/makefs/msdos/msdosfs_fat.c @@ -245,7 +245,7 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp) return (0); } -hiteof:; +hiteof: if (cnp) *cnp = i; if (bp) From nobody Thu Oct 31 04:43:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGP2nN1z5b47C; Thu, 31 Oct 2024 04:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGP0SMlz53fV; Thu, 31 Oct 2024 04:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARzkSpetf/3q8bE4JXqJaVyzXWlmIcH+f3p3AJ+DEhc=; b=ph7Vtr6Pr+J6Vmf1yjZr/0FA1lDcMT4IA+Jgl7G0LjifNGCrRronuMN+Oq2aruQbeTt1jc Nr6WMQjhFEf/oGnim4o95mLZvvec9dqkA1630iSYE9XYmF+EwqRZuWadGBKLJ5DzkMppkb BPqMHH/OQkFYLl5c39lzIdgrR3cIWMtJORAn+BiVoPQvzTYrakKPAX+XetVmnRSacUq0Vp 0AjqbvQqH+DgiglDb8HiMFim1WFD7iBA+ha9pPJb2qsf4C9ed10FrjgLXsmIJ5LfWQXk7D OebfQQhYNsFGtb8Syc4qYfaZZgckziANarDzAksq9c49Fe2iQJ7se4WVhKvc5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARzkSpetf/3q8bE4JXqJaVyzXWlmIcH+f3p3AJ+DEhc=; b=bxx5DhuAkq7ALwGhpnOzGs/DuxkO89QOPNBdOTbD7OA8mR4ddTY7IKsWSSFD/Zs/X9yl9b 3fzcVq+As5Yldba0pvRxGHeWE+nT7V1dm01/p+eDBfne9WQnyBLhLaL39fqnTVLF3zHvZc mbWp9d4thwU0EMmO40EnycOnWxKBceA5ddw9K6DDyanKsxe3HqhQYaLkHHND0jW9hK/c+9 K1flgY8huo+A0G00O0i+FKJZ9Bg4cCyjRRD42/3hlSHt7Ch2Y0hRNA0pk7vZR/y/xWzrsN ue1VMvujfHAVeHwLuBdjCAQ2U8FzfvI8lxmr0JB/9cSZNre5XlXAzK8wVBQyKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349837; a=rsa-sha256; cv=none; b=nL2ms2PfPtnfDsd2jQuir0A5y31tb1bnQVc1YbgundbYw+TVDo3Ysr12tPo+nbdVjPkvNf w+JbI0Vi5n2EExQaUPTUE+aRoj30gIW826dT0hp+aKGwSOlJpMRnewn39BIOKgEvigeX8Y 1zgeFwR1hiYswF1y0b4JtU/x/W/r0xwMZiALYkFmAqtWw3xPtseAVLB3JyEzgZSiFydNmS D7iRYb9XPtzrhYAIeY9rK5ZtO4rqp5O0kGS3kMI5G/AexuoPCf+CIjJ+I7wxMLv/4nr5Ep 2S0mRIRcYggReZlBXHiAq1RcylLpCVH1P+qPNxXEoqXV5ViYLePdEX/qegNFpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGN6TjPzMQd; Thu, 31 Oct 2024 04:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4huCr006688; Thu, 31 Oct 2024 04:43:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4huGl006685; Thu, 31 Oct 2024 04:43:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:56 GMT Message-Id: <202410310443.49V4huGl006685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 4d2d1e824bc5 - stable/14 - arm64: rockchip: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d2d1e824bc5f8bf5e950ae42110e708a0cb5b19 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2d1e824bc5f8bf5e950ae42110e708a0cb5b19 commit 4d2d1e824bc5f8bf5e950ae42110e708a0cb5b19 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:17 +0000 arm64: rockchip: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 88b71d1fe054f9baace237494d22288256a7fca1) --- sys/arm64/rockchip/rk_pinctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c index 02017258dbe2..0d2130b6ed83 100644 --- a/sys/arm64/rockchip/rk_pinctrl.c +++ b/sys/arm64/rockchip/rk_pinctrl.c @@ -1192,7 +1192,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, uint32_t *pindata) drive = ((1 << (value + 1)) - 1) << (pin % 2); - mask = 0x3f << (pin % 2);; + mask = 0x3f << (pin % 2); SYSCON_WRITE_4(syscon, reg, drive | (mask << 16)); } From nobody Thu Oct 31 04:43:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGQ1fYjz5b47D; Thu, 31 Oct 2024 04:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGQ0dMhz53br; Thu, 31 Oct 2024 04:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ULqorc8AcPOUHOt7U0TgMJ7W5x/OFA7JovbAdm3SwQk=; b=IsjhxQVzhnvgoR3e1FBMo1AS2KoLhL7s1SsDgRmBO5aqOXxk96Cp2YwfRlhMDFmzW9G7hx n3GT1C2W/v17BOZTyo6BudRxG2SaoB2q+oG+Tm/zugGOgecPUB2xmdmw07agzA6EkAGeOq d6n5wQD1t9lmWH4J0ac1D0kovyzh00sTC8VCs1JTE1osmuVwpD2dXPvUbrMOPEbDiN1mVi ecKhIfKaY87V9ITebcTn9d1bdjLjlnGclWUlnrfvj4Ir3aqv0sbDu4UCOSCL4cBT6ojyuc Cj/o6B4VgYbeFfRRJMaLN1ypXZhwVfFVQ4QOXR23jOg5aJEykL1Yb6sICEiTOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ULqorc8AcPOUHOt7U0TgMJ7W5x/OFA7JovbAdm3SwQk=; b=dPCpSC3COmZAAA52mr5XaIxABDp0mKNJt67fy89VItSu9IBMh3iDoHX+Sj9nXhMAU5Ww3n LaHgJbVbT4KKz9bVQoweaO0av5LJIwXMYdCr3SyoFYoYW2dJzr+uEHFWquSv9zmdiJTIK9 ROmOho0C6yLogIAbN1gXt++jGgo26iIh00HAjaRiGUqoq/MfcLkl4oFyt/+oSMhmbuTUwJ oK5JYK7WNaLv9c6QDMGNUkC2YCVHc87xO2N5UzbYVRi4q7LjaxH/ldSjw/RsDEBj/xNq6Z b7OVfIZW4PCkHzglHGlwxcCg42g5uK5zSQEKzwcN7O45vwSRya0tZpu35N3zZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349838; a=rsa-sha256; cv=none; b=ItHc3YOp0C4LVXonKGtLoSsQkffW3ZH1r+z5Ay9zyZiJMT0EMmYITr7BUmRjJNuMYm11kl j4+XiR8fDkp+56QNBhecrHQuE4aChMYyByLk5hlDA3e8hf/VqvptCeirIc9bRZfEsY8PqN 915RzNye60dbP/pt3iPKLaO/MJp/LaMdFlm6QqVJjoG4R1yliT9avIGrERreC4qmt679we eUODkK2sdp1tENNZti+WpvCXB1Jkh66Zt0ju0sYj2q51KOJWMZ1uW38QxEm4otTgoiNp/U M2I46MqDyB1TC6BNciXcedISkHTh1oBTkIJB3JRUtMtuqb0CH7b8mvZVUPi4DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGQ0DtjzM4G; Thu, 31 Oct 2024 04:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hvUg006727; Thu, 31 Oct 2024 04:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4hvZt006724; Thu, 31 Oct 2024 04:43:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:57 GMT Message-Id: <202410310443.49V4hvZt006724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 5942658cf357 - stable/14 - LinuxKPI: Remove stray semicolons List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5942658cf3573bc3df9c378b688beb7549754773 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5942658cf3573bc3df9c378b688beb7549754773 commit 5942658cf3573bc3df9c378b688beb7549754773 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:17 +0000 LinuxKPI: Remove stray semicolons MFC after: 1 week (cherry picked from commit b4856b8e9d872ca6ee0c4ef43e7047693ef7645b) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 0786151c4ca8..7086cdb3ff03 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -342,7 +342,7 @@ static inline bool mac_pton(const char *macin, uint8_t *macout) { const char *s, *d; - uint8_t mac[6], hx, lx;; + uint8_t mac[6], hx, lx; int i; if (strlen(macin) < (3 * 6 - 1)) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index d3839820d3d5..341ed33ddfcd 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -614,7 +614,7 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) { SKB_TRACE2(skb, head); - struct sk_buff *p, *n;; + struct sk_buff *p, *n; head->qlen--; p = skb->prev; From nobody Thu Oct 31 04:43:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGR3d6cz5b432; Thu, 31 Oct 2024 04:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGR1lgwz53Wx; Thu, 31 Oct 2024 04:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS96TR8dSQIizr2DGdhgTudz8ngyRg60GpZiTpsw8L4=; b=E2q2891ObEyFpZPngfvPg8RDyS4Adt/YAO6aX47YR58WVjTYGMZnDInQwKHHqUOOET03Ae Bi9zOVOpeYL/LItacjy9nIJNfSbOVlDG0hiXFipJbYTDIJHbOcrcEMiCUEgR0d2kp5TVs/ kIUckjRZp6Eb0gnUPKp1jfB+YbwATQBV66CfKK7W9FN/cYUEIf9f1B0hkhulI4iAYjchr0 PSTvBc2jKJJt/buBBOyVTyjjNpnCGRP/pQ2yhLptrSFZdbgPni+uKslrXEapTX+s6vtiNL rIxyRxV7sYfCJ9VcFM4CbzarVvgQWbenLqiAFhGnTo7KtCYtDMqfK4uME2aL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS96TR8dSQIizr2DGdhgTudz8ngyRg60GpZiTpsw8L4=; b=PUOkjG+HlrubxkDhPSHAK+rnsz78sZU0t86X90x9WmWOG+iRJ1XPxlJ59hoVICoG/b4BPw ldCUCvhpnpIUX0fZWk18e/bDlchgJYr8Sd7R1ko72TkuD3QFJzcm6EQJAAhEA7X1zFbAy/ IdpFs6WfH7ONa36Th96iUtn2eFAY3xzds4Mb7lxmyO5k8BcxeR44iZ1mmYDEx8f9x6fuPT Vf6uE/DMuK947r8NlUpqkAsNZYeEkcVv13Zlijr7iS6inDovchTJ5cPWXmi3oXh85xjFOq og8sMlRGSS8J3clwe97B8giRxF2uhXJzVCRmR9VBjDZn275dehuIwE6Y1PPJ3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349839; a=rsa-sha256; cv=none; b=I1U86N4o40ADJ7S+A2DgqfBqAHAmrH1Y7nUkFzcwQyCqPEsfCf83PFeZ2tuqY487jt2fmu PrOqruURAxy6ns4DT5Q4fxu/0P05kA77DgJC4D4OlFeQ8M4G7tuaxK9FF/QJeES2p9AmRo hGojGXQ7Mq5RlLEnn8EEATxuwcBFgwjwuEYVhCVEUnMwdtzG0tczJB4HJrZlfCJ9anTGvz 5FbYi3mlnwG0dK6xRG/paYQ7KLtrAdUL14TFwBW2a1CiH+/tNvRMNh9Qev9S22fCEWdRRQ xnFa1Grb752FgQtMDtVTBiNdytPPyLiVzRk6QUaEsb6jNLECxCz38UzBe+t0hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGR0g7tzMQf; Thu, 31 Oct 2024 04:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4hx4g006772; Thu, 31 Oct 2024 04:43:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4hxBg006769; Thu, 31 Oct 2024 04:43:59 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:43:59 GMT Message-Id: <202410310443.49V4hxBg006769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 88971439fbe0 - stable/14 - enic: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88971439fbe02b8ffd129c1cc78094d2278b95a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=88971439fbe02b8ffd129c1cc78094d2278b95a8 commit 88971439fbe02b8ffd129c1cc78094d2278b95a8 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:49 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:17 +0000 enic: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 75ff90814aec7a68e719d326f8dd0a7e1d0fc66d) --- sys/dev/enic/enic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/enic/enic.h b/sys/dev/enic/enic.h index 6d0eb8563efd..8c2212726548 100644 --- a/sys/dev/enic/enic.h +++ b/sys/dev/enic/enic.h @@ -228,7 +228,7 @@ struct enic { /* interrupt vectors (len = conf_intr_count) */ struct vnic_intr *intr; - struct intr_queue *intr_queues;; + struct intr_queue *intr_queues; unsigned int intr_count; /* equals enabled interrupts (lsc + rxqs) */ From nobody Thu Oct 31 04:44:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGV0ZDDz5b43K; Thu, 31 Oct 2024 04:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGT35sVz53cf; Thu, 31 Oct 2024 04:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFPd7W8HvN0isYIxTZHRXa4O8WrxKyPWt3N7l6LQoQI=; b=ASk1p7mB2neGulLhWi59j8CEyWTn5jIwW698pNMYRRrIbqcH7BGUm9YKZpVbq78+/2D4tV d3UF6ZLLetxS7IQMaIymcejK+S9CFCTsg+yMxxJJ1RYcLyqSLhoVISNoX+DJsUZLANTpez MYEju/dOdA06xYLRSBbAl1ILzl7PQ4zVbMdY6peJhZNoIqEkkjjHYEZX66l+hRQfl9eduL kjFd8CCXofHUiWtoDJIcfPtiVNL7Iq6qMU1Mmpk+NkMyA8mfxvS9rqh3Dxj9g6lFX+HC1+ V1FrN6ZIuMrfAY9Z3BLMDKmBuUzpzEVkM4uge+DBbn7XxHgHq6NlnHgAs5Orhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFPd7W8HvN0isYIxTZHRXa4O8WrxKyPWt3N7l6LQoQI=; b=cE6hGyvtEQCEKXnrGpjU4CbANU8cwJI/RwNoHoaHm4L1Sp9HNfEcaEfk6+kDq8oGRpdo7a DiXG1wkMzBN2Mgqpa3GpAb/NR7CkgkcIi9YWvWNyZssbHAoSPKI6hyhcy7o5ynlBMUClb+ 3iahMKW0VIMBRySF9DWe3VRajkKUUlkQk/AFwzqBW5cikfz7ZyWyLHHkP7GAB6lLUhSLAP fXtW6MWnM/9Wbr/WaAccRfGIq93/WCY36Fq4AerTWxqtlbhhLTZ/uJo34VdEBSwZDibJhz Y7eMbI53PPcl+maLTpxkNPZSScnxw/FtpArKaiIUWDLabYFiiE5xeLbBP0gsJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349841; a=rsa-sha256; cv=none; b=qFVvtHd7ykwwyXH3CaAjmcd3C5UhcixUUGGuG6x2CajhHbLyrWZQb5F0p1+sHKvLxGO5Ph e2eNu7TunTSM7AGpZuoaMPF1dGf3+P4EYGcjJbUw3NCUaPsYLZqb/OR/IK2Ig0ljMpkgqE yX9Q1tYP8LnhznYUbZkEF0dAd+BTBt+4y9MFzW5I1h82xEej133kIGxdA8/uPdmnM4cneS lItUlWdV2H8R6/kAZeDuREVtAS6eulwHSP8n0mAHrZYkbY7Rzq5BEAdhUs33WCDUyXYYrI CDM7+VXAbScrmWVS6ARW/0GVzLwT2E60OmFVvvdYQt9cBoDwtjfVu2U7YbFWqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGT2jHFzM6j; Thu, 31 Oct 2024 04:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4i1ka006891; Thu, 31 Oct 2024 04:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4i1Ru006888; Thu, 31 Oct 2024 04:44:01 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:44:01 GMT Message-Id: <202410310444.49V4i1Ru006888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1d8eda2e3255 - stable/14 - mpi3mr: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d8eda2e325502bd0a6b3020cf55bb233d52b301 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d8eda2e325502bd0a6b3020cf55bb233d52b301 commit 1d8eda2e325502bd0a6b3020cf55bb233d52b301 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:50 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:18 +0000 mpi3mr: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 86a2c910c05c65d1318aef81ddbde8ac7eab79b9) --- sys/dev/mpi3mr/mpi3mr_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mpi3mr/mpi3mr_app.c b/sys/dev/mpi3mr/mpi3mr_app.c index 384d0d6fe178..f0dee22518a8 100644 --- a/sys/dev/mpi3mr/mpi3mr_app.c +++ b/sys/dev/mpi3mr/mpi3mr_app.c @@ -2068,7 +2068,7 @@ mpi3mr_get_adpinfo(struct mpi3mr_softc *sc, adpinfo.pci_dev_hw_rev = pci_read_config(sc->mpi3mr_dev, PCIR_REVID, 1); adpinfo.pci_subsys_dev_id = pci_get_subdevice(sc->mpi3mr_dev); adpinfo.pci_subsys_ven_id = pci_get_subvendor(sc->mpi3mr_dev); - adpinfo.pci_bus = pci_get_bus(sc->mpi3mr_dev);; + adpinfo.pci_bus = pci_get_bus(sc->mpi3mr_dev); adpinfo.pci_dev = pci_get_slot(sc->mpi3mr_dev); adpinfo.pci_func = pci_get_function(sc->mpi3mr_dev); adpinfo.pci_seg_id = pci_get_domain(sc->mpi3mr_dev); From nobody Thu Oct 31 04:44:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGS5yCNz5b436; Thu, 31 Oct 2024 04:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGS3y87z53cK; Thu, 31 Oct 2024 04:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnHRrPSEKBr3KvVESdfCY5t7br2u8hrVT+HlSbuPJ80=; b=n/4/pmlGhkvNYHgTLI4IXiMa5gzLjzVSNV5i70vhDO4FH8TTRos7wTgZoTvgreyTbVMvCx tEWZLRk6rm71JBJ6/TiHSWqiHAOCRS77vIC15TNDUO4MC/fxMudUcamhYGpsJcBvQDghcP fK7a9aQhSIxhbQaL7v8U7ciGm/N+dhr0tm2ks3NEKbl+/d7lXoNze9I5Z56dupDZ2BIv/O heaCQLngtL/UvAjMI3Mu9EGVFpW2winTaJ9DlzcOPamiLHs0Lb4pgq7am4oSnHTyQKILSX P/rBEZmjIEfVtZt2ueSehBiVW/2kyc3p8/8Zee5MwJo8QnXBc285xRbuJv9o8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnHRrPSEKBr3KvVESdfCY5t7br2u8hrVT+HlSbuPJ80=; b=uPRQI8eW0H7l0eiULCejlBlLYS52aAOOTSIjsftsA54bWW1nKm6Tw/y8u0azhR1k5EPr5r eflyC8xFsO8NeqZ1eOHVK46wg2HWCKruf+9putrW8jzbbf5gcR5Vli8mWi9ocNrfHu7d8B bwIHEU6zqUxiNHocI4bwbgb9sAnNbXjTzafahKcwcyKBXEX1aw7+B2IchyoTdz4QH62eyV 6y33IOJ/xlMiWmNlTLylIzpYGo0pCtasEZT7mVzH1rQ/zrqeuJSZHH2U7Tp5GcKdzR1u0n Y9yhDCBamQkDjiZyJpgXheo0X9xFN9wyJNKd6kxpQH6NqwjV6VhOsTAjhaGkSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349840; a=rsa-sha256; cv=none; b=SaUEE3c2lTQFFy6bnez3tcRqjH+GfWfIiWcnNxx8KB7EjQj62sn1dlv2PDeqCSSA9X0zqs B2SvfbgmwSR91mx/UCmvVSHMOLe2AsMeRSWjUAXTvXl3J7RflWxNk2tVIK3W7ztFqLnai8 dvjC2UlTDq4G8n13VY1MWPs7GEU1/E+5Qhv4JBP+E2pgcBzCu4jESjd7gTyD1s9PodmAdF wjIF+VHQdFrCp9+qFujGi/UNinz5kJdFujTShHBo3gCxCP0EXZPCS+N/FlrmiUreL8xSyL UqplvdDJyXkUavUnv4RL6RQ9veZBj/S1QWaxtVcEeA5C0O5st01Td7Bhg8Sxvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGS1hCFzM4H; Thu, 31 Oct 2024 04:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4i05D006844; Thu, 31 Oct 2024 04:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4i0n9006840; Thu, 31 Oct 2024 04:44:00 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:44:00 GMT Message-Id: <202410310444.49V4i0n9006840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e96a62ea658e - stable/14 - mana: Remove stray semicolons List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e96a62ea658ef65f820c9e0b6f6e3ff514dc667d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e96a62ea658ef65f820c9e0b6f6e3ff514dc667d commit e96a62ea658ef65f820c9e0b6f6e3ff514dc667d Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:49 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:17 +0000 mana: Remove stray semicolons MFC after: 1 week (cherry picked from commit 6ccf4f4071c5bf85a9aad593e92d1623e949c039) --- sys/dev/mana/mana_en.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index d5efb071a07e..90730bcd70fa 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -1426,7 +1426,7 @@ mana_poll_tx_cq(struct mana_cq *cq) uint16_t next_to_complete; if_t ndev; int comp_read; - int txq_idx = txq->idx;; + int txq_idx = txq->idx; int i; int sa_drop = 0; @@ -2114,7 +2114,7 @@ mana_create_txq(struct mana_port_context *apc, if_t net) mana_dbg(NULL, "txq %d, txq gdma id %d, txq cq gdma id %d\n", - i, txq->gdma_txq_id, cq->gdma_id);; + i, txq->gdma_txq_id, cq->gdma_id); if (cq->gdma_id >= gc->max_num_cqs) { if_printf(net, "CQ id %u too large.\n", cq->gdma_id); From nobody Thu Oct 31 04:44:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGV6qpTz5b49p; Thu, 31 Oct 2024 04:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGV44ZXz53lH; Thu, 31 Oct 2024 04:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sirrAJCF/MwM/XGeLf80ozT9iZRHm5AcCoJkprs2FmA=; b=leH8PBuQ3LmLwbtB5toIkdS60+cD0/JKa8EADBvabVRRtt+Xl2QENktHYbDwA2fh2IpMjv Z9cJxMcoLCAAXI4vXauHSY7ksShEkMctjPiPIT9cTp3NTVzbvTJrhUZYlHBr38ncGfiYIb xoa8fT5z73XarpqXLzy8DZgHq2f+8f/yhkUd+6ftdE4LMkdga9Be2r0TSB9RCzHtAjvlqK uNZGoxzm67VRl08xHU+egsu7hIsRgBLDfeziUakA5i9evTYpg8eEbUY5WeR1ICH0nzlIZw G5TzvY0sMGVad8mnYJugWjD1Ba5IB+hu4iu2Uw4fCQsQefLFT7PVKY9LKwLwkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sirrAJCF/MwM/XGeLf80ozT9iZRHm5AcCoJkprs2FmA=; b=xpQjOy595BIiDWBBRzaYux+gqjw86quHf7kHbnjM4qh4SrXymegzrHR9G6FBCO3u+pQU6c 9sxV8eLRgXevv/+0B+koQcOh7qrA2CacdterZIEa77PsSruK36m/CHDIW3Zjie6RWqY3Ma pLvpYGVTJQJ+/i/gHJErZfWLdOni2wpyajZVh3rlEVYcALA6VoCBXN9e1l0Z2ASIBHVnRE feB0eaj4Xw7O4PP6kbqKf6HkZ1EvkQa/174wOxFkpB7VOeEvnOFbL7SBeS/hRTDajGxpps AfZLVqQqVzz3vgsdhjJD+aTBkfJSry226rpJcMidh+KMJFt3dPmdWmik/jzmLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349842; a=rsa-sha256; cv=none; b=geaEU+GG9u2DSo8DNtD/Wld8xa/sJx7UNPbR3NkS+MuL0BzHgXRclIITbw3U+ptEx1x498 QuNvS7ffSSpDVaDivNqmub0Von2yQqqvBfEAZklytW6UnH8ep9G1bjn2HvroQPHwfQI8ct 7U5a62m2PHgFPg5/qJ5/ChcelaaN+jgRLh9tEln3kSH3UDMB+C3MHNjyXshYODk9kJJFcy 1pcbgUUth/CKGTdseQctw1uhC0A44x8+BCP05URSc7aDO66rXnfJcbeAH5fakQxg23HV9X CdJS75lnzBRLedwM+G75MZG0K9vmubtD6XtPxXlvn1FMr+sEWNebAkt8ScNRBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGV3gVPzMP3; Thu, 31 Oct 2024 04:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4i22c006933; Thu, 31 Oct 2024 04:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4i2PY006930; Thu, 31 Oct 2024 04:44:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:44:02 GMT Message-Id: <202410310444.49V4i2PY006930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 02e61e1d9e02 - stable/14 - ocs_fc: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02e61e1d9e02cb76706d4e82b5f56df20f9802aa Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=02e61e1d9e02cb76706d4e82b5f56df20f9802aa commit 02e61e1d9e02cb76706d4e82b5f56df20f9802aa Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:50 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:18 +0000 ocs_fc: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 36756195a342dbfb8fcfc7561b1d656fc6310d05) --- sys/dev/ocs_fc/ocs_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index c368e09aef8c..62ef3cd49be3 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -12192,7 +12192,7 @@ ocs_hw_set_persistent_topology(ocs_hw_t *hw, uint32_t topology, uint32_t opts) param.persistent_topo = SLI4_INIT_LINK_F_P2P_FAIL_OVER; param.topo_failover = 1; } else { - param.persistent_topo = SLI4_INIT_LINK_F_P2P_ONLY;; + param.persistent_topo = SLI4_INIT_LINK_F_P2P_ONLY; param.topo_failover = 0; } break; From nobody Thu Oct 31 04:44:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfBGX08bcz5b454; Thu, 31 Oct 2024 04:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfBGW5Qcwz53ld; Thu, 31 Oct 2024 04:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1L4UflnNKb3XL0BuJ6/IM6AJO9YDXWX6vMx0tfAYQw=; b=kXv4hHbNyMXTumwThN/WJFrlBI+yziuLIwNPMKmqUoPmGjDpG+czFxVpNuij7v84mTH060 +KrYY5QUBximEGeYDhA8S8gEl36TyTNEi1bRB8fFQshPILSlRZ65j3LtP200BjzENQ9L6J nFVBKuwTt8UHOhOO9ED/i8DiUIk/jtpEIlsbAepeyf9ZGPDCc2QmUTvTitGEK5zKiQYPvq JxPXzJbOFGDsreyNDe6I0KWnosa5GBzCHChzowDsF8HCqJVD3nU4EJxxer4uElwCQdvNtT 2xAyhjTWJWrjLR9+MGxYkFQb0gjaz4ci8/wAl4VI9+1D+mjUS4ngYx9m1mCxtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730349843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p1L4UflnNKb3XL0BuJ6/IM6AJO9YDXWX6vMx0tfAYQw=; b=JklkV/46G4jea0Zf2Nu33paiL1Dwkeg8UwtH12SuQDI3T50Noz7yyGfiav5O4vx+hNEyow NbFGs4QIYzmOOOgkYpudOxE21ojyc+2wdPeaTf0zLPPuUwX+pI3Q1ZOqyNNYX5l551kwGL 5zxLxWYZS4mIiH//i2PVjfbTUi8HtztBTnRp1M36dxl6AVHsBixUVoCdNLvTjz4TumDNob dJTQODUatzOT9uT+OrPmMIF8SQb/IrAyDbKziUKZhiQcANZvlj2+8bL/yPuOwy0O6eVCyK jthip1iov/dmv7Y2fidzCjDjtqQWahLzPLHgSPPavYktBe5X2esNOL68XmWOnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730349843; a=rsa-sha256; cv=none; b=nObrXaoS+ILghKSojnT6YbHyUepNukzHRFRVVjQ6wlIkc1Z25xNfIYsAJqvoaKzgIMA+sC BB6d7NKAyvYHoFfLoZN5tFHK2GdRvg04LoEMUqpa4a8IvQF8+sQ+8H62sPMXtXQRR9e3/p S7XQT8zmDOalmsHcWEMnUCvyU4ToeReHo7jhem16T0UYPlVu0M4NWCYL+j+Qi7FqjsezBJ gATDtb02S3ts/9OWPW6aVM/N5tY29EghdQP26D8B74ppYxkDhAPK6H6yo22Hn8xbhsHetX ol88liD7l3FqrngeaEiLJq98BRC89ZdPn+Pec3gdR9TtgYlsUSZRFOw2fLwskw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfBGW4rNRzM1X; Thu, 31 Oct 2024 04:44:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49V4i3Rq006979; Thu, 31 Oct 2024 04:44:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49V4i30r006976; Thu, 31 Oct 2024 04:44:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 04:44:03 GMT Message-Id: <202410310444.49V4i30r006976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1821145f28e9 - stable/14 - tcp cc: Remove a stray semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1821145f28e954c82654ba8cf67c9939fb136d39 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1821145f28e954c82654ba8cf67c9939fb136d39 commit 1821145f28e954c82654ba8cf67c9939fb136d39 Author: Zhenlei Huang AuthorDate: 2024-10-24 15:04:50 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 04:40:18 +0000 tcp cc: Remove a stray semicolon MFC after: 1 week (cherry picked from commit 2f395cfda8b5c1dc267e9cd4d99d7d0862fb4fca) --- sys/netinet/cc/cc_newreno.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 903f0b7761c2..08c0d2dc1b7b 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -373,7 +373,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) cwin = CCV(ccv, snd_cwnd); mss = tcp_fixed_maxseg(ccv->ccvc.tcp); nreno = ccv->cc_data; - beta = (nreno == NULL) ? V_newreno_beta : nreno->beta;; + beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; /* * Note that we only change the backoff for ECN if the From nobody Thu Oct 31 13:34:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQ2T5jMCz5bhjw; Thu, 31 Oct 2024 13:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQ2T4dtvz4qbK; Thu, 31 Oct 2024 13:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yzdrgaf86B5j2HmYcZNHrTeXTJuW4+R8YwgLWBwrrdc=; b=flp5XLqFeNIBE8NW05apYC6tdOWky0eLKD5N7qQ2rxRQljAGO42lw9GTBscqOaGWNfTZps vZY5216VZKVD+SqDiA2NQTSOz6t3Ra5xxfmsQG/CpMpHxu+6KFHDziqJib14vuqp02Zh6V kF0vQRzvuq+tnOgjmPn7AC6uEPNGoffJW3j8Bkq+yw8s5riT7i5V+5SF0p9iqv+WadK/6f FZ2gOJUfZFU2PNaKtbAIbbXDvvT4SGu6ZxUMkkLqOgdx5VQVEla4k2CJ4aX0TqKEefpkK5 5WXPZc+/yUHi9vHdG6Sh/YyeWpa06CVu0UKFUnI9oHhE3TpZ7FJPKLpQXM/GLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yzdrgaf86B5j2HmYcZNHrTeXTJuW4+R8YwgLWBwrrdc=; b=PgMRN+H+tXZvK76TYnRFeUSbpGKYqd+dfSRspf0eY/sLp29V/y2kzOn+nOmR5kvxZpeRq/ R/gnVXjEZpqPmWHlwL3cET1waXu1niUPqh4IvYXgAjnmIjIf0WzwQ6e6tXW9And6OU4naF 0aFu1D5olFyut9kcn/R7LylaKZ2goRoxlBx78nvGdpD0DZF7z+vpbvUoBQdBHRf37kAk5B 9Huf4XHgDspnugoj+w/2LoCeMLy8KfT15dCX//tVyIDmhw4nzPL/015Bwhio19z4+ZwQIQ DLcvNTkBMtZHPGoFKS5DQTbo6Xvr1hx4qUlF7+u5xya5tCbs4bjzuYcl1GYGgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730381665; a=rsa-sha256; cv=none; b=Hhg1qtOKOoDv8SMisQIMNSuw6JzMUnXapQTmBdj6ArC8O83/YkAkrxqFll2ttG8+aIJdPq zH487YoExmCtYwajfhXhXk83JUkchmSdz0zdln+qmMcJVqALXDiQBMbSVxGQBYOqFwBiwN 0g/p9Vz1ZnUF+7WEFWAjyKv4qhp1mchFCZ2qva5Ek8q/T86Kvbm+dSAFXy4C36lE/uDTUV iXTnm3eruxj5q+Wmfm800Pru9B6mWJuKGhoNr1Ywx9UfFozhM1OtRrDhL1KGmFAj0rJl27 EjAnXreba+lfv312f7/Rc9DpPEukpuFutyrQfC0qn1rveSZ3UOM/no3acCMRPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQ2T4Fjqzf5L; Thu, 31 Oct 2024 13:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDYPuJ091086; Thu, 31 Oct 2024 13:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDYPSv091083; Thu, 31 Oct 2024 13:34:25 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:34:25 GMT Message-Id: <202410311334.49VDYPSv091083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 1e4da42a36d5 - main - ktls.4: note that there are multiple openssl ports with KTLS knobs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e4da42a36d5cf44bacf0e261626b69a4761f0cc Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4da42a36d5cf44bacf0e261626b69a4761f0cc commit 1e4da42a36d5cf44bacf0e261626b69a4761f0cc Author: Alan Somers AuthorDate: 2024-10-31 13:32:04 +0000 Commit: Alan Somers CommitDate: 2024-10-31 13:33:57 +0000 ktls.4: note that there are multiple openssl ports with KTLS knobs [skip ci] Reported by: "Herbert J. Skuhra" MFC after: 2 weeks MFC with: 7200d90644ba61d63e6fec33855bba5d3b7eb7bd Sponsored by: ConnectWise --- share/man/man4/ktls.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 2b4bc315d670..56b03d45faf7 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd October 28, 2024 +.Dd October 31, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -220,7 +220,7 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa security/openssl-devel +.Fa security/openssl* and .Fa security/gnutls ports may also be built with support for From nobody Thu Oct 31 13:38:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQ7648jbz5bjNr; Thu, 31 Oct 2024 13:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQ763gH7z4rV4; Thu, 31 Oct 2024 13:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dIumlZj5gi2uIf0uGKyUryGUpjhWJSWEWCcslvSUcNk=; b=cVRmBJrM32+tsaWuqg1yCToc8IkbXq5zecrRfOJH9vFT41d0jxk/QIWPnD70u+EtYm/Uq/ M07asxIZAWj/GSw3O9P4bupU7g0YCk7uxy8BFbq0KZjjaESW6pbKW267zJw/UNhKe4NtOU 1AdbJgPTWdkhamPdmoUJ5dAIpwMgnGv80XeK+xjREn12oUtjdv5g5/pwqNLYr7hR4zw1sV PgnI/mUmMHr2BBN97iLwQ2xA2bbShAazYyVLJj1QUEo2GBRNtuiIATRTfJZes2C3ZdFBUR uFUT1qNGX1HcelKKlvwMENM6lKTVgmSiNXc9jmNUq5jTXI3YS2rceVaR6C/6hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dIumlZj5gi2uIf0uGKyUryGUpjhWJSWEWCcslvSUcNk=; b=G1/knfNLSfKdT8HkW6FmTSlFJ+R8jCO5rfm/rNZ/xaZ8kVh00oyKJ2VaLtxE8JV1iIpQA8 VOU8XMQJtGCHrPVnbVMbas5jbcWOAv9g5uneBpiU+Nww2Jenlfod+iTXMRG4/2/9MjUNZO am9eC2UQ8HKb3N0qmJYXL1EgV3ldHLOm6H2ifJ6CyNS4OZq+eHHV4IKhNgsPVHv0QVmuvF JOCYiAknqI2VQ8nP1fruIaTJkJlrSrFwPeaGSaRpExGbWvHRWxgxmHa8b+Lq2iA/kB1TRV 9WMhin6p2i5LS0/Z8xwynTanD5gjxoJyj2fS9bJKVBB2XWPppf6JDzxxy2JY0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730381906; a=rsa-sha256; cv=none; b=Psx2pamhjTr989kzaqJ7qPZ2RE+T6QehYPg75BoQceKO3QprrJf54wWq/e/T5Icj6m6FW1 TLTKG6ShOHd9E4ef/GgaX1BVM7knPk+wWZIjz0x8dtzaWXVQZsf+gFkyMUOgPk8rDbMGlJ 5i41u9eWCHlgPzDW5ki18WPAEp+RP2hAeBNvjZ5arrvfhib3bisQXzsuUzun34vdhwTa/X StO3db6/ILpNF8jcypGiGvD4suUvdEcb6cx/m/lNtZNg1uUf04X0hR8ykZHNAJPYffArX9 457f9LAuCYM3y50zHvxbNYuQmU+ipHB8mw0qj0BMzB6oZNawWz/gqq36lKc7Ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQ7638R9zdfg; Thu, 31 Oct 2024 13:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDcQds092352; Thu, 31 Oct 2024 13:38:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDcQFk092349; Thu, 31 Oct 2024 13:38:26 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:38:26 GMT Message-Id: <202410311338.49VDcQFk092349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2e45166856e2 - stable/14 - tcp rack, bbr: improve handling of soft errors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e45166856e271f8a981a2c6c35f4738321851fb Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2e45166856e271f8a981a2c6c35f4738321851fb commit 2e45166856e271f8a981a2c6c35f4738321851fb Author: Michael Tuexen AuthorDate: 2024-08-30 07:26:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:16:29 +0000 tcp rack, bbr: improve handling of soft errors Do not report an error, if it is stored as a soft error. This avoids, for example, the dropping of TCP connections using an interface, while enabling or disabling LRO on that interface. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46427 (cherry picked from commit b2044c4557443bbce974101f04e2b465d1bbe769) --- sys/netinet/tcp_stacks/bbr.c | 1 + sys/netinet/tcp_stacks/rack.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index c1bbec3800fd..2c737360cbe4 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -13837,6 +13837,7 @@ nomore: case ENETUNREACH: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 35ae371a082e..8cdb6e1f9efe 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -22473,6 +22473,7 @@ nomore: case ENETDOWN: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: From nobody Thu Oct 31 13:39:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQ8R5qvvz5bjFp; Thu, 31 Oct 2024 13:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQ8R5KH1z4s8L; Thu, 31 Oct 2024 13:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCSRSDgYoWVdsUTM9QvM2Lug43i94hdURfjS13RxwvU=; b=m95eVMLCLmHltDc5oTj6xKUMLkTiH9l/DUdROPixHWA7NRvZqO7/J79szsbr0Zx8Nbc2UQ KqVRZNNAujoGjvnjRsOitReGmhOtCAG9Ng8mGnuhkVHHXIhGVpWorrggkF4Q6Xtq2jQBp7 hC7lTUwdKxdyDZFd2E1TCCUoiwYyeawg46TJqsogNXJfSm6bazfhmgb3N/5BBczT1ieK8V hdPOMfn2mDS7P2vrcJKVvL80Ze9t+e9DtpiU1czicHFbdin3m/Q6WtBb0UmmYC1dSQU1lh kyfOv1P8qVpmD98TTE6LMu1XQLAua6v8Ds44bB169uvi0QrbbA/ltsWOH7HdQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730381975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCSRSDgYoWVdsUTM9QvM2Lug43i94hdURfjS13RxwvU=; b=A0z2DslryY9CjB9Cg7R9LdzFmKthpbd7qqbAGryzaoVhbYkEGhYu+rG2UQlBLeSz9fzyIV lsz/qkTu72FWSfCxigoW1eyqPjYvqtCAoxWuutnkLYpL4ntqP6wQoYJnGn/qIGNpNtnV4Y pjQ5YIwza3JTT4HZ/p5RA8LEZ2ricXlID4vADk1liAf//aO8OHrgXxJDfEp+yJENf14D4E 0HI4GwWoK0VFJDKypKNzuoJbw+NOQWMlXEtjjarbMZTmuahBo0G2JFCGEPI0TlAPTmxXkg +hy2VJFexeXgvV5/m29Ob5j2Wqrxe5Xkc2LvuxBBnQptuPiBz9REXl+AfeMK6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730381975; a=rsa-sha256; cv=none; b=ImPmZjBM3gr/cScJxt0DYH8gzZZv8e0OfFdS7xlwp63hLqZ5WRUyBgKAkL9nM7XYnHYfE4 j5dSwD2OOrj76kbUwRL5pyoqjDlwv2MORR8qbZe/n1m//XNzW9PlVPvCmrSWGjklDoGE28 PxmThS8EbXEyVIf1qMmAm/Ia0rtecXWJPbvRSBNwv5k6V04wHZoknnpcVDC5+NlGg0IN6A ALPimd6mAENApXVFnP/6mGPOPR18ypJphqgXsbG2eu4YY5x8CSnoStTBccQKU1tk5A7VO5 c92mnR85W6lbpOZPd8IeCUvIEC9/3oMbGN2ieipDF9KzMey1VNFIaUfTpnSioQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQ8R4cwjzf3V; Thu, 31 Oct 2024 13:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDdZ3R092804; Thu, 31 Oct 2024 13:39:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDdZxI092801; Thu, 31 Oct 2024 13:39:35 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:39:35 GMT Message-Id: <202410311339.49VDdZxI092801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 003f1ebcbce1 - stable/14 - tcp: improve consistency of syncache_respond() failure handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 003f1ebcbce10775ae7d4dd631946f9bfec983ab Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=003f1ebcbce10775ae7d4dd631946f9bfec983ab commit 003f1ebcbce10775ae7d4dd631946f9bfec983ab Author: Michael Tuexen AuthorDate: 2024-09-05 01:33:13 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:17:53 +0000 tcp: improve consistency of syncache_respond() failure handling When the initial sending of the SYN ACK segment using syncache_respond() fails, it is handled as a permanent error. To improve consistency, apply this policy in all cases, where syncache_respond() is called. These include * timer based retransmissions of the SYN ACK * retransmitting a SYN ACK in response to a SYN retransmission * sending of challenge ACKs in response to received RST segments In these cases, fall back to SYN cookies, if enabled. While there, also improve consistency of the TCP stats counters. Reviewed by: cc, glebius (earlier version) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46428 (cherry picked from commit ef438f7706be48f1cf7fd4c8a60329e1619cfe30) --- sys/netinet/tcp_syncache.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 6e71d14196f5..b6318ec23556 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -535,10 +535,16 @@ syncache_timer(void *xsch) } NET_EPOCH_ENTER(et); - syncache_respond(sc, NULL, TH_SYN|TH_ACK); + if (syncache_respond(sc, NULL, TH_SYN|TH_ACK) == 0) { + syncache_timeout(sc, sch, 0); + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + TCPSTAT_INC(tcps_sc_retransmitted); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } NET_EPOCH_EXIT(et); - TCPSTAT_INC(tcps_sc_retransmitted); - syncache_timeout(sc, sch, 0); } if (!TAILQ_EMPTY(&(sch)->sch_bucket)) callout_reset(&(sch)->sch_timer, (sch)->sch_nextc - tick, @@ -696,7 +702,13 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - syncache_respond(sc, m, TH_ACK); + if (syncache_respond(sc, m, TH_ACK) == 0) { + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1559,6 +1571,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); } SCH_UNLOCK(sch); goto donenoprobe; From nobody Thu Oct 31 13:40:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQ9P5Hb5z5bjFt; Thu, 31 Oct 2024 13:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQ9P4kSqz4s7M; Thu, 31 Oct 2024 13:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oIxoG9nLUC3unN+GGMEZY6w0QVuFqNMYZ/4/kwybXu0=; b=Fp4OysvN7jzEZHoGivLE4Fw69id1wWhStyET0HBUHYqZ7nhjAckjiD8GVmRaRd9TRbc6If wOJqYdfWeKQhlilWngxq8j+MMhRygoVVeW5cto3aBNAvF4KY2RAg3yUSsCvY3g5x1f6+kb goFPwtyR5kZtIXeNOdXXZHx1Vzt4T/PVjlaFmHa8mkluGsmTjaRfA1GwzggI4bC+sncELl 7uxWLO+/qAg1dABl++cFAPBrP/CGY6h04qRLFIA5aC72X9+uV33XUOdK+ZJ7gYe7YtCojr x0ZuehI2dIqk4HLDG979Jz3d+KU06VO3VpWDefXTa5kg4vadmu8QIaSFub7v9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oIxoG9nLUC3unN+GGMEZY6w0QVuFqNMYZ/4/kwybXu0=; b=N3gl2yGp5TyzuQU/eO+sGTGMuWLn2td2Q358cLz5mELR+J7PgVCNFyS/A0ILOEqQzzib4R C5c7oHPNKUzTot+3JdMyhNWSecBYWolcJqPcpx34fMkcW9JJFyxfY5ZWNuut+7HjYYcYyr esAWddDOHlhrmEQW0KhTbhq9FOV0flN8ELPmLZ7gL+6PlITQduQo7/dht30F7j/D1Guk0H SIAqbeJvbI9dDxjkeTYVMLL1LrCtEfrFRhgjemR7XjMcDExKZ+4jBAMlmos8WkESv84pQ6 WmWwG74cn2fhT2+RPRqsmOZMlIyS19eauHKWycKmw3k5dF3KFvWbWBjPSDrz3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382025; a=rsa-sha256; cv=none; b=TndFptNhIlvPdggkAKJp+4MerRrOL/TvBijh7oHWlmSctjUtwzY8DuFPe4GXIRtTUTDS6J 3GVcbeKYN6JS0FXkEdCFJNWKr0WyMiEktgcf14KR1PE4/m10Q3MB8fqkW6rqYAJmlH9xwj 4WrHL3c/tb0bzc4ahMVpPT37inMihHWgBnn0X20Budf4zM9tu03Zd+3YuY/DYpV/dTYBWh JMxT/uwcOesGFIOBl4pq8CsJ/PhBNQ7t6F+mJBnrMyDqlfuLkLOwPjbyVYmjQEM3lrxLDR NEzG1jVszhAG/diAboElwk8n8FiZwzPp9RUqC0e6qd/7ENXEyefS5er+kEdssw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQ9P4Bl7zddH; Thu, 31 Oct 2024 13:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDeP9O001766; Thu, 31 Oct 2024 13:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDePxm001763; Thu, 31 Oct 2024 13:40:25 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:40:25 GMT Message-Id: <202410311340.49VDePxm001763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c87c8fda44ba - stable/14 - neta: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c87c8fda44ba507a4ac373bf2998e755ab2dd8c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c87c8fda44ba507a4ac373bf2998e755ab2dd8c9 commit c87c8fda44ba507a4ac373bf2998e755ab2dd8c9 Author: Michael Tuexen AuthorDate: 2024-09-05 15:31:31 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:18:52 +0000 neta: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46433 (cherry picked from commit 5203dcce2527fd235648e2b855a13f62247eb2de) --- sys/dev/neta/if_mvneta.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index fdd6467edde1..0bdcdf0db5da 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -3000,8 +3000,6 @@ mvneta_rx_queue(struct mvneta_softc *sc, int q, int npkt) struct mvneta_rx_desc *r; struct mvneta_buf *rxbuf; struct mbuf *m; - struct lro_ctrl *lro; - struct lro_entry *queued; void *pktbuf; int i, pktlen, processed, ndma; @@ -3115,11 +3113,7 @@ rx_lro: /* * Flush any outstanding LRO work */ - lro = &rx->lro; - while (__predict_false((queued = LIST_FIRST(&lro->lro_active)) != NULL)) { - LIST_REMOVE(LIST_FIRST((&lro->lro_active)), next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(&rx->lro); } STATIC void From nobody Thu Oct 31 13:41:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQBJ5YJbz5bjWs; Thu, 31 Oct 2024 13:41: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQBJ3zq2z4sTY; Thu, 31 Oct 2024 13:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbp9UpiI9iMbo1vjRbT+7i89Aqn1NtcWuZlZSDX7npw=; b=hCfvc0Zt0rJNC5P6ZJS6RL3RYm6ouSnfA85mL/qn/vNP6A6BCjLr4gWV4VieL96zlkgrbK yqH8JVfIL5KshJrACEpODMe2Rd+z4S6OHhnX6nPMvh0qOxqpijL7HV5S7wo7jmc95RYkiJ jW8K4DeV+y1wS05paHyx2qS1tqYnxBbBVv6YuDQDqcQ1kYYKY3znWwzvQNYw/iBPnnci5x YCgQ3px3fQXIlB7hnXe3M/GAb2VhXdrm9CpkLZ3Vw0+wQXykNywPJ7gRI/82ZYWHNWFPMc Mju3ksdW9+5AsHyStBVFgPavQlXCSMO+jQhqb8eL/UIekhKcDmOZqaIGgOJ8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbp9UpiI9iMbo1vjRbT+7i89Aqn1NtcWuZlZSDX7npw=; b=UHQH6C7JtEpwx5NuIkJY15Gk0TBTeLYk9ao+BiG2VTnPvqAsSSa2Mq/1u0KhJWMQum/uE7 BA79SzImpOu+s+LPy6MxCUsqENTuM+462eWGSQQrStloZJktUdnztdV/GWrNiwrquw2Vpd 0SDrecNPBF2nq8lD25xC3il1a89X+gXKPn4RYH0n0yWOSggu9mppO5BMShxZ6/YFEWZ1rA sePl4XkLMwFc/tqLBtj/iaeEn4zFP7QysS8mho033cyaIbCMqjx4ZwBU7lfHhi1VcqPx30 ysZqo36X/M6IcTeQ/0DtI2aw6Tc4qLlpwghu7+mpJHT3xoxNMmOztgKkIOYwUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382072; a=rsa-sha256; cv=none; b=OaO703fZXjLEZr7sHACMnoH1VKgllF1iXZbCMjVOxIDOlcD9+//+4TA9tOgTIXq2kUOzHZ QwCYzDauVHtChHH9z23l3LpyeGhNW5cOnGusgySdDTX87IiVolJurIOaxi7UYlRN3yYiWa ixVmAhWoNUaJYZQCkpvMDa42irLXivDGUxqJuftDqfA6Ei5xWEJU3Xw5ScgTNk80BQHQgj UzQT9fZ3GiTnHjobpYE9mdmEfIBKEmi9KRzPzT0T41nkblyegPzFlJhD9w7Nt2T3lwZ/AU RI6UiDX7BEpLfKSa7EqAY+6bbefBHm2eMqxKyyK8db3SsvTCTqWICXfEwRhx/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQBJ3Ng9zf5j; Thu, 31 Oct 2024 13:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDfCEQ002121; Thu, 31 Oct 2024 13:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDfCmm002118; Thu, 31 Oct 2024 13:41:12 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:41:12 GMT Message-Id: <202410311341.49VDfCmm002118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f84956ab3781 - stable/14 - al_eth: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f84956ab37819227f488adde81d4cdbba34ce47a Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f84956ab37819227f488adde81d4cdbba34ce47a commit f84956ab37819227f488adde81d4cdbba34ce47a Author: Michael Tuexen AuthorDate: 2024-09-05 15:35:40 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:19:40 +0000 al_eth: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46434 (cherry picked from commit 0b45d36510d8c629fcc49805bc64e5893f4ba63c) --- sys/dev/al_eth/al_eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c index b4fbf041660b..1b976e7a724c 100644 --- a/sys/dev/al_eth/al_eth.c +++ b/sys/dev/al_eth/al_eth.c @@ -1581,7 +1581,6 @@ al_eth_rx_recv_work(void *arg, int pending) { struct al_eth_ring *rx_ring = arg; struct mbuf *mbuf; - struct lro_entry *queued; unsigned int qid = rx_ring->ring_id; struct al_eth_pkt *hal_pkt = &rx_ring->hal_pkt; uint16_t next_to_clean = rx_ring->next_to_clean; @@ -1672,10 +1671,7 @@ al_eth_rx_recv_work(void *arg, int pending) "%s: not filling rx queue %d\n", __func__, qid); } - while (((queued = LIST_FIRST(&rx_ring->lro.lro_active)) != NULL)) { - LIST_REMOVE(queued, next); - tcp_lro_flush(&rx_ring->lro, queued); - } + tcp_lro_flush_all(&rx_ring->lro); if (napi != 0) { rx_ring->enqueue_is_running = 0; From nobody Thu Oct 31 13:43:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQDN417vz5bjby; Thu, 31 Oct 2024 13:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQDN3VYyz4vDt; Thu, 31 Oct 2024 13:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMVCX2Y2Oau58E75QRckYMSsQVW8VuuZftM4Em3AMQc=; b=v6FDV5MkXtShcgNt8qqOnBk1hhhMnMbAmACnBe8UOxGQlGxdgn9DyNignZCdS1fPjV7nJ0 s6M9q/GOKTz9kuQYk1SGRihEOiMLcApTeBKeH/49XHHiZyucIMH6tagpHQF/uKoXGKtLtB 67e4XEcHVEf69erhQMBKhCtOiQSa1AQa0JYxzs6G0ymWCpp45+LnhPK0+Rw8wlTnsjGtv4 MFJrmtWepdB2gXRq4T+MOHHMjpZQm8DYmSdmT5qnyFW4xiHMnvERKi5LbsjNkN3tlwpEVo 2FK+/zm3PAWl4/GKQ0UwTrDCE4+cFCFxce1sFjIC/m8EFkcoiyZnVS359hrFaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMVCX2Y2Oau58E75QRckYMSsQVW8VuuZftM4Em3AMQc=; b=V5XPcoFcBXn9FvtM/aSOK6gn8kjU1h5pJuMeBpWGqWxqMUfmIsf6r4A+a5sXVTTyCgK8mL vPrX7M1Juihw+TLHU4zgY6kdBRk+loS0hCGeKf0JD0BtKVSJKgP8FqBLWxKr8vO1N3Nsfj 0VW92+TK51jehAwk5PG8O3YSJamM17L/NNk+RjmNSelTWEcdWzMKC8BGa+6+9iiopg6EY0 e0A30p800NICsjKqPZesP4hSRGgDwaO8aBluo6CYGn2h1Q9aDEocU19cwXOXKEyqYmpczu I3zxQ4kYT46Tx/JAB1HIpypXgeAKR5AbwQHsyD8XasICcDgB9XC2beAvDYxorQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382180; a=rsa-sha256; cv=none; b=Nnph1tsHgxFESONlTKFT4ttVYllPW2lCwnJ9kIx2M89oFQJWBr2GdRya9vD7eD+5TB8spm BjM8euFeOWES38sxAYYp+kcnunS75wgAMcea2qHV+HaJfeKKkwoVWoyBnxNgKrl9GSw8zh ckO0lr4F2uyGTK0koXf/uLBudx+WfT2ZVVCN6A1jxeh2R/kVOyu96n9pZPZGptoXWMQLoD ZO4uxJ1QshYmXGYmCs1ilBv2qKNJdfHoCNRkWe7sdCTDXuT4jOytkGhYMEOQP8TC8IYWQ6 qH6oTdwKtr+oTlcNcA1kH9BJPGInQvOZ2IM1KIVn8CjQjorTHkYzFfYOanYXIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQDN35q4zdgS; Thu, 31 Oct 2024 13:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDh0EG009552; Thu, 31 Oct 2024 13:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDh0fs009549; Thu, 31 Oct 2024 13:43:00 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:43:00 GMT Message-Id: <202410311343.49VDh0fs009549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 8df12a277f09 - stable/14 - tcp: make tcp_lro_flush() static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8df12a277f0912805c5f54a96a94e29c30a0efa6 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8df12a277f0912805c5f54a96a94e29c30a0efa6 commit 8df12a277f0912805c5f54a96a94e29c30a0efa6 Author: Michael Tuexen AuthorDate: 2024-09-05 15:44:33 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:20:35 +0000 tcp: make tcp_lro_flush() static tcp_lro_flush() is not used anymore outside of tcp_lro.c. Therefore make it static. Reviewed by: rscheff, glebius, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46435 (cherry picked from commit e06cf0fc5dd626c34acdef308b696b4995371a4b) --- sys/netinet/tcp_lro.c | 3 ++- sys/netinet/tcp_lro.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 906e01257a04..10afed17bf3b 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -83,6 +83,7 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO control structures"); static void tcp_lro_rx_done(struct lro_ctrl *lc); static int tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, bool use_hash); +static void tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP LRO"); @@ -1104,7 +1105,7 @@ again: } } -void +static void tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) { diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index b4b5e3f811e4..a94eca665eb5 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -216,7 +216,6 @@ int tcp_lro_init(struct lro_ctrl *); int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); void tcp_lro_free(struct lro_ctrl *); void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *); -void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); void tcp_lro_flush_all(struct lro_ctrl *); extern int (*tcp_lro_flush_tcphpts)(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); From nobody Thu Oct 31 13:46:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQJr3DtDz5bk6D; Thu, 31 Oct 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQJr2l1dz4vcM; Thu, 31 Oct 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvMOXogRGE3PuIYLdCHxc/n0PvTL/1PG0tlDbYjatvg=; b=sbglna9SVdV2cdXYPZg7cVx+Xy6tJrQvNkgclZQOrKk+/fVEUbtIfbFMuufp1lNACBk9YB LZu52iC4JBgKJOVXsSwf0yWIC3o80OYm00WRt2Syf3dPQ9E9Sn63oNmgANIDcO9VgvocKp CT0sOijlqE6hnSGN2pYsRkXUNEMcmkrY2jg89hmdfzHthTsZ3C3Zvgyy2iirBIagzGKbvE qYsi1aQHA2arHvO1WwJRUpQH/6s+dMtnNTEXc2J+CTmgxyIPEh5hC/36dgv32NL5GFdp6O RjRljOxusZ2a2HI0ErTkpGRD+LvBRErMsSGYMnraGI95LYJbrOwzVjy9blUJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvMOXogRGE3PuIYLdCHxc/n0PvTL/1PG0tlDbYjatvg=; b=DWEyVQAV0AfO9gcTi2YSv2bcdBspN7sD3kfwYVM0bp++RNpJvlkFqFU33MsXbLgxibVwrT 0owC7sI8/EMUM80zFMkjzYJvAbTJCZEb7M/Sr4UDWG4V2QWzMKFQ5g8aVQnUeXRudqAYHf uLCOLr3R5gKgv7j8hptd2ABY0B+I0uWW4UC6BvCgNS0HdRoU2lkgcyhMbaPoun2w7+uV5+ 29IRktMQZX4rrC1lVMbg4L+Hx53hqP+jgupIEphYtb73SllXCr1sLKa3MMvWV/ZETT3FjH fx3Uo9fNapn6QSxzy0q277JjgqU1yCEtlD+QVRpe2V0oP0XelFdA42I7eA7waA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382412; a=rsa-sha256; cv=none; b=Rk2mibIm7AvjYz623sD4F+2DbkWhpN1jZjXgJwb21j9eTwrs0NreQEEQa6BHhygL3EI/Iw 0o44onWKmmPbJv7hSOlQtzVZ+Hb5bMNwhO1aE9JSrVmYzgpWTCzp0dZ+tFQbUhTB5y00xd fvMgCkQachoFcg5hHfr2i4YuI3kOljZR/tFaHQMUD7CF84m+f2exqUVqfS1cYzwL916iFi Ik6rh+xYsaYEdDoH3++0LQgmwyOHDYOZ9GiUYooZ+41ZDlO5fAEBu6vSHNjO5Y7rmIsV7X D15lH+GkSXFFLkDhidqzwHM57iTW2tP0bkTQ5i84PJBwqnLhT7C4KEnOpjWJ2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQJr2Cymzf49; Thu, 31 Oct 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDkqoQ010797; Thu, 31 Oct 2024 13:46:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDkqgG010794; Thu, 31 Oct 2024 13:46:52 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:46:52 GMT Message-Id: <202410311346.49VDkqgG010794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 406d75a5816e - stable/14 - MAC: improve consistency in error handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 406d75a5816eb45bc16197b0eff9360461541ad7 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=406d75a5816eb45bc16197b0eff9360461541ad7 commit 406d75a5816eb45bc16197b0eff9360461541ad7 Author: Michael Tuexen AuthorDate: 2024-09-26 06:02:06 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:24:34 +0000 MAC: improve consistency in error handling Whenever mac_syncache_init() returns an error, ensure that *label = NULL. This simplifies the error handling by the caller. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46701 (cherry picked from commit 3f2792166aeed4baf07d351bcb12a9d196c443eb) --- sys/security/mac/mac_inet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/security/mac/mac_inet.c b/sys/security/mac/mac_inet.c index 29a355071065..9770fa840f95 100644 --- a/sys/security/mac/mac_inet.c +++ b/sys/security/mac/mac_inet.c @@ -485,6 +485,7 @@ mac_syncache_init(struct label **label) MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label, *label); mac_labelzone_free(*label); + *label = NULL; } return (error); } else From nobody Thu Oct 31 13:54:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQTN3CQlz5bl4R; Thu, 31 Oct 2024 13:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQTN2h8Bz3xCP; Thu, 31 Oct 2024 13:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZZZkkRpN9rlhpsTORExFyqPcNNWEtJX2HJkIjA+ltE=; b=HCLMFrhPyoch/ogRgnBW7peSt+n3xvd2DYjL2PLG2R0jJRwCqgkJklkuvmdcH5w/2a8xNp +42wclC+lXAH4np63PmTobkfl4LWnAkkACgFocDIrTZsxS5t8WiNBOAiDWftL1JwKGD+Gc gtnb2LlUCgdE1JkPBH8WPZ9EDxDkl5U7fa4qFCLTy7IDYGfP5JFLQfpYhAKAExh3kcS68J yZXREmt4pjmKaRJJQk7YVcwV7AKu7GvWKy1n05B6VdLGK78jpq2RBJ2/JCZtGVsI37xjzC e9CFrG/fGGRlgJk1A7Ja6GTKAgNZcPeqwDrOI2WmFfM+ov9g2Xfik/fd7kqSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZZZkkRpN9rlhpsTORExFyqPcNNWEtJX2HJkIjA+ltE=; b=aIEpwFqsPWWnI+pi+PHEdiqTs4sZoNWJtt8tuZlhFG6eYwK0o9ZkJeE+UwjV4S5Awo9PsQ 84KZqlc6RaNvRor5yNrDdebR+3bIggu8OGOJxcSgnVz/Cy/zAIz7KGBViwCsZj55fV1eRS jXn4Z04RT5eLbE2SGSYIyX+zeSZTle4EqsTNKkEipWXrPjmHbpXPtVTupHwFHDK1INXCFh T2OZhx8xD9Z+103TOBszFfn5VYa6n+UHiNMQIe+F8D0PfVxgwZCbJdkwZdpIvfkdUZvPBG DAPSoYzrzSDZSGxktbc4rE97w2kUw7rLDNgwn1t4REb7tSo+uUP3qRQvyNVMcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382856; a=rsa-sha256; cv=none; b=KQ9bGDuXnO5Oi2MJm41IxwzI3qDynPLjTQt3OU/wg0bAv9CVm9TrbUw8Eju570hGD/9Lsb 5oHhltykURfjzwu+wHxGNCuTzPdZxX9/6q4M/0wqWqTdU0J8leOZ0zXd4fWIWPdf13dSYs YKDNkPCerDrwnaNIIoRdRytzv1wO6a1MSWLTm3gp/DaTInkjcxPkb1rWCxmUXDMswFNe5F NXDivFkc6xvytLtVocwhH6HvcRE8xvLuRpl3FF7Js2NVA2X3zz3J2rj9ctSWRJ6kfEEkeG iS6XTuQid3AIn5r2xdknfVzHnVP02CBiwUEh9Ay66Zwp+tT+iFoh6hmnJQ0PVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQTN2HP9zfLL; Thu, 31 Oct 2024 13:54:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDsGWA027897; Thu, 31 Oct 2024 13:54:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDsGfT027893; Thu, 31 Oct 2024 13:54:16 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:54:16 GMT Message-Id: <202410311354.49VDsGfT027893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 66c7d5365a78 - stable/14 - MAC: improve handling of listening sockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 66c7d5365a7812f530d15962fd3640db5a2d4b15 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=66c7d5365a7812f530d15962fd3640db5a2d4b15 commit 66c7d5365a7812f530d15962fd3640db5a2d4b15 Author: Michael Tuexen AuthorDate: 2024-09-26 06:06:24 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:32:36 +0000 MAC: improve handling of listening sockets so_peerlabel can only be used when the socket is not listening. Reviewed by: markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46755 (cherry picked from commit 2fb778fab893b4a8a86ecfa20acf2e23bb2cdae8) --- sys/kern/uipc_socket.c | 5 +++++ sys/security/mac/mac_internal.h | 1 + sys/security/mac/mac_socket.c | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index a038939399e3..4621339c4429 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -155,6 +155,7 @@ #include #include +#include #include @@ -1466,6 +1467,10 @@ solisten_proto(struct socket *so, int backlog) sbrcv_timeo = so->so_rcv.sb_timeo; sbsnd_timeo = so->so_snd.sb_timeo; +#ifdef MAC + mac_socketpeer_label_free(so->so_peerlabel); +#endif + sbdestroy(so, SO_SND); sbdestroy(so, SO_RCV); diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index d1ee1af09c0b..4b2be98b4e03 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -242,6 +242,7 @@ struct label *mac_pipe_label_alloc(void); void mac_pipe_label_free(struct label *label); struct label *mac_socket_label_alloc(int flag); void mac_socket_label_free(struct label *label); +void mac_socketpeer_label_free(struct label *label); struct label *mac_vnode_label_alloc(void); void mac_vnode_label_free(struct label *label); diff --git a/sys/security/mac/mac_socket.c b/sys/security/mac/mac_socket.c index be1363024657..910cab493d6b 100644 --- a/sys/security/mac/mac_socket.c +++ b/sys/security/mac/mac_socket.c @@ -170,7 +170,7 @@ mac_socket_label_free(struct label *label) mac_labelzone_free(label); } -static void +void mac_socketpeer_label_free(struct label *label) { @@ -185,8 +185,10 @@ mac_socket_destroy(struct socket *so) if (so->so_label != NULL) { mac_socket_label_free(so->so_label); so->so_label = NULL; - mac_socketpeer_label_free(so->so_peerlabel); - so->so_peerlabel = NULL; + if (!SOLISTENING(so)) { + mac_socketpeer_label_free(so->so_peerlabel); + so->so_peerlabel = NULL; + } } } @@ -616,10 +618,15 @@ mac_getsockopt_peerlabel(struct ucred *cred, struct socket *so, buffer = malloc(mac->m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); - mac_socket_copy_label(so->so_peerlabel, intlabel); + if (SOLISTENING(so)) + error = EINVAL; + else + mac_socket_copy_label(so->so_peerlabel, intlabel); SOCK_UNLOCK(so); - error = mac_socketpeer_externalize_label(intlabel, elements, buffer, - mac->m_buflen); + if (error == 0) { + error = mac_socketpeer_externalize_label(intlabel, elements, buffer, + mac->m_buflen); + } mac_socket_label_free(intlabel); if (error == 0) error = copyout(buffer, mac->m_string, strlen(buffer)+1); From nobody Thu Oct 31 13:55:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQVk3rLBz5bknD; Thu, 31 Oct 2024 13:55:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQVk3PJqz3xgJ; Thu, 31 Oct 2024 13:55:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g1dCY1ZEZEJtEKNKPtD8oZ1oSOG9M+DjL3P0lxcRXS8=; b=OwfJSiyApcOsZRvor/mM7FfbApjItwWTI//q39zHTuEYdOwesAjbjzuyDTtv+CLUTTql6u rFRUWUN/3ZS/JjxP7dGt9N5rBq4QdYIbYh7ybrdwbw5FscoQtxo4qz2oO3eg3vX+pKB9fp cEtC8obA21K2iHJ+QmDdw8DmBuayFNq+kKBQvdd4pLdPNQ74OTZF5eDaWZrtEOA79UfLyy GoiYSHTMXP9ZKW0JqYGphNICfk28ZdykJnaHDwCHVwtivn8vvZ4W6uOOjALLnnkrYynRtX obaMCwUTi18a3m6F7sJxps1E1U1D6VgLFTrHdbCFwPEHjb8NG1PjL9J9XOSKfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g1dCY1ZEZEJtEKNKPtD8oZ1oSOG9M+DjL3P0lxcRXS8=; b=jq+U6DpeRZPZhnO80rSlYMNGgf2gFNo2qqAUNWAhtBChqiP1/4A+dBGb47wi1dGU4Q7EXA ddy9+BxvRD7L1ASL6y4xozqwREpYd9QoOO6bRRHlsBiFt4TMORTBBA6lmI3ojlCrCp/PUN 4rrI0OH4fExkqEdklPkmxj1qeFuqMls3tkrVqb+33mWUNKqp2oYTAn/2bv7JXhrRlD3Bjy 7DiKbismVXhTfd/CmFR+XZdRf5XPsAVRwYhRHqRapWWl+6z19V+h9xucTGlRq+8g2mheDg vV0juiRqazlbxSUdAqNQ1CpvSxIh7MNXTe/GRqolSctDAoyAiA95/ee7T0sKQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382926; a=rsa-sha256; cv=none; b=ydARtVSHuRMYDfeykEwgkds1s6MBlZH0zjkK3PyHKy3lOafZveR6oFaKvKMwVQqz91Jk78 n//VxqWEEx06aMkeqom3CaafUHUduSbYv7B3iCqCwZILkKRgNfmqJPyN6fYQunyAis9xM9 5rpj0S+JSOyEbFUn5DFEKbLx8xwRZ4lJ2XxGBl0rE0aPTuT+S4AGm6oDwowZs7QNAKWOX3 +RFmf2jUdZblGzPXRkxx0aPgiHXYk4K7xAj2l8xL/M2EXhFDBms/bxIhc5lrSsFK2vjPyp xby0pF/nYxt4VLs3I8repBhVo88ZUbTHi0k/pjeR5FRAf9vRrH+XGtbk+bu3aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQVk30nlzdh2; Thu, 31 Oct 2024 13:55:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDtQJP028408; Thu, 31 Oct 2024 13:55:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDtQxf028405; Thu, 31 Oct 2024 13:55:26 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:55:26 GMT Message-Id: <202410311355.49VDtQxf028405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2f5ac48d9b6d - stable/14 - tcp: improve MAC error handling for SYN segments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2f5ac48d9b6d7bd8928604f8259c48ad4246e7ae Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2f5ac48d9b6d7bd8928604f8259c48ad4246e7ae commit 2f5ac48d9b6d7bd8928604f8259c48ad4246e7ae Author: Michael Tuexen AuthorDate: 2024-09-26 06:10:01 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:33:35 +0000 tcp: improve MAC error handling for SYN segments Don't leak a maclabel when SYN segments are processed which results in an error due to MD5 signature handling. Tweak the #idef MAC to allow additional upcoming changes. Reviewed by: markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46766 (cherry picked from commit 78e1b031d2e8ef0e1cbc8874891f5476dc7868bc) --- sys/netinet/tcp_syncache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index b6318ec23556..fa64d2d79c3b 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1382,7 +1382,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, int autoflowlabel = 0; #endif #ifdef MAC - struct label *maclabel; + struct label *maclabel = NULL; #endif struct syncache scs; struct ucred *cred; @@ -1773,10 +1773,11 @@ donenoprobe: tfo_expanded: if (cred != NULL) crfree(cred); + if (sc == NULL || sc == &scs) { #ifdef MAC - if (sc == &scs) mac_syncache_destroy(&maclabel); #endif + } return (rv); } From nobody Thu Oct 31 13:56:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQWd2cZmz5bl6y; Thu, 31 Oct 2024 13:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQWd23xpz3xyH; Thu, 31 Oct 2024 13:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tR9jt5U6I7vSkHokU85APh1Y3qyinpi+Y6oL9/+pnkY=; b=jARC9VV7Mp02WddmwfgwxF5zB34hUtiYd1pUiRHBSpWuyeoSRrNH9Oa5xJSgTLr5QKeQQK YcODY7UVXCYZKboZB3hx0yRyfEqsjDUWO6C6jypGFhBb9OAcE7OH5O7wVvraBx0CpfQIBS Fa9tIfJGPiXOkams6cGgS7ATxpgG8FbuQTbHlZqaEtQxZ0PSUwGEhRUHgUFv6U82W6zlh3 R5EZQ+CuwilWN+VQZJdJ9tPpvkLdPrxOAST8gfhRRlR0GfC+UKZ/+zD9PZjCMDNEx1R9zm 4SibtQI1GZ66obGEfTAUZ8LzfyvqEVeuDhqxsraL1kX2GNPADOdWpttjnewoOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730382973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tR9jt5U6I7vSkHokU85APh1Y3qyinpi+Y6oL9/+pnkY=; b=Qy5pBzN/5fZ3YDGzeZFor1LYdGccmIuyi2L6OixxSttTDxf95vJ3iBE/HFmyJdSGGj33ks MHXmyHMrSZk9kCCDkUPhtordR+koha/XL9kHmam2SUzlBJSXiQ1cn7MlerNRFzwUQh18Jj DQkA0UlGvpFef5cB1x37MpArT8q6nhaPADLgZ1sxVjKIpOHwTWlxRRC8npvWtAg8iA2ZKe RlIPLhM04MHdsEbG1A6vFuCpdADH8bJmqeM0ENk3pA9z26qtusaoC5lZUG1ELEboCBBoKC 64B/9tnxqiIUctUMeUIFCsn29kG2mHg7KYZEK2y8AnEHdmY6P3GbpA5uGdiIyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730382973; a=rsa-sha256; cv=none; b=f0dtbt6JnWm9zJZqoLxYRCrTKP9Fn4IvSewxlOGcD0MpQIgZ3nBRuN1KUyqe9BtekA8dmv l67PjSxFpPRUOUJ+liFpVVeULApIH7062k1p44+3O+AedBAeRNF2QOtOAyfRQbbsC7LhL1 p8s6Yk/6vF67iTywyu/dUcud/+iUeE/CYLnasA3/EWseehMjCoD8tpXDfdKId4XHLQ3j9G n6uK/HXjjlg2Z+29bJ4URKJz0ueVYjQ5ZZbMb/pI2g1QjyyABdbcgujKS7VpJbrHJ8QOzd aZIUb0e7vnAwNwM7caP8pa8j4B0Nf/i5/PvhOZIJDKcV6p5RYX5SWVL1bxal9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQWd1MQ1zfGg; Thu, 31 Oct 2024 13:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDuDFx028800; Thu, 31 Oct 2024 13:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDuDGX028797; Thu, 31 Oct 2024 13:56:13 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:56:13 GMT Message-Id: <202410311356.49VDuDGX028797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 00c3c39fcc4c - stable/14 - tcp: improve ref count handling when processing SYN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00c3c39fcc4ccdbc2b83ed0f0f2838863856b795 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=00c3c39fcc4ccdbc2b83ed0f0f2838863856b795 commit 00c3c39fcc4ccdbc2b83ed0f0f2838863856b795 Author: Michael Tuexen AuthorDate: 2024-09-28 20:06:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:34:33 +0000 tcp: improve ref count handling when processing SYN Don't leak a reference count for so->so_cred when processing an incoming SYN segment with an on-stack syncache entry and the sysctl variable net.inet.tcp.syncache.see_other is false. Reviewed by: cc, markj, rscheff Sponsored by: Netflix, Inc. Pull Request: https://reviews.freebsd.org/D46793 (cherry picked from commit cbc9438f0505bd971e9eba635afdae38a267d76e) --- sys/netinet/tcp_syncache.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index fa64d2d79c3b..0f7e7359679f 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1385,7 +1385,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct label *maclabel = NULL; #endif struct syncache scs; - struct ucred *cred; uint64_t tfo_response_cookie; unsigned int *tfo_pending = NULL; int tfo_cookie_valid = 0; @@ -1402,7 +1401,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ KASSERT(SOLISTENING(so), ("%s: %p not listening", __func__, so)); tp = sototcpcb(so); - cred = V_tcp_syncache.see_other ? NULL : crhold(so->so_cred); #ifdef INET6 if (inc->inc_flags & INC_ISIPV6) { @@ -1633,9 +1631,21 @@ skip_alloc: #ifdef MAC sc->sc_label = maclabel; #endif - sc->sc_cred = cred; + /* + * 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 and take a reference count 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 = crhold(so->so_cred); + else + sc->sc_cred = NULL; sc->sc_port = port; - cred = NULL; sc->sc_ipopts = ipopts; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); sc->sc_ip_tos = ip_tos; @@ -1771,8 +1781,6 @@ donenoprobe: tcp_fastopen_decrement_counter(tfo_pending); tfo_expanded: - if (cred != NULL) - crfree(cred); if (sc == NULL || sc == &scs) { #ifdef MAC mac_syncache_destroy(&maclabel); From nobody Thu Oct 31 13:57:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQXb2SNXz5blXj; Thu, 31 Oct 2024 13:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQXb14fPz40GG; Thu, 31 Oct 2024 13:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mgXfg86HtGjfEVQZKuqTPBPi+eXJ3IGv4jtwvN39XzU=; b=H36skgjj9Andg6/IMs8ukmknGvqI6Q/CBgxIqyHRz4Iu4/c4+tC2nShcaRDhpb0RqXchUm p+fAz4On6ljWZfdPDXz7yC1Zn3z2w5KX0b2mDFdJMmNGYHxFlDjAkVVdrK/aFbD6csEqSD Pd4JEJGmdH42PmUNqG5IGy8SjISK3g1qnDnlodidoAHEGirzbb2V1Ynfecr8jSFWsJ+2W7 TSWr0J8D75g5xf4U4ZDxNZd1lgJGX9vesqCUnAm3suCqxMNfKFzBCcVs0OYVUyyrTqvjqY hwiFrmSWG1d337dh8AdkLHuutwbjshBrQNJQkNUMDWfi7Hcw9lYUoeOWC+JC+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mgXfg86HtGjfEVQZKuqTPBPi+eXJ3IGv4jtwvN39XzU=; b=KfSw+lXM58W2Wiv0+IHcILcb4iiBHbvAnviZmYQAGCSF0/1WL3gcT2hMiliNTptL1LBLZC w/5PKU39mH+RWH2l+iFoiz8A8Z/EwSd2aDdZDAYflHRM1lJZA9TcIqhVcHWOIOK6FKD/g4 GY5j79y84adTtGWcqdWDBrvpgxB3av5XFTxY3ogjrrQZ3J7ylP6rhgke/R+SqlyVr0K3vx M0IVWItBZlLAYZieo6SLpz9r3Rf+t/o+Ku6Bq6oG/r+57zKV7/4SIKtTh6k3eI+sWr/7L6 51jrRL7Zoyo6fc+0sc06a0R7xA+G14nz/Ypefk9Zw3VpreY/3w9zjmX+gvJmWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383023; a=rsa-sha256; cv=none; b=Jw3Jc81R12fL2jUR+vGC1GpWb2xVoOYYf9uwiK2qeD4ZD8Deux4Y7kExFowABgW/mzUWin d8G71laMeQXgyBGMFigOJTbzoCSOE6sOm8uDFzPycBejKFd45wn+cB99nipiR++Po2kkP5 36IuFUEMBgkAAV1bZ6Q7r3NtpDgg4BvgvT3MxsoMSnYYOw0/IZdRTIZucD9atTSsLaY5Rx Lj+jHzhwqQeo4jIvuc6NlMDEsHZHyMM/GqzogTEWFMHMXIhMjj1zvsh85goXP3NAtNM3zb qCgoi74VQErWhhpjfEHerLVnB7AXQUYsfiEAD8tFkxLtJEW+V7P5lCvgqqiPxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQXb0hw5zf4t; Thu, 31 Oct 2024 13:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDv291029222; Thu, 31 Oct 2024 13:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDv2d3029219; Thu, 31 Oct 2024 13:57:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:57:02 GMT Message-Id: <202410311357.49VDv2d3029219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 9a3bb25babfe - stable/14 - tcp: whitespace cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a3bb25babfef234940e31bbee26082548c67614 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9a3bb25babfef234940e31bbee26082548c67614 commit 9a3bb25babfef234940e31bbee26082548c67614 Author: Michael Tuexen AuthorDate: 2024-09-30 17:53:57 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:35:24 +0000 tcp: whitespace cleanup No functional change intended. Reported by: markj Sponsored by: Netflix, Inc. (cherry picked from commit a2e4f45480c248036b002904ddbceef20ba7c523) --- sys/netinet/tcp_syncache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 0f7e7359679f..c0c571fb76c2 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -237,7 +237,7 @@ syncache_free(struct syncache *sc) { if (sc->sc_ipopts) - (void) m_free(sc->sc_ipopts); + (void)m_free(sc->sc_ipopts); if (sc->sc_cred) crfree(sc->sc_cred); #ifdef MAC @@ -1530,7 +1530,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, * forget it and use the new one we've been given. */ if (sc->sc_ipopts) - (void) m_free(sc->sc_ipopts); + (void)m_free(sc->sc_ipopts); sc->sc_ipopts = ipopts; } /* @@ -1615,7 +1615,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, __func__)); SCH_UNLOCK(sch); if (ipopts) - (void) m_free(ipopts); + (void)m_free(ipopts); goto done; } } From nobody Thu Oct 31 13:57:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQYM3kpBz5blQM; Thu, 31 Oct 2024 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQYM3Bz1z40M1; Thu, 31 Oct 2024 13: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=1730383063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YuwsCDnJZSl6+5NoyHOxwdzdA1RyDfEBVI7gCBLM1Q0=; b=XK6r9pcAKKC21zDX27cCPR65CgwMcBH9IosY/dpcXHsWHULVQDlzqSCuY1NOArxGTrzoN2 gGT0m+OvXGU7lLrC36ZFiV/K026ercRBSJsBYKd3jo5gUEbOk9hRx0chOgNnqnJ1BJAX5L Yaz6tSS16Svh6rl7iYbR7QLsjj6PbQOGzjnvAUWRKvRlX1kfSafVJWT05gnf4D6mY7WcT8 CxyQG9/uZV2PqvwWO356nko6NJLibbvMq2K5rmyvrRPRt1YBxObev1qCEgDoD1cUGhFaGA arV1OYN84U5PyviAzbgEL0gESQivOIbSy8Mqx1HqAeUf/iUTbITXq5TQelOufQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YuwsCDnJZSl6+5NoyHOxwdzdA1RyDfEBVI7gCBLM1Q0=; b=es6iRI5QQ/rjyePr2K5W7zor2eiteF56ebTUvyhopVS5f0jiuXmpvPzKJxycYVRgo4K+mp FR62VJbojxUnFrPM6iL21XMO6iGDY4vBpdFIOkkd5nsF0S0L0tVeEPtOkqsp4zNO1RHaVt 1TLQIop/LYAJadTGG0zB/C/gJIhSeQyiVPRkxTIKCjN/Rdfmcbd5yWoXH/4EdgSxM9MCMy MKObBDhCdWZGeliBOdwMBJ/ivv2vpaaHBEoFUnxr5KzF4I7BUf8DLq7sdP4TzU70NUQKnu LGlvZa23ZhKBMLLP6jJ8mtpViNJzuQsAs2q6XN7sFYQz9vvZZAZdqcpqfr2COA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383063; a=rsa-sha256; cv=none; b=xORZtZmle0xfnErvOrMcK/+YGNj31moJoR9WqJ1/B4D6sUaRkQ7w4bET92uLi4ew3zgEmc jod8lvBC5i71scVcxKyeyIxYdAAyOUSBd8a8/gD/eupxVFf0/ZzFQ0mGpqv7MD988tjsGw c9xdbIDjQIi+E17G300CxBLEEyGzs/z4ej24pGjetOK4EIyGgzEhw9Bhl329M44LNqtc9l mb4YBTNCLa/uPUfD1k8DVvjHlXPCdn5QzwFHdyova5y143UIBl5/ZKW5B/k2DSzN11RHbo yDFNoaQsJE/Td2zd69GnLKqRC8NM+mwGfYAOXfUSlTTWs0Z6kj1EYTfeAA2Qww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQYM2pM5zfJr; Thu, 31 Oct 2024 13:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDvhJJ029532; Thu, 31 Oct 2024 13:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDvhVx029529; Thu, 31 Oct 2024 13:57:43 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:57:43 GMT Message-Id: <202410311357.49VDvhVx029529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 67e469299821 - stable/14 - tcp: improve mbuf handling when processing SYN segments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 67e469299821c9b02b26e1b379f2b1754fee536c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=67e469299821c9b02b26e1b379f2b1754fee536c commit 67e469299821c9b02b26e1b379f2b1754fee536c Author: Michael Tuexen AuthorDate: 2024-09-30 18:00:04 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:36:12 +0000 tcp: improve mbuf handling when processing SYN segments When the sysctl-variable net.inet.ip.accept_sourceroute is non-zero, an mbuf would be leaked when processing a SYN-segment containing an IPv4 strict or loose source routing option, when the on-stack syncache entry is used or there is an error related to processing TCP MD5 options. Fix this by freeing the mbuf whenever an error occurred or the on-stack syncache entry is used. Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46839 (cherry picked from commit 01eb635d12953e24ee5fae69692c28e4aab4f0f6) --- sys/netinet/tcp_syncache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index c0c571fb76c2..6d171b2b7ea6 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1614,8 +1614,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, ("%s: bucket unexpectedly unlocked", __func__)); SCH_UNLOCK(sch); - if (ipopts) - (void)m_free(ipopts); goto done; } } @@ -1785,6 +1783,8 @@ tfo_expanded: #ifdef MAC mac_syncache_destroy(&maclabel); #endif + if (ipopts) + (void)m_free(ipopts); } return (rv); } From nobody Thu Oct 31 13:58:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQZZ3Fhfz5blXy; Thu, 31 Oct 2024 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQZZ2kdCz40ph; Thu, 31 Oct 2024 13:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z1O+aPEaBbMXiDJnUpOb8XKLgSzzMV3s+MAmQiJ1Ns=; b=G0PsJ8DbONjdK/HrDOgcYVd6U3JZL4UZmlOquOP8mmLCMckG+ympLVztYTh0CE6xgfT5sO Ysl4s+x1xMTjyq7czZnj+GfvjkvdVQcPBBnOqO3Oa32dSw2pq18HjhSM2Brrns4/zPnARf +jAuapAy3CWYs9QCoCdGBHPqwhWB3fw5wiA0OuWeNvYKCnwnjn6sUM4rC+tr9A9p0i40ht ciYta1o+/0LBpLtMlnvXyzTfpVi8Xvh7BCgOdUzLLSAPQ1ls4qo2mKn4hE9s1U5ypou1ET /+L+5NAt9jVfNOxk9yyEC78oTA2rem2e+GWeLdtb8xq4Ix8NLqQG18pWUe3v8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7z1O+aPEaBbMXiDJnUpOb8XKLgSzzMV3s+MAmQiJ1Ns=; b=izNoeBWj+j7EVvoJ0YToVK8OPOW2VPyDF84TEFyZzFewjnk+61c6Rv94Y6aXC9bKXget/b yuYM7LV7LVLQMgZX7BCvpcjsdcWUcsgH7OEZTwBiNyXmPcE+EAHtUcnzXKT1zRvn2l4BPs mBiDXYJ7xoICU/Nj2narBUYFceUEtU94DvRy8fSIy7WaRwozCU0vlrKW79t9pcCdsk0fQM KWFeUG1G/rHHinrNXqEjfXq8BoFykaJDKBk8XwMO5hdV6GeTXp3Jsu/2IDFLhVm7lerFFQ 5jPC1fHJ6KICiCQn7CILVKIDov192rmFsz32lyHY1DgO4Hj1Fm+e7Pmv7QAGUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383126; a=rsa-sha256; cv=none; b=livC3/EmKoLgfu5+qFLiYH4SluJO2cacAKuG/e1EOpkNCiEnaOP4ll4y4GOcMhPx0+105Y ivwW1enG2Q9R5jmvEbvHjyjn8Lla1o14FTASnhkLr0k8Mj2Qybdj6cHhHC6/qBOcTTY7Oz uTdqpoaqXzIX2GgPWWSo5WbLip7Y3qFDe97/QrEz7Msh8kNiEeEUDiLl5OZFBP/LpdyONK tQEVcCxKwwMBq2jU6CWJtMnYRGG0LzapY++u4m48cYhSWvNcx6xl8ZmweahPlnDPTBsV+T e2nxSqcVaLR4rHvmX4PiwyoAWqr2reONG3AE4uyDpdRPOhu/RnbTdipnnkWQpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQZZ2L9xzfLN; Thu, 31 Oct 2024 13:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDwks7029951; Thu, 31 Oct 2024 13:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDwkVn029948; Thu, 31 Oct 2024 13:58:46 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:58:46 GMT Message-Id: <202410311358.49VDwkVn029948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b785f83e987d - stable/14 - tcp: small cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b785f83e987dd59d4a2812fc2e300436c47e08c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b785f83e987dd59d4a2812fc2e300436c47e08c0 commit b785f83e987dd59d4a2812fc2e300436c47e08c0 Author: Michael Tuexen AuthorDate: 2024-10-01 15:32:18 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:37:05 +0000 tcp: small cleanup No functional change intended. Reviewed by: cc, glebius, markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46850 (cherry picked from commit 2eacb0841c7dfc92030abc433e53cd31383a0648) --- sys/netinet/tcp_syncache.c | 59 ++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 6d171b2b7ea6..15244a61d8da 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1577,49 +1577,46 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, goto donenoprobe; } - if (tfo_cookie_valid) { - bzero(&scs, sizeof(scs)); - sc = &scs; - goto skip_alloc; - } - + KASSERT(sc == NULL, ("sc(%p) != NULL", sc)); /* * Skip allocating a syncache entry if we are just going to discard * it later. */ - if (!locked) { + if (!locked || tfo_cookie_valid) { bzero(&scs, sizeof(scs)); sc = &scs; - } else - sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); - if (sc == NULL) { - /* - * The zone allocator couldn't provide more entries. - * Treat this as if the cache was full; drop the oldest - * entry and insert the new one. - */ - TCPSTAT_INC(tcps_sc_zonefail); - if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) { - sch->sch_last_overflow = time_uptime; - syncache_drop(sc, sch); - syncache_pause(inc); - } + } else { sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { - if (V_tcp_syncookies) { - bzero(&scs, sizeof(scs)); - sc = &scs; - } else { - KASSERT(locked, - ("%s: bucket unexpectedly unlocked", - __func__)); - SCH_UNLOCK(sch); - goto done; + /* + * The zone allocator couldn't provide more entries. + * Treat this as if the cache was full; drop the oldest + * entry and insert the new one. + */ + TCPSTAT_INC(tcps_sc_zonefail); + sc = TAILQ_LAST(&sch->sch_bucket, sch_head); + if (sc != NULL) { + sch->sch_last_overflow = time_uptime; + syncache_drop(sc, sch); + syncache_pause(inc); + } + sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); + if (sc == NULL) { + if (V_tcp_syncookies) { + bzero(&scs, sizeof(scs)); + sc = &scs; + } else { + KASSERT(locked, + ("%s: bucket unexpectedly unlocked", + __func__)); + SCH_UNLOCK(sch); + goto done; + } } } } -skip_alloc: + KASSERT(sc != NULL, ("sc == NULL")); if (!tfo_cookie_valid && tfo_response_cookie_valid) sc->sc_tfo_cookie = &tfo_response_cookie; From nobody Thu Oct 31 13:59:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQbH4hJnz5blT7; Thu, 31 Oct 2024 13:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQbH49P9z4162; Thu, 31 Oct 2024 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WY81bY1TNl3KUaYBaRdXwwD7XOgRPXE7q8W2UzEyTTE=; b=X7sGCxhMOT1VRq1o6lF574r6azcvEY6k53YM9LFLGKh3vJ+U0kDgvN2supoN6Ui/ViHD4E kFytnUobDgI1Q9VQ5CrdEJjQtDCR5FEFXN3YB5KQiovoUYKAVl7U8KoNoW0zfzGtOuETIP IyPfNPnCZY/ZAkRaz6IIRnNHf784n5YtHdSp17UYyL0vHtSLnld1fE59SWaMj+Ie0bMLBp t5rMpOdj341Tr0pavYHBq/TxJn9FF70x/j92JZpAgfUHzlXNHFadidV9hbke9wC00F7Flt tufYtbI1bftTmBU/H38KfP4Oj8Xv2z3WPDcDOCnP5NzwBq9RbmltnO5jHvnsoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WY81bY1TNl3KUaYBaRdXwwD7XOgRPXE7q8W2UzEyTTE=; b=mKSO+e56JA8JXK9sA+qnt+FGioBB05uEbG7nSeJiqeMGBcu1InHvCKPcTfP3LpSyP7H4dc g0Dl+Y9Vzt8hH6DGob9eCvLKFkIVQ+r6IQ57jlTOYy5Ea5HXdciPNGJj59PLrXtXoUKg9A gUd19/9bY253SkWs41YCe+PP35qUdg0ThEcpjvXAcN8h8Xytb0asK4IJsGV3QrXkCI8fb+ /swCs2WY50Q0bISRFrjcGGtcXIt8dc/HRiAnDychTSQNZX/ibBKAHxeXuLyucRJITQ7bZQ /IOLhEySs+pM0WoD3RWRs3N+serPcz/VCC2r4Kz0CataUa2W/hH7ZFNbRtI5mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383163; a=rsa-sha256; cv=none; b=KHTwNsWgQddoidizu8dvkiMTCzTSLY8sqZsUI3HbT03gXdyXP7bBzr9FV+jcOGMZmCem8Q bXVaNWpqEvnaAyLM9XLCqKHE+QJqZD3edxlZlCmVIOS5jYv6MUacW1Rr8FQemjGTPg7nGG +7ELoGyJHAIuTTkTQbYM/0FpXDtyV6yoXP2gmYfDYALAITTdP7ZC4Klmi/vz99zz7O0x7B uavw6+guthPMYxLLLPlKyt1ia64npcdXis1O5fW4fX3s+2vmdlj1Er7h6fkg3qAb3Q+RZy bepVAzkzOLzp222gZ6gCR8S/qizDX+QpG7kFTJm4r1OFcFRxyfneJ94ZHtqIxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQbH3f9Gzf4v; Thu, 31 Oct 2024 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VDxNKV030281; Thu, 31 Oct 2024 13:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VDxNt1030278; Thu, 31 Oct 2024 13:59:23 GMT (envelope-from git) Date: Thu, 31 Oct 2024 13:59:23 GMT Message-Id: <202410311359.49VDxNt1030278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 1e980fdf7ade - stable/14 - getsockopt: improve locking for SOL_SOCKET level socket options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e980fdf7adee2d3ad53b29e192d134bb46d3e6c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1e980fdf7adee2d3ad53b29e192d134bb46d3e6c commit 1e980fdf7adee2d3ad53b29e192d134bb46d3e6c Author: Michael Tuexen AuthorDate: 2024-10-07 14:46:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:37:55 +0000 getsockopt: improve locking for SOL_SOCKET level socket options Ensure SOLISTENING() is done inside SOCK_LOCK()/SOCK_UNLOCK() for getsockopt() handling of SOL_SOCKET-level socket options. Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46881 (cherry picked from commit 3326ab87cc22cb70a41e13aefd8684ff0feed01f) --- sys/kern/uipc_socket.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 4621339c4429..84d817c9ada1 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -4112,23 +4112,31 @@ integer: goto integer; case SO_SNDBUF: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbsnd_hiwat : so->so_snd.sb_hiwat; + SOCK_UNLOCK(so); goto integer; case SO_RCVBUF: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbrcv_hiwat : so->so_rcv.sb_hiwat; + SOCK_UNLOCK(so); goto integer; case SO_SNDLOWAT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbsnd_lowat : so->so_snd.sb_lowat; + SOCK_UNLOCK(so); goto integer; case SO_RCVLOWAT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbrcv_lowat : so->so_rcv.sb_lowat; + SOCK_UNLOCK(so); goto integer; case SO_SNDTIMEO: @@ -4185,15 +4193,21 @@ integer: break; case SO_LISTENQLIMIT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_qlimit : 0; + SOCK_UNLOCK(so); goto integer; case SO_LISTENQLEN: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_qlen : 0; + SOCK_UNLOCK(so); goto integer; case SO_LISTENINCQLEN: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_incqlen : 0; + SOCK_UNLOCK(so); goto integer; case SO_TS_CLOCK: From nobody Thu Oct 31 14:00:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQc649Ymz5blX0; Thu, 31 Oct 2024 14:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQc61Y1Wz41Db; Thu, 31 Oct 2024 14:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T7Ude7hwCotXvUhTCihw7H64hyZQktBSlICJd+RSmnE=; b=kwqEVl7AS9jObCMjjUesSgR/mz2yohgwsyEyeuDqoGHkI5C18LU2atyqeRkZaJhbOkeyuu f7ApSIHGXfiDTpsKm8BWyJnYCRWbAKYcIvdbmUhV2MXALDOta+bsS22S6nJb5CcZ2MW4pd hy5BEHjoK8MbbJyVum9vGE6aoYJ0BxMjm8kzoAWG4Y6GP+hN1zwXQNvzT1+oFCADQ+Y5gN PvYlvgRiQCPEGRpmDz7X1ruh/GaKX+9V2+Fu4vYPVgVhWtJCBxh0oohq2TxdRyQHsu3R4J WxUCiBw4i+nIVcKnBsiTXkH4SePWkTB+hDKthqiU9VuRNiKWovkRhx1yNNCu4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T7Ude7hwCotXvUhTCihw7H64hyZQktBSlICJd+RSmnE=; b=Slh6V1C4MsS0NzP2ssw/krCrbCW/AWZyz/VG64fSeoWUk3TscbPeqB+sJxySLa3jIGsEvl 1Ty5C3ZX+2BN4pJpkuXsXFaXpF9N+MHVrdkk0oG7eUk0EZ5sdoRbjo/uhR7v2WnhzBNZxc E1dufx7Qg5ynn7bsLNqO9x3W3nzRzA2PJ6Cjo6qPGVVXB3p39WQMoS30sJ4NI8Za/cIx5T LyPfBe55SU+yHdAwwU3hcMVqHyREwt7YZTudCDMuczbpM1mnF3wSW9ETXxPrylx0HIXyxw Pw30S8WSaJTEo2uQrafcVOR7eBcpfxVCSf/187CNCKkMWAd9BA1iTNWvqsqYbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383206; a=rsa-sha256; cv=none; b=eaWhDPN/H5+kv2p/vX3TnOh4HmuXgcOz6b3SsTCF8dPfxXhW4hDrSOhoqpDHQZAlab8X6D 7KX1kl9ellO6u+G7RiZD+w9/9n/wYMdKoRRt9URYUTm1/uyB5pozKNftCIBGfvNsrH584v Trzp+r3lPazHhMQ1uPAonCtIoAAWjrqbxX7NjnqF6b34Jbg7xzb7N8RQ9584bRl0Le/jhc W6IfaVHHf1eifoRkOIbFgfu2CQrfoc0Z+mN0yFRJybU/34X6jJggT8obDD9Z9wdDwUtMSO vlR2DaRrBXEI/dKwILmORKk3db5yg+O8eYOwMn2uLCwzj4GFyHRf7XoSMlFI0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQc6193Yzdh4; Thu, 31 Oct 2024 14:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE062N034549; Thu, 31 Oct 2024 14:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE06xt034544; Thu, 31 Oct 2024 14:00:06 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:00:06 GMT Message-Id: <202410311400.49VE06xt034544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: efcaa63aca0c - stable/14 - sctp: cleanup sctp_delete_ifn List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efcaa63aca0c7b1c0baacd333725f137e3fea678 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=efcaa63aca0c7b1c0baacd333725f137e3fea678 commit efcaa63aca0c7b1c0baacd333725f137e3fea678 Author: Michael Tuexen AuthorDate: 2024-10-10 08:36:00 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:38:39 +0000 sctp: cleanup sctp_delete_ifn The address lock is always held, so no need for the second parameter. No functional change intended. (cherry picked from commit 2e9761eb80f3e58c116efc10c739ed0d8497c1d6) --- sys/netinet/sctp_pcb.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b2cafdc2f81e..2972b0a925d6 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -277,25 +277,16 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap) } static void -sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) +sctp_delete_ifn(struct sctp_ifn *sctp_ifnp) { - struct sctp_ifn *found; - found = sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index); - if (found == NULL) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); + if (sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index) == NULL) { /* Not in the list.. sorry */ return; } - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WLOCK(); - } else { - SCTP_IPI_ADDR_WLOCK_ASSERT(); - } LIST_REMOVE(sctp_ifnp, next_bucket); LIST_REMOVE(sctp_ifnp, next_ifn); - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WUNLOCK(); - } /* Take away the reference, and possibly free it */ sctp_free_ifn(sctp_ifnp); } @@ -450,7 +441,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) if (LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { /* remove the ifn, possibly freeing it */ - sctp_delete_ifn(sctp_ifap->ifn_p, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifap->ifn_p); } else { /* re-register address family type, if needed */ if ((sctp_ifap->ifn_p->num_v6 == 0) && @@ -555,7 +546,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ - sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifnp); } if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { /* easy to solve, just switch back to active */ From nobody Thu Oct 31 14:00:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQcr6nZPz5blR0; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQcr6GR8z41ds; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21Y1+ZJpP8T3nASTox9bSOX6kVTEgaalBPBNm9Eg90=; b=dK2bW5rqgqObemlf7s4pBgg5gV3EovoOvE/F4lPvHjSH9imLHShZ8VU1Atmy4U8YJNqKK0 KLRgudhAIKGTRAM6Y/KtWsqLlUbn8i5vnSHVzSLBsb0YBTz5fy7eKQaxe1ePJ8btvgrFPR azLAPhXsLT6KCmWgg41C6jvKR5G22cEJ9tfDf4GyIlp+Pw3enr/rLj37buBRdFDGawgxUb jpCYyMCA6G31c0yZtg36bqpXApefg79PBPtNznYbgda37EMvDs06zSqc6l++MC35uNROdN LW840+1bLCc0qsLkVzHHP2OmrODg3MGuhX2al1AooR3kC3zVcCE1kI91kd/1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i21Y1+ZJpP8T3nASTox9bSOX6kVTEgaalBPBNm9Eg90=; b=szR/CjNH5pEMqIY3w+PJ/rsyggL7pQ9tPm0QTKp2dWIklxtHGcUOPUGgI/+FvL7VckrlfL VXu+GQUryB8I92s0pi7AFlcyKoqPQTCt4uGzAdKwoCmPaGZNGbwHEO/30yOH0hGsRfhcwN VXlB8o0w+VN/sFhi8UWIKy1kVe5wg+f+9K4UTi5fd7zqPpvzKzTh987qnJmv3DlpO4tPuU jKBbf1rBV+/zYX4khIJ/SJvMbtqjvTb0b0Fr+aMUD6YjQuBnxC/9rf8cVKBTcX7wU8d9NZ iAupoSBudPi2B8cEMdiGoitKh/TOVwxMsnJvYEA4HyY8t4Qmke5DpD8sdsUrhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383244; a=rsa-sha256; cv=none; b=uERw0i0hWjb8m4tZ8YpKoNjldvtsXoYxVgaX4DNpckWQxwez5BH4CuTw9hU95IX4G+52FT WQAtmtLijuNJWHaSiHGw1tVgM8CammJcYz7JF8Ymg9kTe5nN0OzaG+aRGRzq0+K3oHBKKt 62yb49hAQS5ByZxzGIWYpTBt0E5DTejRd3rzQtY/qIp1hEq7Odb6H5ZrqGPalpraA6ofnc n+IjWTpdPMpG7u3AJw1DW+ub6BkrtNUJCBY/DR5MXK2n+VSfFfv1yl9AjuwKLfoUbh1CVn puE18S/eWPyiEbugRL2rc69IrUjMNquumdNygPhGw3l4bYqn3EPpnwhdK7ajQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQcr5ssqzf6y; Thu, 31 Oct 2024 14:00:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE0iN9040584; Thu, 31 Oct 2024 14:00:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE0ij5040581; Thu, 31 Oct 2024 14:00:44 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:00:44 GMT Message-Id: <202410311400.49VE0ij5040581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d3459fe7f737 - stable/14 - zfsd: replace vdevs with the AUX faulted state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d3459fe7f737f7168992e833fdad7d3aa1f01bc9 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d3459fe7f737f7168992e833fdad7d3aa1f01bc9 commit d3459fe7f737f7168992e833fdad7d3aa1f01bc9 Author: Alan Somers AuthorDate: 2024-10-03 21:54:28 +0000 Commit: Alan Somers CommitDate: 2024-10-31 14:00:32 +0000 zfsd: replace vdevs with the AUX faulted state Without this patch, vdevs faulted via AUX state would not be replaced once the appropriate drive is replaced. ZFS does not internally use that state, but a drive can be manually forced into such a state with a command like zinject. Submitted by: Goran Mekić Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D46866 (cherry picked from commit 618ae939b7f95a197a0518cbb390a572bb90c6d0) --- cddl/usr.sbin/zfsd/case_file.cc | 2 +- tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib | 2 +- .../zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh | 26 +++++++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc index f9fd84da7277..7adfb08b75c6 100644 --- a/cddl/usr.sbin/zfsd/case_file.cc +++ b/cddl/usr.sbin/zfsd/case_file.cc @@ -288,7 +288,7 @@ CaseFile::ReEvaluate(const string &devPath, const string &physPath, Vdev *vdev) return (/*consumed*/false); } - if (VdevState() > VDEV_STATE_CANT_OPEN) { + if (VdevState() > VDEV_STATE_FAULTED) { /* * For now, newly discovered devices only help for * devices that are missing. In the future, we might diff --git a/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib b/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib index a4a7ef80ed9f..6369387ba069 100644 --- a/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib +++ b/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib @@ -52,7 +52,7 @@ function wait_for_pool_dev_state_change function wait_for_pool_removal { typeset -i timeout=$1 - wait_for_pool_dev_state_change $timeout $REMOVAL_DISK "REMOVED|UNAVAIL" + wait_for_pool_dev_state_change $timeout $REMOVAL_DISK "REMOVED|UNAVAIL|FAULTED" } function wait_until_scrubbed diff --git a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh index 4eb04d60809e..7ad7a9113402 100644 --- a/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh +++ b/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh @@ -83,19 +83,25 @@ typeset SPARE_NOP=${DISK4}.nop typeset OTHER_DISKS="${DISK1} ${DISK2}" typeset OTHER_NOPS=${OTHER_DISKS//~(E)([[:space:]]+|$)/.nop\1} set -A MY_KEYWORDS "mirror" "raidz1" "raidz2" +set -A MY_FAILURES "FAULTED" "REMOVED" ensure_zfsd_running log_must create_gnops $OTHER_DISKS $SPARE_DISK -for keyword in "${MY_KEYWORDS[@]}" ; do - log_must create_gnop $REMOVAL_DISK $PHYSPATH - log_must create_pool $TESTPOOL $keyword $REMOVAL_NOP $OTHER_NOPS spare $SPARE_NOP - log_must $ZPOOL set autoreplace=on $TESTPOOL +for failure in "${MY_FAILURES[@]}" ; do + for keyword in "${MY_KEYWORDS[@]}" ; do + log_must create_gnop $REMOVAL_DISK $PHYSPATH + log_must create_pool $TESTPOOL $keyword $REMOVAL_NOP $OTHER_NOPS spare $SPARE_NOP + log_must $ZPOOL set autoreplace=on $TESTPOOL - log_must destroy_gnop $REMOVAL_DISK - log_must wait_for_pool_removal 20 - log_must create_gnop $NEW_DISK $PHYSPATH - verify_assertion - destroy_pool "$TESTPOOL" - log_must destroy_gnop $NEW_DISK + if [ $failure = "FAULTED" ]; then + log_must zinject -d $REMOVAL_NOP -A fault $TESTPOOL + fi + log_must destroy_gnop $REMOVAL_DISK + log_must wait_for_pool_removal 20 + log_must create_gnop $NEW_DISK $PHYSPATH + verify_assertion + destroy_pool "$TESTPOOL" + log_must destroy_gnop $NEW_DISK + done done log_pass From nobody Thu Oct 31 14:01:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQdQ40Q7z5blHc; Thu, 31 Oct 2024 14:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQdQ3SJlz41m9; Thu, 31 Oct 2024 14:01:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olTce2iF7OlJMv/4ma1uPFmlc6CLvZO9shFqyHKWdB8=; b=QKEpmBWasujMtR0hvpv70iqRf2nEh45G0DBYfM2NR1bjQN4hQnzLxrmlVzHxA0yzsLj2rB lGrFXOGIl495EeN3ZzHZPdpQrz65o2VMPWaDV27PoE/Dz3d6GjhXTn7dqMFCk8I2xvQdlI tDBZ0B7Si09W81EzvOV0/pzDfw/N+pg2f4fqQuwlI9VqeTWLCcyQdUPNbbPUDKPukVevbR Mjf2C8n7wKGwNkf4ilWyv+GLGpyIGnV14yDwKvw8dN+vOFy9EzSwowx3LTfp/0W+POSYfh FCdSO4zWCrs+aYmuru7M6qeirJwXf4gZyU9roZHBw39Vuiipgmeln2KQG5GJag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olTce2iF7OlJMv/4ma1uPFmlc6CLvZO9shFqyHKWdB8=; b=Iz/PTzgGFgxRqISvb2IMlF71ymnYOgcoYqeG5AlnmbT+LEb9WXRNpbMzC8+gE2RQAGKWAv F+pBKW9LYuIidrmfZgUP1G//rM3q8lkWtmdeR53kSXV3NOeq/I6ra4bJntHm4ekmLSCtUY DEEfK4L68c6Udm6oYnTLIfVCGIm6oUpEY15eyJECxbyYlyy4E/LKFjgsk7//zY09nqIO0w EzhkrUV2WjjguRca4Xsd0AoLRATLWZ2sqHv7EIF+iyqEUs1S2yJAstshXRd95Gc4f4MoiM wgbJm3c/89DcnZihZotFc+/zqPTxevKe9QY0yMR7dgbUd0vCVBSudhYrPLxxgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383274; a=rsa-sha256; cv=none; b=eTxO50pKdp4cjOdtmDUnIUylE5uNlOST1SJ0hge61TV+r5pM5N8CMBwQQyGFNNWhyCzn0F Gs8S6mz8n7d6On+yxQpJr6NluMgV2eIQ3bLE/fbZXRvIlW5dRKThPpFirSWu1q1joxZExV yv5L5TTQgEAE+zAR+ZzwwQ2KREl4/HWHfEP8f4OSkmN1Fz9dqXDSaj/wYl8TYiuvp2BSnc SXsaydbFDl2npea2yD9kS/ujpqgyNqakMIpj1akhwyQ8huoPjXU3OAh4dcDIlMxM8XU1eF KS2Y4pZPkx3wJHrWUnwG05uzsFQKOl70K0xlG5VU92cIBQIllKKyQO8NbeCg3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQdQ33gMzfGn; Thu, 31 Oct 2024 14:01:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE1EHs040874; Thu, 31 Oct 2024 14:01:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE1EmZ040871; Thu, 31 Oct 2024 14:01:14 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:01:14 GMT Message-Id: <202410311401.49VE1EmZ040871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: ebdee305b160 - stable/14 - sctp: make sctp_free_ifn() static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ebdee305b160223fd3f7f5357f649dedb8805fa7 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ebdee305b160223fd3f7f5357f649dedb8805fa7 commit ebdee305b160223fd3f7f5357f649dedb8805fa7 Author: Michael Tuexen AuthorDate: 2024-10-10 08:42:35 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:40:03 +0000 sctp: make sctp_free_ifn() static It is not used outside of the file. No functional change intended. (cherry picked from commit e1a09d1e9df30347c279604191a04ce2ef20bf0c) --- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_pcb.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2972b0a925d6..f89865456274 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -239,7 +239,7 @@ sctp_free_vrf(struct sctp_vrf *vrf) } } -void +static void sctp_free_ifn(struct sctp_ifn *sctp_ifnp) { if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&sctp_ifnp->refcount)) { diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index ade29fb3544d..ed6a1c34ccf7 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -508,7 +508,6 @@ sctp_add_addr_to_vrf(uint32_t vrfid, void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu); -void sctp_free_ifn(struct sctp_ifn *sctp_ifnp); void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void From nobody Thu Oct 31 14:01:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQf91vTyz5bldJ; Thu, 31 Oct 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQf90zlDz42Cw; Thu, 31 Oct 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrdMZ8y+6jobTm9mPdymTfF0XSSPk7Z7ZBm5m/zzu3w=; b=SuKlOsWE3yG123bRE97AZZGCrA2sGbwTa/QME3w+HvbOaqFyWmzJpBcezqQATNc+LrI3tK vTUgvFXqQiy1A3G3EUZeqgot32vfu+9bJKLOMCGCJWsHYaw375xBVjmhotgDpo2fx7MaeA g9oAqWR6DI1FLQwEbZ1TlliK6nrCKMYRNE+EVJfd92su5zu/rLxasdik+rG5kKFN3DJvED Mec7TuCSYQAZWOvD/yR+pcz+CZZZHZdtDGJjFNf/RSfHR5uIcryXRGho5wNUn5JtMH0vsP W+8J68SpLryN6adccyXl7Q3EeAGMgln9hPVomeDkyeruamntmi2oDFmQth0AKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrdMZ8y+6jobTm9mPdymTfF0XSSPk7Z7ZBm5m/zzu3w=; b=ZyivYml6EJW5qlbDXuYmyMBtfrAWrsNDg4cnRh2MLdxX3Wp2K2jKktxeHafd8n4YA3rv3Z cYqGdRF0Ty3i5vE9TDLVqUs3Ux0JGdYo/z83qzRw/dnLDElTtgNE+aE9IymWoJV/TEdegw FX3kTO/uZIUO28ZHX0bWkgBBmRkIYPuOTFtGc+v0DJPJEOqwr0Rf62SqxB3NKUBGA4Z9b1 O9BHyCwLxbBti5c2tc/4wzhobjzHk86n/m2yfPeQtCdgBUBWB4usfUVmGH6104AwoTpkDu UjSgCXM1nmwanw6Fw4Pz/Vzf2JfxLJNshA6qCipZSYo+1jrsf1ZnZ8AnmvzIqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383313; a=rsa-sha256; cv=none; b=GLgtL/udzn0HX7ltm+0l+cuflawy9ygszTJPpoIA7JBB0jZJ8ZovuEWh371ewP1lTQLmdY UxY6MEbedTqOD3KT+p7RBSb6CnzOjZs5EjOTfrYLOyfUUcKqEPV7ZDYXj7Hsb0tDBvsM7b nztO8jdRGyzVa8j1DwQFZwatEMnkQ0/jqFKE3klFWL0WZ3b0pAmCCNH5YsArwR6DgIvU+j odmaq0O4w+t461BshODQTL1PppLW9boLWIjRZiDiRMfdkB0A8SMgM/eNWKY0UqdWIwbA8n 9gqayvOoFAD2VRk0ULtF1R3NDLbf5LNL9PW2ocP2xdOOwj3LNCOwZzllqoKQHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQf90bjhzfdB; Thu, 31 Oct 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE1q3O044443; Thu, 31 Oct 2024 14:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE1qMo044440; Thu, 31 Oct 2024 14:01:52 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:01:52 GMT Message-Id: <202410311401.49VE1qMo044440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bbb73d8941d4 - stable/14 - sctp: check locking requirements List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bbb73d8941d4ccbbf8b97677556f6485a8e3845b Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb73d8941d4ccbbf8b97677556f6485a8e3845b commit bbb73d8941d4ccbbf8b97677556f6485a8e3845b Author: Michael Tuexen AuthorDate: 2024-10-10 13:50:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:40:21 +0000 sctp: check locking requirements Actually assert the locking instead of describing it in a comment. No functional change intended. (cherry picked from commit 4466a97e83fd9484cb22dd2867b6972f6b185e8b) --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index f89865456274..a0f323043d9b 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -378,13 +378,13 @@ out: /*- * Add an ifa to an ifn. * Register the interface as necessary. - * NOTE: ADDR write lock MUST be held. */ static void sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) { int ifa_af; + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_INSERT_HEAD(&sctp_ifnp->ifalist, sctp_ifap, next_ifa); sctp_ifap->ifn_p = sctp_ifnp; atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); @@ -415,11 +415,11 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register * the interface based on the remaining address families left. - * NOTE: ADDR write lock MUST be held. */ static void sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_REMOVE(sctp_ifap, next_ifa); if (sctp_ifap->ifn_p) { /* update address counts */ From nobody Thu Oct 31 14:02:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQft5hVbz5blpt; Thu, 31 Oct 2024 14:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQft5Cfzz42Q8; Thu, 31 Oct 2024 14:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BXctueyxXKI/Szsr4W53oK3wNhJ5g2rEsTY9KT6QXU=; b=OSx44c8rhToT9ABThx12XVivQzH1q2aO12P+uFLvyHjwCNDB3wUEjdEM7fDusSMU+EX1T3 3pXYMi9A1AkNkvbVf4aGhyIYo4DxjzC2NL5I8GQiusN1VNiIqXZrfkNfhmKvIm5YJetCFW ur3CHIsnApsL6ZzVXPHqPCKyr1yZgFKqBnRC+7y9HxOlgAHvkTCktPkqH3rKjSTHZGx2Q6 DqnlDjrUH+227xbfICxQPyjyCC/ond+5aAE2cucLddLDAhpNsw1PINyLT8qhIgO5eA4Omp lyEoEbVyjAelszmFapNSaGDMsHKC7iQ4eY14YCgnqag1xp/x1WdTcnJWgjXPpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BXctueyxXKI/Szsr4W53oK3wNhJ5g2rEsTY9KT6QXU=; b=GlWMQRphztoGjvpafY91a5Rkzi8wjhcOFolhaUWA50sWRIn6ZPP3UvlB3ZZPUPHvLhwCGc N9ZSnBw55RM4oKD23Exu+Kl3/FCmPSGS1qU/nDD60cRcWSpa8/RsW8W+X9UEMtG7FZ6/Vc u4QfvsBoVy+A8gTU+OmyMOb+05BvJr0qNTDUb568UUz3JEzLXV+GaS93+vPEv/pNkK+dHp EK5zExGeFUbeWBpV5Bl0IjiGDovAeOH1/vadJBilcGc/pB13NUjOHqcOeZzgj2QwsiiL9Z AQck7B3qnpkcVB8hcTiv4wM/sWj9sy53+29ed4zjtD59JAb3e9+5+AmW7IVsYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383350; a=rsa-sha256; cv=none; b=xHCz3fv/netu+n1DvU7v5pzdl8rDjysBjLHCVO5UiVwJ3LEPdkQ8nfyfPwoRP0YQvhLSB8 64pnwSOK/XbxxfT+yD4q4fDeidMJWEkUY+I6W5oUBaOUkwDB1TURv/6RPIxRy2UYAffRLq uTcoeOtmtP/TRfvbaJaWJIxfJFFC74qmVCdAbNbCom1ntJfx5SNBHebnO6P7+HWCCw5Slv nI7ldGJnZhC/vwFen60y+qb2mEENZgdHo4ljNMz5bxSLDbS9VXQ6ZbhF5yCGyxtsKdAM2Y bNgqpbHAw8KEmUiZFyZJuibPcjQOajhij2e4Ll9AIEZVTJFNrVAK4np7rzAFcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQft4q00zfY0; Thu, 31 Oct 2024 14:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE2U3e048901; Thu, 31 Oct 2024 14:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE2UjT048898; Thu, 31 Oct 2024 14:02:30 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:02:30 GMT Message-Id: <202410311402.49VE2UjT048898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 8689398f0921 - stable/14 - sctp: improve debug output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8689398f0921fd2f26240608e6866fe78feff672 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8689398f0921fd2f26240608e6866fe78feff672 commit 8689398f0921fd2f26240608e6866fe78feff672 Author: Michael Tuexen AuthorDate: 2024-10-24 11:18:22 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:41:06 +0000 sctp: improve debug output (cherry picked from commit ce20b48a60fbae275085237dd48075d426f00d37) --- sys/netinet/sctp_asconf.c | 6 +++--- sys/netinet/sctp_output.c | 8 ++++---- sys/netinet/sctp_pcb.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 3a30b0ba3740..6b98557c45a6 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -1313,13 +1313,13 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, #ifdef SCTP_DEBUG if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) { if (type == SCTP_ADD_IP_ADDRESS) { - SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else if (type == SCTP_DEL_IP_ADDRESS) { - SCTP_PRINTF("asconf_queue_mgmt: appended asconf DEL_IP_ADDRESS: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: appended asconf DEL_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else { - SCTP_PRINTF("asconf_queue_mgmt: appended asconf SET_PRIM_ADDR: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: appended asconf SET_PRIM_ADDR: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } } diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index cc8d017aba16..2a3c0248be60 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -13913,15 +13913,15 @@ sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro) mask = (struct sockaddr_in *)(ifa->ifa_netmask); sin = &sifa->address.sin; srcnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: src address is "); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "match_nexthop4: src address is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &sifa->address.sa); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "network address is %x\n", srcnetaddr.s_addr); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "network address is %x\n", srcnetaddr.s_addr); sin = &ro->ro_nh->gw4_sa; gwnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: nexthop is "); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "match_nexthop4: nexthop is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &ro->ro_nh->gw_sa); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "network address is %x\n", gwnetaddr.s_addr); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "network address is %x\n", gwnetaddr.s_addr); if (srcnetaddr.s_addr == gwnetaddr.s_addr) { return (1); } diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index a0f323043d9b..d09b5062a512 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -769,7 +769,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, else { SCTPDBG(SCTP_DEBUG_PCB4, "Del Addr-ifn:%d Could not find address:", ifn_index); - SCTPDBG_ADDR(SCTP_DEBUG_PCB1, addr); + SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr); } #endif From nobody Thu Oct 31 14:03:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQgY0Phsz5bm2s; Thu, 31 Oct 2024 14:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQgX6fBmz42v0; Thu, 31 Oct 2024 14:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/+15qieJRqhv83gQdQ5pY4qY1bDazi0O9WImaF12enc=; b=vr12LxBQzWLKVTIK8jcZUNV+OK8chV+9mGpqYZTMCn5a1JXwQUx8HmIwI3dAGa3zBAonbo aPPET9fRFwqT4Q4gt0IKJsTpwCpQBm1yrzn0wvoKJ4Oh/w008EuELN7pz95opTJkb4uFxl JX4p+xXlmPJs5j3v+ytnf+gJfgTs7kVZwERSEjWhxgBYoWrYqnf7Zv5DHvzamO+jcqcMao 2bCVQVi8gAHIBgEc6Jbpab/P28Tg1U/iAGIhfb+1IW8mHVcB/1yFBKI2C1p0QulugiSmu1 zP2fXDRtzWXrg08JoPeMlr9iAZppLM7fBCnH23gk/chO5zEMSiXIRofHyCF3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/+15qieJRqhv83gQdQ5pY4qY1bDazi0O9WImaF12enc=; b=j9fqSsfOnDWPjhDEvbqKZ7BXZQ0YRY8pi41kHwIfwjE6h4vkREQYyfUXt0QxpcdbtMbEwA f8fkqSQehiDFjqY5tC4DrELu8UabeYlAIDnt4qmaiL++PxVqM/1DM+bPUCLP4sO3O+luZP OjCUKRZT85MyGHCm93Lb8VgqzArDNfOESnqmLoo5LYFf3sb86GDLQdjdOxTnfNb3eUQRin YhiUn2XvJ2+uudZIpvm/7nixWvhnldNGmr311h9ZnkGr4kCG8J8XaWFdXf1S6/yD8LHxST rn8DizR0foR4YYNuAmUlolu73S3nlIfhO7Q0JOhB1yxy1yKmSQgsCtPmLuORfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383384; a=rsa-sha256; cv=none; b=yF3hci1W0NOFhiP5GiqneMy1QkfjIMEtTZrlbQFDST7eL2Q0vAXftL1TMxIyS5PwnLp2LD dmu3JWDSp0u6uArzp+QQh4QJ2GIoolkhlIe9EHYoF6QZpX4ODBkFdyYtcqwO4v1EjsIJ/W YMC7ikueL9+qW+s0TgEPJWIVEvGlQYdfrExp8r1n52g0Fhl6IB9QBEDo4WvrZu/SNIzXsK 2r8iZRQUMKHBDTB/bomlVY/HcPDmhjGhzDNL/vvo4hqCBvWBDo+n0FLK8YuomTyF95iB1/ TbR8QVfCtKcFjgDPNqZHTY1GJbx74f8qW6OFQSk3PDuzCqHdzZdaqwiZ2vDTLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQgX6FD3zfhF; Thu, 31 Oct 2024 14:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE348R049206; Thu, 31 Oct 2024 14:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE34EC049203; Thu, 31 Oct 2024 14:03:04 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:03:04 GMT Message-Id: <202410311403.49VE34EC049203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 18a20a430691 - stable/14 - sctp: cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18a20a43069193171c175c36077a1aae125f117c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=18a20a43069193171c175c36077a1aae125f117c commit 18a20a43069193171c175c36077a1aae125f117c Author: Michael Tuexen AuthorDate: 2024-10-24 11:24:49 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:41:41 +0000 sctp: cleanup No functional change intended. (cherry picked from commit e4ac0183a1a846ef6556c9876dab76c06f5fea9c) --- sys/netinet/sctp_pcb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index d09b5062a512..f3d477e2a9a8 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -192,21 +192,17 @@ sctp_find_ifn(void *ifn, uint32_t ifn_index) struct sctp_ifn *sctp_ifnp; struct sctp_ifnlist *hash_ifn_head; - /* - * We assume the lock is held for the addresses if that's wrong - * problems could occur :-) - */ SCTP_IPI_ADDR_LOCK_ASSERT(); hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_FOREACH(sctp_ifnp, hash_ifn_head, next_bucket) { if (sctp_ifnp->ifn_index == ifn_index) { - return (sctp_ifnp); + break; } - if (sctp_ifnp->ifn_p && ifn && (sctp_ifnp->ifn_p == ifn)) { - return (sctp_ifnp); + if (ifn != NULL && sctp_ifnp->ifn_p == ifn) { + break; } } - return (NULL); + return (sctp_ifnp); } struct sctp_vrf * From nobody Thu Oct 31 14:03:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQhG1T19z5blsC; Thu, 31 Oct 2024 14:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQhG11MVz433h; Thu, 31 Oct 2024 14:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KaKUL6VwAaCUWD2bP/7QMZ6nzRPxkPrnT3bQXabGIGQ=; b=um9ZZwRRQAHxhGXsYWLVyiiHFxj8cUxkYOWoaObyM89wXSK1HSy/RT+7IPxsXtMxaLjmT7 2vS+hAAuLTP8eZZ7EDyysTxyra0d+Ks4Q6jXy2h16GvoBM5dOa76YGgvvzfuOdRf5p3gfE kfKUdv76/wqiUuvHmS4LTTsh0wqN9hBLxg2tCGkRZ2+iYA+miNxlUpJl+MAidlj7wzqcHh UqvPaLNtADBWF/pqGe5L0xjJaPV6r63bByPBV/2A48Bz/arHYKBU/6btdCrxF4Xb0xn7kf 6y1KB4eBJ3zdig3WEyPDtpvJTETKIft4tD43gDyzlonzlp9de3K3Z+/wQ6mEfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KaKUL6VwAaCUWD2bP/7QMZ6nzRPxkPrnT3bQXabGIGQ=; b=T4M4N6O4k1SmuGRpPKbUksd/5GSfvpUYEAx4eRFvjy5vICTOsayO5wfS+qJ0NdyrlDLcro 84hVTfAHKj0PhXNvZqD9oOZRiWVo4ms+o3+MwjK/fOkEn2NB6fTDNeWGIbQp3GO8B4WnZK YF/rZnDa+Lsus+Izo8r47mw/9k6/sFKfTh76Jn66joM/zQtjQIARAGBuIidmOt42R5js+P S0K7rruKR3HiwK4wKMrR/WYqPpKWCqgUQOyv1ZOPrte40n1z4dfif6WBPQh6ToQc4ZLRbC MUyb5eG5XEU3M1iWqw0eNHcYUlzs1cjDE1G+585KqbI8hTH8g/lLWxcp7UKh8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383422; a=rsa-sha256; cv=none; b=GP2kPZLMKTlDFIkmK5TbWPOPrQt43cN1Pg0X3p+kExpdwLmw4/6Y3zkij1+GsxmvIDqi8V W0xAZLN3Dv48/SznQVrcnI8KH36LdglimmQ6WVuz8FA7nZdM/4OXdYISzG6ygAaluQ0LIi HRvdghaAYy/HhtuBbY9sqwBUm7k5VYIGGdl8id4RZIIl9OzBWqGrpjmuNCxBKfv9fyAbWY xrlRY+glc78omtRdTXaCDuBfDrhZbGalXtLgSkHAFRJg1x6uVlZvWODTAy57BapXujaiB/ Iyz/dUJarH7azLyGRQ1kFtvVTecE5DHZ77puZ8Sbqrxk8Ml4LflCtk/PVi/dTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQhG0Y8SzfY1; Thu, 31 Oct 2024 14:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE3feW049459; Thu, 31 Oct 2024 14:03:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE3f9T049456; Thu, 31 Oct 2024 14:03:41 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:03:41 GMT Message-Id: <202410311403.49VE3f9T049456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 129057d5fadd - stable/14 - sctp garbage collect sctp_update_ifn_mtu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 129057d5fadd06e2c3644b60a8f9bc76868d2e51 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=129057d5fadd06e2c3644b60a8f9bc76868d2e51 commit 129057d5fadd06e2c3644b60a8f9bc76868d2e51 Author: Michael Tuexen AuthorDate: 2024-10-24 20:00:59 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:42:13 +0000 sctp garbage collect sctp_update_ifn_mtu (cherry picked from commit ce5b5361d4d1b3868631baa6870ba6e1e6ec8330) --- sys/netinet/sctp_pcb.c | 11 ----------- sys/netinet/sctp_pcb.h | 2 -- 2 files changed, 13 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index f3d477e2a9a8..3665b8e2f211 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -248,17 +248,6 @@ sctp_free_ifn(struct sctp_ifn *sctp_ifnp) } } -void -sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu) -{ - struct sctp_ifn *sctp_ifnp; - - sctp_ifnp = sctp_find_ifn((void *)NULL, ifn_index); - if (sctp_ifnp != NULL) { - sctp_ifnp->ifn_mtu = mtu; - } -} - void sctp_free_ifa(struct sctp_ifa *sctp_ifap) { diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index ed6a1c34ccf7..86c244c71544 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -506,8 +506,6 @@ sctp_add_addr_to_vrf(uint32_t vrfid, void *ifa, struct sockaddr *addr, uint32_t ifa_flags, int dynamic_add); -void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu); - void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void From nobody Thu Oct 31 14:04:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQhv3z5mz5bm2x; Thu, 31 Oct 2024 14:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQhv3FCSz43cC; Thu, 31 Oct 2024 14:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GQD33K6ou5cpbXswexT5T8MJIMs6lv9Mh4YTtEIkMlk=; b=JrrBxhKN3SCxydFqfgMIntO/QoG+Gvv0QtaEGLihQ7btcy7etzbJmp9/6YoAj9ZCageh5+ nzlcaqj4txL5DIe+HZC3yLtCQowJTqB6YBLoFG3lNBzNFrqY6ARxmgVK48okoGewsov8J7 qeWgSGTQF0dSkLAWqLoIo6PuURAmBaaxka+7Nw32QNEfofFA80u3ffJHe48Bi3L36qXo2z XgjE0jdUaZmCFEFWz2gedVBrT32Lo67pOl1jb7i5WMJd///cYlv4kctCpSfm+ZRlqfPy5f xuij/EnD+aAQuN8HNcQdLaa2dYbb9D8cVaydQThYqUaxRyhAprYVDJbkZhp3Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GQD33K6ou5cpbXswexT5T8MJIMs6lv9Mh4YTtEIkMlk=; b=mjwevqRJXOcmTfjwVPZzus0SOc/gTdoAAoqmvW/ef5zrkAVCjEF1ppCGsICChpgkk5dmFJ /TPpPyoxzYCAPs7/QZEm0hW9k3d+O/NZesZLEjtLB/fS9wYc8EmhAfffNt1xoj9ss7VhFB Zy2Fgn6QNy7jM19/zoB3jhaI13byDLOtKfkEwm1Lz8m7MlxlsuYVsHnPa0sdfMeCHSwY87 XfP9kzXdfursCpDUqROXX9FuFcHuCpVQkuoR55tX20RqJ2i4IIKWo/1LVqFQI+YqVhLfxr u4IgXKNdE6SsIXXAJ6xM5YgXyHDM1Oj8svKa55ezvdXoiMs3RnvOWnM76nHPKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383455; a=rsa-sha256; cv=none; b=RNtajjEIvtViSpUhRz9YIa/ePQMv/NEbCcmhZZGXiAQ/FlSEvPC6vFMwnvDK1hKFq4d8jD eq57Avoq9YmFAv00G+xbDPGPCyGpAF5V2OxbjcRr4kRZv/RidqgeplBGyF4MV1KI8e9YiA Qcv3xwx62YDpJMGWwZkaAMv22WcI8h7sQFxJeNaWZld/Eu32U9TS7qZTEkS3m5x/hQ3htu 010EwMPTyclCkJ5rOw+ptW6G1X3rlt6rPkEtbTm7ecMD5IbMFm44AEHQISLLdVjRFkiMmB W/o+BXe4eOqsTqbY6LtN7ETOKf3W4+hQbllW8PqDSHvMe1OcrDn0Ga2kAcaVdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQhv2Y34zfY2; Thu, 31 Oct 2024 14:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE4FTm049768; Thu, 31 Oct 2024 14:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE4Fcg049765; Thu, 31 Oct 2024 14:04:15 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:04:15 GMT Message-Id: <202410311404.49VE4Fcg049765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 676b45d04b60 - stable/14 - sctp: further cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 676b45d04b60c59f813d5bd385954c4a820c5840 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=676b45d04b60c59f813d5bd385954c4a820c5840 commit 676b45d04b60c59f813d5bd385954c4a820c5840 Author: Michael Tuexen AuthorDate: 2024-10-25 11:47:43 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:42:52 +0000 sctp: further cleanup (cherry picked from commit 02478e65910ab1ef53511ebb2271cdcf0e9a14cf) --- sys/netinet/sctp_pcb.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 3665b8e2f211..d32be9c791a9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -455,7 +455,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, struct sctp_ifalist *hash_addr_head; struct sctp_ifnlist *hash_ifn_head; uint32_t hash_of_addr; - int new_ifn_af = 0; #ifdef SCTP_DEBUG SCTPDBG(SCTP_DEBUG_PCB4, "vrf_id 0x%x: adding address: ", vrf_id); @@ -519,7 +518,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, LIST_INSERT_HEAD(hash_ifn_head, sctp_ifnp, next_bucket); LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn); atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifns), 1); - new_ifn_af = 1; } sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); if (sctp_ifap) { @@ -529,7 +527,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, (void *)sctp_ifap); - if (new_ifn_af) { + if (new_sctp_ifnp == NULL) { /* Remove the created one that we don't want */ sctp_delete_ifn(sctp_ifnp); } @@ -597,8 +595,8 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifap->src_is_priv = 1; } sctp_ifnp->num_v4++; - if (new_ifn_af) - new_ifn_af = AF_INET; + if (new_sctp_ifnp == NULL) + sctp_ifnp->registered_af = AF_INET; break; } #endif @@ -617,13 +615,12 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifap->src_is_priv = 1; } sctp_ifnp->num_v6++; - if (new_ifn_af) - new_ifn_af = AF_INET6; + if (new_sctp_ifnp == NULL) + sctp_ifnp->registered_af = AF_INET6; break; } #endif default: - new_ifn_af = 0; break; } hash_of_addr = sctp_get_ifa_hash_val(&sctp_ifap->address.sa); @@ -639,9 +636,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifnp->ifa_count++; vrf->total_ifa_count++; atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifas), 1); - if (new_ifn_af) { - sctp_ifnp->registered_af = new_ifn_af; - } SCTP_IPI_ADDR_WUNLOCK(); if (new_sctp_ifnp != NULL) { SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); From nobody Thu Oct 31 14:04:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQjd22cMz5blyT; Thu, 31 Oct 2024 14:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQjd1VRsz43gs; Thu, 31 Oct 2024 14:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RP3Y+SpXZC56VBuosBmXCb/fMMx4L6bdBvJlW/fE6FA=; b=dJ/LnwDrspWk5lqQft4nHQppTN7xa058S7z17FXzgMbX7UvOpYeYnCYcHm4yztFqXsGpvM 8SkytSktuvIWmHapYlJCnq7imTncgpRYZiSRHj7l21Li3XcXXyZK2SSMsTIG9cd6PZ+jCx yWoJDs0eK19XDquy2W2gFZsgIumD/bOFUWAfqbnG3kBzeYrBL6Q1r+/+Oty3BGktBznL04 iX6Guer4Ziku4nrI1DaEgSHo8eGvp7xn+7mC8f1JF9EJitj/Lu8KjPf6+8uegbB+/fa6qR wRc9QP/RnUoKnfIPBmfaDiVa9LdQpSdmfs26AE5EDUKS4OhQj1r2T1DVRqauOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RP3Y+SpXZC56VBuosBmXCb/fMMx4L6bdBvJlW/fE6FA=; b=HPxW8WRj6rEf6bZsAAd2ju4Yve5EoTLKRAIvJEJOqJzT/LXJoj9CT6vZa/ILQhm85/NHDa a3iTms5c2PWrOKOaNTn1A+Uf3AYyAd9robcEGWSTzQG7eXpbCUtIHgaxh8UY2EdpEMU59+ EkvCgEkakVIJtQ4TcyrsAa100SY68mJUONJfCqfwTqn4GDz58KAkGIMb/93+IPWDbISIf5 3SLsdqZyIZWgOc8HK1747zw7wEHN5Ut+H9onppaDPh4YS/PULwDx7M2scR7OYKEQYG+xZ3 qfo1AS65aR+4+VUTipyxwIp2CTTV1MjRJbVtxBvNrWdyN0OgM9CKAMN3Qda5RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383493; a=rsa-sha256; cv=none; b=No6cTvMO18zPwP/mWtEnF5dLdu4qg4G15wveG6nMdDzunaDH0PQEvlWqBv3+8MhMk0eb86 b4CP9v8TvDp8XdH6O6aedbDK5q4KI/CKMfMo+thWgTn5MEVxmfIcqYBvHzZqo8yg0dMdFB nUdmCfpXdHuYbIdQEp2AYpG+IbMlj+lwyASuYqAkaBwa9o4hYBPKrNoDTnFACFGTE2pcpT rETr2I3iu5DVlL4b//TXlsl6Usb8N3poD+FNUAojBwMfZo4YcLQnvUwbwPeC81Kjp7e9Eu u9MrAKStxdgD5OLKreTzCqKbcYVJLw9W3mKDGuEKAwvrd+2BIIU+VjKRFPbLyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQjd16fvzfY3; Thu, 31 Oct 2024 14:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE4rlT050116; Thu, 31 Oct 2024 14:04:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE4rse050111; Thu, 31 Oct 2024 14:04:53 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:04:53 GMT Message-Id: <202410311404.49VE4rse050111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: abbfa0cb48b3 - stable/14 - sctp: cleanup the addition of addresses which are already known List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: abbfa0cb48b36ecc8c1acf6bd61f7c9364919b2b Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=abbfa0cb48b36ecc8c1acf6bd61f7c9364919b2b commit abbfa0cb48b36ecc8c1acf6bd61f7c9364919b2b Author: Michael Tuexen AuthorDate: 2024-10-25 12:11:09 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:43:29 +0000 sctp: cleanup the addition of addresses which are already known No functional change intended. (cherry picked from commit a05620b0f67fe526350bf386882262ca8005533f) --- sys/netinet/sctp_pcb.c | 83 ++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index d32be9c791a9..90eb5822cbb7 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -520,56 +520,61 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifns), 1); } sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap) { - /* Hmm, it already exists? */ - if ((sctp_ifap->ifn_p) && - (sctp_ifap->ifn_p->ifn_index == ifn_index)) { - SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", - sctp_ifap->ifn_p->ifn_name, ifn_index, - (void *)sctp_ifap); - if (new_sctp_ifnp == NULL) { - /* Remove the created one that we don't want */ - sctp_delete_ifn(sctp_ifnp); - } - if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { - /* easy to solve, just switch back to active */ - SCTPDBG(SCTP_DEBUG_PCB4, "Clearing deleted ifa flag\n"); - sctp_ifap->localifa_flags = SCTP_ADDR_VALID; - sctp_ifap->ifn_p = sctp_ifnp; - atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); - } - exit_stage_left: - SCTP_IPI_ADDR_WUNLOCK(); - if (new_sctp_ifnp != NULL) { - SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); - } - SCTP_FREE(new_sctp_ifap, SCTP_M_IFA); - return (sctp_ifap); - } else { - if (sctp_ifap->ifn_p) { + if (sctp_ifap != NULL) { + /* The address being added is already or still known. */ + if (sctp_ifap->ifn_p != NULL) { + if (sctp_ifap->ifn_p->ifn_index == ifn_index) { + SCTPDBG(SCTP_DEBUG_PCB4, + "Using existing ifn %s (0x%x) for ifa %p\n", + sctp_ifap->ifn_p->ifn_name, ifn_index, + (void *)sctp_ifap); + if (new_sctp_ifnp == NULL) { + /* Remove the created one not used. */ + sctp_delete_ifn(sctp_ifnp); + } + if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { + /* Switch back to active. */ + SCTPDBG(SCTP_DEBUG_PCB4, + "Clearing deleted ifa flag\n"); + sctp_ifap->localifa_flags = SCTP_ADDR_VALID; + sctp_ifap->ifn_p = sctp_ifnp; + atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); + } + } else { /* * The last IFN gets the address, remove the * old one */ - SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", - (void *)sctp_ifap, sctp_ifap->ifn_p->ifn_name, + SCTPDBG(SCTP_DEBUG_PCB4, + "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", + (void *)sctp_ifap, + sctp_ifap->ifn_p->ifn_name, sctp_ifap->ifn_p->ifn_index, if_name, ifn_index); /* remove the address from the old ifn */ sctp_remove_ifa_from_ifn(sctp_ifap); /* move the address over to the new ifn */ sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); - goto exit_stage_left; - } else { - /* repair ifnp which was NULL ? */ - sctp_ifap->localifa_flags = SCTP_ADDR_VALID; - SCTPDBG(SCTP_DEBUG_PCB4, "Repairing ifn %p for ifa %p\n", - (void *)sctp_ifnp, (void *)sctp_ifap); - sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); } - goto exit_stage_left; - } - } + } else { + /* Repair ifn_p, which was NULL... */ + sctp_ifap->localifa_flags = SCTP_ADDR_VALID; + SCTPDBG(SCTP_DEBUG_PCB4, + "Repairing ifn %p for ifa %p\n", + (void *)sctp_ifnp, (void *)sctp_ifap); + sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); + } + SCTP_IPI_ADDR_WUNLOCK(); + if (new_sctp_ifnp != NULL) { + SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); + } + SCTP_FREE(new_sctp_ifap, SCTP_M_IFA); + return (sctp_ifap); + } + KASSERT(sctp_ifnp != NULL, + ("sctp_add_addr_to_vrf: sctp_ifnp == NULL")); + KASSERT(sctp_ifap == NULL, + ("sctp_add_addr_to_vrf: sctp_ifap (%p) != NULL", sctp_ifap)); sctp_ifap = new_sctp_ifap; memset(sctp_ifap, 0, sizeof(struct sctp_ifa)); sctp_ifap->ifn_p = sctp_ifnp; From nobody Thu Oct 31 14:05:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfQkJ40Tsz5blP2; Thu, 31 Oct 2024 14:05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQkJ3C1Gz43xL; Thu, 31 Oct 2024 14:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kqj91ZiYgZClxFp6pdxp5KEDWB7WLQ5KFBeAIt2VysE=; b=FZ44Zs1Xx9bRknNrzWPoUrD6w81hEJfcQPiO5XrW2jz4bjM1rKS0gAbxNCGpAlmfT18Q6r wz+z551RCPt1ZeFoG9ATt+5WKkd3v8px30syXJz0vsi/Y1nLzmeVOdhv5YPl8sw93oNzlJ RP5nieqL0fJJgzWcc2PSzVHeFNMjLTFYeN9ggUHNeIODGx2vAspBFl3LlDBqKtCiN2YfvI VickmXriBM/YtF6P+KU5/swrON3XexlPED10dFgKzWmGVsC78k6q904mrblt4cXo/YLyxc CiA1eIo1dAbkC7FsCQAcfhJjmD34UfdaGAlOsobZOdKuA+i4GThzcpZN4fe26g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kqj91ZiYgZClxFp6pdxp5KEDWB7WLQ5KFBeAIt2VysE=; b=wrQM6zcVoPxEN06yNrbctUsB/lyjFp2YIkT3oEBBwV4ILwHHFNCMd0sPPL04UbLGWxL48H BbY4eHZAxjisg/FbaeWcb6XgElSKMNn9f+RnZXWY5m14rcLGzt2Vs71Bu4VzuNKR0zurbb 30Q7Kzrub8IuC1XDzVJO/V9IXDsL/gOOUpaP+Js/glNg5//UQ36xv+YkLTryZ679coH19w cjsn7TKMj0UcQVnBrmzEwdQsplmStlphiPYjyquX+yeKgOR5R1Fu4jGpbetr0V85w/FuVH g1NmEyfD3nZYWOVugpwm4vAqHzIOoWmKY8vrPoRiu5On+giFCxGJiNAPxyEmBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383528; a=rsa-sha256; cv=none; b=KLzTVfNej4Stm2lfgLC7yaXEe7oOXtnQzfJEDLIMQVhMhm12P/V9F1Nsxmc6/EmI+lsIef c5R0wNiGdLLbsAV+UxzoLr1Jlt8gUvW97N2jGV7fqkzihfORQa+98k+qtqOoriVjELlZnh hZfGUa9U2OJS07dgddpdfgEw7k+GGv3UmcRT/KXyJsQfpr2sTjUCo2tY5pOp3y3wFBJYaW SW3l4yIofrRr0zw82QnBLUDAGzUPIklYhTN41xwWlxfumOa8DCmgYqMPONBhNz3dxFE1tZ ozmEl2HUZa08bifs6E2MALhjfslGR7buayNEhvNao/VPEIaWUG/YGq35Qb4hEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfQkJ2WLwzfM5; Thu, 31 Oct 2024 14:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE5Scl050392; Thu, 31 Oct 2024 14:05:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE5SYV050389; Thu, 31 Oct 2024 14:05:28 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:05:28 GMT Message-Id: <202410311405.49VE5SYV050389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: d27f63fa8cbf - stable/14 - sctp: another cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d27f63fa8cbfe4ea576c39233a602d96953dc444 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d27f63fa8cbfe4ea576c39233a602d96953dc444 commit d27f63fa8cbfe4ea576c39233a602d96953dc444 Author: Michael Tuexen AuthorDate: 2024-10-27 14:01:45 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:44:02 +0000 sctp: another cleanup No functional change intended. (cherry picked from commit d08713dcdb158b2f55a885e7cfbbe410272c55a2) --- sys/netinet/sctp_pcb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 90eb5822cbb7..0030c5385390 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -543,7 +543,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, } else { /* * The last IFN gets the address, remove the - * old one + * old one. */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", @@ -691,13 +691,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, uint32_t ifn_index, const char *if_name) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_WLOCK(); vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); - goto out_now; + SCTP_IPI_ADDR_WUNLOCK(); + return; } #ifdef SCTP_DEBUG @@ -705,10 +706,10 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr); #endif sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap) { + if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - int valid = 0; + bool valid = false; /*- * The name has priority over the ifn_index @@ -717,13 +718,13 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (if_name) { if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { /* They match its a correct delete */ - valid = 1; + valid = true; } } if (!valid) { /* last ditch check ifn_index */ if (ifn_index == sctp_ifap->ifn_p->ifn_index) { - valid = 1; + valid = true; } } if (!valid) { @@ -757,9 +758,8 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, } #endif -out_now: SCTP_IPI_ADDR_WUNLOCK(); - if (sctp_ifap) { + if (sctp_ifap != NULL) { struct sctp_laddr *wi; wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr); From nobody Thu Oct 31 14:33:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRLP2n65z5bpDg; Thu, 31 Oct 2024 14:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRLP2D4zz47JG; Thu, 31 Oct 2024 14:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TpSGHX/LQ2ZnX6dafn0wsAkwcLqpaB3zpQrsOxzFZ3E=; b=DnPR47JG0E+ogY6gCs0kNm1dtHfSddyDVHNZ45KNAixDB5F36+TH99jGJzrjLIIXo0rrz9 mousxXY4aiKYTioqeOgT8D2+HLKiavuwF9QkfX/dQ3zU1dpKjB7ZtBidp6hOsc/VxCTqiF aRVNlq0g8jG+2qbsLlpSGNd32sVs3TxZxnSzeE187UkdGec5e57cvy3X6b0J5gyPEPzLG6 BGe/pfjf3De2QfMioCRmpPFjuFmC6AUQnFUAvQfDXeX+NgCLIZCF2v3Tyy3EQNV3sEr2Pr IXQDDaU/mzPPbyU9RCaBaIC1M+0QzyZfJ3SoW1cuyxsO4ruI5djuk4Iy6VQBAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TpSGHX/LQ2ZnX6dafn0wsAkwcLqpaB3zpQrsOxzFZ3E=; b=pJ2ls1WOWnrw7lj0Xqcve+PAJFDvMfXIyCtojc8x4GMfR1slDFVOdX5c5uXQxR31SYa2ow ldZ9JWLyWjXum3XpfjuVgjyA6a+XnTskrV48Q9QdMKeQ4hv5N9xd+NioYP+cc6BBy2ZJDx Yd70+y5AGtP+/o8HWFjvpfHCrJtHHIIrYaBlLcg4L+AZ91fHUahG+B+jYldrWzBJCvgwqt SYMZSSZLuMjMNoRhD5tEmfJNePKsHhuqNqZDx66yEmtKJ7KTndZ8o6T8MTuHtxQhoCG9dP QhuogbzXNCABz/IsQr1q7G1IkIOSMTvUiSc+jF89miHmIo1RxEi3zgVTsT1zYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385197; a=rsa-sha256; cv=none; b=O/rktsaJPe5Ponoj2Ozd78PMULzqp69qSUzamNLHE37jq6WQM3aWzwG4ApFwEl+2mcBvoI FqfWtmGH/XW8oU0aDIEUwoPXtFlHe1uFbLOl0GlQ7iZ99mVtce7VqFyBH88LR5niIXmyBt X1MOZ2QJBnWBorgnW0KcEL1zL+f45yiZiwQ4HfwhAnl02Y5F1ebe5wBCQ/gx1sXtRPByDN txMdRd5Enzv3x4zElCSylgM2Y+hChNJOEqtnLBj2RhT8tyS7UouegzUvyLkCCsgV8LqT76 sdga1+4/pu31xx6MN+03s7jv1Uz396zJ2yDcqlcUGEvxI7Xe1fEkSXndelKxpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRLP1RlZzgH7; Thu, 31 Oct 2024 14:33:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEXHoP004355; Thu, 31 Oct 2024 14:33:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEXHVQ004352; Thu, 31 Oct 2024 14:33:17 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:33:17 GMT Message-Id: <202410311433.49VEXHVQ004352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e7f0f4f9206e - main - resolver.5: Fix example Google DNS server address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7f0f4f9206e8b0f411847b293c7b79eb84f0e51 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e7f0f4f9206e8b0f411847b293c7b79eb84f0e51 commit e7f0f4f9206e8b0f411847b293c7b79eb84f0e51 Author: Paula Breton AuthorDate: 2024-10-31 07:11:04 +0000 Commit: Ed Maste CommitDate: 2024-10-31 14:32:42 +0000 resolver.5: Fix example Google DNS server address MFC after: 3 days Signed-off-by: Paula Breton --- share/man/man5/resolver.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/resolver.5 b/share/man/man5/resolver.5 index f7f1b1d6f9ea..9f8c0d689a0a 100644 --- a/share/man/man5/resolver.5 +++ b/share/man/man5/resolver.5 @@ -236,7 +236,7 @@ nameserver 192.168.2.1 # Fallback nameservers, in this case these from Google. nameserver 8.8.8.8 -nameserver 4.4.4.4 +nameserver 8.8.4.4 # Attach an OPT pseudo-RR for the EDNS0 extension, # as specified in RFC 2671. From nobody Thu Oct 31 14:34:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNB1k7fz5bpK8; Thu, 31 Oct 2024 14:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNB1FR5z47f0; Thu, 31 Oct 2024 14:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UB/L6CLB7QW6OOhg9EUsc8TnVA+pSzQf4B/dwP1taU4=; b=xiqjvgYhfMdL/woPanFtMYmjzjNRfxjr68m4NdgMRqr1Jedad1BMcurkLFXZqaqqRM23wn 4zEE2pwWJA19uU3tD+mbvzh5N/8h1kkFUBxu7aHO10OYA6eCwYsBAKGuDsE81u/3upoDIF +ZSXQeLi/iQz3EQ0tSXsJ2OYZ/xwIGqJx+wnb02Vpy5tTvcAxiDM5B0vHe66W4m94fSuXM 0Z7WMx5wVi+8ZjiVu2vBBgjqopWlx0uFuqE753hkc8djILqQx9PhQ79WM6/DiIyr+LJ2bq DdcZ19JJwLclL+14y8rDB9Vd+SzpERv13uCnVCLU96aVi+IrZUt2X+LufX0+Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UB/L6CLB7QW6OOhg9EUsc8TnVA+pSzQf4B/dwP1taU4=; b=tnPq28uXqwqPjAJmSIMNCdbVUz9qxzip8qY6QhzNbxiaCzbNVQIRXk09Ru5CigDiA/lVkw /vgmAR9DwwRNziSTC3tWbXf7Cte4MbtvT4QmS3rBJwYIsZclqaj8rc6CaeRNJJYUmdGXl2 SILIt80iBGJ5WbmODUSg8+x4YHUjB4t1ZaP5MSOg+KubGlfA1Bd/IFnYujXobBTzYwNn4i paxX9kLRvW/gOolLzH7wIf+jW17fgHmQJ/OqxAIvE6cDSV6e+QYKQfrsSogxS/7qEbIxNW eWvG9zQTaGaMZJsC+cvzcFvzRMGxxlVR/XANv/qZG+ncVRJUxLxPgU4+NfHcYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385290; a=rsa-sha256; cv=none; b=TgsnQsbkhZJJGPyRZsTxcv3sZZCcUCuRxWi0XJmkO/Fv+32Ww7LjzI6LHKNmDEfQy8OxBo BjXHoyxVsalUu4w/360xZqoXobZBiD/hJtuLam4jLcXlpAAZlQo6GlBDhaeDxXIZgPh663 skR+01kXGs3zGGdafv+EPE8cTdcra23uTV34EBacvVAWWyZlThhQTUI415vZACuNvWsF0D Yr7iLFkGbn1tj1Pbvuqk3Trx+pGYR1He2pOapGrQf6/kTSM6+X1DfCjHG3bTgzbxmgkJz0 1Ss/KLoNqrd0lLskRRODPVrOraNY6E8/DUqnAKKtoWjfdWnD6tYq0AC/RCFyfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNB0sfPzgMx; Thu, 31 Oct 2024 14:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYoLn004966; Thu, 31 Oct 2024 14:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYoeC004963; Thu, 31 Oct 2024 14:34:50 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:50 GMT Message-Id: <202410311434.49VEYoeC004963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0dee359c0942 - stable/14 - LinuxKPI: netdevice: add alloc_netdev_dummy() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0dee359c094209a56ae96546c1c4b03551e3b305 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0dee359c094209a56ae96546c1c4b03551e3b305 commit 0dee359c094209a56ae96546c1c4b03551e3b305 Author: Bjoern A. Zeeb AuthorDate: 2024-09-26 21:06:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:56 +0000 LinuxKPI: netdevice: add alloc_netdev_dummy() Add alloc_netdev_dummy() which is needed by an updated rtw88 driver. Given we already call linuxkpi_init_dummy_netdev() ourselves allow the setup function to be NULL to not initialize and start a tasq td twice. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46802 (cherry picked from commit 105331f658e2f14fb4daa64dcd076c7369505295) --- sys/compat/linuxkpi/common/include/linux/netdevice.h | 2 ++ sys/compat/linuxkpi/common/src/linux_netdev.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index dde3ad07dec2..cd7d23077a62 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -466,6 +466,8 @@ void linuxkpi_free_netdev(struct net_device *); #define alloc_netdev(_l, _n, _f, _func) \ linuxkpi_alloc_netdev(_l, _n, _f, _func) +#define alloc_netdev_dummy(_l) \ + linuxkpi_alloc_netdev(_l, "dummy", NET_NAME_UNKNOWN, NULL) #define free_netdev(_n) \ linuxkpi_free_netdev(_n) diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c index 61342395f03c..2ca1784896de 100644 --- a/sys/compat/linuxkpi/common/src/linux_netdev.c +++ b/sys/compat/linuxkpi/common/src/linux_netdev.c @@ -410,7 +410,8 @@ linuxkpi_alloc_netdev(size_t len, const char *name, uint32_t flags, /* This needs extending as we support more. */ - setup_func(ndev); + if (setup_func != NULL) + setup_func(ndev); return (ndev); } From nobody Thu Oct 31 14:34:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNC327hz5bpF1; Thu, 31 Oct 2024 14:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNC2c2Cz47Wx; Thu, 31 Oct 2024 14:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=immiBpJuEiPCndur+J6S6yPyXK0pbJEATwjiTl72AVM=; b=Q8Qp0MCNjDoW2Ih6/QOWePnJhFVKAxKH8r4FXNtH5lk0YS3ctEbyQnXcgyvLFBModXN/48 EBmnnIRsXAl8NSZ5Pk+wt0vmz9Bap/NyGiXHqyk/6AAE1L/R5GYOo9gpH8qdMR2cvGypBT M/nN1/n8gnO2kH7cXSXL2ZUeliYu/+l//2lLjFXxJT5tVo4YOnJW0KZpX54zpSBz4FAtKn 1HuT49SaCsopho1cpiXgWj4cxSypcrxUHXpFH0XMqCs8qZPTfGs4T6lZex8Fy72osHu55R mt7VCd4BFkDLeTsGqnbA1Nt5nj13pe2RMq/ouekBCya/DUPp9dQ38uUXJjAJ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=immiBpJuEiPCndur+J6S6yPyXK0pbJEATwjiTl72AVM=; b=r3QBOb8OXeKrGaVj+kWTgWAW+Fv63NBeNPhOAzlmKNMmlhJHY3UQ3lJhtbKq7acnXTYdUE zayYdAq7LRUWKboQ5QelZ9lUM/M5DXx0gPdN/afaBJaRvvWJp9K7nNcRfm3YvSsqz/Dg3Q p6OnTFGi9j0u4iKY3ydFk08L4X3+RiyB8NVgY6wlwBsyOWX2QKg7PbJYgRTNMXaOaoTxo7 yaDIgkRHm81VPf/IB3zwWz3qLM/mHaooMmKaYQZjpLKuBGE7qiGsdWLEMQ8RO+8iBF88Lc bY6ryYKKpihukleGwJq0hjJHAMJb76f3gJyHgReFPKl1g3gznnPWhk46YdED+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385291; a=rsa-sha256; cv=none; b=WwOBM7dkAqUs+lfSQ20UXQ6aHPhrd24d0Wg8S4uxL+j2ilOMbQh+9KFeG3uC6tfZ4k4UKA Cdj0TLeMDN8I7negopa5bDSwflTegXNlVPTfoEQAiDDcds7I894zHVWl8NNBmhVDqqDBtt NF9ON/4hyK+i3ahAMPDgy4gMvOziZbijlmjc8xDRC3uBc6F2BpGr6Dr5iFQJmBn+YYX43l FqODT6A4g7ppV4eiMjt1DnAG2GeM3se3p8KCJeCH6M1OryyjeSyVsh2dGKw/8K9juyjOnP 7PkChVXY719/wAOz2683JCFmWbXQOMsWIZuJEgN6bi1f1qcJUEgeG5xUhTtOQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNC2BRYzgcM; Thu, 31 Oct 2024 14:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYpkK005014; Thu, 31 Oct 2024 14:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYp7A005011; Thu, 31 Oct 2024 14:34:51 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:51 GMT Message-Id: <202410311434.49VEYp7A005011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1579a25f0a1b - stable/14 - LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1579a25f0a1be6ea4679adb0d03b6a0c048211ac Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1579a25f0a1be6ea4679adb0d03b6a0c048211ac commit 1579a25f0a1be6ea4679adb0d03b6a0c048211ac Author: Bjoern A. Zeeb AuthorDate: 2024-09-26 21:13:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:56 +0000 LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX PCI_IRQ_LEGACY was added in 366d68f28379 (likely) for rtw88 only. The define now got renamed and I cannot find any other use but rtw88 and rtw89. We keep the old name as comapt while driver updates are in progress enabling it defining LINUXKPI_VERSION for the two drivers. Sponsored by; The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46822 (cherry picked from commit 157e93e0e8138fbaa6ab5d5b20b0c23f903667a6) --- sys/compat/linuxkpi/common/include/linux/pci.h | 8 ++++++-- sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- sys/modules/rtw88/Makefile | 1 + sys/modules/rtw89/Makefile | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index aa756c6e5b09..c91521ae6df4 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -233,10 +233,14 @@ extern const char *pci_power_names[6]; #define PCI_L1SS_CTL1 0x8 #define PCI_L1SS_CTL1_L1SS_MASK 0xf -#define PCI_IRQ_LEGACY 0x01 +#define PCI_IRQ_INTX 0x01 #define PCI_IRQ_MSI 0x02 #define PCI_IRQ_MSIX 0x04 -#define PCI_IRQ_ALL_TYPES (PCI_IRQ_MSIX|PCI_IRQ_MSI|PCI_IRQ_LEGACY) +#define PCI_IRQ_ALL_TYPES (PCI_IRQ_MSIX|PCI_IRQ_MSI|PCI_IRQ_INTX) + +#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION >= 60800) +#define PCI_IRQ_LEGACY PCI_IRQ_INTX +#endif struct pci_dev; diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 59775629e247..ce7f91cd15ac 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1305,7 +1305,7 @@ out: if (error == 0 && pdev->msi_enabled) return (pdev->dev.irq_end - pdev->dev.irq_start); } - if (flags & PCI_IRQ_LEGACY) { + if (flags & PCI_IRQ_INTX) { if (pdev->irq) return (1); } diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index da4233b7c79e..db42192233a7 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -33,6 +33,7 @@ SRCS+= opt_wlan.h opt_inet6.h opt_inet.h #CFLAGS+= -ferror-limit=0 CFLAGS+= -DKBUILD_MODNAME='"rtw88"' +CFLAGS+= -DLINUXKPI_VERSION=60800 CFLAGS+= -I${DEVRTW88DIR} CFLAGS+= ${LINUXKPI_INCLUDES} diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile index 9f81912a762d..eb2d9cddb413 100644 --- a/sys/modules/rtw89/Makefile +++ b/sys/modules/rtw89/Makefile @@ -33,6 +33,7 @@ SRCS+= ${LINUXKPI_GENSRCS} SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h CFLAGS+= -DKBUILD_MODNAME='"rtw89"' +CFLAGS+= -DLINUXKPI_VERSION=60800 CFLAGS+= -I${DEVRTW89DIR} CFLAGS+= ${LINUXKPI_INCLUDES} From nobody Thu Oct 31 14:34:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRND5P1bz5bnrY; Thu, 31 Oct 2024 14:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRND3r1Yz47hc; Thu, 31 Oct 2024 14:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1I23FqcBnCes6ElZYG1mZyRRkPVKT5f0kIM5GKMP+/4=; b=wYaOn97xun9a1JARaUcc/2N52XXhPzNxkPMUJs1JMC826ZXo0gHCZYdWsoaJHg2IFt+FsC k1aHQmfurol3lE0jXYHFCrUstZBfGgoTnGBOsSPVdknLzFbEGBXlg8aQCOdk0a1IHG88cb XqpIZg03M/QtD7ACxPpfOmbkTft80eXo/lqQLBGxqEsK7vnDXWw7ByAqXYFANXtLXP6G94 n7uXqyhgG3ImgV8YfDQCYH6uQrx/eCA+75Yn7Q4du+TIgpkpzsFrtxSxDXQxZltNWaSCLN 9EEZz3SnVD5B4AwVBJsldOjU89KRenlQQA8PRYeGf5feRzhjmETHRKvK+706hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1I23FqcBnCes6ElZYG1mZyRRkPVKT5f0kIM5GKMP+/4=; b=RjTmY7ihtU/zu2QaDCef5T1lik9mvrGjbxlkMD5tPsEBA5+RKL6kHLyUXhCXitk6aIoISO ITHvfnCNOVe7crPYzm/OEM+9dnsMMa7YSK3BtlkEm7mY6HpK6RSr3Ry90mfx4rAdNP78MF jrKUasWYT0JG1JXEfqpFeT7EmaAuU1xNNx9NDKeW5VBS30uL6i8LHPAhTEK8qxtS5iwgho fsc2Z8H6peGwNRljFq34fmaJKyz8xyswepDIe0uVP3NmSvT8pZNymcp+Fl0DKukT9KNPre 5kY22LbNOIDv3vzI1ACmT/Vus11Q8AkLtKIP5GaTNUGr0J6AOmEUwOTrFpoK4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385292; a=rsa-sha256; cv=none; b=g0CNpwMxfxRgEEhpc7e+ylmtXLsKeTKJWa3QDl3/ZxSukC6ljfcf8ynJwJVRBalDr/P+uM CaQqQeikBnUKJ73ocPY/ZBAhBLtA2GtPt2vT8aXLGLM28XkA/bzony+DvAsoXrM7E1e3PF VTt9PcIwYPO/sjKCvI7EmB+/US/iYjI3rWfjm+ZLUqr2Lc/FQrmHKdIvOBsfGiI6M82fcV MK2LEAhNASaA7xxOzreuSZWzagEWhuTTC2uja6LooytSAZziXcus5oGSPH1B9qxWbObbc+ M4S3IeMKiLLi3ygXQq2XAeaBKJcjwBZ24xOJE6y58AMyNP5z3qo2KOYiUpY/Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRND3D4Wzg6b; Thu, 31 Oct 2024 14:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYqdZ005073; Thu, 31 Oct 2024 14:34:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYqUt005070; Thu, 31 Oct 2024 14:34:52 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:52 GMT Message-Id: <202410311434.49VEYqUt005070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 64517ad54a91 - stable/14 - iwlwifi: FreeBSD specific sysctl export update List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 64517ad54a914f5676af4a11484002deb1df5322 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=64517ad54a914f5676af4a11484002deb1df5322 commit 64517ad54a914f5676af4a11484002deb1df5322 Author: Bjoern A. Zeeb AuthorDate: 2024-05-16 21:48:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:56 +0000 iwlwifi: FreeBSD specific sysctl export update Update the sysctl export (also adding a mapping function) to also print (1) for all lines the "flavor" (device_family) name and (2) also print lines where we only have the trans cfg and not iwl cfg as with the flavor we can match PCI IDs to firmware package and so we can have an increased number of matches. A side effect is that we can also have fwget(8) PCI ID matches for firmware (flavors) not yet (publicly) existing. That will allow us to add them at a later point while a previous release already supports the chipsets and knows how to get the firmware for them. Sponsored by: The FreeBSD Foundation (cherry picked from commit b4c8f251d65fa99601da000e586933a6df662839) --- sys/contrib/dev/iwlwifi/iwl-config.h | 36 ++++++++++++++++++++++++++++++++++++ sys/contrib/dev/iwlwifi/pcie/drv.c | 22 ++++++++++++++++------ 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/iwl-config.h b/sys/contrib/dev/iwlwifi/iwl-config.h index 241a9e3f2a1a..4ea322595925 100644 --- a/sys/contrib/dev/iwlwifi/iwl-config.h +++ b/sys/contrib/dev/iwlwifi/iwl-config.h @@ -38,6 +38,42 @@ enum iwl_device_family { IWL_DEVICE_FAMILY_SC, }; +#if defined(__FreeBSD__) +static const char *iwl_device_family_str[] = { + [IWL_DEVICE_FAMILY_UNDEFINED] = "undefined", + [IWL_DEVICE_FAMILY_1000] = "1000", + [IWL_DEVICE_FAMILY_100] = "100", + [IWL_DEVICE_FAMILY_2000] = "2000", + [IWL_DEVICE_FAMILY_2030] = "2030", + [IWL_DEVICE_FAMILY_105] = "105", + [IWL_DEVICE_FAMILY_135] = "135", + [IWL_DEVICE_FAMILY_5000] = "5000", + [IWL_DEVICE_FAMILY_5150] = "5150", + [IWL_DEVICE_FAMILY_6000] = "6000", + [IWL_DEVICE_FAMILY_6000i] = "6000i", + [IWL_DEVICE_FAMILY_6005] = "6005", + [IWL_DEVICE_FAMILY_6030] = "6030", + [IWL_DEVICE_FAMILY_6050] = "6050", + [IWL_DEVICE_FAMILY_6150] = "6150", + [IWL_DEVICE_FAMILY_7000] = "7000", + [IWL_DEVICE_FAMILY_8000] = "8000", + [IWL_DEVICE_FAMILY_9000] = "9000", + [IWL_DEVICE_FAMILY_22000] = "22000", + [IWL_DEVICE_FAMILY_AX210] = "AX210", + [IWL_DEVICE_FAMILY_BZ] = "BZ", + [IWL_DEVICE_FAMILY_SC] = "SC", +}; + +static inline const char * +iwl_device_family_name(enum iwl_device_family devive_family) +{ + if (devive_family < 0 || + devive_family >= ARRAY_SIZE(iwl_device_family_str)) + return "unknown"; + return (iwl_device_family_str[devive_family]); +} +#endif + /* * LED mode * IWL_LED_DEFAULT: use device default diff --git a/sys/contrib/dev/iwlwifi/pcie/drv.c b/sys/contrib/dev/iwlwifi/pcie/drv.c index 0aab7a1fdc8e..8780d77b704b 100644 --- a/sys/contrib/dev/iwlwifi/pcie/drv.c +++ b/sys/contrib/dev/iwlwifi/pcie/drv.c @@ -1628,18 +1628,27 @@ sysctl_iwlwifi_pci_ids_name(SYSCTL_HANDLER_ARGS) if ((id->driver_data & TRANS_CFG_MARKER) != 0) { /* Skip and print them below. */ + struct iwl_cfg_trans_params *trans; + + trans = (void *)(id->driver_data & ~TRANS_CFG_MARKER); + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", + id->vendor, id->device, id->subvendor, id->subdevice, + "", "", trans->device_family, + iwl_device_family_name(trans->device_family)); } else if (id->driver_data != 0) { const struct iwl_cfg *cfg; cfg = (void *)(id->driver_data & ~TRANS_CFG_MARKER); - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", id->vendor, id->device, id->subvendor, id->subdevice, - cfg->name, cfg->fw_name_pre); + cfg->name, cfg->fw_name_pre, cfg->trans.device_family, + iwl_device_family_name(cfg->trans.device_family)); } else { - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", id->vendor, id->device, id->subvendor, id->subdevice, - "",""); + "","", IWL_DEVICE_FAMILY_UNDEFINED, + iwl_device_family_name(IWL_DEVICE_FAMILY_UNDEFINED)); } id++; } @@ -1655,9 +1664,10 @@ sysctl_iwlwifi_pci_ids_name(SYSCTL_HANDLER_ARGS) else name = ""; - sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\n", + sbuf_printf(sb, "%#06x/%#06x/%#06x/%#06x\t%s\t%s\t%d\t%s\n", PCI_VENDOR_ID_INTEL, dev_info->device, PCI_ANY_ID, dev_info->subdevice, - name, dev_info->cfg->fw_name_pre); + name, dev_info->cfg->fw_name_pre, dev_info->cfg->trans.device_family, + iwl_device_family_name(dev_info->cfg->trans.device_family)); } error = sbuf_finish(sb); From nobody Thu Oct 31 14:34:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNF6GQXz5bpBY; Thu, 31 Oct 2024 14:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNF4FD0z47fZ; Thu, 31 Oct 2024 14:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7ap/nHU4P9qPxJkmqm10ajmPQsi1ztlz2zh6yoK+dE=; b=SDJigXE/4eokj9CNlsXaUEQjLJqTBITQBtEu1N+VCnAEZOcQ3ddpjayi+nFwoltqDEeBMj g/FOntP3akHsvv8KtNgTMVjfQdYM8POvUt/DAz8lzGASWw2G73OKvwY4FHmq2slaXkXRBq M55vCn7bFgn1yKHMGBm59TmRQHmF4L25iypis+Ad0SQLk8poCw058V8wcIErm2WrNrw1PH DU9gqjjjzn5VeAxm9uuhkq+lSLzz887zScm1/QgftWqJxA7MncwJmwCUOOxJIXueWvAdCU snIhGfqjgPxzv5Mdzd8stZhHaaKFcBN3IEOA1A5xJUyHQBHD4SBO10Fgnmnxdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7ap/nHU4P9qPxJkmqm10ajmPQsi1ztlz2zh6yoK+dE=; b=n1zI3U0ijPmSpg3IKgIHkx773jQSotNPFtHVmoed17D/dVRlkV3vjD7sw5uMYeXpKGqm4S s5M07BLpeoqgBegdUzqM1BmHMjE2HjA30SCTTEtGMPq9VgntBjuIkgRY5UXXMZjdf3UZQC gAxyYyvJdhr+YROFL12oIDcm+YSEkaevDGlT+YKEldb7eF/r7oLOnvl5cl5W2VVVoC7GPU qNhf5ap9/2p+3SgV0zKZl5hzUWIKrcwC6MlpH21zKjhV+uSaJHRxknXNepKJk+k9hlXic3 Cb///LOmiImwYkelShar/3Rh5B62lW0+538k6tk7m7Ux/nSK51VF3Vj/GmxqyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385293; a=rsa-sha256; cv=none; b=RwHQ+0OLf2jx5gEBvcQbK8Gu/GNiFToffU2jksmRBZpXbzcMNo+M3k+PTw10JoPKNvcaQ2 Wu7QZKth4jMl+OJTs6IFWPJWX6yyVlrG5Wve0E3AGYVS44x4qrRu0+UbNHE2NPB8i1eT/M WN+c8zrjkcmRwxhH0GgA6953XYhXMZsnbY5zrzXO6wqkz2SbnmHZPHlf2KMXf1lJkjv4BJ lET8ekVtEMoa9mHYa0lImbUFqpvcxNJRS4OC0LdvPYZ/Vos50iHNa1hVmYgyDFgUtSAcyL 1WpIfP727DhUZ16qMuAyayL9vhdLyMaL/W4eVKYJ+UwB8Ey5GuTx4Cd/M+LmHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNF3cY9zgWT; Thu, 31 Oct 2024 14:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYrLv005150; Thu, 31 Oct 2024 14:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYrnh005142; Thu, 31 Oct 2024 14:34:53 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:53 GMT Message-Id: <202410311434.49VEYrnh005142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3ed00f392098 - stable/14 - LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ed00f392098a324f34ea5f25a3859d224f72c73 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3ed00f392098a324f34ea5f25a3859d224f72c73 commit 3ed00f392098a324f34ea5f25a3859d224f72c73 Author: Bjoern A. Zeeb AuthorDate: 2024-04-28 20:50:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:56 +0000 LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details Add a "zzz_fw_ports_fwget.sh" script to each LinuxKPI based wireless driver which in essential are all the same and in detail all different. They extract information for fwget(8), wifi-firmware-* ports, man pages and for iwlwififw also for the wiki. Sponsored by: The FreeBSD Foundation Suggested by: imp (to have automation in D44918) (cherry picked from commit 96190b4fef3b4a0cc3ca0606b0c4e3e69a5e6717) --- sys/contrib/dev/athk/ath10k/zzz_fw_ports_fwget.sh | 286 ++++++++++++++++ sys/contrib/dev/athk/ath11k/zzz_fw_ports_fwget.sh | 317 +++++++++++++++++ sys/contrib/dev/athk/ath12k/zzz_fw_ports_fwget.sh | 310 +++++++++++++++++ sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh | 374 +++++++++++++++++++++ .../dev/mediatek/mt76/zzz_fw_ports_fwget.sh | 292 ++++++++++++++++ sys/contrib/dev/rtw88/zzz_fw_ports_fwget.sh | 145 ++++++++ sys/contrib/dev/rtw89/zzz_fw_ports_fwget.sh | 152 +++++++++ 7 files changed, 1876 insertions(+) diff --git a/sys/contrib/dev/athk/ath10k/zzz_fw_ports_fwget.sh b/sys/contrib/dev/athk/ath10k/zzz_fw_ports_fwget.sh new file mode 100644 index 000000000000..71a11a890a48 --- /dev/null +++ b/sys/contrib/dev/athk/ath10k/zzz_fw_ports_fwget.sh @@ -0,0 +1,286 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Björn Zeeb +# under sponsorship from the FreeBSD Foundation. +# +# This is neither efficient nor elegant but we need it few times +# a year and it does the job. +# +# +# USAGE: please check out the correct tag/hash for ports in the +# linux-firmware.git repository you point this script to. +# + +set -e + +DRIVER=ath10k +CHECKFILE=qmi_wlfw_v01.c + +################################################################################ +# +# Check pre-reqs +# +if [ $# -ne 1 ]; then + printf "USAGE: %s /path/to/linux-firmware.git\n" $0 >&2 + exit 1 +fi + +if [ ! -e ${CHECKFILE} ]; then + printf "ERROR: run from %s driver directory; no %s.c here\n" ${DRIVER} ${CHECKFILE} >&2 + exit 1 +fi + +LFWDIR=${1} +if test ! -d ${LFWDIR} -o ! -e ${LFWDIR}/WHENCE; then + printf "ERROR: cannot find linux-firmware.git at '%s'\n" ${LFWDIR} >&2 + exit 1 +fi + +################################################################################ +# +# Helper functions. +# +# This uses a hack (cpp) to expand some macros for us and parses out the result +# which is the PCI device ID or the firmware directory for that. +# Checking MODULE_FIRMWARE was pointless as it had too many "dead" entries: +# NOTICE: no firmware file found for 'ath10k/QCA6174/hw2.1/firmware-4.bin' +# NOTICE: no firmware file found for 'ath10k/QCA6174/hw3.0/firmware-5.bin' +# NOTICE: no firmware file found for 'ath10k/QCA9887/hw1.0/board-2.bin' +# NOTICE: no firmware file found for 'ath10k/QCA988X/hw2.0/board-2.bin' +# NOTICE: no firmware file found for 'ath10k/QCA988X/hw2.0/firmware-2.bin' +# NOTICE: no firmware file found for 'ath10k/QCA988X/hw2.0/firmware-3.bin' +# +list_fw() +{ + # List of already seen flavor (firmware directory). + sfwl="" + + # List of "supported" device IDs (ignoring Ubiquity). + devidl=$(cpp pci.c 2> /dev/null | awk '/PCI_VDEVICE\(ATHEROS,/ { gsub("^.*, \\(", ""); gsub("\\)\\) },$", ""); print tolower($0); }') + + # List of (device ID) -> (firware directory) mappings. + cpp core.c 2> /dev/null | egrep -E '\.(dev_id|dir) = ' | awk '{ if (/dev_id/) { printf "%s", $0; } else { print; } }' | grep -v 'dev_id = 0,' | sort | uniq | \ + awk '{ + gsub("^.*\\(", ""); + gsub("),.* = ", "\t"); + gsub(",$", ""); + gsub(/"/, ""); + gsub(" ", ""); + print; + }' | \ + while read did fwd; do + + x="" + for d in ${devidl}; do + if test "${did}" == "${d}"; then + x="${d}" + break + fi + done + if test "${x}" == ""; then + # Device ID not in the list of PCI IDs we support. + # At least the Ubiquity one we hit here. + #printf "Device ID %s (%s) not in PCI ID list; skipping\n" ${did} ${fwd} >&2 + continue + fi + + if test ! -d ${LFWDIR}/${fwd}; then + # Leave this on as it MUST not happen. + printf "Firmware dir %s (for %s) does not exist; skipping\n" ${fwd} ${did} >&2 + continue + fi + + flav=$(echo "${fwd}" | awk -v drv=${DRIVER} '{ + # Ports FLAVOR names are [a-z0-9_]. If needed add more mangling magic here. + gsub("^" drv "/", ""); + gsub("/", "_"); + gsub("\\.", ""); + print tolower($0); + }') + + # Print this first or otherwise if two device IDs have the same firmware + # we may not see that. + echo "FWGET ${did} ${flav}" + + x="" + for zf in ${sfwl}; do + if test "${zf}" == "${flav}"; then + x="${zf}" + break + fi + done + if test "${x}" != ""; then + #printf "Flavor %s (firmware directory %s) already seen; skipping\n" ${flav} ${fwd} >&2 + continue + fi + sfwl="${sfwl} ${flav}" + + #echo "==> ${did} -> ${fwd} -> ${flav}" + + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a \! -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + #echo "==> ${flav} :: ${fn} :: ${lx}" >&2 + + if test ${fn} -gt 0; then + + echo "FWS ${flav}" + echo "DISTFILES_${flav}= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + gsub("^" drv "/", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + + # Check for "lic" files. + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + if test ${fn} -gt 0; then + echo "FWL ${flav}" + echo "DISTFILES_${flav}_lic= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + gsub("^" drv "/", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + fi + fi + done +} + +################################################################################ +# +# Generate the PORTS file template. +# + +fwsl=$(list_fw | grep ^FWS | awk '{ print $2 }') +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + portsfile=$(mktemp -p /tmp ${DRIVER}-fwport.XXXXXX) + + :> ${portsfile} + ( + echo "FWSUBS= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t%s%s\n", $0, x; + }' + + echo + list_fw | grep -v ^FWS | grep -v ^FWL | grep -v ^FWGET + + echo + echo "DISTFILES_\${FWDRV}= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s}%s\n", $0, x; + }' + + fwsl=$(list_fw | grep ^FWL | awk '{ print $2 }') + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + if test ${fn} -gt 0; then + echo "DISTFILES_\${FWDRV}_lic= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s_lic}%s\n", $0, x; + }' + else + echo "DISTFILES_\${FWDRV}_lic=" + fi + + ) >> ${portsfile} + + printf "INFO: wifi-firmware-%s-kmod template at %s\n" ${DRIVER} ${portsfile} >&2 +fi + +################################################################################ +# +# Generate the fwget(8) case pattern table (PCI device ID -> fw port flavor). +# + +fwgetfile=$(mktemp -p /tmp ${DRIVER}-fwget.XXXXXX) +:> ${fwgetfile} + +fwsl=$(list_fw | grep ^FWGET | sort) +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | grep -c FWGET | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + # We need to check for same ID with multiple firmware. + # The list ist sorted by ID so duplicates are next to each other. + cs=$(echo "${fwsl}" | awk '{ print $2 }' | uniq -c | awk '{ print $1 }') + + #echo "==> cs=${cs}" >&2 + + for n in ${cs}; do + + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + # printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + if test ${n} -eq 1; then + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"; return 1 ;;\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + else + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + + i=1 + while test ${i} -lt ${n}; do + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + #printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + drv, tolower($2); + }' >> ${fwgetfile} + + i=$((i + 1)) + done + + printf "\t\treturn 1 ;;\n" >> ${fwgetfile} + fi + done +fi + +printf "INFO: fwget pci_network_qca %s template at %s\n" ${DRIVER} ${fwgetfile} >&2 + +# end diff --git a/sys/contrib/dev/athk/ath11k/zzz_fw_ports_fwget.sh b/sys/contrib/dev/athk/ath11k/zzz_fw_ports_fwget.sh new file mode 100644 index 000000000000..9de14ed45442 --- /dev/null +++ b/sys/contrib/dev/athk/ath11k/zzz_fw_ports_fwget.sh @@ -0,0 +1,317 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Björn Zeeb +# under sponsorship from the FreeBSD Foundation. +# +# This is neither efficient nor elegant but we need it few times +# a year and it does the job. +# +# +# USAGE: please check out the correct tag/hash for ports in the +# linux-firmware.git repository you point this script to. +# + +set -e + +DRIVER=ath11k +CHECKFILE=debugfs_htt_stats.c + +################################################################################ +# +# Check pre-reqs +# +if [ $# -ne 1 ]; then + printf "USAGE: %s /path/to/linux-firmware.git\n" $0 >&2 + exit 1 +fi + +if [ ! -e ${CHECKFILE} ]; then + printf "ERROR: run from %s driver directory; no %s.c here\n" ${DRIVER} ${CHECKFILE} >&2 + exit 1 +fi + +LFWDIR=${1} +if test ! -d ${LFWDIR} -o ! -e ${LFWDIR}/WHENCE; then + printf "ERROR: cannot find linux-firmware.git at '%s'\n" ${LFWDIR} >&2 + exit 1 +fi +LFWDIR=${LFWDIR}/${DRIVER} + +################################################################################ +# +# Helper functions. +# +# This uses a hack (cpp) to expand some macros for us and parses out the result +# which is the PCI device ID or the firmware directory for that. +# +# Driver is there, the firmware not yet...? +# ==> 0x1101 -> ATH11K_HW_QCA6390_HW20 -> QCA6390/hw2.0 +# ==> 0x1104 -> ATH11K_HW_QCN9074_HW10 -> QCN9074/hw1.0 +# ==> 0x1103 -> ATH11K_HW_WCN6855_HW20 -> WCN6855/hw2.0 +# ==> 0x1103 -> ATH11K_HW_WCN6855_HW21 -> WCN6855/hw2.1 +# Firmware dir WCN6855/hw2.1 (for 0x1103) does not exist; skipping +# +list_fw() +{ + # List of already seen flavor (firmware directory). + sfwl="" + + # List of "supported" device IDs. + devidl=$(cpp pci.c 2> /dev/null | awk '/PCI_VDEVICE\(QCOM,/ { gsub("^.*, ", ""); gsub("\\) },$", ""); print tolower($0); }') + # Turn them into a regex. + didreg=$(echo "${devidl}" | xargs -J % echo -n % | sed -e 's, ,|,g') + # List the device ID cases along with their hw_rev which we can go and take to lookup fw. + hwrevs=$(cpp pci.c 2> /dev/null | egrep -E "(case (${didreg})|ab->hw_rev = )" | awk '{ + if (FNR > 1 && /case/) { + printf "\n"; + } + gsub("^.*case[[:space:]]*", ""); + gsub("[[:space:]]*ab->hw_rev = ", " "); + gsub("[:;]", ""); + printf "%s", $0; + }') + + # hwrevs is a list of (device IDs) -> (1..n hardware revisions) mappings. + #echo "==> ${devidl} :: ${didreg} :: ${hwrevs}" >&2 + + # List of (hardware revision) -> (firware directory) mappings. + l=$(cpp core.c 2> /dev/null | egrep -E '\.(hw_rev|dir) = ' | awk '{ if (/hw_rev/) { printf "%s", $0; } else { print; } }' | sort | uniq | \ + awk '{ + gsub("^.*hw_rev = ", ""); + gsub(",.* = ", "\t"); + gsub(",$", ""); + gsub(/"/, ""); + gsub(" ", ""); + gsub("\t", " "); + print; + }') + #echo "===> ${l}" >&2 + + ll=$(echo "${l}" | wc -w | awk '{ print $1 }') + while test "${ll}" -gt 1; do + hwr=${l%%[[:space:]]*} + l=${l#*[[:space:]]} + fwd=${l%%[[:space:]]*} + l=${l#*[[:space:]]} + + #echo "=+=> ${hwr} -> ${fwd}" >&2 + eval fwd_${hwr}=${fwd} + ll=$(echo "${l}" | wc -w | awk '{ print $1 }') + done + + echo "${hwrevs}" | \ + while read did hwrl; do + hwrn=$(echo "${hwrl}" | wc -w | awk '{ print $1 }') + if test ${hwrn} -lt 1; then + printf "Device ID %s has no hardware revisions (%s); skipping\n" "${did}" ${hwrn} >&2 + continue + fi + + for hwrx in ${hwrl}; do + + eval fwd=\${fwd_${hwrx}} + #echo "===> ${did} -> ${hwrx} -> ${fwd}" >&2 + + if test ! -d ${LFWDIR}/${fwd}; then + #printf "Firmware dir %s (for %s) does not exist; skipping\n" ${fwd} ${did} >&2 + continue + fi + + flav=$(echo "${fwd}" | awk -v drv=${DRIVER} '{ + # Ports FLAVOR names are [a-z0-9_]. If needed add more mangling magic here. + gsub("^" drv "/", ""); + gsub("/", "_"); + gsub("\\.", ""); + print tolower($0); + }') + + # Print this first or otherwise if two device IDs have the same firmware + # we may not see that. + echo "FWGET ${did} ${flav}" + + x="" + for zf in ${sfwl}; do + if test "${zf}" == "${flav}"; then + x="${zf}" + break + fi + done + if test "${x}" != ""; then + #printf "Flavor %s (firmware directory %s) already seen; skipping\n" ${flav} ${fwd} >&2 + continue + fi + sfwl="${sfwl} ${flav}" + + #echo "==> ${did} -> ${fwd} -> ${flav}" + + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a \! -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + #echo "==> ${flav} :: ${fn} :: ${lx}" >&2 + + if test ${fn} -gt 0; then + + echo "FWS ${flav}" + echo "DISTFILES_${flav}= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + #gsub("^" drv "/", "${FWSUBDIR}/"); + gsub("^", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + + # Check for "lic" files. + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + if test ${fn} -gt 0; then + echo "FWL ${flav}" + echo "DISTFILES_${flav}_lic= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + #gsub("^" drv "/", "${FWSUBDIR}/"); + gsub("^", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + fi + fi + done + + done +} + +################################################################################ +# +# Generate the PORTS file template. +# + +fwsl=$(list_fw | grep ^FWS | awk '{ print $2 }') +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + portsfile=$(mktemp -p /tmp ${DRIVER}-fwport.XXXXXX) + + :> ${portsfile} + ( + echo "FWSUBS= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t%s%s\n", $0, x; + }' + + echo + list_fw | grep -v ^FWS | grep -v ^FWL | grep -v ^FWGET + + echo + echo "DISTFILES_\${FWDRV}= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s}%s\n", $0, x; + }' + + fwsl=$(list_fw | grep ^FWL | awk '{ print $2 }') + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + if test ${fn} -gt 0; then + echo "DISTFILES_\${FWDRV}_lic= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s_lic}%s\n", $0, x; + }' + else + echo "DISTFILES_\${FWDRV}_lic=" + fi + + ) >> ${portsfile} + + printf "INFO: wifi-firmware-%s-kmod template at %s\n" ${DRIVER} ${portsfile} >&2 +fi + +################################################################################ +# +# Generate the fwget(8) case pattern table (PCI device ID -> fw port flavor). +# + +fwgetfile=$(mktemp -p /tmp ${DRIVER}-fwget.XXXXXX) +:> ${fwgetfile} + +fwsl=$(list_fw | grep ^FWGET | sort) +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | grep -c FWGET | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + # We need to check for same ID with multiple firmware. + # The list ist sorted by ID so duplicates are next to each other. + cs=$(echo "${fwsl}" | awk '{ print $2 }' | uniq -c | awk '{ print $1 }') + + #echo "==> cs=${cs}" >&2 + + for n in ${cs}; do + + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + # printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + if test ${n} -eq 1; then + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"; return 1 ;;\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + else + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + + i=1 + while test ${i} -lt ${n}; do + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + #printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + drv, tolower($2); + }' >> ${fwgetfile} + + i=$((i + 1)) + done + + printf "\t\treturn 1 ;;\n" >> ${fwgetfile} + fi + done +fi + +printf "INFO: fwget pci_network_qca %s template at %s\n" ${DRIVER} ${fwgetfile} >&2 + +# end diff --git a/sys/contrib/dev/athk/ath12k/zzz_fw_ports_fwget.sh b/sys/contrib/dev/athk/ath12k/zzz_fw_ports_fwget.sh new file mode 100644 index 000000000000..500f5de05cc4 --- /dev/null +++ b/sys/contrib/dev/athk/ath12k/zzz_fw_ports_fwget.sh @@ -0,0 +1,310 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Björn Zeeb +# under sponsorship from the FreeBSD Foundation. +# +# This is neither efficient nor elegant but we need it few times +# a year and it does the job. +# +# +# USAGE: please check out the correct tag/hash for ports in the +# linux-firmware.git repository you point this script to. +# + +set -e + +DRIVER=ath12k +CHECKFILE=dp_mon.c + +################################################################################ +# +# Check pre-reqs +# +if [ $# -ne 1 ]; then + printf "USAGE: %s /path/to/linux-firmware.git\n" $0 >&2 + exit 1 +fi + +if [ ! -e ${CHECKFILE} ]; then + printf "ERROR: run from %s driver directory; no %s.c here\n" ${DRIVER} ${CHECKFILE} >&2 + exit 1 +fi + +LFWDIR=${1} +if test ! -d ${LFWDIR} -o ! -e ${LFWDIR}/WHENCE; then + printf "ERROR: cannot find linux-firmware.git at '%s'\n" ${LFWDIR} >&2 + exit 1 +fi +LFWDIR=${LFWDIR}/${DRIVER} + +################################################################################ +# +# Helper functions. +# +# This uses a hack (cpp) to expand some macros for us and parses out the result +# which is the PCI device ID or the firmware directory for that. +# +list_fw() +{ + # List of already seen flavor (firmware directory). + sfwl="" + + # List of "supported" device IDs. + devidl=$(cpp pci.c 2> /dev/null | awk '/PCI_VDEVICE\(QCOM,/ { gsub("^.*, ", ""); gsub("\\) },$", ""); print tolower($0); }') + # Turn them into a regex. + didreg=$(echo "${devidl}" | xargs -J % echo -n % | sed -e 's, ,|,g') + # List the device ID cases along with their hw_rev which we can go and take to lookup fw. + hwrevs=$(cpp pci.c 2> /dev/null | egrep -E "(case (${didreg})|ab->hw_rev = )" | awk '{ + if (FNR > 1 && /case/) { + printf "\n"; + } + gsub("^.*case[[:space:]]*", ""); + gsub("[[:space:]]*ab->hw_rev = ", " "); + gsub("[:;]", ""); + printf "%s", $0; + }') + + # hwrevs is a list of (device IDs) -> (1..n hardware revisions) mappings. + #echo "==> ${devidl} :: ${didreg} :: ${hwrevs}" >&2 + + # List of (hardware revision) -> (firware directory) mappings. + l=$(cpp hw.c 2> /dev/null | egrep -E '\.(hw_rev|dir) = ' | awk '{ if (/hw_rev/) { printf "%s", $0; } else { print; } }' | sort | uniq | \ + awk '{ + gsub("^.*hw_rev = ", ""); + gsub(",.* = ", "\t"); + gsub(",$", ""); + gsub(/"/, ""); + gsub(" ", ""); + gsub("\t", " "); + print; + }') + #echo "===> ${l}" >&2 + + ll=$(echo "${l}" | wc -w | awk '{ print $1 }') + while test "${ll}" -gt 1; do + hwr=${l%%[[:space:]]*} + l=${l#*[[:space:]]} + fwd=${l%%[[:space:]]*} + l=${l#*[[:space:]]} + + #echo "=+=> ${hwr} -> ${fwd}" >&2 + eval fwd_${hwr}=${fwd} + ll=$(echo "${l}" | wc -w | awk '{ print $1 }') + done + + echo "${hwrevs}" | \ + while read did hwrl; do + hwrn=$(echo "${hwrl}" | wc -w | awk '{ print $1 }') + if test ${hwrn} -lt 1; then + printf "Device ID %s has no hardware revisions (%s); skipping\n" "${did}" ${hwrn} >&2 + continue + fi + + for hwrx in ${hwrl}; do + + eval fwd=\${fwd_${hwrx}} + #echo "===> ${did} -> ${hwrx} -> ${fwd}" >&2 + + if test ! -d ${LFWDIR}/${fwd}; then + #printf "Firmware dir %s (for %s) does not exist; skipping\n" ${fwd} ${did} >&2 + continue + fi + + flav=$(echo "${fwd}" | awk -v drv=${DRIVER} '{ + # Ports FLAVOR names are [a-z0-9_]. If needed add more mangling magic here. + gsub("^" drv "/", ""); + gsub("/", "_"); + gsub("\\.", ""); + print tolower($0); + }') + + # Print this first or otherwise if two device IDs have the same firmware + # we may not see that. + echo "FWGET ${did} ${flav}" + + x="" + for zf in ${sfwl}; do + if test "${zf}" == "${flav}"; then + x="${zf}" + break + fi + done + if test "${x}" != ""; then + #printf "Flavor %s (firmware directory %s) already seen; skipping\n" ${flav} ${fwd} >&2 + continue + fi + sfwl="${sfwl} ${flav}" + + #echo "==> ${did} -> ${fwd} -> ${flav}" + + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a \! -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + #echo "==> ${flav} :: ${fn} :: ${lx}" >&2 + + if test ${fn} -gt 0; then + + echo "FWS ${flav}" + echo "DISTFILES_${flav}= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + #gsub("^" drv "/", "${FWSUBDIR}/"); + gsub("^", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + + # Check for "lic" files. + lx=$(cd ${LFWDIR} && find ${fwd} -type f \! -name "*sdio*" -a -name "*.txt" -print) + + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${lx}" | wc -w | awk '{ print $1 }') + + if test ${fn} -gt 0; then + echo "FWL ${flav}" + echo "DISTFILES_${flav}_lic= \\" + for fz in ${lx}; do echo "${fz}"; done | \ + awk -v fn=$fn -v fwg=${flav} -v drv=${DRIVER} '{ + if (FNR == fn) { x="" } else { x=" \\" }; + #gsub("^" drv "/", "${FWSUBDIR}/"); + gsub("^", "${FWSUBDIR}/"); + printf "\t%s${DISTURL_SUFFIX}%s\n", $0, x; + }' + fi + fi + done + + done +} + +################################################################################ +# +# Generate the PORTS file template. +# + +fwsl=$(list_fw | grep ^FWS | awk '{ print $2 }') +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + portsfile=$(mktemp -p /tmp ${DRIVER}-fwport.XXXXXX) + + :> ${portsfile} + ( + echo "FWSUBS= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t%s%s\n", $0, x; + }' + + echo + list_fw | grep -v ^FWS | grep -v ^FWL | grep -v ^FWGET + + echo + echo "DISTFILES_\${FWDRV}= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s}%s\n", $0, x; + }' + + fwsl=$(list_fw | grep ^FWL | awk '{ print $2 }') + # Get a count so we can automatically add \\ apart from the last line. + fn=$(echo "${fwsl}" | wc -w | awk '{ print $1 }') + if test ${fn} -gt 0; then + echo "DISTFILES_\${FWDRV}_lic= \\" + for sz in ${fwsl}; do echo "${sz}"; done | \ + awk -v fn=$fn '{ + if (FNR == fn) { x="" } else { x=" \\" }; + printf "\t${DISTFILES_%s_lic}%s\n", $0, x; + }' + else + echo "DISTFILES_\${FWDRV}_lic=" + fi + + ) >> ${portsfile} + + printf "INFO: wifi-firmware-%s-kmod template at %s\n" ${DRIVER} ${portsfile} >&2 +fi + +################################################################################ +# +# Generate the fwget(8) case pattern table (PCI device ID -> fw port flavor). +# + +fwgetfile=$(mktemp -p /tmp ${DRIVER}-fwget.XXXXXX) +:> ${fwgetfile} + +fwsl=$(list_fw | grep ^FWGET | sort) +# Get a count so we can automatically add \\ apart from the last line. +fn=$(echo "${fwsl}" | grep -c FWGET | awk '{ print $1 }') + +if test ${fn} -gt 0; then + + # We need to check for same ID with multiple firmware. + # The list ist sorted by ID so duplicates are next to each other. + cs=$(echo "${fwsl}" | awk '{ print $2 }' | uniq -c | awk '{ print $1 }') + + #echo "==> cs=${cs}" >&2 + + for n in ${cs}; do + + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + # printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + if test ${n} -eq 1; then + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"; return 1 ;;\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + else + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t%s)\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + tolower($1), drv, tolower($2); + }' >> ${fwgetfile} + + i=1 + while test ${i} -lt ${n}; do + # Skip FWGET + fwsl=${fwsl#*[[:space:]]} + # get device ID + did=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + # get flavor + flav=${fwsl%%[[:space:]]*} + fwsl=${fwsl#*[[:space:]]} + + #printf "===> did %s flav %s\n" ${did} ${flav} >&2 + + echo "${did} ${flav}" | awk -v drv=${DRIVER} '{ + printf "\t\taddpkg \"wifi-firmware-%s-kmod-%s\"\n", + drv, tolower($2); + }' >> ${fwgetfile} + + i=$((i + 1)) + done + + printf "\t\treturn 1 ;;\n" >> ${fwgetfile} + fi + done +fi + +printf "INFO: fwget pci_network_qca %s template at %s\n" ${DRIVER} ${fwgetfile} >&2 + +# end diff --git a/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh b/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh new file mode 100644 index 000000000000..60c75c00cbc7 --- /dev/null +++ b/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh @@ -0,0 +1,374 @@ +#!/bin/sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Björn Zeeb +# under sponsorship from the FreeBSD Foundation. +# +# This is neither efficient nor elegant but we need it few times +# a year and it does the job. +# +# +# USAGE: please check out the correct tag/hash for ports in the +# linux-firmware.git repository you point this script to. +# +# USAGE: please make sure to pre-load if_iwlwifi.ko so that we +# have access to the sysctl. You do not need to have a supported *** 963 LINES SKIPPED *** From nobody Thu Oct 31 14:34:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNG6bDzz5bnrZ; Thu, 31 Oct 2024 14:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNG515Cz47b2; Thu, 31 Oct 2024 14:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YmbNnPxHwSuLlpLHZi6vKnr5gyGwHBCGtLMN/Ckv9K0=; b=nL+bb3ImIKX3LBMnmxFRH6ATCCIhm5Cev6NF2F55UKQi5GmdVvCn/uZxj9NNCuAquqT3xT Fb8cMkxRgiwIZ+GV1NZdwa1tYGKJDUJETpnRIg1ndMinl+Czlpmn5sdzN9xxdSbz2QLH08 RpvfEb1jqtQ7KfRVeGhzLcfNL6uFplsFXSNcij1Z0U0PwKZ0B4S/V60dAzL/DA3CahExlx H07Au7S451dIr/AS8aWN6r3roxcEZi00i4h6SrJkEu0qwiJg8DuEbByyywgvY+1qIkk1W+ MOMB+xyfe6VegCUynSLRuYb6k8Q468PBm1Nf2vi3go76o6OfP61adFcGBz1RHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YmbNnPxHwSuLlpLHZi6vKnr5gyGwHBCGtLMN/Ckv9K0=; b=oCpcHjftEtkUOWBasdW6AEiHNGqetWbetjArAtZEbDq7+pqit/3AGrIRObs2OzTcOXEYAl 1gQXA09KmV1cy5GLfnM8hZUhJ5fprvJVW2ShaxyVmFTO+g8jbfOUr9hFWJkcFpspMkJmz1 3iKLEJFm+XUQzQ026XtMTo+FXryI637c7jwq5biyDLboWfxfwQQp+uPvo6WH0708Cem7lW dyVEWzeheKEidijNBbtSurASJTFe+MEWXdI0k4ncQW2qmwE0hgHWL+hYWj9u+Wi7lPRsI9 LzAZ2IFlJDJBL6Me5jQL/ARFFllvdvxIzy7onu+wsrmB599W23XcGolsERcmcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385294; a=rsa-sha256; cv=none; b=o1pcniP8p6g88jGA4grxkZzVYvLhkeWfzZDWtRGFQoJ1e3AJ/c0fkw5a2GmcY0qwlR/BrH BrdtALAWRZfNv3VborqTJHn6G9AtGrxdKsANhbKEAsRtcN4BjP2go1wLYLjQUj/bd/qLcz Eh597TDj9q62u0zcsEDWYyW3FJ+/X9HpmHYRn8L6TWASgVOUWoZmMRahCdKKbcouqey1cb zsikBzLs4ni5aVXu6nHOePvrr8CumNbJmqm/ZirR+yjW3JZ+wWTccs1S0PnL/C/DyrlzWm EaU3RyRgl/N179l1/TaJc53kdcTxO/y1154LkAxQpCITp7i1hq2NwisdrFppBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNG4cybzgH8; Thu, 31 Oct 2024 14:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYsMc005212; Thu, 31 Oct 2024 14:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYs3Z005209; Thu, 31 Oct 2024 14:34:54 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:54 GMT Message-Id: <202410311434.49VEYs3Z005209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bc56cb293966 - stable/14 - iwn.4: move hardware to HARDWARE + minor cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc56cb293966b00376e86a9e49192e20a3744aa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bc56cb293966b00376e86a9e49192e20a3744aa5 commit bc56cb293966b00376e86a9e49192e20a3744aa5 Author: Alexander Ziaee AuthorDate: 2024-10-17 19:29:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:56 +0000 iwn.4: move hardware to HARDWARE + minor cleanup Add devices supported by this driver to a HARDWARE section for inclusion in the release Hardware Compatibility Notes. While here: - add SPDX tag - add networking(7) cross-ref quick start guide - tweak examples for consistency Differential Revision: https://reviews.freebsd.org/D47168 (cherry picked from commit 545dbf9d5fadfab591350c7c504b8e4bd113ba7b) --- share/man/man4/iwn.4 | 106 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/share/man/man4/iwn.4 b/share/man/man4/iwn.4 index 1d9f50c38fee..55692a5386a5 100644 --- a/share/man/man4/iwn.4 +++ b/share/man/man4/iwn.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2006 .\" Damien Bergamini . All rights reserved. .\" @@ -23,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 30, 2021 +.Dd October 17, 2024 .Dt IWN 4 .Os .Sh NAME @@ -87,38 +90,7 @@ iwn6050fw_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for: -.Pp -.Bl -tag -width Ds -offset indent -compact -.It Intel Centrino Advanced-N 6200 -.It Intel Centrino Advanced-N 6205 -.It Intel Centrino Advanced-N 6230 -.It Intel Centrino Advanced-N 6235 -.It Intel Centrino Advanced-N + WiMAX 6250 -.It Intel Centrino Ultimate-N 6300 -.It Intel Centrino Wireless-N 100 -.It Intel Centrino Wireless-N 105 -.It Intel Centrino Wireless-N 130 -.It Intel Centrino Wireless-N 135 -.It Intel Centrino Wireless-N 1000 -.It Intel Centrino Wireless-N 1030 -.It Intel Centrino Wireless-N 2200 -.It Intel Centrino Wireless-N 2230 -.It Intel Centrino Wireless-N 4965 -.It Intel Centrino Wireless-N 5100 -.It Intel Centrino Wireless-N 6150 -.It Intel Centrino Wireless-N 6200 -.It Intel Centrino Wireless-N 6250 -.It Intel Centrino Wireless-N + WiMAX 6150 -.It Intel Ultimate N WiFi Link 5300 -.It Intel Wireless WiFi Link 4965 -.It Intel WiFi Link 5100 -.It Intel WiMAX/WiFi Link 5150 -.It Intel WiMAX/WiFi Link 5350 -.El -.Pp -.Nm -supports +driver supports .Cm station and .Cm monitor @@ -130,27 +102,84 @@ For more information on configuring this device, see This driver requires the firmware built with the .Nm iwnfw module to work. +.Sh HARDWARE +The +.Nm +driver provides support for: +.Pp +.Bl -bullet -compact +.It +Intel Centrino Advanced-N 6200 +.It +Intel Centrino Advanced-N 6205 +.It +Intel Centrino Advanced-N 6230 +.It +Intel Centrino Advanced-N 6235 +.It +Intel Centrino Advanced-N + WiMAX 6250 +.It +Intel Centrino Ultimate-N 6300 +.It +Intel Centrino Wireless-N 100 +.It +Intel Centrino Wireless-N 105 +.It +Intel Centrino Wireless-N 130 +.It +Intel Centrino Wireless-N 135 +.It +Intel Centrino Wireless-N 1000 +.It +Intel Centrino Wireless-N 1030 +.It +Intel Centrino Wireless-N 2200 +.It +Intel Centrino Wireless-N 2230 +.It +Intel Centrino Wireless-N 4965 +.It +Intel Centrino Wireless-N 5100 +.It +Intel Centrino Wireless-N 6150 +.It +Intel Centrino Wireless-N 6200 +.It +Intel Centrino Wireless-N 6250 +.It +Intel Centrino Wireless-N + WiMAX 6150 +.It +Intel Ultimate N WiFi Link 5300 +.It +Intel Wireless WiFi Link 4965 +.It +Intel WiFi Link 5100 +.It +Intel WiMAX/WiFi Link 5150 +.It +Intel WiMAX/WiFi Link 5350 +.El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Bd -literal -offset indent -ifconfig wlan create wlandev iwn0 inet 192.168.0.20 \e +# ifconfig wlan create wlandev iwn0 inet 192.168.0.20 \e netmask 0xffffff00 .Ed .Pp Join a specific BSS network with network name -.Dq Li my_net : +.Ql my_net : .Pp -.Dl "ifconfig wlan create wlandev iwn0 ssid my_net up" +.Dl # ifconfig wlan create wlandev iwn0 ssid my_net up .Pp Join a specific BSS network with 64-bit WEP encryption: .Bd -literal -offset indent -ifconfig wlan create wlandev iwn0 ssid my_net \e +# ifconfig wlan create wlandev iwn0 ssid my_net \e wepmode on wepkey 0x1234567890 weptxkey 1 up .Ed .Pp Join a specific BSS network with 128-bit WEP encryption: .Bd -literal -offset indent -ifconfig wlan create wlandev iwn0 wlanmode adhoc ssid my_net \e +# ifconfig wlan create wlandev iwn0 wlanmode adhoc ssid my_net \e wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 .Ed .Sh DIAGNOSTICS @@ -191,6 +220,7 @@ This should not happen. .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , +.Xr networking 7 , .Xr ifconfig 8 , .Xr wpa_supplicant 8 .Sh AUTHORS From nobody Thu Oct 31 14:34:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNJ260qz5bnwq; Thu, 31 Oct 2024 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNJ0lynz47nj; Thu, 31 Oct 2024 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2FKlqhLCPjcRFElQpWySY3LFgbkzMsPNU05D/180iqA=; b=UC3/2kbNbNGMYdKQ/XMg1nJroIBom5UIE2JKFXtBwho5EoEHuc0XC3Nkj14LlqdL0gg7cW AF/jq0ubx0G1IjZrdD4qKRFa9gKogtM3SUiWDM0flIi1MSfsPhNx47DPAFcddMQ7DmJtnm +kcC+nNKEV7ba6lUqMbpDBzNjtn32YuplRAAoo3TRhIrE0Df7YHqssg5Z3tB72styJeDMV 9vem+cVeKz/vtH803lOOZrZkfMTn2tS3EB7QUN68klVcX9m8Z+sVTZXrz03LUCJgg1Jxha F+KJf1/b/Vhght1PA5ZrYXwdusIfBKTDMJXKv5th1iFgDjB7uaOM2uMjmBdJJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2FKlqhLCPjcRFElQpWySY3LFgbkzMsPNU05D/180iqA=; b=eVpnCgqs93fb3mQOw+BTBwHTJrTmuFAuA5UBZhPOlykvfe7xTE+j3GQXZ+KzwFstCgijHn 4UtTAzwyDEZNximMkaHLDjDgK3fbwwEXMAkZFgeVCn4ZL3ScY9SF8GoJ0Hx9eZ8YzmhHB0 aK7WW/UVtm9XjFRr0yTlNkuzKMNIHGyB47Y7pMhvW8GeU7KMwu8TzHU6rYSSdJ4weMhm70 4e7A2f8oXDMUw1Gja8BDuCEjRAGeHlYN9COsLVwv9uWfLd9UFQaloOXpHn/DTlzwtL22vA 49bR3fCpHGDifKBZ9+XK8lIqVPSQtgt72KSaPTZvqYBH8pAHqqrifodt5yli+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385296; a=rsa-sha256; cv=none; b=rA6TN5iamcaf6xabQFuGx3c3XjEHKXMS0cT0GgDyTs1lSn4AJ7rfRogo44fRBXTCBdqSpX 2WYgyVM3rU+QB17a5OhNGLG5fluOHhLiuSfyWmDfT+qzUnx7/b8YKgugFFk/U1y785damX CNGgxxc6lwW+tPGi3eTKSICUOYSopjcto82vKOSP9/ByWqMcKUIEERyW5gROPgLcF9Lb8i 43SD1dSSsfqlGvS0J4Y3mf7wLE/0lj+NrRqwQWwBwRTWbvLVAKxIDGYTps06dLXZPnAmj+ oczkePC68UpC3cL+KDVJ/4YAQe92/YM6Zrtemyf1USADYK9PDBMaD4bt0Qu0sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNH5CLWzg6c; Thu, 31 Oct 2024 14:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYtju005277; Thu, 31 Oct 2024 14:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYtbj005274; Thu, 31 Oct 2024 14:34:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:55 GMT Message-Id: <202410311434.49VEYtbj005274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 231e279ca99b - stable/14 - wpi.4: move hardware to HARDWARE + minor cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 231e279ca99bad95c42090fb4ef329cbaa69ec3d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=231e279ca99bad95c42090fb4ef329cbaa69ec3d commit 231e279ca99bad95c42090fb4ef329cbaa69ec3d Author: Alexander Ziaee AuthorDate: 2024-10-17 19:38:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:57 +0000 wpi.4: move hardware to HARDWARE + minor cleanup Add devices supported by this driver to a HARDWARE section for generation in the Hardware Compatibility Notes. While here: - describe more consistently with product doc and rest of manual - consolidate basics in first paragraph of description - mention boot time configuration - cross-ref networking(7) quick start guide - zap deprecated Tn, macro in list width, and "Dq Li" => "Ql" - markup some unmarked elements - add SPDX tag Differential Revision: https://reviews.freebsd.org/D47170 (cherry picked from commit fa573868f187956b384722a90392866769f4965a) --- share/man/man4/wpi.4 | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/share/man/man4/wpi.4 b/share/man/man4/wpi.4 index 8fe52cdc58eb..9d8d5fb1bd65 100644 --- a/share/man/man4/wpi.4 +++ b/share/man/man4/wpi.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2007 .\" Damien Bergamini . All rights reserved. .\" Benjamin Close . All rights reserved. @@ -26,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 31, 2016 +.Dd October 17, 2024 .Dt WPI 4 .Os .Sh NAME .Nm wpi -.Nd "Intel 3945ABG Wireless LAN IEEE 802.11 driver" +.Nd Intel PRO/Wireless 3945ABG IEEE 802.11a/b/g network driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -48,16 +51,13 @@ kernel configuration file: Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset indent -if_wpi_load="YES" -.Ed +.Pp +.Dl if_wpi_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the -.Tn Intel -3945ABG Wireless network adapter. -The driver supports +driver supports running the +Intel PRO/Wireless 3945ABG network adapter in .Cm station , .Cm adhoc , .Cm adhoc-demo , @@ -65,6 +65,11 @@ The driver supports and .Cm monitor mode operation. +This driver requires the wpifw firmware module +and can be configured at runtime with +.Xr ifconfig 8 +or at boot in +.Xr rc.conf 5 . Only one virtual interface may be configured at any time. .Pp The @@ -81,17 +86,13 @@ The .Nm driver offloads both encryption and decryption of data frames to the hardware for the CCMP cipher. -.Pp -This driver requires the firmware built with the -.Nm wpifw 4 -module to work. -.Pp +.Sh HARDWARE The .Nm -driver can be configured at runtime with -.Xr ifconfig 8 . +driver provides support for the +Intel PRO/Wireless 3945ABG Mini PCIe network adapter. .Sh FILES -.Bl -tag -width ".Pa /usr/share/doc/legal/intel_wpi.LICENSE" -compact +.Bl -tag -width "/usr/share/doc/legal/intel_wpi.LICENSE" -compact .It Pa /usr/share/doc/legal/intel_wpi.LICENSE .Nm firmware license @@ -104,7 +105,7 @@ ifconfig wlan0 create wlandev wpi0 inet 192.168.0.20 \e .Ed .Pp Join a specific BSS network with network name -.Dq Li my_net : +.Ar my_net : .Pp .Dl "ifconfig wlan0 create wlandev wpi0 ssid my_net up" .Pp @@ -122,7 +123,7 @@ ifconfig wlan0 create wlandev wpi0 wlanmode adhoc ssid my_net \e .Ed .Pp Join/create an 802.11b IBSS network with network name -.Dq Li my_net : +.Ar my_net : .Bd -literal -offset indent ifconfig wlan0 create wlandev wpi0 wlanmode adhoc ifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e @@ -141,9 +142,7 @@ ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e The driver failed to load the firmware image using the .Xr firmware 9 subsystem. -Verify the -.Xr wpifw 4 -firmware module is installed. +Verify the wpifw firmware module is installed. .It "wpi%d: %s: timeout waiting for adapter to initialize, error %d" The onboard microcontroller failed to initialize in time. This should not happen. @@ -189,7 +188,7 @@ This should not happen. .Xr wlan_tkip 4 , .Xr wlan_wep 4 , .Xr wlan_xauth 4 , -.Xr wpifw 4 , +.Xr networking 7 , .Xr hostapd 8 , .Xr ifconfig 8 , .Xr wpa_supplicant 8 @@ -207,10 +206,11 @@ ported to .Fx . .Sh CAVEATS -Hostap mode is not directly supported by the device; +.Cm Hostap +mode is not directly supported by the device; it is implemented through IBSS mode (as a result, DFS/passive channels are not available in this mode). .Pp -Powersave may be unstable on some networks (results in -occasional 'wpi%d: device timeout' messages); you can try -to disable it to improve device stability. +Powersave may be unstable on some networks +.Po results in occasional Sy 'wpi%d: device timeout' No messages Pc ; +you can try to disable it to improve device stability. From nobody Thu Oct 31 14:34:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNK3r63z5bpBg; Thu, 31 Oct 2024 14:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNJ6GN6z47g8; Thu, 31 Oct 2024 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oa5ohhqgLh51UoxGN86YRNE0ibgfV59sY4if3KRlKZQ=; b=PwFBTSXmLstVvqNOS8ZzmmE0rRhmNDMI948LohpR6wVNqcDjUkoTnoFAp+Gya9kjOoTgpE GjQzaAwOz9WfPulekGytg8pQfj+gxkbOeX+m5ooXr15V8ESfJxdS9QHnKxO77/vt5B4WlJ 5dxTF2otblvgfaVrhbisELRXnx9GO53zwlaxPNfwNe5YzhGh6GHs3NwtbjEWjNfVTAGi7M 0eKpJoi2QbL0lRVRuuIfjXZqqxXk3CJJp8X3rCeYaLYQWglSVrhmfPgBVSxpGQGi19ZNsf /pAsPs+umFslfTM2egz1EN8xX5lvLAR16SDOdir5HlxJHQSASL/1brzU/jE6+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oa5ohhqgLh51UoxGN86YRNE0ibgfV59sY4if3KRlKZQ=; b=bwLtWjn06Nd7Y272yKhOdEqA0YUUUpuAkz3xAY1eOMecpWtCe9TwjyB40ce5xjf8RMOtaB VWdCiE52/WFestkyOX6ctnQpD1Rx3dvg0edmY2oixJuTthvYF39GLRVrkLNOsnpIVSpouM GmjJRqBYaloW1FOGhnl43RKAQnZYzfoTh6UcAVVJ7UF8mTURKaQxjFjiP5gyu2+I0BUy2X OleGsNPWP9+NuXaHKIHFDmg0qUwZfhVb/YUCnnYTPUNYSl9soRf5zOFlvjsHjE5+k1ouXu DuIUcmooXFsxrLxMzy6rfv9TWmmxBRoiwkw0HY5wn6NqBxMH0aXH2jqiYzB05A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385296; a=rsa-sha256; cv=none; b=odOm33S6k/Dj+OfVCwyHCpHRiF3MBwYuhMB7TBogoVQrYiuWZLzotdIhw0UXox/Ga5Ubiv xFpfYQf60ThPGP89Pm95+RSBaI4osOHkueT9AdXogHrtxlg9Px7IEfsi6NTT1Pey6HupVA s9l80id+yRKnTG76aRoDu47Y3zt9oXF2RxoMHWA91MmubQQHvKmsnQeEbQUcWDjBi2DNL8 1tRQxDBiSqCGgqqkOL97npTXhmDNiuO3VfZZRxT+jqvxOncqzkcuTuS71hvhGfDFvZiUwm AAYN2i/2s7hZmSrpxLYr2Oe1xYDgdBggt1lU1KINSiEgiH+cUmp4eexlR5yIkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNJ5s0TzgYk; Thu, 31 Oct 2024 14:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYuh1005330; Thu, 31 Oct 2024 14:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYuV8005326; Thu, 31 Oct 2024 14:34:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:56 GMT Message-Id: <202410311434.49VEYuV8005326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 83412843682b - stable/14 - LinuxKPI: update rcu_dereference_*() and lockdep_is_held() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83412843682beccc5306cca836160e6e509c563e Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=83412843682beccc5306cca836160e6e509c563e commit 83412843682beccc5306cca836160e6e509c563e Author: Bjoern A. Zeeb AuthorDate: 2024-09-29 00:35:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:57 +0000 LinuxKPI: update rcu_dereference_*() and lockdep_is_held() Update rcu_dereference_{check,protected}() to call the check and log once if it fails and if the RCU debug sysctl is turned on. Also add proper checks for conditions passed in to these functions. For that implement linux_rcu_read_lock_held() (lots of help from wulf). (While here also remove extraneous extern for function prototypes). Update lockdep_is_held() to always be an inline function with argument annotation so that we do no longer have unused variables in callers which only call lockdep_is_held(). Sponsored by: The FreeBSD Foundation Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D46842 (cherry picked from commit 5c92f84bb607c692ce4fa762a7a3c4b86a2fa281) --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 28 ++++++----- .../linuxkpi/common/include/linux/rcupdate.h | 57 ++++++++++++++++++---- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++ sys/compat/linuxkpi/common/src/linux_rcu.c | 31 ++++++++++++ 4 files changed, 97 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index 5291be79218e..70a4e45867fe 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -70,17 +70,6 @@ struct pin_cookie { #define lockdep_assert_none_held_once() do { } while (0) -static __inline bool -lockdep_is_held(void *__m) -{ - struct lock_object *__lock; - struct thread *__td; - - __lock = __m; - return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); -} -#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) - #else #define lockdep_assert(cond) do { } while (0) #define lockdep_assert_once(cond) do { } while (0) @@ -91,10 +80,23 @@ lockdep_is_held(void *__m) #define lockdep_assert_held_once(m) do { (void)(m); } while (0) -#define lockdep_is_held(m) 1 -#define lockdep_is_held_type(_m, _t) 1 #endif +static __inline bool +lockdep_is_held(void *__m __diagused) +{ +#ifdef INVARIANTS + struct lock_object *__lock; + struct thread *__td; + + __lock = __m; + return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); +#else + return (true); +#endif +} +#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) + #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) #define might_lock_nested(m, n) do { } while (0) diff --git a/sys/compat/linuxkpi/common/include/linux/rcupdate.h b/sys/compat/linuxkpi/common/include/linux/rcupdate.h index 95332217f8f5..85d766c8dbc9 100644 --- a/sys/compat/linuxkpi/common/include/linux/rcupdate.h +++ b/sys/compat/linuxkpi/common/include/linux/rcupdate.h @@ -1,6 +1,10 @@ /*- * Copyright (c) 2016-2017 Mellanox Technologies, Ltd. * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +30,20 @@ #ifndef _LINUXKPI_LINUX_RCUPDATE_H_ #define _LINUXKPI_LINUX_RCUPDATE_H_ +#include + #include #include +#include #include +extern int linuxkpi_rcu_debug; +#define RCU_WARN_ONCE(c, ...) do { \ + if (unlikely(linuxkpi_rcu_debug > 0)) \ + WARN_ONCE((c), ##__VA_ARGS__); \ +} while(0) + #define LINUX_KFREE_RCU_OFFSET_MAX 4096 /* exclusive */ /* BSD specific defines */ @@ -61,6 +74,9 @@ linux_rcu_read_unlock(RCU_TYPE_REGULAR);\ } while (0) +#define rcu_read_lock_held(void) \ + linux_rcu_read_lock_held(RCU_TYPE_REGULAR) + #define synchronize_rcu(void) do { \ linux_synchronize_rcu(RCU_TYPE_REGULAR); \ } while (0) @@ -79,14 +95,34 @@ #define rcu_access_pointer(p) \ ((__typeof(*p) *)READ_ONCE(p)) -#define rcu_dereference_protected(p, c) \ +#define rcu_dereference(p) \ ((__typeof(*p) *)READ_ONCE(p)) -#define rcu_dereference(p) \ - rcu_dereference_protected(p, 0) +#define __rcu_var_name(n, f, l) \ + __CONCAT(__CONCAT(__CONCAT(rcu_, n), _), __COUNTER__) + +#define __rcu_dereference_protected(p, c, n) \ +({ \ + RCU_WARN_ONCE(!(c), "%s:%d: condition for %s failed\n", \ + __func__, __LINE__, __XSTRING(n)); \ + rcu_dereference(p); \ +}) + +#define rcu_dereference_protected(p, c) \ + __rcu_dereference_protected((p), (c), \ + __rcu_var_name(protected, __func__, __LINE__)) + +#define __rcu_dereference_check(p, c, n) \ +({ \ + __typeof(*p) *n = rcu_dereference(p); \ + RCU_WARN_ONCE(!(c), "%s:%d: condition for %s failed\n", \ + __func__, __LINE__, __XSTRING(n)); \ + n; \ +}) -#define rcu_dereference_check(p, c) \ - rcu_dereference_protected(p, c) +#define rcu_dereference_check(p, c) \ + __rcu_dereference_check((p), (c) || rcu_read_lock_held(), \ + __rcu_var_name(check, __func__, __LINE__)) #define rcu_dereference_raw(p) \ ((__typeof(*p) *)READ_ONCE(p)) @@ -113,11 +149,12 @@ /* prototypes */ -extern void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t func); -extern void linux_rcu_barrier(unsigned type); -extern void linux_rcu_read_lock(unsigned type); -extern void linux_rcu_read_unlock(unsigned type); -extern void linux_synchronize_rcu(unsigned type); +void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t func); +void linux_rcu_barrier(unsigned type); +void linux_rcu_read_lock(unsigned type); +void linux_rcu_read_unlock(unsigned type); +bool linux_rcu_read_lock_held(unsigned); +void linux_synchronize_rcu(unsigned type); /* Empty implementation for !DEBUG */ #define init_rcu_head(...) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index ec4e59f66e7f..fe1a545c6a3a 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -117,6 +117,10 @@ int linuxkpi_debug; SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); +int linuxkpi_rcu_debug; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, rcu_debug, CTLFLAG_RWTUN, + &linuxkpi_rcu_debug, 0, "Set to enable RCU warning. Clear to disable."); + int linuxkpi_warn_dump_stack = 0; SYSCTL_INT(_compat_linuxkpi, OID_AUTO, warn_dump_stack, CTLFLAG_RWTUN, &linuxkpi_warn_dump_stack, 0, diff --git a/sys/compat/linuxkpi/common/src/linux_rcu.c b/sys/compat/linuxkpi/common/src/linux_rcu.c index 4515684aabc7..8151d7fd15e1 100644 --- a/sys/compat/linuxkpi/common/src/linux_rcu.c +++ b/sys/compat/linuxkpi/common/src/linux_rcu.c @@ -2,6 +2,10 @@ * Copyright (c) 2016 Matthew Macy (mmacy@mattmacy.io) * Copyright (c) 2017-2021 Hans Petter Selasky (hselasky@freebsd.org) * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -246,6 +250,33 @@ linux_rcu_read_unlock(unsigned type) sched_unpin(); } +bool +linux_rcu_read_lock_held(unsigned type) +{ +#ifdef INVARINATS + struct linux_epoch_record *record __diagused; + struct task_struct *ts; + + MPASS(type < RCU_TYPE_MAX); + + if (RCU_SKIP()) + return (false); + + if (__current_unallocated(curthread)) + return (false); + + ts = current; + if (ts->rcu_recurse[type] == 0) + return (false); + + MPASS(curthread->td_pinned != 0); + MPASS((record = &DPCPU_GET(linux_epoch_record[type])) && + record->epoch_record.active != 0); +#endif + + return (true); +} + static void linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, ck_epoch_record_t *epoch_record, void *arg __unused) { From nobody Thu Oct 31 14:34:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRNL1TVhz5bpBh; Thu, 31 Oct 2024 14:34:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRNK6XG3z47td; Thu, 31 Oct 2024 14:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mp6V6CcnbMZECyYLXlS/LWBwUE+xox4zYeW/420FS3I=; b=nKzMqzO1wg7Ld+sYmws2U73rImvT5qHwlsqv7RBX6F9KG13Z9w53EnlMR5m6PTDL222/y7 6qZPShPjqZfyvJ/QT0bdItkqIA2NPO5INXyADN6QDO1t1scARcWAOIe5ZBQjoC12Taldfj Yd7ky1lBG3Fbkf3mPcWpLL3NUoWqdTzyuklRBbIhh5a+plZ9URuQUeCz2RmFk65dmKL07z 96aJ6Qohi25bDwOBBuQ4JrCaLi3ENJL75iO3zZ7rtWW8A94vR8V8hdnyFZ0htLxbPr1+H+ QE+tjSgVfpzP6gYRxTJ8xRbxdc3y0ZDjdU56AbJ7JNWR83pLOT+a0ETWoD2nqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mp6V6CcnbMZECyYLXlS/LWBwUE+xox4zYeW/420FS3I=; b=tTRJFfX9Vh0eiYoMDRVr1EvnaR2ZnjfFjZjN0Ac1wkTbaIXEVJtT/yeJ2KYsqZmsNunyyx j1gsewa5ooSF6UKNv+4+EbXNKQOYA0ZbhpF8UXSnjy9mZllcl3G3uemnve4vHnJlvpG5Nb bNvRPuMSO2f72BzL2EfltNBf3rxvFnjxxCfsozZcAYtmj6RGSpXQppIusXOjAousgCFQ+y yITLwDx5o32wgGe83LFzPDjQflAoqyUwYiaOrdRI43Qwz8OLIxwqH5/IvcaOwopnushkVa BVYnTfPPhZQU515qQ8BY4ir3NO9h2a7twW/yV1791AguQByQwSORcxvct6WFzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385297; a=rsa-sha256; cv=none; b=mQtUurc9gLDwMztq/fOiy1yeMaVj0qIC1PGOydoNkvbYscxzivMgoqKHqFTPD9oUh/pvAS x8pdCiEatjNJ6gOhBRWv95SkUU3Lm3z7wGTSmYrFFN9ytAzJum3Xs3kOdnF0VE0JsmZ8ZC Sz4MQmW34tme4CKv129S+diAQfPqNr3OW7SpmZL64YBuzF7Ru1rk6/Zlhr2hY0HiGM51Jl ideEX/l6P4A09dsHa5FJqptQsFHy57s68+u9znapUzYtO1pE9PDgmd7CkmNprzZ1fwJzHn iYn6cEnQY/DwcrliYPSxAJLwcwXrnp3Ybr/slUCV3v4vigIjhRLnrcvBV4sKXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRNK65wmzgYl; Thu, 31 Oct 2024 14:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEYvee005398; Thu, 31 Oct 2024 14:34:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEYv4n005391; Thu, 31 Oct 2024 14:34:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:34:57 GMT Message-Id: <202410311434.49VEYv4n005391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d964b9d8ed8a - stable/14 - LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d964b9d8ed8ade2731b5ef3bd3fbbf47d3002a35 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d964b9d8ed8ade2731b5ef3bd3fbbf47d3002a35 commit d964b9d8ed8ade2731b5ef3bd3fbbf47d3002a35 Author: Bjoern A. Zeeb AuthorDate: 2024-10-28 12:02:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 14:33:57 +0000 LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89 Bring ing the LinuxKPI 802.11 compat bits which are not altering the mac80211 ops KPI. * Add various functions for driver updates. * Add functions (some compat code to I assume cleanup some mac80211 ops) emulating chanctx changes doing (*config) updates. * Adjust structs and defines. * Deal with an enum growing more than 32 bits in printf. * Add a mtx to struct wiphy which is exposed to the drivers. Handle initialization and destruction for now. * Implementation of wiphy_work and wiphy_delayed_work. * Set was_assoc for deassoc/deauth in prep_tx_info. Sponsored by: The FreeBSD Foundation (cherry picked from commit ac1d519c01ca8beb59f27962c7052d09a03f72c8) --- .../linuxkpi/common/include/linux/ieee80211.h | 43 +++- sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/cfg80211.h | 250 +++++++++++++++++++-- sys/compat/linuxkpi/common/include/net/mac80211.h | 173 +++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.c | 202 ++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 19 +- 6 files changed, 635 insertions(+), 53 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index ce6a18f798d1..865d85c6f7b7 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -42,8 +42,8 @@ extern int linuxkpi_debug_80211; #ifndef D80211_TODO #define D80211_TODO 0x1 #endif -#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ - printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) +#define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) /* 9.4.2.55 Management MIC element (CMAC-256, GMAC-128, and GMAC-256). */ @@ -138,16 +138,18 @@ enum wlan_ht_cap_sm_ps { #define WLAN_PMKID_LEN 16 #define WLAN_PMK_LEN_SUITE_B_192 48 -#define WLAN_KEY_LEN_WEP40 5 -#define WLAN_KEY_LEN_WEP104 13 -#define WLAN_KEY_LEN_TKIP 32 -#define WLAN_KEY_LEN_CCMP 16 -#define WLAN_KEY_LEN_GCMP 16 -#define WLAN_KEY_LEN_AES_CMAC 16 -#define WLAN_KEY_LEN_GCMP_256 32 -#define WLAN_KEY_LEN_BIP_CMAC_256 32 -#define WLAN_KEY_LEN_BIP_GMAC_128 16 -#define WLAN_KEY_LEN_BIP_GMAC_256 32 +enum ieee80211_key_len { + WLAN_KEY_LEN_WEP40 = 5, + WLAN_KEY_LEN_WEP104 = 13, + WLAN_KEY_LEN_TKIP = 32, + WLAN_KEY_LEN_CCMP = 16, + WLAN_KEY_LEN_GCMP = 16, + WLAN_KEY_LEN_AES_CMAC = 16, + WLAN_KEY_LEN_GCMP_256 = 32, + WLAN_KEY_LEN_BIP_CMAC_256 = 32, + WLAN_KEY_LEN_BIP_GMAC_128 = 16, + WLAN_KEY_LEN_BIP_GMAC_256 = 32, +}; /* 802.11-2020, 9.4.2.55.3, Table 9-185 Subfields of the A-MPDU Parameters field */ enum ieee80211_min_mpdu_start_spacing { @@ -483,9 +485,14 @@ enum ieee80211_back { WLAN_ACTION_ADDBA_REQ = 0, }; +enum ieee80211_sa_query { + WLAN_ACTION_SA_QUERY_RESPONSE = 1, +}; + /* 802.11-2020, Table 9-51-Category values */ enum ieee80211_category { WLAN_CATEGORY_BACK = 3, + WLAN_CATEGORY_SA_QUERY = 8, /* net80211::IEEE80211_ACTION_CAT_SA_QUERY */ }; /* 80211-2020 9.3.3.2 Format of Management frames */ @@ -601,6 +608,7 @@ enum ieee80211_eid { WLAN_EID_TIM = 5, WLAN_EID_COUNTRY = 7, /* IEEE80211_ELEMID_COUNTRY */ WLAN_EID_REQUEST = 10, + WLAN_EID_QBSS_LOAD = 11, /* IEEE80211_ELEMID_BSSLOAD */ WLAN_EID_CHANNEL_SWITCH = 37, WLAN_EID_MEASURE_REPORT = 39, WLAN_EID_HT_CAPABILITY = 45, /* IEEE80211_ELEMID_HTCAP */ @@ -612,6 +620,7 @@ enum ieee80211_eid { WLAN_EID_MULTI_BSSID_IDX = 85, WLAN_EID_EXT_CAPABILITY = 127, WLAN_EID_VHT_CAPABILITY = 191, /* IEEE80211_ELEMID_VHT_CAP */ + WLAN_EID_S1G_TWT = 216, WLAN_EID_VENDOR_SPECIFIC = 221, /* IEEE80211_ELEMID_VENDOR */ }; @@ -760,6 +769,16 @@ enum ieee80211_tx_pwr_interpretation_subfield_enc { IEEE80211_TPE_REG_CLIENT_EIRP_PSD, }; +enum ieee80211_tx_pwr_category_6ghz { + IEEE80211_TPE_CAT_6GHZ_DEFAULT, +}; + +/* 802.11-2020, 9.4.2.27 BSS Load element */ +struct ieee80211_bss_load_elem { + uint16_t sta_count; + uint8_t channel_util; + uint16_t avail_adm_capa; +}; /* net80211: IEEE80211_IS_CTL() */ static __inline bool diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 6916957731e2..254ed6e13f5c 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -84,6 +84,7 @@ enum nl80211_reg_rule_flags { NL80211_RRF_NO_6GHZ_VLP_CLIENT = BIT(14), NL80211_RRF_NO_6GHZ_AFC_CLIENT = BIT(15), NL80211_RRF_PSD = BIT(16), + NL80211_RRF_ALLOW_6GHZ_VLP_AP = BIT(17), }; #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS|NL80211_RRF_NO_HT40PLUS) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 7e57ce67cc26..f489e7a7da11 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include /* linux_80211.c */ @@ -49,8 +51,8 @@ extern int linuxkpi_debug_80211; #ifndef D80211_IMPROVE #define D80211_IMPROVE 0x2 #endif -#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ - printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) +#define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) #define IMPROVE(...) if (linuxkpi_debug_80211 & D80211_IMPROVE) \ printf("%s:%d: XXX LKPI80211 IMPROVE\n", __func__, __LINE__) @@ -106,6 +108,11 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_NO_80MHZ = BIT(7), IEEE80211_CHAN_NO_160MHZ = BIT(8), IEEE80211_CHAN_NO_OFDM = BIT(9), + IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = BIT(10), + IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = BIT(11), + IEEE80211_CHAN_PSD = BIT(12), + IEEE80211_CHAN_ALLOW_6GHZ_VLP_AP = BIT(13), + IEEE80211_CHAN_CAN_MONITOR = BIT(14), }; #define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS) @@ -275,6 +282,9 @@ struct cfg80211_bss_ies { struct cfg80211_bss { /* XXX TODO */ struct cfg80211_bss_ies *ies; + struct cfg80211_bss_ies *beacon_ies; + + int32_t signal; }; struct cfg80211_chan_def { @@ -283,6 +293,7 @@ struct cfg80211_chan_def { enum nl80211_chan_width width; uint32_t center_freq1; uint32_t center_freq2; + uint16_t punctured; }; struct cfg80211_ftm_responder_stats { @@ -378,11 +389,16 @@ struct cfg80211_match_set { struct cfg80211_scan_request { /* XXX TODO */ - int duration, duration_mandatory, flags; bool no_cck; bool scan_6ghz; + bool duration_mandatory; + int8_t tsf_report_link_id; + uint16_t duration; + uint32_t flags; struct wireless_dev *wdev; struct wiphy *wiphy; + uint64_t scan_start; + uint32_t rates[NUM_NL80211_BANDS]; int ie_len; uint8_t *ie; uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; @@ -774,6 +790,7 @@ struct linuxkpi_ieee80211_regdomain { #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 0x05 #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 0x06 #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991 0x07 +#define IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC 0x08 #define IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK 0x01 @@ -895,16 +912,26 @@ struct ieee80211_sta_he_6ghz_capa { }; struct ieee80211_eht_mcs_nss_supp_20mhz_only { - uint8_t rx_tx_mcs7_max_nss; - uint8_t rx_tx_mcs9_max_nss; - uint8_t rx_tx_mcs11_max_nss; - uint8_t rx_tx_mcs13_max_nss; + union { + struct { + uint8_t rx_tx_mcs7_max_nss; + uint8_t rx_tx_mcs9_max_nss; + uint8_t rx_tx_mcs11_max_nss; + uint8_t rx_tx_mcs13_max_nss; + }; + uint8_t rx_tx_max_nss[4]; + }; }; struct ieee80211_eht_mcs_nss_supp_bw { - uint8_t rx_tx_mcs9_max_nss; - uint8_t rx_tx_mcs11_max_nss; - uint8_t rx_tx_mcs13_max_nss; + union { + struct { + uint8_t rx_tx_mcs9_max_nss; + uint8_t rx_tx_mcs11_max_nss; + uint8_t rx_tx_mcs13_max_nss; + }; + uint8_t rx_tx_max_nss[3]; + }; }; struct ieee80211_eht_cap_elem_fixed { @@ -1096,7 +1123,7 @@ struct wiphy_iftype_ext_capab { const uint8_t *extended_capabilities_mask; uint8_t extended_capabilities_len; uint16_t eml_capabilities; - + uint16_t mld_capa_and_ops; }; struct tid_config_support { @@ -1133,10 +1160,23 @@ enum wiphy_flags { WIPHY_FLAG_4ADDR_AP = BIT(14), WIPHY_FLAG_4ADDR_STATION = BIT(15), WIPHY_FLAG_SUPPORTS_MLO = BIT(16), + WIPHY_FLAG_DISABLE_WEXT = BIT(17), }; -struct wiphy { +struct wiphy_work; +typedef void (*wiphy_work_fn)(struct wiphy *, struct wiphy_work *); +struct wiphy_work { + struct list_head entry; + wiphy_work_fn fn; +}; +struct wiphy_delayed_work { + struct wiphy_work work; + struct wiphy *wiphy; + struct timer_list timer; +}; +struct wiphy { + struct mutex mtx; struct device *dev; struct mac_address *addresses; int n_addresses; @@ -1185,6 +1225,9 @@ struct wiphy { uint8_t priv[0] __aligned(CACHE_LINE_SIZE); }; +#define lockdep_assert_wiphy(wiphy) \ + lockdep_assert_held(&(wiphy)->mtx) + struct wireless_dev { /* XXX TODO, like ic? */ int iftype; @@ -1249,6 +1292,15 @@ struct cfg80211_ops { struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t); void linuxkpi_wiphy_free(struct wiphy *wiphy); +void linuxkpi_wiphy_work_queue(struct wiphy *, struct wiphy_work *); +void linuxkpi_wiphy_work_cancel(struct wiphy *, struct wiphy_work *); +void linuxkpi_wiphy_work_flush(struct wiphy *, struct wiphy_work *); +void lkpi_wiphy_delayed_work_timer(struct timer_list *); +void linuxkpi_wiphy_delayed_work_queue(struct wiphy *, + struct wiphy_delayed_work *, unsigned long); +void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *, + struct wiphy_delayed_work *); + int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, struct linuxkpi_ieee80211_regdomain *regd); uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); @@ -1300,16 +1352,8 @@ wiphy_dev(struct wiphy *wiphy) return (wiphy->dev); } -#define wiphy_err(_wiphy, _fmt, ...) \ - dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) - -static __inline const struct linuxkpi_ieee80211_regdomain * -wiphy_dereference(struct wiphy *wiphy, - const struct linuxkpi_ieee80211_regdomain *regd) -{ - TODO(); - return (NULL); -} +#define wiphy_dereference(wiphy, p) \ + rcu_dereference_check(p, lockdep_is_held(&(wiphy)->mtx)) static __inline void wiphy_lock(struct wiphy *wiphy) @@ -1661,6 +1705,12 @@ wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) set_bit(ef, wiphy->ext_features); } +static inline bool +wiphy_ext_feature_isset(struct wiphy *wiphy, enum nl80211_ext_feature ef) +{ + return (test_bit(ef, wiphy->ext_features)); +} + static __inline void * wiphy_net(struct wiphy *wiphy) { @@ -1984,6 +2034,44 @@ cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) return (false); } +static __inline bool +cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) +{ + TODO(); + return (false); +} + +static __inline unsigned int +cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) +{ + TODO(); + return (0); +} + +static inline void +_ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *band, + struct ieee80211_sband_iftype_data *iftype_data, size_t nitems) +{ + band->iftype_data = iftype_data; + band->n_iftype_data = nitems; +} + +static inline const struct ieee80211_sband_iftype_data * +ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *band, + enum nl80211_iftype iftype) +{ + const struct ieee80211_sband_iftype_data *iftype_data; + int i; + + for (i = 0; i < band->n_iftype_data; i++) { + iftype_data = (const void *)&band->iftype_data[i]; + if (iftype_data->types_mask & BIT(iftype)) + return (iftype_data); + } + + return (NULL); +} + static __inline const struct ieee80211_sta_eht_cap * ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, enum nl80211_iftype iftype) @@ -1992,8 +2080,122 @@ ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, return (NULL); } +static inline bool +cfg80211_ssid_eq(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2) +{ + int error; + + if (ssid1 == NULL || ssid2 == NULL) /* Can we KASSERT this? */ + return (false); + + if (ssid1->ssid_len != ssid2->ssid_len) + return (false); + error = memcmp(ssid1->ssid, ssid2->ssid, ssid2->ssid_len); + if (error != 0) + return (false); + return (true); +} + +static inline void +cfg80211_rx_unprot_mlme_mgmt(struct net_device *ndev, const uint8_t *hdr, + uint32_t len) +{ + TODO(); +} + +static inline const struct wiphy_iftype_ext_capab * +cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype iftype) +{ + + TODO(); + return (NULL); +} + +static inline int +nl80211_chan_width_to_mhz(enum nl80211_chan_width width) +{ + switch (width) { + case NL80211_CHAN_WIDTH_5: + return (5); + break; + case NL80211_CHAN_WIDTH_10: + return (10); + break; + case NL80211_CHAN_WIDTH_20_NOHT: + case NL80211_CHAN_WIDTH_20: + return (20); + break; + case NL80211_CHAN_WIDTH_40: + return (40); + break; + case NL80211_CHAN_WIDTH_80: + case NL80211_CHAN_WIDTH_80P80: + return (80); + break; + case NL80211_CHAN_WIDTH_160: + return (160); + break; + case NL80211_CHAN_WIDTH_320: + return (320); + break; + } +} + +/* -------------------------------------------------------------------------- */ + +static inline void +wiphy_work_init(struct wiphy_work *wwk, wiphy_work_fn fn) +{ + INIT_LIST_HEAD(&wwk->entry); + wwk->fn = fn; +} + +static inline void +wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_queue(wiphy, wwk); +} + +static inline void +wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_cancel(wiphy, wwk); +} + +static inline void +wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + linuxkpi_wiphy_work_flush(wiphy, wwk); +} + +static inline void +wiphy_delayed_work_init(struct wiphy_delayed_work *wdwk, wiphy_work_fn fn) +{ + wiphy_work_init(&wdwk->work, fn); + timer_setup(&wdwk->timer, lkpi_wiphy_delayed_work_timer, 0); +} + +static inline void +wiphy_delayed_work_queue(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk, + unsigned long delay) +{ + linuxkpi_wiphy_delayed_work_queue(wiphy, wdwk, delay); +} + +static inline void +wiphy_delayed_work_cancel(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk) +{ + linuxkpi_wiphy_delayed_work_cancel(wiphy, wdwk); +} + +/* -------------------------------------------------------------------------- */ + +#define wiphy_err(_wiphy, _fmt, ...) \ + dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) #define wiphy_info(wiphy, fmt, ...) \ - printf("%s:%d XXX TODO " fmt, __func__, __LINE__, __VA_ARGS__) + dev_info(&(wiphy)->dev, fmt, ##__VA_ARGS__) +#define wiphy_info_once(wiphy, fmt, ...) \ + dev_info_once(&(wiphy)->dev, fmt, ##__VA_ARGS__) #ifndef LINUXKPI_NET80211 #define ieee80211_channel linuxkpi_ieee80211_channel diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index c3b07b68090a..6dbf07c85bb8 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -83,6 +83,7 @@ enum mcast_filter_flags { FIF_OTHER_BSS = BIT(4), FIF_PSPOLL = BIT(5), FIF_CONTROL = BIT(6), + FIF_MCAST_ACTION = BIT(7), }; enum ieee80211_bss_changed { @@ -117,6 +118,9 @@ enum ieee80211_bss_changed { BSS_CHANGED_TWT = BIT(28), BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT(30), BSS_CHANGED_EHT_PUNCTURING = BIT(31), + BSS_CHANGED_MLD_VALID_LINKS = BIT_ULL(32), + BSS_CHANGED_MLD_TTLM = BIT_ULL(33), + BSS_CHANGED_TPE = BIT_ULL(34), }; /* 802.11 Figure 9-256 Suite selector format. [OUI(3), SUITE TYPE(1)] */ @@ -167,13 +171,24 @@ enum ieee80211_bss_changed { #define TKIP_PN_TO_IV16(_x) ((uint16_t)(_x & 0xffff)) #define TKIP_PN_TO_IV32(_x) ((uint32_t)((_x >> 16) & 0xffffffff)) -struct ieee80211_sta; +enum ieee80211_neg_ttlm_res { + NEG_TTLM_RES_ACCEPT, + NEG_TTLM_RES_REJECT, +}; + +#define IEEE80211_TTLM_NUM_TIDS 8 +struct ieee80211_neg_ttlm { + uint16_t downlink[IEEE80211_TTLM_NUM_TIDS]; + uint16_t uplink[IEEE80211_TTLM_NUM_TIDS]; +}; /* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */ #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x3 #define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2 #define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT) +struct ieee80211_sta; + struct ieee80211_ampdu_params { struct ieee80211_sta *sta; enum ieee80211_ampdu_mlme_action action; @@ -217,11 +232,13 @@ struct mac80211_fils_discovery { }; struct ieee80211_chanctx_conf { - /* TODO FIXME */ - int rx_chains_dynamic, rx_chains_static; - bool radar_enabled; struct cfg80211_chan_def def; struct cfg80211_chan_def min_def; + struct cfg80211_chan_def ap; + + uint8_t rx_chains_dynamic; + uint8_t rx_chains_static; + bool radar_enabled; /* Must stay last. */ uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); @@ -240,12 +257,39 @@ struct ieee80211_ema_beacons { } bcn[0]; }; +struct ieee80211_chanreq { + struct cfg80211_chan_def oper; +}; + #define WLAN_MEMBERSHIP_LEN (8) #define WLAN_USER_POSITION_LEN (16) +/* + * 802.11ac-2013, 8.4.2.164 VHT Transmit Power Envelope element + * 802.11-???? ? + */ +struct ieee80211_parsed_tpe_eirp { + int8_t power[5]; + uint8_t count; + bool valid; +}; +struct ieee80211_parsed_tpe_psd { + int8_t power[16]; + uint8_t count; + bool valid; +}; +struct ieee80211_parsed_tpe { + /* We see access to [0] so assume at least 2. */ + struct ieee80211_parsed_tpe_eirp max_local[2]; + struct ieee80211_parsed_tpe_eirp max_reg_client[2]; + struct ieee80211_parsed_tpe_psd psd_local[2]; + struct ieee80211_parsed_tpe_psd psd_reg_client[2]; +}; + struct ieee80211_bss_conf { /* TODO FIXME */ struct ieee80211_vif *vif; + struct cfg80211_bss *bss; const uint8_t *bssid; uint8_t addr[ETH_ALEN]; uint8_t link_id; @@ -308,6 +352,7 @@ struct ieee80211_bss_conf { struct mac80211_fils_discovery fils_discovery; struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_vif *mbssid_tx_vif; + struct ieee80211_parsed_tpe tpe; int ack_enabled, bssid_index, bssid_indicator, cqm_rssi_hyst, cqm_rssi_thold, ema_ap, frame_time_rts_th, ftm_responder; int htc_trig_based_pkt_ext; @@ -322,6 +367,7 @@ struct ieee80211_bss_conf { struct ieee80211_channel_switch { /* TODO FIXME */ int block_tx, count, delay, device_timestamp, timestamp; + uint8_t link_id; struct cfg80211_chan_def chandef; }; @@ -444,6 +490,10 @@ enum ieee80211_hw_flags { IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, IEEE80211_HW_SUPPORTS_RC_TABLE, IEEE80211_HW_DETECTS_COLOR_COLLISION, + IEEE80211_HW_DISALLOW_PUNCTURING, + IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ, + IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN, + IEEE80211_HW_HANDLES_QUIET_CSA, /* Keep last. */ NUM_IEEE80211_HW_FLAGS @@ -500,6 +550,7 @@ enum ieee802111_key_flag { IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(6), IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(7), IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(8), + IEEE80211_KEY_FLAG_SPP_AMSDU = BIT(9), }; struct ieee80211_key_conf { @@ -569,6 +620,9 @@ enum ieee80211_rx_status_flags { RX_FLAG_SKIP_MONITOR = BIT(26), RX_FLAG_8023 = BIT(27), RX_FLAG_RADIOTAP_TLV_AT_END = BIT(28), + RX_FLAG_MACTIME = BIT(29), + RX_FLAG_MACTIME_IS_RTAP_TS64 = BIT(30), + RX_FLAG_FAILED_PLCP_CRC = BIT(31), }; enum mac80211_rx_encoding { @@ -742,7 +796,9 @@ enum ieee80211_vif_driver_flags { IEEE80211_VIF_BEACON_FILTER = BIT(0), IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), - IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), + IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), /* Renamed to IEEE80211_VIF_EML_ACTIVE. */ + IEEE80211_VIF_EML_ACTIVE = BIT(4), + IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW = BIT(5), }; #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 @@ -799,6 +855,8 @@ struct ieee80211_vif_chanctx_switch { struct ieee80211_prep_tx_info { u16 duration; bool success; + bool was_assoc; + int link_id; }; /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */ @@ -813,6 +871,7 @@ struct ieee80211_tx_info { struct { struct ieee80211_tx_rate rates[4]; bool use_rts; + uint8_t antennas:2; struct ieee80211_vif *vif; struct ieee80211_key_conf *hw_key; enum ieee80211_tx_control_flags flags; @@ -1044,6 +1103,8 @@ struct ieee80211_ops { int (*change_vif_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16, u16, struct ieee80211_bss_conf *[IEEE80211_MLD_MAX_NUM_LINKS]); int (*change_sta_links)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u16, u16); + bool (*can_activate_links)(struct ieee80211_hw *, struct ieee80211_vif *, u16); + enum ieee80211_neg_ttlm_res (*can_neg_ttlm)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_neg_ttlm *); /* #ifdef CONFIG_MAC80211_DEBUGFS */ /* Do not change depending on compile-time option. */ void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *); @@ -2052,7 +2113,6 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) static __inline void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) { - linuxkpi_ieee80211_tx_status(hw, skb); } @@ -2060,14 +2120,14 @@ static __inline void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) { IMPROVE(); - ieee80211_tx_status(hw, skb); + linuxkpi_ieee80211_tx_status(hw, skb); } static __inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb) { IMPROVE(); - ieee80211_tx_status(hw, skb); + linuxkpi_ieee80211_tx_status(hw, skb); } static __inline void @@ -2370,7 +2430,102 @@ ieee80211_get_eht_iftype_cap_vif(const struct ieee80211_supported_band *band, return (NULL); } +static inline uint32_t +ieee80211_vif_usable_links(const struct ieee80211_vif *vif) +{ + TODO(); + return (1); +} + +static inline bool +ieee80211_vif_link_active(const struct ieee80211_vif *vif, uint8_t link_id) +{ + if (ieee80211_vif_is_mld(vif)) + return (vif->active_links & BIT(link_id)); + return (link_id == 0); +} + +static inline void +ieee80211_set_active_links_async(struct ieee80211_vif *vif, + uint32_t new_active_links) +{ + TODO(); +} + +static inline int +ieee80211_set_active_links(struct ieee80211_vif *vif, + uint32_t active_links) +{ + TODO(); + return (-ENXIO); +} + +static inline void +ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp __unused) +{ + IMPROVE("we notify user space by a vap state change eventually"); + linuxkpi_ieee80211_beacon_loss(vif); +} + #define ieee80211_send_bar(_v, _r, _t, _s) \ linuxkpi_ieee80211_send_bar(_v, _r, _t, _s) +/* -------------------------------------------------------------------------- */ + +int lkpi_80211_update_chandef(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *); + +static inline int +ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf) +{ + int error; + + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + +static inline void +ieee80211_emulate_remove_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf __unused) +{ + hw->conf.radar_enabled = false; + lkpi_80211_update_chandef(hw, NULL); +} + +static inline void +ieee80211_emulate_change_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, uint32_t changed __unused) +{ + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + lkpi_80211_update_chandef(hw, chanctx_conf); +} + +static inline int +ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, + struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, + enum ieee80211_chanctx_switch_mode mode __unused) +{ + struct ieee80211_chanctx_conf *chanctx_conf; + int error; + + /* Sanity check. */ + if (n_vifs <= 0) + return (-EINVAL); + if (vifs == NULL || vifs[0].new_ctx == NULL) + return (-EINVAL); + + /* + * What to do if n_vifs > 1? + * Does that make sense for drivers not supporting chanctx? + */ + hw->conf.radar_enabled = vifs[0].new_ctx->radar_enabled; + chanctx_conf = vifs[0].new_ctx; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + +/* -------------------------------------------------------------------------- */ + #endif /* _LINUXKPI_NET_MAC80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index ff257bf32766..c26eb8740c77 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2024 The FreeBSD Foundation * Copyright (c) 2020-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -896,14 +896,14 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, if (linuxkpi_debug_80211 & D80211_TRACE) printf("%s:%d [%s:%d] assoc %d aid %d beacon_int %u " "dtim_period %u sync_dtim_count %u sync_tsf %ju " - "sync_device_ts %u bss_changed %#08x\n", + "sync_device_ts %u bss_changed %#010jx\n", __func__, __LINE__, _f, _l, vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, vif->bss_conf.sync_device_ts, - bss_changed); + (uintmax_t)bss_changed); #endif if (vif->bss_conf.beacon_int != ni->ni_intval) { @@ -927,14 +927,14 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, if (linuxkpi_debug_80211 & D80211_TRACE) printf("%s:%d [%s:%d] assoc %d aid %d beacon_int %u " "dtim_period %u sync_dtim_count %u sync_tsf %ju " - "sync_device_ts %u bss_changed %#08x\n", + "sync_device_ts %u bss_changed %#010jx\n", __func__, __LINE__, _f, _l, vif->cfg.assoc, vif->cfg.aid, vif->bss_conf.beacon_int, vif->bss_conf.dtim_period, vif->bss_conf.sync_dtim_count, (uintmax_t)vif->bss_conf.sync_tsf, vif->bss_conf.sync_device_ts, - bss_changed); + (uintmax_t)bss_changed); #endif return (bss_changed); @@ -1776,6 +1776,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -1810,6 +1811,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -2163,6 +2165,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -2197,6 +2200,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -2301,6 +2305,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int !lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.duration = PREP_TX_INFO_DURATION; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_prepare_tx(hw, vif, &prep_tx_info); lsta->in_mgd = true; } @@ -2335,6 +2340,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (lsta->in_mgd) { memset(&prep_tx_info, 0, sizeof(prep_tx_info)); prep_tx_info.success = false; + prep_tx_info.was_assoc = true; lkpi_80211_mo_mgd_complete_tx(hw, vif, &prep_tx_info); lsta->in_mgd = false; } @@ -5332,18 +5338,158 @@ linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *hdr, bool nonqos_ok) return (tid); } +/* -------------------------------------------------------------------------- */ + +static void +lkpi_wiphy_work(struct work_struct *work) +{ + struct lkpi_wiphy *lwiphy; + struct wiphy *wiphy; + struct wiphy_work *wk; + + lwiphy = container_of(work, struct lkpi_wiphy, wwk); + wiphy = LWIPHY_TO_WIPHY(lwiphy); + + wiphy_lock(wiphy); + + LKPI_80211_LWIPHY_WORK_LOCK(lwiphy); + wk = list_first_entry_or_null(&lwiphy->wwk_list, struct wiphy_work, entry); + /* If there is nothing we do nothing. */ + if (wk == NULL) { + LKPI_80211_LWIPHY_WORK_UNLOCK(lwiphy); + wiphy_unlock(wiphy); + return; + } + list_del_init(&wk->entry); + + /* More work to do? */ + if (!list_empty(&lwiphy->wwk_list)) + schedule_work(work); + LKPI_80211_LWIPHY_WORK_UNLOCK(lwiphy); + + /* Finally call the (*wiphy_work_fn)() function. */ + wk->fn(wiphy, wk); + + wiphy_unlock(wiphy); +} + +void +linuxkpi_wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk) +{ + struct lkpi_wiphy *lwiphy; + + lwiphy = WIPHY_TO_LWIPHY(wiphy); + + LKPI_80211_LWIPHY_WORK_LOCK(lwiphy); + /* Do not double-queue. */ *** 213 LINES SKIPPED *** From nobody Thu Oct 31 14:42:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRYG5wC5z5bq2C; Thu, 31 Oct 2024 14:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRYG4ly0z4DMF; Thu, 31 Oct 2024 14:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M3jF6ZwOosjcb/zPWgznaiyMCBV4z3ih+LWe2DJkcGo=; b=NtAaY+yUlVsTzKX4tN55q0ARqiVLcLB6p83co5whpsA80w/txjIb4oEtnsS5Bi6HNx3NVy t0Qb0/JW2AQ5qeMZ3Zmc83IYegM0FAEVBXpYPkTUuwxPaoD/StJs9gB2bE2CjDYb5zXclx y7hgQEE6XX3qD/9pn1wCYPd/KO1YkRKCEcqfNUedeDndWy/DB5ECLOK/fmt2uUpPOlX0kH skdABnI0gD1i5hUEV6OBsDPaAc9YnoX4PRdymkY6FHjBl1jsMSyGGNZhQfQXbWT3B13aPZ 572E6t+bk9aQsdn644AhAQbsuvEfZYWhkYccrP01GSBhOGib3kstA1SOszfXXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730385762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M3jF6ZwOosjcb/zPWgznaiyMCBV4z3ih+LWe2DJkcGo=; b=gfmYumZyn267b1zQR/5k3Le5z8PmI+PCvmncFtq94CGAcNn+osoNOlKhjM3o89kItkJVUg y4uq8PWtnAwkvCGa9sNqIZE4U/tJdRYq/COlkwll6HALY28Fnxmg8lB6pOABElwor/9UWA z+rvYhbKKIlmr864RLrwhnp2MqUsKHkp/8SPw4gm2oVDO5wsSQNhya2hkf0UjjW77r/ok9 kHHR30TTFyFwuJCMDdA19PsLMwRqyvC4wQO9lGgLmnRLq+jORln6MbeFLyN2b0cD7+RTAX NK9zOU7LEnloqCvGw1dLgl2r2zIevWDpsTHdPOMYQkRCennEyDHqaGjksL3eLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730385762; a=rsa-sha256; cv=none; b=baCjkNf1AaSPFZ/QfkXFEDwTeQcAoJxP0ACtyPPuhAWg56PZYLnUjAuRQWaF1JbYArcR6U i23rXQcletcyF0qmgjkyZeIM2bDPN9F2k4kmxik9yPb9c54HQGuf3hxsz/r9C6uZoX8ZKE Em3oBKNMB/t1AHddawNfGrGkizB5qFHk1l+7+5crmrLd9QRxBwqMwk9B5zIL5BsH4zUhjl Z3gq7tkWzjWf1E4T6kM0GFDbtSt7q9PRUXZKHVZo6VDTpv51pwaf7a7I0HoWFfPVTznLyu Phrce54mmOiAHWO7mVjhe2UjDN4Z+onwwbj4l/jjicfe15XyyU9ol67js6tO8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRYG4N36zgqC; Thu, 31 Oct 2024 14:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEggx0023595; Thu, 31 Oct 2024 14:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEggPB023592; Thu, 31 Oct 2024 14:42:42 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:42:42 GMT Message-Id: <202410311442.49VEggPB023592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Peek Subject: git: f9e09dc5b1d5 - stable/14 - bhyve: support noVNC SetPixelFormat request List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9e09dc5b1d593a239d170a975ff60114030b471 Auto-Submitted: auto-generated The branch stable/14 has been updated by mp: URL: https://cgit.FreeBSD.org/src/commit/?id=f9e09dc5b1d593a239d170a975ff60114030b471 commit f9e09dc5b1d593a239d170a975ff60114030b471 Author: Mark Peek AuthorDate: 2024-09-09 17:21:17 +0000 Commit: Mark Peek CommitDate: 2024-10-31 14:41:17 +0000 bhyve: support noVNC SetPixelFormat request The bhyve VNC server would ignore the SetPixelFormat message from the VNC client. This change supports a limited implementation to detect and reorder the colors such as requested from the noVNC client. PR: 280984 Reviewed by: corvink Differential Revision: https://reviews.freebsd.org/D46402 MFC after: 3 weeks (cherry picked from commit dda0f9837b1c4049079aeaefb35076aef5f06a6c) --- usr.sbin/bhyve/rfb.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c index db2924fee453..4e9f52ed4700 100644 --- a/usr.sbin/bhyve/rfb.c +++ b/usr.sbin/bhyve/rfb.c @@ -104,6 +104,13 @@ static int rfb_debug = 0; #define AUTH_FAILED_UNAUTH 1 #define AUTH_FAILED_ERROR 2 +struct pixfmt { + bool adjust_pixels; + uint8_t red_shift; + uint8_t green_shift; + uint8_t blue_shift; +}; + struct rfb_softc { int sfd; pthread_t tid; @@ -132,14 +139,20 @@ struct rfb_softc { atomic_bool pending; atomic_bool update_all; atomic_bool input_detected; + atomic_bool update_pixfmt; pthread_mutex_t mtx; + pthread_mutex_t pixfmt_mtx; pthread_cond_t cond; int hw_crc; uint32_t *crc; /* WxH crc cells */ uint32_t *crc_tmp; /* buffer to store single crc row */ int crc_width, crc_height; + + struct pixfmt pixfmt; /* owned by the write thread */ + struct pixfmt new_pixfmt; /* managed with pixfmt_mtx */ + uint32_t *pixrow; }; struct rfb_pixfmt { @@ -180,6 +193,10 @@ struct rfb_pixfmt_msg { #define RFB_MAX_HEIGHT 1200 #define RFB_ZLIB_BUFSZ RFB_MAX_WIDTH*RFB_MAX_HEIGHT*4 +#define PIXEL_RED_SHIFT 16 +#define PIXEL_GREEN_SHIFT 8 +#define PIXEL_BLUE_SHIFT 0 + /* percentage changes to screen before sending the entire screen */ #define RFB_SEND_ALL_THRESH 25 @@ -262,9 +279,9 @@ rfb_send_server_init_msg(int cfd) sinfo.pixfmt.red_max = htons(255); sinfo.pixfmt.green_max = htons(255); sinfo.pixfmt.blue_max = htons(255); - sinfo.pixfmt.red_shift = 16; - sinfo.pixfmt.green_shift = 8; - sinfo.pixfmt.blue_shift = 0; + sinfo.pixfmt.red_shift = PIXEL_RED_SHIFT; + sinfo.pixfmt.green_shift = PIXEL_GREEN_SHIFT; + sinfo.pixfmt.blue_shift = PIXEL_BLUE_SHIFT; sinfo.pixfmt.pad[0] = 0; sinfo.pixfmt.pad[1] = 0; sinfo.pixfmt.pad[2] = 0; @@ -319,9 +336,67 @@ static void rfb_recv_set_pixfmt_msg(struct rfb_softc *rc __unused, int cfd) { struct rfb_pixfmt_msg pixfmt_msg; + uint8_t red_shift, green_shift, blue_shift; + uint16_t red_max, green_max, blue_max; + bool adjust_pixels = true; (void)stream_read(cfd, (uint8_t *)&pixfmt_msg + 1, sizeof(pixfmt_msg) - 1); + + /* + * The framebuffer is fixed at 32 bit and orders the colors + * as RGB bytes. However, some VNC clients request a different + * ordering. We will still require the same bit depth and size + * but allow the colors to be shifted when sent to the client. + */ + if (pixfmt_msg.pixfmt.bpp != 32 || pixfmt_msg.pixfmt.truecolor != 1) { + WPRINTF(("rfb: pixfmt unsupported bitdepth bpp: %d " + "truecolor: %d", + pixfmt_msg.pixfmt.bpp, pixfmt_msg.pixfmt.truecolor)); + return; + } + + red_max = ntohs(pixfmt_msg.pixfmt.red_max); + green_max = ntohs(pixfmt_msg.pixfmt.green_max); + blue_max = ntohs(pixfmt_msg.pixfmt.blue_max); + + /* Check for valid max values */ + if (red_max != 255 || green_max != 255 || blue_max != 255) { + WPRINTF(("rfb: pixfmt unsupported max values " + "r: %d g: %d b: %d", + red_max, green_max, blue_max)); + return; + } + + red_shift = pixfmt_msg.pixfmt.red_shift; + green_shift = pixfmt_msg.pixfmt.green_shift; + blue_shift = pixfmt_msg.pixfmt.blue_shift; + + /* Check shifts are 8 bit aligned */ + if ((red_shift & 0x7) != 0 || + (green_shift & 0x7) != 0 || + (blue_shift & 0x7) != 0) { + WPRINTF(("rfb: pixfmt unsupported shift values " + "r: %d g: %d b: %d", + red_shift, green_shift, blue_shift)); + return; + } + + if (red_shift == PIXEL_RED_SHIFT && + green_shift == PIXEL_GREEN_SHIFT && + blue_shift == PIXEL_BLUE_SHIFT) { + adjust_pixels = false; + } + + pthread_mutex_lock(&rc->pixfmt_mtx); + rc->new_pixfmt.red_shift = red_shift; + rc->new_pixfmt.green_shift = green_shift; + rc->new_pixfmt.blue_shift = blue_shift; + rc->new_pixfmt.adjust_pixels = adjust_pixels; + pthread_mutex_unlock(&rc->pixfmt_mtx); + + /* Notify the write thread to update */ + rc->update_pixfmt = true; } static void @@ -389,6 +464,30 @@ rfb_send_update_header(struct rfb_softc *rc __unused, int cfd, int numrects) sizeof(struct rfb_srvr_updt_msg)); } +static uint32_t * +rfb_adjust_pixels(struct rfb_softc *rc, uint32_t *gcptr, int width) +{ + uint32_t *pixelp; + uint32_t red, green, blue; + int i; + + /* If no pixel adjustment needed, send in server format */ + if (!rc->pixfmt.adjust_pixels) { + return (gcptr); + } + + for (i = 0, pixelp = rc->pixrow; i < width; i++, pixelp++, gcptr++) { + red = (*gcptr >> 16) & 0xFF; + green = (*gcptr >> 8) & 0xFF; + blue = (*gcptr & 0xFF); + *pixelp = (red << rc->pixfmt.red_shift) | + (green << rc->pixfmt.green_shift) | + (blue << rc->pixfmt.blue_shift); + } + + return (rc->pixrow); +} + static int rfb_send_rect(struct rfb_softc *rc, int cfd, struct bhyvegc_image *gc, int x, int y, int w, int h) @@ -396,8 +495,8 @@ rfb_send_rect(struct rfb_softc *rc, int cfd, struct bhyvegc_image *gc, struct rfb_srvr_rect_hdr srect_hdr; unsigned long zlen; ssize_t nwrite, total; - int err; - uint32_t *p; + int err, width; + uint32_t *p, *pixelp; uint8_t *zbufp; /* @@ -410,6 +509,7 @@ rfb_send_rect(struct rfb_softc *rc, int cfd, struct bhyvegc_image *gc, srect_hdr.width = htons(w); srect_hdr.height = htons(h); + width = w; h = y + h; w *= sizeof(uint32_t); if (rc->enc_zlib_ok) { @@ -417,7 +517,8 @@ rfb_send_rect(struct rfb_softc *rc, int cfd, struct bhyvegc_image *gc, rc->zstream.total_in = 0; rc->zstream.total_out = 0; for (p = &gc->data[y * gc->width + x]; y < h; y++) { - rc->zstream.next_in = (Bytef *)p; + pixelp = rfb_adjust_pixels(rc, p, width); + rc->zstream.next_in = (Bytef *)pixelp; rc->zstream.avail_in = w; rc->zstream.next_out = (Bytef *)zbufp; rc->zstream.avail_out = RFB_ZLIB_BUFSZ + 16 - @@ -453,7 +554,8 @@ doraw: total = 0; zbufp = rc->zbuf; for (p = &gc->data[y * gc->width + x]; y < h; y++) { - memcpy(zbufp, p, w); + pixelp = rfb_adjust_pixels(rc, p, width); + memcpy(zbufp, pixelp, w); zbufp += w; total += w; p += gc->width; @@ -492,6 +594,11 @@ rfb_send_all(struct rfb_softc *rc, int cfd, struct bhyvegc_image *gc) if (nwrite <= 0) return (nwrite); + if (rc->pixfmt.adjust_pixels) { + return (rfb_send_rect(rc, cfd, gc, 0, 0, + gc->width, gc->height)); + } + /* Rectangle header */ srect_hdr.x = 0; srect_hdr.y = 0; @@ -547,6 +654,14 @@ doraw: #define PIXCELL_SHIFT 5 #define PIXCELL_MASK 0x1F +static void +rfb_set_pixel_adjustment(struct rfb_softc *rc) +{ + pthread_mutex_lock(&rc->pixfmt_mtx); + rc->pixfmt = rc->new_pixfmt; + pthread_mutex_unlock(&rc->pixfmt_mtx); +} + static int rfb_send_screen(struct rfb_softc *rc, int cfd) { @@ -574,6 +689,10 @@ rfb_send_screen(struct rfb_softc *rc, int cfd) if (atomic_exchange(&rc->pending, false) == false) goto done; + if (atomic_exchange(&rc->update_pixfmt, false) == true) { + rfb_set_pixel_adjustment(rc); + } + console_refresh(); gc_image = console_get_image(); @@ -1158,6 +1277,12 @@ rfb_init(const char *hostname, int port, int wait, const char *password) rc->password = password; + rc->pixrow = malloc(RFB_MAX_WIDTH * sizeof(uint32_t)); + if (rc->pixrow == NULL) { + EPRINTLN("rfb: failed to allocate memory for pixrow buffer"); + goto error; + } + snprintf(servname, sizeof(servname), "%d", port ? port : 5900); if (!hostname || strlen(hostname) == 0) @@ -1209,6 +1334,7 @@ rfb_init(const char *hostname, int port, int wait, const char *password) pthread_cond_init(&rc->cond, NULL); } + pthread_mutex_init(&rc->pixfmt_mtx, NULL); pthread_create(&rc->tid, NULL, rfb_thr, rc); pthread_set_name_np(rc->tid, "rfb"); @@ -1224,12 +1350,15 @@ rfb_init(const char *hostname, int port, int wait, const char *password) return (0); error: + if (rc->pixfmt_mtx) + pthread_mutex_destroy(&rc->pixfmt_mtx); if (ai != NULL) freeaddrinfo(ai); if (rc->sfd != -1) close(rc->sfd); free(rc->crc); free(rc->crc_tmp); + free(rc->pixrow); free(rc); return (-1); } From nobody Thu Oct 31 14:47:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRfx0pfYz5bqLv; Thu, 31 Oct 2024 14:47:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRfw6klnz4Dc6; Thu, 31 Oct 2024 14:47:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730386056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ensDv/c9swLGFssdCemMNGRrxaSOLw0NAzqzL9QEHeo=; b=firRV1QkfwCCdBfCprer6SA7pCGS8H5bN6kfy2QrNzB5b9bK4/aEmcyE2aYe6X+mv7bkr0 gxrpmNv8TpBCIaS0Q+wEGbcXCgmg6fG4dNqWDDnujKONxy9IHKAb+aVhJ7+x0YWCUsVBku Ylb397qm6UKZmwCjBUiDDIBh3UhSTkdxXJXPBjrdxi1JTxxu/kGzji7OQYb8Sa+DqMXd5x HNQqtKvf/Wo+TXvWruznI81Cqm0jMldWv8tg4fxA5sfjm9mRiddSlxMgyDe/4vUldmEkKQ W7K2ByLffsob1Va3yUqd+cE27YJIlI4+qOeu6iFJZqMKj4s3smIlzJEEVi461A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730386056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ensDv/c9swLGFssdCemMNGRrxaSOLw0NAzqzL9QEHeo=; b=EXRGaBvzlaM560tJ/SRX9b0j+VsHHffquWAQ/LY313jrh5l5HkHEW6slDPleAJSdLbIjGD DpDUsIFkxVMrtRFU86RtMds94VI0wYu8ljF0qwwb9ZoorDe05KV8/WJvIwQf0QvBFF6b1l rrfdGFtLrKgGyCQ+vyDbGYaqSYmzgJ4oSqPzY2wFGcSOn+2ztA3FAby8JY9n6DdPpVN/YM Jmq852DSgslcs9WRoKT7HuyfGZnpAkSbdhWmMiIxzLwmxx4r4vupDIQ8TVa5x72OfNzLm4 1m6gXWQPa9HfuY0Di22lnIIaHflcxMCnKL+hg1sSXkuzWxqdZIrihmYnVjXmgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730386056; a=rsa-sha256; cv=none; b=JYNc0fdoQszTLDkL22XNEJoQkQXBKCA4YAKxVLYsVsmakCkiwKn0W4l7puT9Hy0hQHWK8f JAlrnktuTLG1eymuDA5gaccmViX26y6EmFGhEWQikyBuHrREO5yssXsmXeJ9FiVyRK9eqf 2Yu5e441UyeR+xk22kb306TGvagtixdbLSiBjrUBqupylV1k0JuBCFTZQ8LxuP33aLQOP4 FyloTbjbWyPisRqbNQut+9xFLxXHMcNjphIG1FFe56BFs/S9Vmtar+9laZTjwbhn/0vW1b zcJ9De1nDUQWS/y41ZKi2R2NaCHiSwJyi762fLsvpxmIqH+Fo6qmwBvRjQ5PtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRfw6CLLzfmM; Thu, 31 Oct 2024 14:47:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VElaAW025234; Thu, 31 Oct 2024 14:47:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VElafJ025231; Thu, 31 Oct 2024 14:47:36 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:47:36 GMT Message-Id: <202410311447.49VElafJ025231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e63d5726b4ff - main - ipsec.4: cross-reference typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e63d5726b4ff96c87db05391464cbe195438d747 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e63d5726b4ff96c87db05391464cbe195438d747 commit e63d5726b4ff96c87db05391464cbe195438d747 Author: Quentin Thébault AuthorDate: 2024-10-28 06:55:39 +0000 Commit: Ed Maste CommitDate: 2024-10-31 14:47:06 +0000 ipsec.4: cross-reference typo MFC after: 3 days Reviewed by: Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1502 --- share/man/man4/ipsec.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ipsec.4 b/share/man/man4/ipsec.4 index 2f0e13a2ad29..96a10dfb7700 100644 --- a/share/man/man4/ipsec.4 +++ b/share/man/man4/ipsec.4 @@ -182,7 +182,7 @@ is synonymous with which requires that a security association must exist for the packets to move, and not be dropped. These terms are defined in -.Xr ipsec_set_policy 8 . +.Xr ipsec_set_policy 3 . .Bl -column net.inet6.ipsec6.esp_trans_deflev integerxxx .It Sy "Name Type Changeable" .It "net.inet.ipsec.esp_trans_deflev integer yes" From nobody Thu Oct 31 14:58:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfRvB54hDz5br3Q; Thu, 31 Oct 2024 14:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfRvB4MNYz4GBZ; Thu, 31 Oct 2024 14:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730386694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G0ebr8eKJNJEiztzkJb1IZrS/K3qEJWe6cWZLuJ+zZ0=; b=W7DrvWuRLwLXrg4836rgP7bfzoHu5y5h3aJqbQlsOmyZkLWcnS5IbkOJmpPVGsL/lYbQ6f Ahq3+EklIOB2E2FVEp3SsYviGJUrlovHGdU+dMOkaKiOwOSjpgE1OySJTPrDQ06f/dz+Js Bp7J1yvAg6/U0SUOdLF8X1nAunSGXXQ5izepN/w5xPHGo98ewQePo0hDEPOkK0Y26hf1ct VLa+SMd5ge993fSeNuZaV5iVfoFX5/QmpCTvrdr04hwMmJYetgOcXT/hDhFgHXsNCRsSQw ez1j6pqPr75yh3WZQNuIzWFpBGauNUSgs+S749MH6m1GWZxkOFk+xyz4kFiSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730386694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G0ebr8eKJNJEiztzkJb1IZrS/K3qEJWe6cWZLuJ+zZ0=; b=Rq0oV2T9+7wkVZJitYimNgQ2dBhaVzWgLUGbADmzcl0tQ/loRAdVaghVKCbQhbTqvuWdGj XN3xRtUEeDlp5yJoGFaT2rSimg4YaYYBNRlhM5T77Gct8qV/c+cp6aTsmmx2aLiLR6PTEi oOihyJ2POQMdST9WfUwZgd2rQALwkW167a4ASLNa3VGQKMFhcjQJ8a+H2J1fVBjYKdO/zi zeNdqXl5QPkTS2fbOi80sTIWF2b0FM+VWwQ2bzTiqlYUAnFdUQg43jBsS/9EZAW1TOnibd 5cDAz1DrwBOYoloqBAuYs5U1+wzoQ7UM2aFU8cbSvmY2/m6IbfHI2USYM3ZKmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730386694; a=rsa-sha256; cv=none; b=gmeoTLPS5MdWG2tDqZ0D2H5XkwfDerJobiEguQ03fwqT0EC2dwlTq70b27LIOl7D3hq85q kK4g7jx+W6FqFa+veIcAHrP2d5hBx6N34xOIFfQGKFgTjphP6iN8/U0OBFsltEHNZZp5PX +QPaiJHIn6b3QmwOsFMZrx4OB019QskLZIHCaNXsKuIpOf3WraAg5GOBuMqlf1f7aCGXBp LY2VVlAwcLe2FoiuZ8zcXmLSfDvowZToManFLDYEYtt17sGGGqV/igXxQkLx71ETrGaXvI zMwET70ri8T6IkBWZjZp8MDp41pxqblXu0tzPvxuF3HS6W4q6+fMA94gXfXGAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfRvB3qWmzgJg; Thu, 31 Oct 2024 14:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VEwEwm043896; Thu, 31 Oct 2024 14:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VEwEKU043893; Thu, 31 Oct 2024 14:58:14 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:58:14 GMT Message-Id: <202410311458.49VEwEKU043893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 66a56e411ced - main - mfc-candidates: Support GitHub mirror naming conventions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66a56e411cedc4f4891063e0d8f2378231d0d124 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=66a56e411cedc4f4891063e0d8f2378231d0d124 commit 66a56e411cedc4f4891063e0d8f2378231d0d124 Author: Pat Maddox AuthorDate: 2024-10-18 02:03:34 +0000 Commit: Ed Maste CommitDate: 2024-10-31 14:57:31 +0000 mfc-candidates: Support GitHub mirror naming conventions GitHub repository mirrors are named freebsd-src and freebsd-ports. Additionally, GitHub permits remote URLs with or without the .git suffix. Signed-off-by: Pat Maddox Pull Request: https://github.com/freebsd/freebsd-src/pull/1483 --- tools/tools/git/mfc-candidates.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh index c232a1ad3345..7af4d29df67e 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -33,14 +33,14 @@ from_branch=freebsd/main author="${USER}" # Get the FreeBSD repository -repo=$(basename "$(git remote get-url freebsd 2>/dev/null)" 2>/dev/null) +repo=$(basename "$(git remote get-url freebsd 2>/dev/null)" .git 2>/dev/null) -if [ "${repo}" = "ports.git" ]; then +if [ "${repo}" = "ports" -o "${repo}" = "freebsd-ports" ]; then year=$(date '+%Y') month=$(date '+%m') qtr=$(((month-1) / 3 + 1)) to_branch="freebsd/${year}Q${qtr}" -elif [ "${repo}" = "src.git" ]; then +elif [ "${repo}" = "src" -o "${repo}" = "freebsd-src" ]; then to_branch=freebsd/stable/14 # If pwd is a stable or release branch tree, default to it. cur_branch=$(git symbolic-ref --short HEAD 2>/dev/null) From nobody Thu Oct 31 15:50:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfT3T0Wtxz5bvnK for ; Thu, 31 Oct 2024 15:50: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfT3T022Cz4LD8; Thu, 31 Oct 2024 15:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730389829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AtHYFksAnsUUU0fN8OkbqopYq9SZ+amZr0PIIjolIbA=; b=Km/OXdq15XDxhdRLTVXXzRRFn20kTT2wo4XUQdiqJ3PZTnrXkYdOddk5gGg8afQVw/Q59H gWqIO1yXtN5m6S3Fce8x2+Z8xpoWeM3cwGO4QwBBCMMkP6K8ErjHSEPYWMjQwhjgQ/ZBv1 f5m9W2YcyMlpFg1thXuQF3tk8I+RpNglkQa/de6iId//lGWbll1lSTBDd2GNG6lS4qxcDD Oc5y4YrmTVGz93qpAirwb1VOv4S/Qf8pnJnguGh4AnAWNkRHVXE3UD22wlS9J+CvtPiQre ucknthquS57YrVV2Og6Vr8Lv+r2TqgttJdmJ5la+b41JC/soupjW9UtbnFl8uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730389829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AtHYFksAnsUUU0fN8OkbqopYq9SZ+amZr0PIIjolIbA=; b=wToEKfdn0EQOSad5Ukpd6kVY+tIwoOjXrPOPDhiDaN3e2hAQfM7nAMDAiI28KCstRQZfc+ 7WBNqFgD90OxlXubIymzGRBTsPVgjTOlDkrytExN2CL3qx5wGbQagNCOaVP5G5Bo7jGFxr tsGaYSeAxWsBmQl7266ZFO9bN8GqoDdvL/WflVgcSnZXGFxe8n5qp6htZ4aNFO1xvaQQry 4lQwszkdygH9B2rCIv7l2o0mdZjeGia1pSCFDCU2wEszuOb3x55zJAjw8ouINNItqRJHNG Cz870qtVL2l6GTbqu2nNlaFExXMReV0jDWiIE+Qk6GgeUb0Sf/2ZGZ1PRtszDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730389829; a=rsa-sha256; cv=none; b=XM1MZ+qWGBs5x2MiE4M5JeU3Mk5vwlgDkThJbsyXj6UnqEq2D4w2P0QHGhoWZxeiM4pq/Q W5Qa34WV2X0UoNqT2W+h9XaLKlaCY7o4SyeZVH0TkT7gHb8klG3R39w5uMWPrrNyjdjU9v MskVzaiplGczfZa1bwfp8HdRRvgab1ikP/e6O+9GPpePHUrufYCW3FlRKsKIf4feU9RTyo lRQsN3Y6lVBtr2WvULLTgP7Hbr+M7xXxfRJ5NdjVz0sCtcM4gLjrVcDgj4borzGkceOi74 +3YlzXpczcS5SlMQpXzzI8nxXJeW3/f8OnGDyo11mZj287D5XEPQSD0ooSP8Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfT3S6MP7zhRB; Thu, 31 Oct 2024 15:50:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFoSw8045598; Thu, 31 Oct 2024 15:50:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFoS6T045597; Thu, 31 Oct 2024 15:50:28 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:50:28 GMT Message-Id: <202410311550.49VFoS6T045597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 5a07cb04925d..f177240452aa - vendor/libcxxrt - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/vendor/libcxxrt X-Git-Reftype: branch X-Git-Commit: f177240452aa5577d9089fe982c1514136c68a2d X-Git-Oldrev: 5a07cb04925d79523b5cf1cb11edfbc74b828af7 X-Git-Newrev: f177240452aa5577d9089fe982c1514136c68a2d Auto-Submitted: auto-generated The branch vendor/libcxxrt has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=5a07cb04925d..f177240452aa f177240452aa Import libcxxrt master 6f2fdfebcd6291d763de8b17740d636f01761890 From nobody Thu Oct 31 15:53:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfT6f3qS3z5bvtM; Thu, 31 Oct 2024 15:53: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfT6f32PWz4Ltj; Thu, 31 Oct 2024 15:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730389994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wWOBCdiyxivMnU+ZfpW86Q664HTyVyZoImNPKAVhYdw=; b=QAEmOBXnIFxRR3DCWnQbCX2vqYD8w8V+ek7OvI1vLUCQyi0pFibkGBSo0bHG83kcjVjQJU QEoBsgZAC7JVj4Z2kALwjFUkIvzm0QJX8uWFP0zsc1hC86rs2sG+aN4TeebA4cTmRNzBnq hFX/R2Bp04Xlcg4+a3k31JGBSL1qsgeIVPmG49wjDYNypvsL9vk3U6dKrpgGum62BSdgiE FvIY8d2SXN0pg2tGorEjbwjkzthjxwAfe8Til9Mb49eAE833I9lmOSrOGK3f0zvmic8TrA FcJAeZ8TpyVTgDX5GUuxbLFrwAkb4dIC0/8Hc3oPdpM7j/dhOeJgepUOA5z7jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730389994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wWOBCdiyxivMnU+ZfpW86Q664HTyVyZoImNPKAVhYdw=; b=p0E3pZ6hunQgEpi9ToESZlVsPepLpbqPoCC/Y+D5YM0ANT93+vq4L1PflFdI2NhUhklK7x aNFy5gFHKtNRlY+Pomu66qsDM7JNONnXX801ye2EIx73VVsTbNzWP1S0ANvsJSpdl1zADr nOc70NqWfw5JR0afK7y+1TNJ1+1GooA7Iyq3aOssC0TlTg61cSqG191AWHiW5zSB0aziio UfY9gpP6C7y8xLqp85dXJyOXyurJ5mWW4964R7iH/JPfs8Woa63JUCaPmF4E95n1nVDgKj J0DXAbnOtqBbaNIqHHnZ2eBm5tl/i+wLNjb2W5y4rWurLrXBdxU4qgzlMAzg0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730389994; a=rsa-sha256; cv=none; b=iiOeZtJdOnLF6j2eEALpkIZ+XlUXzI7EFMES9tEf2Q/WOJYuJYYnHK9rsGhhxe3VIcCkoh dmQjRtPa19Ipco720MI9nsGKnrXcmNPma7nAKuK0oQBK3yB+oErkRJ8xead4e+7qMa3H7o jFE3pkhsPnAJfGG+xFQsyzCt20FZkNriaAdtuF7dnITVAZZTjUw8xr5gIGt5jbrS+YQqNi pE6RlOxkeyRGH4zxPQs4f5o9tj3/RPqb64HeUUrw5Lm3lXGDnDblrYAtiibkZwxq8NzRDq SvAjsR8DMkgLpQN8HZSaUkt7Tus2gXmr1KyfURZNRBDyJvdWwM1JFu4QnbbLVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfT6f2db1zjZY; Thu, 31 Oct 2024 15:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFrEnP054064; Thu, 31 Oct 2024 15:53:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFrAwW054051; Thu, 31 Oct 2024 15:53:10 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:53:10 GMT Message-Id: <202410311553.49VFrAwW054051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2dccd21949f2 - main - libcxxrt: Update to upstream 6f2fdfebcd62 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2dccd21949f26b1bdf5e7cf258b760fffd3bf259 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2dccd21949f26b1bdf5e7cf258b760fffd3bf259 commit 2dccd21949f26b1bdf5e7cf258b760fffd3bf259 Merge: 66a56e411ced f177240452aa Author: Ed Maste AuthorDate: 2024-10-31 15:51:29 +0000 Commit: Ed Maste CommitDate: 2024-10-31 15:51:29 +0000 libcxxrt: Update to upstream 6f2fdfebcd62 Interesting fixes: 3cbfe5a556fe Avoid noreturn warning on terminate() contrib/libcxxrt/exception.cc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) From nobody Thu Oct 31 15:59:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGL4NHlz5bwV2; Thu, 31 Oct 2024 15:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGL3rSgz4Nr9; Thu, 31 Oct 2024 15:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h1Ge3E3VW5XsBBv/RTeotb4PH2XUreg3kBPwUwNbF9s=; b=eDEJFOha97OdAeXOkYMrKuSU1JsH38JweiAzPSR1/LA4H4rQT1liRaLM1R20i+C+HhpHr7 c+AMOpJkGY4lyQhMJj8Kfa5ao5/rhTU8DV/RLr2HWcMNczfiXPrHMudTL2ncjkYGEjPUqe aB4iHIl0170ECQGGjFIHvA8AOw7x5aF7tMb3Z+JBhIoQVcH8RsrOi4Aw9ZekcqZ1OKD7MD HUK/StQvLm8vq5wBRpNc+N+di1Ay1SqkajbakYstvb9NnMqsOhxGyk+2DCJzuMNV8CNRb/ Lt2l11NAyks3B8qiLLmqHaxbXzVfuBqg3VqNE7n7jJeAfdwfZdPYW5FartD1yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h1Ge3E3VW5XsBBv/RTeotb4PH2XUreg3kBPwUwNbF9s=; b=PD7/YLWvhGAaYawD/WNN9V7OZ0y7JKWgCBw3iRK5Hznt/UeLJr+lQD1h5OUeubwhwPomY7 yIWKu75gwQw9EC5dBn8/zU0zosO0qSzwjXtY6/2NsDXi1qixyFisjesO5gY7T9fM63sOoA xvx//HFW6Qbh7bEKwjDSEdbScSGygPyLhURqpGn9rx0Es0hVoJ609xFbLJftQ7XIfJZ0jr nhKZ7x448fMBVjqwqa2AkDgTF7L4Gr7s4KGZOQPAMLF33oHDnaN5dlR3Pqk6GrqgUbYFZL dq6W7zjgEFbZ9/ougS3//8oPc72fOUnX9dq6r2cL2HLcIhJ65pLZZjt6pioH/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390394; a=rsa-sha256; cv=none; b=g3E7/3wOGD0dSqeWxHaw+8yfFZuMsHmw9qEFD+J46MoUA92ESJPlSP/1+whEnmV6BGafjL AdOToRVkgtF+rSBsXwGxpHB5WcPpC/cq+0/aOOJAZRnH0qAD+UiibfbFwTP2WuWbjkEkNx fVdFDH0YLACawBC4YXUjPR7SwMiTEn599OBrqhcP9rfKXGlsR3qGVM269yLfFnwZtmZHOy TrITFGG5n7EjWjFQHXV5nXup87VaTxwaKQ52FcnXKT6DywrohbAqQc9OL85qgzpmYnmNrt V9qSbA7sOs3gde3EU/Ag6uZGJ+P+DN2PH2cPkklyfVFS30AVMAnWs7tVCLn7Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGL3RFNzj9g; Thu, 31 Oct 2024 15:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxso8056404; Thu, 31 Oct 2024 15:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxs60056397; Thu, 31 Oct 2024 15:59:54 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:54 GMT Message-Id: <202410311559.49VFxs60056397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 4691f19ae80e - stable/13 - ena: Upgrade ena-com to freebsd v2.8.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4691f19ae80e13171ded7c58c8b94d53ba7421aa Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=4691f19ae80e13171ded7c58c8b94d53ba7421aa commit 4691f19ae80e13171ded7c58c8b94d53ba7421aa Author: Osama Abboud AuthorDate: 2024-10-15 17:02:26 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Upgrade ena-com to freebsd v2.8.0 Merge commit '0fd934a2fd12fa74ae409d3de1313e449be5d97e' Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f5f8d7c9cdf0341f7c5fdb3a7c3358ec0ed67a0c) --- sys/contrib/ena-com/ena_com.c | 257 ++++++++++++++++++------- sys/contrib/ena-com/ena_com.h | 61 +++++- sys/contrib/ena-com/ena_defs/ena_admin_defs.h | 112 ++++++++--- sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h | 43 ++++- sys/contrib/ena-com/ena_defs/ena_gen_info.h | 34 ---- sys/contrib/ena-com/ena_defs/ena_regs_defs.h | 5 + sys/contrib/ena-com/ena_eth_com.c | 38 ++-- sys/contrib/ena-com/ena_eth_com.h | 19 +- sys/contrib/ena-com/ena_plat.h | 7 +- 9 files changed, 425 insertions(+), 151 deletions(-) diff --git a/sys/contrib/ena-com/ena_com.c b/sys/contrib/ena-com/ena_com.c index 91c711eaa438..ae952c4e4435 100644 --- a/sys/contrib/ena-com/ena_com.c +++ b/sys/contrib/ena-com/ena_com.c @@ -70,15 +70,19 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_MAX_BACKOFF_DELAY_EXP 16U + #define ENA_MIN_ADMIN_POLL_US 100 #define ENA_MAX_ADMIN_POLL_US 5000 /* PHC definitions */ -#define ENA_PHC_DEFAULT_EXPIRE_TIMEOUT_USEC 20 +#define ENA_PHC_DEFAULT_EXPIRE_TIMEOUT_USEC 10 #define ENA_PHC_DEFAULT_BLOCK_TIMEOUT_USEC 1000 -#define ENA_PHC_TIMESTAMP_ERROR 0xFFFFFFFFFFFFFFFF +#define ENA_PHC_MAX_ERROR_BOUND 0xFFFFFFFF #define ENA_PHC_REQ_ID_OFFSET 0xDEAD +#define ENA_PHC_ERROR_FLAGS (ENA_ADMIN_PHC_ERROR_FLAG_TIMESTAMP | \ + ENA_ADMIN_PHC_ERROR_FLAG_ERROR_BOUND) /*****************************************************************************/ /*****************************************************************************/ @@ -111,7 +115,7 @@ static int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, struct ena_common_mem_addr *ena_addr, dma_addr_t addr) { - if ((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr) { + if (unlikely((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr)) { ena_trc_err(ena_dev, "DMA address has more bits that the device supports\n"); return ENA_COM_INVAL; } @@ -131,7 +135,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_queue *admin_queue) ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, sq->entries, sq->dma_addr, sq->mem_handle); - if (!sq->entries) { + if (unlikely(!sq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -154,7 +158,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_queue *admin_queue) ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, cq->entries, cq->dma_addr, cq->mem_handle); - if (!cq->entries) { + if (unlikely(!cq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -179,7 +183,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, aenq->dma_addr, aenq->mem_handle); - if (!aenq->entries) { + if (unlikely(!aenq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -213,6 +217,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, static void comp_ctxt_release(struct ena_com_admin_queue *queue, struct ena_comp_ctx *comp_ctx) { + comp_ctx->user_cqe = NULL; comp_ctx->occupied = false; ATOMIC32_DEC(&queue->outstanding_cmds); } @@ -264,7 +269,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu /* In case of queue FULL */ cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); - if (cnt >= admin_queue->q_depth) { + if (unlikely(cnt >= admin_queue->q_depth)) { ena_trc_dbg(admin_queue->ena_dev, "Admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(ENA_COM_NO_SPACE); @@ -388,7 +393,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, io_sq->desc_addr.mem_handle); } - if (!io_sq->desc_addr.virt_addr) { + if (unlikely(!io_sq->desc_addr.virt_addr)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -413,7 +418,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, if (!io_sq->bounce_buf_ctrl.base_buffer) io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); - if (!io_sq->bounce_buf_ctrl.base_buffer) { + if (unlikely(!io_sq->bounce_buf_ctrl.base_buffer)) { ena_trc_err(ena_dev, "Bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -478,7 +483,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, ENA_CDESC_RING_SIZE_ALIGNMENT); } - if (!io_cq->cdesc_addr.virt_addr) { + if (unlikely(!io_cq->cdesc_addr.virt_addr)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -506,6 +511,9 @@ static void ena_com_handle_single_admin_completion(struct ena_com_admin_queue *a return; } + if (!comp_ctx->occupied) + return; + comp_ctx->status = ENA_CMD_COMPLETED; comp_ctx->comp_status = cqe->acq_common_descriptor.status; @@ -581,8 +589,9 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) { + exp = ENA_MIN32(ENA_MAX_BACKOFF_DELAY_EXP, exp); delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us); - delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US); + delay_us = ENA_MIN32(ENA_MAX_ADMIN_POLL_US, delay_us * (1U << exp)); ENA_USLEEP(delay_us); } @@ -604,7 +613,7 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c if (comp_ctx->status != ENA_CMD_SUBMITTED) break; - if (ENA_TIME_EXPIRE(timeout)) { + if (unlikely(ENA_TIME_EXPIRE(timeout))) { ena_trc_err(admin_queue->ena_dev, "Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ @@ -803,7 +812,7 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); - if (rc) + if (unlikely(rc)) ena_trc_err(ena_dev, "Cannot set LLQ configuration: %d\n", rc); return rc; @@ -830,6 +839,7 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); if (comp_ctx->status == ENA_CMD_COMPLETED) { + admin_queue->is_missing_admin_interrupt = true; ena_trc_err(admin_queue->ena_dev, "The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); @@ -850,8 +860,19 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com ret = ENA_COM_TIMER_EXPIRED; goto err; } + } else if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { + ena_trc_err(admin_queue->ena_dev, "Command was aborted\n"); + ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); + admin_queue->stats.aborted_cmd++; + ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); + ret = ENA_COM_NO_DEVICE; + goto err; } + ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED, + admin_queue->ena_dev, "Invalid comp status %d\n", + comp_ctx->status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); @@ -909,7 +930,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset) goto err; } - if (read_resp->reg_off != offset) { + if (unlikely(read_resp->reg_off != offset)) { ena_trc_err(ena_dev, "Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { @@ -1033,7 +1054,7 @@ static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, exp_state) return 0; - if (ENA_TIME_EXPIRE(timeout_stamp)) + if (unlikely(ENA_TIME_EXPIRE(timeout_stamp))) return ENA_COM_TIMER_EXPIRED; ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); @@ -1494,7 +1515,7 @@ int ena_com_get_io_handlers(struct ena_com_dev *ena_dev, u16 qid, struct ena_com_io_sq **io_sq, struct ena_com_io_cq **io_cq) { - if (qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Invalid queue number %d but the max is %d\n", qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; @@ -1602,7 +1623,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) int ret; ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); - if (ret) { + if (unlikely(ret)) { ena_trc_info(ena_dev, "Can't get aenq configuration\n"); return ret; } @@ -1649,7 +1670,7 @@ int ena_com_get_dma_width(struct ena_com_dev *ena_dev) ena_trc_dbg(ena_dev, "ENA dma width: %d\n", width); - if ((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS) { + if (unlikely((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS)) { ena_trc_err(ena_dev, "DMA width illegal value: %d\n", width); return ENA_COM_INVAL; } @@ -1811,16 +1832,21 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) struct ena_admin_set_feat_cmd set_feat_cmd; int ret = 0; - /* Get device PHC default configuration */ - ret = ena_com_get_feature(ena_dev, &get_feat_resp, ENA_ADMIN_PHC_CONFIG, 0); + /* Get default device PHC configuration */ + ret = ena_com_get_feature(ena_dev, + &get_feat_resp, + ENA_ADMIN_PHC_CONFIG, + ENA_ADMIN_PHC_FEATURE_VERSION_0); if (unlikely(ret)) { ena_trc_err(ena_dev, "Failed to get PHC feature configuration, error: %d\n", ret); return ret; } - /* Suporting only readless PHC retrieval */ - if (get_feat_resp.u.phc.type != ENA_ADMIN_PHC_TYPE_READLESS) { - ena_trc_err(ena_dev, "Unsupprted PHC type, error: %d\n", ENA_COM_UNSUPPORTED); + /* Supporting only PHC V0 (readless mode with error bound) */ + if (get_feat_resp.u.phc.version != ENA_ADMIN_PHC_FEATURE_VERSION_0) { + ena_trc_err(ena_dev, "Unsupprted PHC version (0x%X), error: %d\n", + get_feat_resp.u.phc.version, + ENA_COM_UNSUPPORTED); return ENA_COM_UNSUPPORTED; } @@ -1837,11 +1863,11 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) get_feat_resp.u.phc.block_timeout_usec : ENA_PHC_DEFAULT_BLOCK_TIMEOUT_USEC; - /* Sanity check - expire timeout must not be above skip timeout */ + /* Sanity check - expire timeout must not exceed block timeout */ if (phc->expire_timeout_usec > phc->block_timeout_usec) phc->expire_timeout_usec = phc->block_timeout_usec; - /* Prepare PHC feature command with PHC output address */ + /* Prepare PHC config feature command */ memset(&set_feat_cmd, 0x0, sizeof(set_feat_cmd)); set_feat_cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; set_feat_cmd.feat_common.feature_id = ENA_ADMIN_PHC_CONFIG; @@ -1873,13 +1899,16 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) void ena_com_phc_destroy(struct ena_com_dev *ena_dev) { struct ena_com_phc_info *phc = &ena_dev->phc; - - phc->active = false; + unsigned long flags = 0; /* In case PHC is not supported by the device, silently exiting */ if (!phc->virt_addr) return; + ENA_SPINLOCK_LOCK(phc->lock, flags); + phc->active = false; + ENA_SPINLOCK_UNLOCK(phc->lock, flags); + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, sizeof(*phc->virt_addr), phc->virt_addr, @@ -1890,15 +1919,14 @@ void ena_com_phc_destroy(struct ena_com_dev *ena_dev) ENA_SPINLOCK_DESTROY(phc->lock); } -int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) +int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp) { volatile struct ena_admin_phc_resp *read_resp = ena_dev->phc.virt_addr; + const ena_time_high_res_t zero_system_time = ENA_TIME_INIT_HIGH_RES(); struct ena_com_phc_info *phc = &ena_dev->phc; - ena_time_high_res_t initial_time = ENA_TIME_INIT_HIGH_RES(); - static ena_time_high_res_t start_time; - unsigned long flags = 0; ena_time_high_res_t expire_time; ena_time_high_res_t block_time; + unsigned long flags = 0; int ret = ENA_COM_OK; if (!phc->active) { @@ -1909,9 +1937,10 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) ENA_SPINLOCK_LOCK(phc->lock, flags); /* Check if PHC is in blocked state */ - if (unlikely(ENA_TIME_COMPARE_HIGH_RES(start_time, initial_time))) { + if (unlikely(ENA_TIME_COMPARE_HIGH_RES(phc->system_time, zero_system_time))) { /* Check if blocking time expired */ - block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->block_timeout_usec); + block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, + phc->block_timeout_usec); if (!ENA_TIME_EXPIRE_HIGH_RES(block_time)) { /* PHC is still in blocked state, skip PHC request */ phc->stats.phc_skp++; @@ -1919,9 +1948,9 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) goto skip; } - /* PHC is in active state, update statistics according to req_id and timestamp */ + /* PHC is in active state, update statistics according to req_id and error_flags */ if ((READ_ONCE16(read_resp->req_id) != phc->req_id) || - (read_resp->timestamp == ENA_PHC_TIMESTAMP_ERROR)) { + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) { /* Device didn't update req_id during blocking time or timestamp is invalid, * this indicates on a device error */ @@ -1933,9 +1962,9 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) } /* Setting relative timeouts */ - start_time = ENA_GET_SYSTEM_TIME_HIGH_RES(); - block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->block_timeout_usec); - expire_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->expire_timeout_usec); + phc->system_time = ENA_GET_SYSTEM_TIME_HIGH_RES(); + block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, phc->block_timeout_usec); + expire_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, phc->expire_timeout_usec); /* We expect the device to return this req_id once the new PHC timestamp is updated */ phc->req_id++; @@ -1952,35 +1981,45 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) while (1) { if (unlikely(ENA_TIME_EXPIRE_HIGH_RES(expire_time))) { /* Gave up waiting for updated req_id, PHC enters into blocked state until - * passing blocking time + * passing blocking time, during this time any get PHC timestamp or + * error bound requests will fail with device busy error */ + phc->error_bound = ENA_PHC_MAX_ERROR_BOUND; ret = ENA_COM_DEVICE_BUSY; break; } /* Check if req_id was updated by the device */ if (READ_ONCE16(read_resp->req_id) != phc->req_id) { - /* req_id was not updated by the device, check again on next loop */ + /* req_id was not updated by the device yet, check again on next loop */ continue; } - /* req_id was updated which indicates that PHC timestamp was updated too */ - *timestamp = read_resp->timestamp; - - /* PHC timestamp validty check */ - if (unlikely(*timestamp == ENA_PHC_TIMESTAMP_ERROR)) { - /* Retrieved invalid PHC timestamp, PHC enters into blocked state until - * passing blocking time + /* req_id was updated by the device which indicates that PHC timestamp, error_bound + * and error_flags are updated too, checking errors before retrieving timestamp and + * error_bound values + */ + if (unlikely(read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) { + /* Retrieved timestamp or error bound errors, PHC enters into blocked state + * until passing blocking time, during this time any get PHC timestamp or + * error bound requests will fail with device busy error */ + phc->error_bound = ENA_PHC_MAX_ERROR_BOUND; ret = ENA_COM_DEVICE_BUSY; break; } - /* Retrieved valid PHC timestamp */ + /* PHC timestamp value is returned to the caller */ + *timestamp = read_resp->timestamp; + + /* Error bound value is cached for future retrieval by caller */ + phc->error_bound = read_resp->error_bound; + + /* Update statistic on valid PHC timestamp retrieval */ phc->stats.phc_cnt++; /* This indicates PHC state is active */ - start_time = initial_time; + phc->system_time = zero_system_time; break; } @@ -1990,6 +2029,24 @@ skip: return ret; } +int ena_com_phc_get_error_bound(struct ena_com_dev *ena_dev, u32 *error_bound) +{ + struct ena_com_phc_info *phc = &ena_dev->phc; + u32 local_error_bound = phc->error_bound; + + if (!phc->active) { + ena_trc_err(ena_dev, "PHC feature is not active in the device\n"); + return ENA_COM_UNSUPPORTED; + } + + if (local_error_bound == ENA_PHC_MAX_ERROR_BOUND) + return ENA_COM_DEVICE_BUSY; + + *error_bound = local_error_bound; + + return ENA_COM_OK; +} + int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev) { struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read; @@ -2083,15 +2140,15 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ENA_SPINLOCK_INIT(admin_queue->q_lock); ret = ena_com_init_comp_ctxt(admin_queue); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_admin_init_sq(admin_queue); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_admin_init_cq(admin_queue); - if (ret) + if (unlikely(ret)) goto error; admin_queue->sq.db_addr = (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + @@ -2124,11 +2181,12 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ENA_REG_WRITE32(ena_dev->bus, aq_caps, ena_dev->reg_bar + ENA_REGS_AQ_CAPS_OFF); ENA_REG_WRITE32(ena_dev->bus, acq_caps, ena_dev->reg_bar + ENA_REGS_ACQ_CAPS_OFF); ret = ena_com_admin_init_aenq(ena_dev, aenq_handlers); - if (ret) + if (unlikely(ret)) goto error; admin_queue->ena_dev = ena_dev; admin_queue->running_state = true; + admin_queue->is_missing_admin_interrupt = false; return 0; error: @@ -2144,7 +2202,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, struct ena_com_io_cq *io_cq; int ret; - if (ctx->qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(ctx->qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", ctx->qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; @@ -2175,18 +2233,18 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, ENA_MIN32(ena_dev->tx_max_header_size, SZ_256); ret = ena_com_init_io_sq(ena_dev, ctx, io_sq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_init_io_cq(ena_dev, ctx, io_cq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_create_io_cq(ena_dev, io_cq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx); - if (ret) + if (unlikely(ret)) goto destroy_io_cq; return 0; @@ -2203,7 +2261,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_dev, u16 qid) struct ena_com_io_sq *io_sq; struct ena_com_io_cq *io_cq; - if (qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", qid, ENA_TOTAL_NUM_QUEUES); return; @@ -2345,7 +2403,8 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, else return rc; - rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_LLQ, 0); + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_LLQ, ENA_ADMIN_LLQ_FEATURE_VERSION_1); if (!rc) memcpy(&get_feat_ctx->llq, &get_resp.u.llq, sizeof(get_resp.u.llq)); @@ -2400,8 +2459,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) /* Go over all the events */ while ((READ_ONCE8(aenq_common->flags) & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { - /* Make sure the phase bit (ownership) is as expected before - * reading the rest of the descriptor. + /* Make sure the device finished writing the rest of the descriptor + * before reading it. */ dma_rmb(); @@ -2443,6 +2502,45 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) ena_dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); mmiowb(); } + +bool ena_com_aenq_has_keep_alive(struct ena_com_dev *ena_dev) +{ + struct ena_admin_aenq_common_desc *aenq_common; + struct ena_com_aenq *aenq = &ena_dev->aenq; + struct ena_admin_aenq_entry *aenq_e; + u8 phase = aenq->phase; + u16 masked_head; + + masked_head = aenq->head & (aenq->q_depth - 1); + aenq_e = &aenq->entries[masked_head]; /* Get first entry */ + aenq_common = &aenq_e->aenq_common_desc; + + /* Go over all the events */ + while ((READ_ONCE8(aenq_common->flags) & + ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { + /* Make sure the device finished writing the rest of the descriptor + * before reading it. + */ + dma_rmb(); + + if (aenq_common->group == ENA_ADMIN_KEEP_ALIVE) + return true; + + /* Get next event entry */ + masked_head++; + + if (unlikely(masked_head == aenq->q_depth)) { + masked_head = 0; + phase = !phase; + } + + aenq_e = &aenq->entries[masked_head]; + aenq_common = &aenq_e->aenq_common_desc; + } + + return false; +} + #ifdef ENA_EXTENDED_STATS /* * Sets the function Idx and Queue Idx to be used for @@ -2468,6 +2566,7 @@ int ena_com_extended_stats_set_func_queue(struct ena_com_dev *ena_dev, int ena_com_dev_reset(struct ena_com_dev *ena_dev, enum ena_regs_reset_reason_types reset_reason) { + u32 reset_reason_msb, reset_reason_lsb; u32 stat, timeout, cap, reset_val; int rc; @@ -2494,8 +2593,28 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, /* start reset */ reset_val = ENA_REGS_DEV_CTL_DEV_RESET_MASK; - reset_val |= (reset_reason << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT) & - ENA_REGS_DEV_CTL_RESET_REASON_MASK; + + /* For backward compatibility, device will interpret + * bits 24-27 as MSB, bits 28-31 as LSB + */ + reset_reason_lsb = ENA_FIELD_GET(reset_reason, ENA_RESET_REASON_LSB_MASK, + ENA_RESET_REASON_LSB_OFFSET); + + reset_reason_msb = ENA_FIELD_GET(reset_reason, ENA_RESET_REASON_MSB_MASK, + ENA_RESET_REASON_MSB_OFFSET); + + reset_val |= reset_reason_lsb << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT; + + if (ena_com_get_cap(ena_dev, ENA_ADMIN_EXTENDED_RESET_REASONS)) + reset_val |= reset_reason_msb << ENA_REGS_DEV_CTL_RESET_REASON_EXT_SHIFT; + else if (reset_reason_msb) { + /* In case the device does not support intended + * extended reset reason fallback to generic + */ + reset_val = ENA_REGS_DEV_CTL_DEV_RESET_MASK; + reset_val |= (ENA_REGS_RESET_GENERIC << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT) & + ENA_REGS_DEV_CTL_RESET_REASON_MASK; + } ENA_REG_WRITE32(ena_dev->bus, reset_val, ena_dev->reg_bar + ENA_REGS_DEV_CTL_OFF); /* Write again the MMIO read request address */ @@ -2503,7 +2622,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, rc = wait_for_reset_state(ena_dev, timeout, ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK); - if (rc != 0) { + if (unlikely(rc)) { ena_trc_err(ena_dev, "Reset indication didn't turn on\n"); return rc; } @@ -2511,7 +2630,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, /* reset done */ ENA_REG_WRITE32(ena_dev->bus, 0, ena_dev->reg_bar + ENA_REGS_DEV_CTL_OFF); rc = wait_for_reset_state(ena_dev, timeout, 0); - if (rc != 0) { + if (unlikely(rc)) { ena_trc_err(ena_dev, "Reset indication didn't turn off\n"); return rc; } @@ -2614,7 +2733,7 @@ int ena_com_get_dev_extended_stats(struct ena_com_dev *ena_dev, char *buff, ret = ena_get_dev_stats(ena_dev, &ctx, ENA_ADMIN_GET_STATS_TYPE_EXTENDED); - if (ret < 0) + if (unlikely(ret < 0)) goto free_ext_stats_mem; ret = snprintf(buff, len, "%s", (char *)virt_addr); @@ -3222,7 +3341,7 @@ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev) customer_metrics->buffer_virt_addr, customer_metrics->buffer_dma_addr, customer_metrics->buffer_dma_handle); - if (!customer_metrics->buffer_virt_addr) + if (unlikely(!customer_metrics->buffer_virt_addr)) return ENA_COM_NO_MEM; return 0; @@ -3416,7 +3535,7 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, } rc = ena_com_config_llq_info(ena_dev, llq_features, llq_default_cfg); - if (rc) + if (unlikely(rc)) return rc; ena_dev->tx_max_header_size = llq_info->desc_list_entry_size - diff --git a/sys/contrib/ena-com/ena_com.h b/sys/contrib/ena-com/ena_com.h index 5b091c64572c..87d0662351b0 100644 --- a/sys/contrib/ena-com/ena_com.h +++ b/sys/contrib/ena-com/ena_com.h @@ -51,6 +51,14 @@ #define ADMIN_CQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_acq_entry)) #define ADMIN_AENQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aenq_entry)) +/* Macros used to extract LSB/MSB from the + * enums defining the reset reasons + */ +#define ENA_RESET_REASON_LSB_OFFSET 0 +#define ENA_RESET_REASON_LSB_MASK 0xf +#define ENA_RESET_REASON_MSB_OFFSET 4 +#define ENA_RESET_REASON_MSB_MASK 0xf0 + #define ENA_CUSTOMER_METRICS_BUFFER_SIZE 512 /*****************************************************************************/ @@ -257,6 +265,8 @@ struct ena_com_admin_queue { */ bool running_state; + bool is_missing_admin_interrupt; + /* Count the number of outstanding admin commands */ ena_atomic32_t outstanding_cmds; @@ -294,6 +304,9 @@ struct ena_com_phc_info { /* PHC shared memory - virtual address */ struct ena_admin_phc_resp *virt_addr; + /* System time of last PHC request */ + ena_time_high_res_t system_time; + /* Spin lock to ensure a single outstanding PHC read */ ena_spinlock_t lock; @@ -313,17 +326,20 @@ struct ena_com_phc_info { */ u32 block_timeout_usec; + /* PHC shared memory - physical address */ + dma_addr_t phys_addr; + + /* PHC shared memory handle */ + ena_mem_handle_t mem_handle; + + /* Cached error bound per timestamp sample */ + u32 error_bound; + /* Request id sent to the device */ u16 req_id; /* True if PHC is active in the device */ bool active; - - /* PHC shared memory - memory handle */ - ena_mem_handle_t mem_handle; - - /* PHC shared memory - physical address */ - dma_addr_t phys_addr; }; struct ena_rss { @@ -488,12 +504,19 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev); */ void ena_com_phc_destroy(struct ena_com_dev *ena_dev); -/* ena_com_phc_get - Retrieve PHC timestamp +/* ena_com_phc_get_timestamp - Retrieve PHC timestamp * @ena_dev: ENA communication layer struct - * @timestamp: Retrieve PHC timestamp + * @timestamp: Retrieved PHC timestamp * @return - 0 on success, negative value on failure */ -int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp); +int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp); + +/* ena_com_phc_get_error_bound - Retrieve cached PHC error bound + * @ena_dev: ENA communication layer struct + * @error_bound: Cached PHC error bound + * @return - 0 on success, negative value on failure + */ +int ena_com_phc_get_error_bound(struct ena_com_dev *ena_dev, u32 *error_bound); /* ena_com_set_mmio_read_mode - Enable/disable the indirect mmio reg read mechanism * @ena_dev: ENA communication layer struct @@ -644,6 +667,16 @@ void ena_com_admin_q_comp_intr_handler(struct ena_com_dev *ena_dev); */ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data); +/* ena_com_aenq_has_keep_alive - Retrieve if there is a keep alive notification in the aenq + * @ena_dev: ENA communication layer struct + * + * This method goes over the async event notification queue and returns if there + * is a keep alive notification. + * + * @return - true if there is a keep alive notification in the aenq or false otherwise + */ +bool ena_com_aenq_has_keep_alive(struct ena_com_dev *ena_dev); + /* ena_com_abort_admin_commands - Abort all the outstanding admin commands. * @ena_dev: ENA communication layer struct * @@ -1096,6 +1129,16 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, struct ena_admin_feature_llq_desc *llq_features, struct ena_llq_configurations *llq_default_config); +/* ena_com_get_missing_admin_interrupt - Return if there is a missing admin interrupt + * @ena_dev: ENA communication layer struct + * + * @return - true if there is a missing admin interrupt or false otherwise + */ +static inline bool ena_com_get_missing_admin_interrupt(struct ena_com_dev *ena_dev) +{ + return ena_dev->admin_queue.is_missing_admin_interrupt; +} + /* ena_com_io_sq_to_ena_dev - Extract ena_com_dev using contained field io_sq. * @io_sq: IO submit queue struct * diff --git a/sys/contrib/ena-com/ena_defs/ena_admin_defs.h b/sys/contrib/ena-com/ena_defs/ena_admin_defs.h index abd1ae5d57fb..5437f629712f 100644 --- a/sys/contrib/ena-com/ena_defs/ena_admin_defs.h +++ b/sys/contrib/ena-com/ena_defs/ena_admin_defs.h @@ -98,12 +98,22 @@ enum ena_admin_aq_feature_id { ENA_ADMIN_FEATURES_OPCODE_NUM = 32, }; +/* feature version for the set/get ENA_ADMIN_LLQ feature admin commands */ +enum ena_admin_llq_feature_version { + /* legacy base version in older drivers */ + ENA_ADMIN_LLQ_FEATURE_VERSION_0_LEGACY = 0, + /* support entry_size recommendation by device */ + ENA_ADMIN_LLQ_FEATURE_VERSION_1 = 1, +}; + /* device capabilities */ enum ena_admin_aq_caps_id { ENA_ADMIN_ENI_STATS = 0, /* ENA SRD customer metrics */ ENA_ADMIN_ENA_SRD_INFO = 1, ENA_ADMIN_CUSTOMER_METRICS = 2, + ENA_ADMIN_EXTENDED_RESET_REASONS = 3, + ENA_ADMIN_CDESC_MBZ = 4, }; enum ena_admin_placement_policy_type { @@ -163,8 +173,14 @@ enum ena_admin_get_stats_scope { ENA_ADMIN_ETH_TRAFFIC = 1, }; -enum ena_admin_get_phc_type { - ENA_ADMIN_PHC_TYPE_READLESS = 0, +enum ena_admin_phc_feature_version { + /* Readless with error_bound */ + ENA_ADMIN_PHC_FEATURE_VERSION_0 = 0, +}; + +enum ena_admin_phc_error_flags { + ENA_ADMIN_PHC_ERROR_FLAG_TIMESTAMP = BIT(0), + ENA_ADMIN_PHC_ERROR_FLAG_ERROR_BOUND = BIT(1), }; /* ENA SRD configuration for ENI */ @@ -464,6 +480,10 @@ struct ena_admin_basic_stats { uint32_t tx_drops_low; uint32_t tx_drops_high; + + uint32_t rx_overruns_low; + + uint32_t rx_overruns_high; }; /* ENI Statistics Command. */ @@ -696,8 +716,17 @@ struct ena_admin_feature_llq_desc { /* the stride control the driver selected to use */ uint16_t descriptors_stride_ctrl_enabled; - /* reserved */ - uint32_t reserved1; + /* feature version of device resp to either GET/SET commands. */ + uint8_t feature_version; + + /* llq entry size recommended by the device, + * values correlated to enum ena_admin_llq_ring_entry_size. + * used only for GET command. + */ + uint8_t entry_size_recommended; + + /* max depth of wide llq, or 0 for N/A */ + uint16_t max_wide_llq_depth; /* accelerated low latency queues requirement. driver needs to * support those requirements in order to use accelerated llq @@ -933,19 +962,8 @@ struct ena_admin_feature_rss_flow_hash_input { uint16_t enabled_input_sort; }; -enum ena_admin_os_type { - ENA_ADMIN_OS_LINUX = 1, - ENA_ADMIN_OS_WIN = 2, - ENA_ADMIN_OS_DPDK = 3, - ENA_ADMIN_OS_FREEBSD = 4, - ENA_ADMIN_OS_IPXE = 5, - ENA_ADMIN_OS_ESXI = 6, - ENA_ADMIN_OS_MACOS = 7, - ENA_ADMIN_OS_GROUPS_NUM = 7, -}; - struct ena_admin_host_info { - /* defined in enum ena_admin_os_type */ + /* Host OS type defined as ENA_ADMIN_OS_* */ uint32_t os_type; /* os distribution string format */ @@ -992,7 +1010,9 @@ struct ena_admin_host_info { * 4 : rss_configurable_function_key * 5 : reserved * 6 : rx_page_reuse - * 31:7 : reserved + * 7 : tx_ipv6_csum_offload + * 8 : phc + * 31:9 : reserved */ uint32_t driver_supported_features; }; @@ -1078,10 +1098,10 @@ struct ena_admin_queue_ext_feature_desc { }; struct ena_admin_feature_phc_desc { - /* PHC type as defined in enum ena_admin_get_phc_type, - * used only for GET command. + /* PHC version as defined in enum ena_admin_phc_feature_version, + * used only for GET command as max supported PHC version by the device. */ - uint8_t type; + uint8_t version; /* Reserved - MBZ */ uint8_t reserved1[3]; @@ -1221,7 +1241,9 @@ enum ena_admin_aenq_group { ENA_ADMIN_NOTIFICATION = 3, ENA_ADMIN_KEEP_ALIVE = 4, ENA_ADMIN_REFRESH_CAPABILITIES = 5, - ENA_ADMIN_AENQ_GROUPS_NUM = 6, + ENA_ADMIN_CONF_NOTIFICATIONS = 6, + ENA_ADMIN_DEVICE_REQUEST_RESET = 7, + ENA_ADMIN_AENQ_GROUPS_NUM = 8, }; enum ena_admin_aenq_notification_syndrome { @@ -1252,6 +1274,18 @@ struct ena_admin_aenq_keep_alive_desc { uint32_t tx_drops_low; uint32_t tx_drops_high; + + uint32_t rx_overruns_low; + + uint32_t rx_overruns_high; +}; + +struct ena_admin_aenq_conf_notifications_desc { + struct ena_admin_aenq_common_desc aenq_common_desc; + + uint64_t notifications_bitmap; + + uint64_t reserved; }; struct ena_admin_ena_mmio_req_read_less_resp { @@ -1264,13 +1298,23 @@ struct ena_admin_ena_mmio_req_read_less_resp { }; struct ena_admin_phc_resp { + /* Request Id, received from DB register */ uint16_t req_id; uint8_t reserved1[6]; + /* PHC timestamp (nsec) */ uint64_t timestamp; - uint8_t reserved2[48]; + uint8_t reserved2[8]; + + /* Timestamp error limit (nsec) */ + uint32_t error_bound; + + /* Bit field of enum ena_admin_phc_error_flags */ + uint32_t error_flags; + + uint8_t reserved3[32]; }; /* aq_common_desc */ @@ -1371,6 +1415,10 @@ struct ena_admin_phc_resp { #define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_MASK BIT(4) #define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_SHIFT 6 #define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_MASK BIT(6) +#define ENA_ADMIN_HOST_INFO_TX_IPV6_CSUM_OFFLOAD_SHIFT 7 +#define ENA_ADMIN_HOST_INFO_TX_IPV6_CSUM_OFFLOAD_MASK BIT(7) +#define ENA_ADMIN_HOST_INFO_PHC_SHIFT 8 +#define ENA_ADMIN_HOST_INFO_PHC_MASK BIT(8) /* feature_rss_ind_table */ #define ENA_ADMIN_FEATURE_RSS_IND_TABLE_ONE_ENTRY_UPDATE_MASK BIT(0) @@ -1842,6 +1890,16 @@ static inline void set_ena_admin_host_info_rx_page_reuse(struct ena_admin_host_i p->driver_supported_features |= (val << ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_SHIFT) & ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_MASK; } +static inline uint32_t get_ena_admin_host_info_tx_ipv6_csum_offload(const struct ena_admin_host_info *p) *** 391 LINES SKIPPED *** From nobody Thu Oct 31 15:59:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGM5PvQz5bwNm; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGM4rDFz4Nx8; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+jJAA0GmREAi63RqPjf59f59EKjXBI/+5LPSFRYvgY=; b=QIoBtNsVR8+p+fYsYvrIm1fLrmgg134mw4smTYbBXULRKx/gsfYaoXUmGp7ohOuKSnIdxI p+xde6VKPtTY/CjjPQHAOSSYxDOcx2HXaHudwUGfnGsPxW04BvosSL5MJHOdDlwETPFDtD sBlnmLDnVoyLXk/qc/9vMIQuxs+zGKBbRj7A5Wnx1s6BHGUH0nOAGQcEod/vyWl6D8GpzE tvWwktDa2wMJearYNRp3DZ1KMOwGW6dBuJtmLDNzzVGWdN6E1sIUvD8h+Qo6AqfS5NxVfJ am1Upx9fntmbv9MBRT5rCIOnSNSiwzm8mHvJ9Fqvw8PeE6DjsURZ5swzqBon4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+jJAA0GmREAi63RqPjf59f59EKjXBI/+5LPSFRYvgY=; b=XH+9qGWEte/UgMkd0s86jQEA0rfZIUoOY7K7+7bIXTNFuU4vcGoIRjHMkCcQy9XpzGFbD6 xbXckWiUoH2gNdMQIHbuKUb6v5IjbWmwq9DXPWQM+PczTZSY3yuXO9luvpos0DQ4/0JJYv vvi+gaZf0uJJE7ML2Se/xntZC+shJov3gn5h8yGNusr30Akpa8CLHkhh2OjnBt+FGxSnuC elYjMJqgiiOzvXImaArHz7V6dvDl5MsOlGOsRTDwpI/tRnm3vwgaCqzb8Jn2U4yFIe7m/z hcMzxwAh+Cg/T6G3KfvKKSNE9t3ixZ5xBbMzXuJD2FbUnbVy0SqxMlVU02/5cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390395; a=rsa-sha256; cv=none; b=BBJL2RS72nwsm6WaFC6tW6y4XKFYLzQIqEKNhXh2n7KtSMWJfUWU5PS7ydFuhbONF9yLql iT3MITqc5asRLb2gbrXAabsWUEhbJsph7galo+BVg1ckrQznITKZNecoXA8qg64j82IoGv XAezKt3MTOz7zkaRCapNmCOHmlbvOyEJk6fCR7bMozOQeeQ/372CxjHh3vlhbwU8Kc/yy2 z08rlrXP0YMtVOdCpjJdz/GAKwbaNqw8Fq3537Cw2gk9LwpbHsTsfRV9y0lao21Tir7tor jrnJG5hFixhECLiZAAud+YI5J9m13/wzFy+NE9z+XLzFDURZQcel26vEtHWmuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGM4Rhczj58; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxtpJ056452; Thu, 31 Oct 2024 15:59:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxtK5056449; Thu, 31 Oct 2024 15:59:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:55 GMT Message-Id: <202410311559.49VFxtK5056449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 8a31fe8cf91f - stable/13 - ena: Fix customer metrics deallocation statement place List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a31fe8cf91fe8d55579e18e3a683870160cafef Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8a31fe8cf91fe8d55579e18e3a683870160cafef commit 8a31fe8cf91fe8d55579e18e3a683870160cafef Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Fix customer metrics deallocation statement place Upstream commit [1] made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). Upstream commit [2] removed the NULL check conducted by the driver. This commit also removes err_customer_metrics_alloc goto label. Commit [2] leaves behind a floating free() statement that deallocates customer_metrics_array. This commit places the deallocation statement where it belongs. [1] commit 4787572d0580 ("ifnet: make if_alloc_domain() never fail") [2] commit aa3860851b9f ("net: Remove unneeded NULL check for the allocated ifnet") Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a) --- sys/dev/ena/ena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 934970ea0cf7..3da424a7c9dd 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3842,8 +3842,8 @@ ena_attach(device_t pdev) #ifdef DEV_NETMAP err_detach: ether_ifdetach(adapter->ifp); -#endif /* DEV_NETMAP */ free(adapter->customer_metrics_array, M_DEVBUF); +#endif /* DEV_NETMAP */ err_metrics_buffer_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); err_msix_free: From nobody Thu Oct 31 15:59:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGP11Wvz5bwWb; Thu, 31 Oct 2024 15:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGN6z8Bz4Ntq; Thu, 31 Oct 2024 15:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCenop7uJ+EiMwlnSoy4OmzALvSXU1boiNK9rCImCM4=; b=IGpsGVQMVHXMGKCeXHwMZJE/FdzMgVzct3HFPhD9cfSCr9y88dUieelrsrrAZjH1INfeEW /7L6RkCiueziFaOHt/QGiDQHvhXeijXEetMoQEUEWy+dw6q4L/LbVztX+KBxgYIo1tCB/t 2ezc1ipaltnLPEv2HGnnBuJtMyPF1T1xFcWdaRTLNplkTgm3ub1Kc4icEfbrKR+IjM+HSg sKixcr7trf9F5A30AN969dAJj2DZGlzFT1belNZFo35UB9p38wh7i84coWOFaGckj1rLcS nTFyAWrwssuiilY5Zw1sufdDj78UtjZY8hDnKEYH300sX+8SWgOSLTZ2s10e4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCenop7uJ+EiMwlnSoy4OmzALvSXU1boiNK9rCImCM4=; b=cBSeioeZpmPMxytvb9G1eWB0k9dXcsphNBHkAn1W4WZUjSh2deU07GpT2fZb90m5iWI3Mh 6iPZOCiwkVMdRO8ptMlmBg95gULkIWDyGgGH01KdGJykyYsPWJBso1S94j5yde3hAZoBBV QztnwwxZPzSuUSz52AV0bH7M6D5R+oqQJC8aLJx92ZhodqQrKaQdwjQ4HBu4AJwm5Ssakz os7h23QRhmiIbLEA7rLwCd+fMKTT3nQPj9T4VC2zaT7ZXcMvdmcWkjrhqWujpAdy24i+CW 1SDFRPr45CwF+wyTMQ4PXiu30P/xea0wixdF2T0WTQw/Gx6VnWxzHgvqKGa3yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390397; a=rsa-sha256; cv=none; b=tDLEESH7Tkfe1n7c1q4QtgW5/Dxkin3+3/JuTIkJ1lxikL0bmBdhyU+tL96ws6CTdYej5p opMttTdV0gQ+ls/WpVpYPhLH3Rc3HuOSJpGdL2/W2rbjydPOj7m38NoWeDnV0YU2f5iYWq rz6a/QnMsQNtoGGZbXUpIVJ1O9B3t3TteklvqUAwckeS/VlgbxJJdzvfqa8pGt13aJwB1S Ftmo7j6iBhs+0HBEbcLVz7C1bjS/xd4kqMIhqdxRDPnBF3SouKDypSA8Sm89bWTqP0w18r CSnnQBJ1kOhncQTxosPi9tdGhYw1Tt7zeXbMlBdT0yGv7EMcrwNH19BNNdb9ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGN5TPpzhdV; Thu, 31 Oct 2024 15:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxu1o056506; Thu, 31 Oct 2024 15:59:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxu0U056503; Thu, 31 Oct 2024 15:59:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:56 GMT Message-Id: <202410311559.49VFxu0U056503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 374695be6523 - stable/13 - ena: Count all currently missing TX completions in check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 374695be65238bcf392576538f0fe99f09c5dbc8 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=374695be65238bcf392576538f0fe99f09c5dbc8 commit 374695be65238bcf392576538f0fe99f09c5dbc8 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Count all currently missing TX completions in check Currently we count all of the newly added and already existing missing tx completions in each iteration of check_missing_comp_in_tx_queue() causing duplicate counts to missing_tx_comp stat. This commit adds a new counter new_missed_tx within the relevant function which only counts the newly added missing tx completions in each iteration of check_missing_comp_in_tx_queue(). This will allow us to update missing_tx_comp stat accurately without counting duplicates. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 1f67704e2cd85a507776312b52dc63d8690b9260) --- sys/dev/ena/ena.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 3da424a7c9dd..719dd4b58bae 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3059,13 +3059,13 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) { + uint32_t missed_tx = 0, new_missed_tx = 0; device_t pdev = adapter->pdev; struct bintime curtime, time; struct ena_tx_buffer *tx_buf; int time_since_last_cleanup; int missing_tx_comp_to; sbintime_t time_offset; - uint32_t missed_tx = 0; int i, rc = 0; getbinuptime(&curtime); @@ -3108,13 +3108,15 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, "%d msecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", tx_ring->qid, i, time_since_last_cleanup, missing_tx_comp_to); + /* Add new TX completions which are missed */ + new_missed_tx++; } tx_buf->print_once = false; missed_tx++; } } - + /* Checking if this TX ring missing TX completions have passed the threshold */ if (unlikely(missed_tx > adapter->missing_tx_threshold)) { ena_log(pdev, ERR, "The number of lost tx completion is above the threshold " @@ -3123,8 +3125,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, ena_trigger_reset(adapter, ENA_REGS_RESET_MISS_TX_CMPL); rc = EIO; } - - counter_u64_add(tx_ring->tx_stats.missing_tx_comp, missed_tx); + /* Add the newly discovered missing TX completions */ + counter_u64_add(tx_ring->tx_stats.missing_tx_comp, new_missed_tx); return (rc); } From nobody Thu Oct 31 15:59:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGQ0Dz5z5bwWd; Thu, 31 Oct 2024 15:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGP6jLcz4Nv6; Thu, 31 Oct 2024 15:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FppXkuuDRvyCUt3FbFfZ63NmKPybKBZt2SOkXyv4dq0=; b=NXK1WtS6e7vlaIf9OjwbmTOVTnEx+Nzh4dT9V6U6WQungUqJdCej9D3a9FXBuM+14YugBO DUhOQwcdDw9jSML83IGKxcAqWVsRuLqWpcby+jFFZorpwubCm/kgGEYwY2TlSZbWzICqSI GngeWWKGeYUQk7Vn4yRj+l9db2/2GREOGGc6ztZizEDAKRYlccrNiZ1Vem8GSxmMZ8sx+S GNug+e80zeAB6HF8W/FCPI6lsAxjJbhAVkPcMELP8g4MEDK807byF+0Tpp7rCCTEFR1VrP xdoZ30JYWNjBd4ezzySQA2g1M2GaXZZQsSrycFTeOpoUIxn1CpKhkXtjuTPo2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FppXkuuDRvyCUt3FbFfZ63NmKPybKBZt2SOkXyv4dq0=; b=PGVq41eUNMAggZbQXXBs9AOj/JhflH58nUl06qL7Qz4hAcKU+KmWvolJL9QUM5phnI9vhV c95u+0+PbW9jAf/gruqDca417g8opmheKxrOHXvEbtxfwAUrY5iSc0+xGCTDnnNQgyKq36 oIld5nvPNsHuW3Co4myZk1IgcsdGEI0B6zpq5PcvZFRf7X5srwLthxJNc3bACvJEzxIGvV ZKu4Sl5uaMf0oMPNKkY9AJmUniNos4j3a6kM7yf/tyD88iFWDzaxQM0yE4I3Gfy4T6iBP2 95oIM9y4/MpXnIvOXb/eGt0UEpTTsAI5gFYCP2h6GtGVKlTAQOp1C6luv9oTbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390397; a=rsa-sha256; cv=none; b=EFBvdt0gAdPLQUgNrAwtoHJkIuj+wP4qE59ICmTzvaQhVZU0cp1UaYnqdMuDeBvNydNnfr Wwq6hDbLCVQMnXS2k1Oq277cUfoY0xrkmSVbp6PKEWJNT4BkY/MlsHJ3vsHDCMgVb0Nztu dw6U7LP9/jXCmBifckpA3Lk73UOEGAvvL0fks41c9zdtWvXild0HZycLdU0nm/9KVXLSU1 gFrAE0gF80EA8OhSsD0UtST3BuJh6UmXj4rQaeCeVy49wyeaPX47XnDdGytoR/70ORZdnc DK3KGftigMbarBcx8usg8BeVd/jJ+cM+DcjcQOWY0UrstUN1iF8ZPk1qQq1vAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGP5vckzj59; Thu, 31 Oct 2024 15:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxv7s056556; Thu, 31 Oct 2024 15:59:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxvLF056553; Thu, 31 Oct 2024 15:59:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:57 GMT Message-Id: <202410311559.49VFxvLF056553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 8e9b6049b093 - stable/13 - ena: Add configuration notifications interface support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e9b6049b09321cb8c4d488050310f34dfd4f3a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e9b6049b09321cb8c4d488050310f34dfd4f3a7 commit 8e9b6049b09321cb8c4d488050310f34dfd4f3a7 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Add configuration notifications interface support This commit is part of the effort of notifying the user of non-optimal or performance impacting practices. A new interface is serving as a communication channel between the device and the driver. One of the goals of this channel is to create a new mechanism of notifying the driver and user in case of sub-optimal configuration using a bitmap. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 8cd86b51be4ab0fe70bad4830e608d56db5c850f) --- sys/dev/ena/ena.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 719dd4b58bae..c268c40d460c 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2912,7 +2912,8 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, BIT(ENA_ADMIN_FATAL_ERROR) | BIT(ENA_ADMIN_WARNING) | BIT(ENA_ADMIN_NOTIFICATION) | - BIT(ENA_ADMIN_KEEP_ALIVE); + BIT(ENA_ADMIN_KEEP_ALIVE) | + BIT(ENA_ADMIN_CONF_NOTIFICATIONS); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); @@ -4042,11 +4043,38 @@ unimplemented_aenq_handler(void *adapter_data, "Unknown event was received or event with unimplemented handler\n"); } +static void ena_conf_notification(void *adapter_data, + struct ena_admin_aenq_entry *aenq_e) +{ + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + struct ena_admin_aenq_conf_notifications_desc *desc; + u64 bitmap, bit; + + desc = (struct ena_admin_aenq_conf_notifications_desc *)aenq_e; + bitmap = desc->notifications_bitmap; + + if (bitmap == 0) { + ena_log(adapter->pdev, INFO, + "Empty configuration notification bitmap\n"); + return; + } + + for (bit = ffsll(bitmap); bit != 0; bit = ffsll(bitmap)) { + bit--; + ena_log(adapter->pdev, INFO, + "Sub-optimal configuration notification code: %" PRIu64 " Refer to AWS ENA documentation for additional details and mitigation options.\n", + bit + 1); + // Clear the processed bit + bitmap &= ~(1UL << bit); + } +} + static struct ena_aenq_handlers aenq_handlers = { .handlers = { [ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change, [ENA_ADMIN_NOTIFICATION] = ena_notification, [ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd, + [ENA_ADMIN_CONF_NOTIFICATIONS] = ena_conf_notification, }, .unimplemented_handler = unimplemented_aenq_handler }; From nobody Thu Oct 31 15:59:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGR3Vglz5bwWh; Thu, 31 Oct 2024 15:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGR1Ndkz4Nlr; Thu, 31 Oct 2024 15:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiLWwxNLLhwzJtk4gSzy4SWYBHm6dGd+g56uG6fF+n0=; b=TOrJNogBw3IVme5QGbESwM4u/1r2d9Bb8InWqQjWnoJ50QYvamNeNkSUwrjCFEm4hPmuBD +SqMe0T1aelUVJRVrSNk1a8RFhd613P4xyu3pkVQgOKm118TIyWeTl5r+VrNmhd2LJaPxs GaDhH2PNuysGKmyuYKMnGPTbnJw6U1q/zoSONR7EyDqC+xHdFfLb6fatfBrAQXDytlkt5f +skEdP00prA+wjbLx5KTMaTxgnwFoODQFFRs4/IL8XMIQVBDbCIAftLFGdbX7BEEt+DhJ4 iBDRt2lMOT39d7Kfou8/sp3vIQOmY/4fSNY8nV7i7AIk1H26nB+pv4jHAw8dOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiLWwxNLLhwzJtk4gSzy4SWYBHm6dGd+g56uG6fF+n0=; b=ZGDfIyA7ZxAMZrS9DgVGZ2vsvQAbX9eLFf4obIjcKS+GwNp7i684ym4FaVU407JbRO9s0/ IgNieW0V4Af59KEWjVKVORFemkt++amMLNsLx0Qn5RU++KsTaRKEHrJeewIk8sak2c2hey iebNCRSJn5kwIKXCO8S9COP6mNfO+IMz7Vfu+lvlv4SKnlyBugBe+7rLDkdbR/C9gvnC5u QJ8pwbesSaDI7/ooGibWv5w2q0I5HvG2rxooK4xVue5r5ddl/oz/b/HToLoUxAQWj65wmy 7xiG1gjZ1OKqSa3U+PYM/UJMYY5zVAPYJQiKiUzam/wNLf/sFXO05JozHs5vdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390399; a=rsa-sha256; cv=none; b=XA9wQ8wvCne+3dglO5sezuBuWDc8kXRInTUnWkXEfGklXvp852qZVa/manAAs0DSNrOak8 DHoHQyuKnJlbmol/o26MlzHgXzYKwz3hhT+zWNS7EFFWYjcizzDN1aNuMxuTRWMk/QcQut sOh0S1JfY2ZWtzPt3Se/KhDs9Y1oaKVe/+F/Wz8xLFCUsDu08XIZMqyR/vGjGzF9oX7EGb cVfbCRo2aUdDxDmh2wytsW05xfQSjEt0kjdfanUeOxUIhC6l49zssNDj2Bc6u3xC4cocbN 6bepHOCH+zBlvZPxAch9YTUaY0ei2W+vZ/DY+had9P4BONDeWvweUpV0xg1Zmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGR0BhLzjZZ; Thu, 31 Oct 2024 15:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxwRa056601; Thu, 31 Oct 2024 15:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxwiP056598; Thu, 31 Oct 2024 15:59:58 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:58 GMT Message-Id: <202410311559.49VFxwiP056598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 7397e4db6c55 - stable/13 - ena: Update license signatures to 2024 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7397e4db6c5519a5974543596cb99348d3378bd1 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=7397e4db6c5519a5974543596cb99348d3378bd1 commit 7397e4db6c5519a5974543596cb99348d3378bd1 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Update license signatures to 2024 This commit updates all the license signatures to 2024. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 8d6806cd08c093fc001db1f94cf122368b8d1549) --- share/man/man4/ena.4 | 2 +- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena.h | 2 +- sys/dev/ena/ena_datapath.c | 2 +- sys/dev/ena/ena_datapath.h | 2 +- sys/dev/ena/ena_netmap.c | 2 +- sys/dev/ena/ena_netmap.h | 2 +- sys/dev/ena/ena_rss.c | 2 +- sys/dev/ena/ena_rss.h | 2 +- sys/dev/ena/ena_sysctl.c | 2 +- sys/dev/ena/ena_sysctl.h | 2 +- sys/modules/ena/Makefile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index 4f3d03745467..ab1db7e55b9d 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. +.\" Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index c268c40d460c..2da8a4984921 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 3e42568ba8a9..be55f63bdb7b 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index f93b5fc6bd48..2f3bc72d8760 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.h b/sys/dev/ena/ena_datapath.h index 43292b5abbe9..9edf54fe502a 100644 --- a/sys/dev/ena/ena_datapath.h +++ b/sys/dev/ena/ena_datapath.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 27e306c5a2ac..0d0b7b6a1cf2 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.h b/sys/dev/ena/ena_netmap.h index 598fcf1f08b2..4ee8338e4009 100644 --- a/sys/dev/ena/ena_netmap.h +++ b/sys/dev/ena/ena_netmap.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c index 41fa9c62f94a..b7706e33065d 100644 --- a/sys/dev/ena/ena_rss.c +++ b/sys/dev/ena/ena_rss.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.h b/sys/dev/ena/ena_rss.h index 1c1c89261b35..64dd41851fec 100644 --- a/sys/dev/ena/ena_rss.h +++ b/sys/dev/ena/ena_rss.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index ea651837ebb6..a94bcbccdc98 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index 4f5834214005..df9cc8cb592f 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/modules/ena/Makefile b/sys/modules/ena/Makefile index f8b71588afa1..bfa4cf6da430 100644 --- a/sys/modules/ena/Makefile +++ b/sys/modules/ena/Makefile @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From nobody Thu Oct 31 16:00:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGS46z4z5bwjN; Thu, 31 Oct 2024 16:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGS2Cd8z4Nrl; Thu, 31 Oct 2024 16:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkioklgRerDFIvhG2LXOIqInSABWRDA0QxUgs3j4u0A=; b=QxjSjKPSiZE3D5auZtvYto2eVTNuxBt6+gDVWxSSc75bqLGjZs3XOjqTsz4mqyqSavrVVw COdct6zZaKCmzpZ0G4zJMoVpuYqcAtm12SMZc6fiw4Og++aNEAJPZdmSU75vvhlUbCYOq5 R5g12AhwDx/RUdFbJglEpWtKV7JfpOlZf/n95FH/d+MkE/w7SSZqQoGQRBaTWDCFcKljb2 hS2pRUst3jJDKRdSyfPnb+5/m3OdhEizLNCgkbHgNey04XmkYL+Xn1LS8O4qZV6WXcBwGv W6yvvynW6pYIxmYeJgDtJHEYw11ZqW89N+T+GiA7CzLRuJiN0ooWyltweBoKNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkioklgRerDFIvhG2LXOIqInSABWRDA0QxUgs3j4u0A=; b=Fy4Kq9eanhHYqrgLuYsU6q77qkPwGiz5KVjClyF3w4tk+YfCPZQ/PtPGKtCngQQqBJRG5G TACMRDf9W9GUat4rCXl4GgMprNlPluMPpHjqA8hZZBxjT7TmT8KRhKeVPG3Zq/q3sju2OI V+DsTl76//FGEKQx8bwevTpBcACS1XyeQjtMgN3c+z1x3J1yAYABqQSrBAXmGkzC3JraDf WfMVIi8mPbt26dy1oVwl+AcO/eme0NzB110SFSfH98Xt6kguaZ33kfaGM7uNFL6EamnBi8 eih/agOVJBPEvyBu0tXylIJklvOgVY8ea6szcMwk0dSWQc9Y9YIQ849AdWGqvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390400; a=rsa-sha256; cv=none; b=aj3iiOE4/raWvcg6NWz07RK6hUe2dQMLDAmakEV7rtz6SJuZFVxyS32l42RRo3TrIeTLA+ 6ZyaMMiB7FjCrOWUW9zH2+6wvCkLohLOK2ahVDpzaXp26cCZb0l5xyNi0FmfLw24c7+5W0 ueOCE1f+S73WczDTpfMehP5NF762SCebJg+p9Fgk0DV6045gGWDC3NJnXep2i5NFQVKV7x 2dNvFVer60LB5XibEgunjb4nb7r8so9KC13Yev0c02KfZ6MAaZ7oKLwUeH4EAq9oBnzAtC 6ESoTirknuo5eiTFBROtybgQK56HOZE1sDoaKmHloDeMqHcH5sDcnSN+n+bZ1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGS12Hlzj7S; Thu, 31 Oct 2024 16:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG00Ne056721; Thu, 31 Oct 2024 16:00:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG00mj056712; Thu, 31 Oct 2024 16:00:00 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:00 GMT Message-Id: <202410311600.49VG00mj056712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: d7eb2cd9b880 - stable/13 - ena: Improve reset reason statistics List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7eb2cd9b880d9dbfce68d9ddbc30c321e6118ba Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=d7eb2cd9b880d9dbfce68d9ddbc30c321e6118ba commit d7eb2cd9b880d9dbfce68d9ddbc30c321e6118ba Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Improve reset reason statistics The driver uses different reset reasons. Some of them are counted and presented in the driver statistics. There are cases where statistics are counted on a ring level, but these are zeroed after a reset procedure takes place. This commit makes the following changes: 1. Add statistics for the unrepresented reset reasons. 2. Add reset reasons which are counted on a ring level, to be also global for better tracking. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 89ce3f6314f6feba0e6626be51832d44df611218) --- sys/dev/ena/ena.c | 2 -- sys/dev/ena/ena.h | 42 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/ena/ena_sysctl.c | 16 ++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 2da8a4984921..3f938fe8f619 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3015,7 +3015,6 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) time = getsbinuptime() - timestamp; if (unlikely(time > adapter->keep_alive_timeout)) { ena_log(adapter->pdev, ERR, "Keep alive watchdog timeout.\n"); - counter_u64_add(adapter->dev_stats.wd_expired, 1); ena_trigger_reset(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO); } } @@ -3027,7 +3026,6 @@ check_for_admin_com_state(struct ena_adapter *adapter) if (unlikely(ena_com_get_admin_running_state(adapter->ena_dev) == false)) { ena_log(adapter->pdev, ERR, "ENA admin queue is not in running state!\n"); - counter_u64_add(adapter->dev_stats.admin_q_pause, 1); ena_trigger_reset(adapter, ENA_REGS_RESET_ADMIN_TO); } } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index be55f63bdb7b..4ac79edd0016 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -381,6 +381,14 @@ struct ena_stats_dev { counter_u64_t interface_up; counter_u64_t interface_down; counter_u64_t admin_q_pause; + counter_u64_t total_resets; + counter_u64_t os_trigger; + counter_u64_t missing_tx_cmpl; + counter_u64_t bad_rx_req_id; + counter_u64_t bad_tx_req_id; + counter_u64_t bad_rx_desc_num; + counter_u64_t invalid_state; + counter_u64_t missing_intr; }; struct ena_hw_stats { @@ -519,6 +527,29 @@ struct ena_adapter { extern struct sx ena_global_lock; +#define ENA_RESET_STATS_ENTRY(reset_reason, stat) \ + [reset_reason] = { \ + .stat_offset = offsetof(struct ena_stats_dev, stat) / sizeof(u64), \ + .has_counter = true \ +} + +struct ena_reset_stats_offset { + int stat_offset; + bool has_counter; +}; + +static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_RESET_LAST] = { + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_KEEP_ALIVE_TO, wd_expired), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_q_pause), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_OS_TRIGGER, os_trigger), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_TX_CMPL, missing_tx_cmpl), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_RX_REQ_ID, bad_rx_req_id), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_TX_REQ_ID, bad_tx_req_id), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TOO_MANY_RX_DESCS, bad_rx_desc_num), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), +}; + int ena_up(struct ena_adapter *adapter); void ena_down(struct ena_adapter *adapter); int ena_restore_device(struct ena_adapter *adapter); @@ -547,6 +578,17 @@ ena_trigger_reset(struct ena_adapter *adapter, enum ena_regs_reset_reason_types reset_reason) { if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + const struct ena_reset_stats_offset *ena_reset_stats_offset = + &resets_to_stats_offset_map[reset_reason]; + + if (ena_reset_stats_offset->has_counter) { + uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + + ena_reset_stats_offset->stat_offset; + + counter_u64_add((counter_u64_t)(*stat_ptr), 1); + } + + counter_u64_add(adapter->dev_stats.total_resets, 1); adapter->reset_reason = reset_reason; ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index a94bcbccdc98..6eafe2a8c052 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -280,6 +280,22 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "Network interface down count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", CTLFLAG_RD, &dev_stats->admin_q_pause, "Admin queue pauses"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "os_trigger", CTLFLAG_RD, + &dev_stats->os_trigger, "OS trigger count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_tx_cmpl", CTLFLAG_RD, + &dev_stats->missing_tx_cmpl, "Missing TX completions resets count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_rx_req_id", CTLFLAG_RD, + &dev_stats->bad_rx_req_id, "Bad RX req id count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_tx_req_id", CTLFLAG_RD, + &dev_stats->bad_tx_req_id, "Bad TX req id count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_rx_desc_num", CTLFLAG_RD, + &dev_stats->bad_rx_desc_num, "Bad RX descriptors number count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "invalid_state", CTLFLAG_RD, + &dev_stats->invalid_state, "Driver invalid state count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_intr", CTLFLAG_RD, + &dev_stats->missing_intr, "Missing interrupt count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, + &dev_stats->total_resets, "Total resets count"); for (i = 0; i < adapter->num_io_queues; ++i, ++tx_ring, ++rx_ring) { snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); From nobody Thu Oct 31 16:00:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGT5vltz5bwcK; Thu, 31 Oct 2024 16:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGT2RYxz4Nm7; Thu, 31 Oct 2024 16:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGPP6ihVnZIecRZnWTqWXziWVXi98QQ2fqYySgRhzcA=; b=KLw22/7A6DietQ5O1g1jNZnM2Tb++cNmPGXmz/554kSlbA6SHYgXBnHoRbmVPfIGAnYO3W iKA2SyiV63PUcU2JteLjeAUbMXY5DZ+ewnyahvg5hI9SxPbXj64hmBo2gbf1BvG5PS9dk0 y68D11Zg4E8wDEKN+HG5nJEDgg1+HQTiZgUzlcBV+O06hx0e4aGHZo3FZX81frwCyxQ9vi 21R24fXIrRnYRhKmG+/ljuqFYZLTDtAe4RaFMixjClDrcVgnj/5OtDEnkpAt1/8zZgNxsW yTiAB2OsRBir48GXAxmSUSiHCS5KBdN3oqpKwEXnDk+U04Tk58wg4j7Tn9xNiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGPP6ihVnZIecRZnWTqWXziWVXi98QQ2fqYySgRhzcA=; b=AiNcLyopLRfU2nhA6AhrJrhqWIZ/Lkf1ZFxhOXL9SbAxrk3rXY1GlQ5+JvcPBL4I9iAHYV Dakv+UI+SCcXIF73xcaAlxLsDzl/yrgqEg1YJNlc9opEmEOGi/z91qW3MDlPwsPAYogCMq gdcoLgjWQ350i4LMVNIhHhSIKv2Glxvpzqkezpagm2Ee4GyQ5fi+qaOcjATUz2xntiZDq6 s9XAV8W7Z4ixwDR/cxfqMpEE4ylX49XEF1CjiEOdqalJycJj4Ov3PuOmtYC5PRfR1/MOBJ +b8X2o/2pQbIWzGjIJE/iPIjJlhfMveUtTKHexZX+XlVOE6tQm+//OU+2gDEPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390401; a=rsa-sha256; cv=none; b=iItayS2C8MjD9XjQQ5LMvvLEKuE1ywYbjSpxipE8QQ982mkCSX15lY2oZC7S07kKlRASUM BnY6qYObpRFzTZYib7GsOQsK94t4c/kRY96vd1aeAzW/jIbSYdh2nP1eJLIIqfz9p+dW0m MDIXe5GS5+p2G9Hults7DvV3MiXpkz1Cs+gQbUHOKT/v6hnbx0MnO6mNZeT2TEHidt3fzT cCNeXc3ut1t0D14Jf3N+YMLxCaTDV0G5mbPnNbk5sKPvwbavHKeMzmrGimJPuB92B6bRdl 6TL/6WrDc1ygQWQAUz0qQLSIswBl1miXl9lB1VZDQdB94iZuZwfXsLLJOs9uXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGT1YZJzj5D; Thu, 31 Oct 2024 16:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG01e6058855; Thu, 31 Oct 2024 16:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG01HN058845; Thu, 31 Oct 2024 16:00:01 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:01 GMT Message-Id: <202410311600.49VG01HN058845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: a5b6e4509b4f - stable/13 - ena: Add reset reason for corrupted TX cdescs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a5b6e4509b4f21069e94227080ff423194bb5672 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=a5b6e4509b4f21069e94227080ff423194bb5672 commit a5b6e4509b4f21069e94227080ff423194bb5672 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Add reset reason for corrupted TX cdescs TX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 38727218460008a500fbc18f08c90082ed678895) --- sys/dev/ena/ena.c | 26 ++++++++++++++++++++++++++ sys/dev/ena/ena.h | 3 +++ sys/dev/ena/ena_datapath.c | 27 ++++++++++----------------- sys/dev/ena/ena_netmap.c | 38 ++++++++++++++------------------------ sys/dev/ena/ena_sysctl.c | 2 ++ 5 files changed, 55 insertions(+), 41 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 3f938fe8f619..32c93de821a3 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -560,6 +560,32 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } +int +validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id, int tx_req_id_rc) +{ + struct ena_adapter *adapter = tx_ring->adapter; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; + + if (unlikely(tx_req_id_rc != 0)) { + if (tx_req_id_rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED; + ena_log(adapter->pdev, ERR, + "TX descriptor malformed. req_id %hu qid %hu\n", + req_id, tx_ring->qid); + } else if (tx_req_id_rc == ENA_COM_INVAL) { + ena_log_nm(adapter->pdev, WARN, + "Invalid req_id %hu in qid %hu\n", + req_id, tx_ring->qid); + counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); + } + + ena_trigger_reset(adapter, reset_reason); + return (EFAULT); + } + + return (0); +} + static void ena_release_all_tx_dmamap(struct ena_ring *tx_ring) { diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 4ac79edd0016..22c42a9346f7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -389,6 +389,7 @@ struct ena_stats_dev { counter_u64_t bad_rx_desc_num; counter_u64_t invalid_state; counter_u64_t missing_intr; + counter_u64_t tx_desc_malformed; }; struct ena_hw_stats { @@ -548,6 +549,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TOO_MANY_RX_DESCS, bad_rx_desc_num), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), }; int ena_up(struct ena_adapter *adapter); @@ -562,6 +564,7 @@ int ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num); int ena_update_base_cpu(struct ena_adapter *adapter, int new_num); int ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num); +int validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id, int tx_req_id_rc); static inline int ena_mbuf_count(struct mbuf *mbuf) { diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 2f3bc72d8760..e85d29d7f278 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -200,29 +200,22 @@ ena_get_tx_req_id(struct ena_ring *tx_ring, struct ena_com_io_cq *io_cq, uint16_t *req_id) { struct ena_adapter *adapter = tx_ring->adapter; - int rc; + int rc = ena_com_tx_comp_req_id_get(io_cq, req_id); - rc = ena_com_tx_comp_req_id_get(io_cq, req_id); - if (rc == ENA_COM_TRY_AGAIN) + if (unlikely(rc == ENA_COM_TRY_AGAIN)) return (EAGAIN); - if (unlikely(rc != 0)) { - ena_log(adapter->pdev, ERR, "Invalid req_id %hu in qid %hu\n", + rc = validate_tx_req_id(tx_ring, *req_id, rc); + + if (unlikely(tx_ring->tx_buffer_info[*req_id].mbuf == NULL)) { + ena_log(adapter->pdev, ERR, + "tx_info doesn't have valid mbuf. req_id %hu qid %hu\n", *req_id, tx_ring->qid); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - goto err; + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); + rc = EFAULT; } - if (tx_ring->tx_buffer_info[*req_id].mbuf != NULL) - return (0); - - ena_log(adapter->pdev, ERR, - "tx_info doesn't have valid mbuf. req_id %hu qid %hu\n", - *req_id, tx_ring->qid); -err: - ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); - - return (EFAULT); + return (rc); } /** diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 0d0b7b6a1cf2..fb2c5cb21e6d 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -71,7 +71,6 @@ static void ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *, struct ena_tx_buffer *); static void ena_netmap_tx_cleanup(struct ena_netmap_ctx *); static uint16_t ena_netmap_tx_clean_one(struct ena_netmap_ctx *, uint16_t); -static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static int ena_netmap_rx_frames(struct ena_netmap_ctx *); static int ena_netmap_rx_frame(struct ena_netmap_ctx *); static int ena_netmap_rx_load_desc(struct ena_netmap_ctx *, uint16_t, int *); @@ -795,25 +794,33 @@ ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *ctx, static void ena_netmap_tx_cleanup(struct ena_netmap_ctx *ctx) { + struct ena_ring *tx_ring = ctx->ring; + int rc; uint16_t req_id; uint16_t total_tx_descs = 0; ctx->nm_i = ctx->kring->nr_hwtail; - ctx->nt = ctx->ring->next_to_clean; + ctx->nt = tx_ring->next_to_clean; /* Reclaim buffers for completed transmissions */ - while (ena_com_tx_comp_req_id_get(ctx->io_cq, &req_id) >= 0) { - if (validate_tx_req_id(ctx->ring, req_id) != 0) + do { + rc = ena_com_tx_comp_req_id_get(ctx->io_cq, &req_id); + if(unlikely(rc == ENA_COM_TRY_AGAIN)) break; + + rc = validate_tx_req_id(tx_ring, req_id, rc); + if(unlikely(rc != 0)) + break; + total_tx_descs += ena_netmap_tx_clean_one(ctx, req_id); - } + } while (1); ctx->kring->nr_hwtail = ctx->nm_i; if (total_tx_descs > 0) { /* acknowledge completion of sent packets */ - ctx->ring->next_to_clean = ctx->nt; - ena_com_comp_ack(ctx->ring->ena_com_io_sq, total_tx_descs); + tx_ring->next_to_clean = ctx->nt; + ena_com_comp_ack(tx_ring->ena_com_io_sq, total_tx_descs); } } @@ -856,23 +863,6 @@ ena_netmap_tx_clean_one(struct ena_netmap_ctx *ctx, uint16_t req_id) return tx_info->tx_descs; } -static inline int -validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) -{ - struct ena_adapter *adapter = tx_ring->adapter; - - if (likely(req_id < tx_ring->ring_size)) - return (0); - - ena_log_nm(adapter->pdev, WARN, "Invalid req_id %hu in qid %hu\n", - req_id, tx_ring->qid); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - - ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); - - return (EFAULT); -} - static int ena_netmap_rxsync(struct netmap_kring *kring, int flags) { diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 6eafe2a8c052..71c25dd5e443 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -294,6 +294,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->invalid_state, "Driver invalid state count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_intr", CTLFLAG_RD, &dev_stats->missing_intr, "Missing interrupt count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD, + &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:00:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGV4t76z5bwWq; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGV2ZKJz4Ns1; Thu, 31 Oct 2024 16:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2ETY6Jcr87HcS8GGOmCkVcfcvcms0SJC8md0nk+TU0=; b=dkhb6ZZ4W1TGA+k0TdrgspApRDT+c5CM23dkXRJZUByXDK6pjhfjkobWfnL3Caz/sueMDJ nm35OdRCGjJAa31wmIfVB4iOUZnAasF9Y6YlL14Tz7tnDRu9zAPr4HEC7PoxqJ3WHPQDIR KZDTvIv+rmJ97AXmnUsu+oczXJu5PSxSjZQjbnPPmymxDibbq4uU2P4IoSidkgBOBdDhkr Fsm4qQmBsecNRbx90nBwuQiik7XygEFSYAgwifgLTKqW4L8UakTEs/4lmPKy1nBlttR3Gl kaNriJCfNBjbk188pMqiYsc0Kj2jvBiXHPi047x33+5FXldT6pfupN5ZH8FUrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2ETY6Jcr87HcS8GGOmCkVcfcvcms0SJC8md0nk+TU0=; b=As9VvkXpyN8Y9oE5jMT2dSGhMu25IkTC7Dw8Ij/vH41pMfn4RErhq3sZQRtlPkRmJ0oeSL iTQKOC9CiecMxgDgS7jXaszbqPvz9IYsOai5XkWacvrUyFyUmsXLHeiUR0cuiRnQcAgKpY 0CqQ9o21r9ACK11qBmEmRDz27jK3EqgLoZQZuqzAzBJLZMVxgh4YsMU33qnach4Nwxc7k0 oK6rhgiqP5cjz7cXIoL2HrkoW475fJSzW7zrTIdOLMgVvw2km8wVI0yZFxzI1jPx+PokwF o+4bgTGAXrCdgSjjT0xnNu3YOrkd3HLWSKD37aQKq4sCw83B3W1RKC2dDIc++w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390402; a=rsa-sha256; cv=none; b=VqsuRqV+0iQLwfecxMPoNHPql7CcIYr6f8vwFFHELvhR9S8zajsKRBksS2PFu3El8heozN +VcVfM8rZTf7day3UOsEGIog+xUbogukxMO0+Wsx8zIuiXnAL/DV6uO+q7qhGq5a4mOhss sNVJAOtW3uwCHbtLy+EULPe5hV+ST51DokLEWNLjeyA9bQCQWhTSI6JIM0a8rlaAleK2rQ WTz+yp9RC7mFZWEPCJjteYukskL138ylWlzm2d6y8Hg2eqMSXMWIz4+iO6jYS2n5UdkRdl RK++cPVEdqMEcay/6byX2lIoaoxldAhLjSW73bMozZEiVZ5CFsANWPYjtIzM9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGV28fjzj7T; Thu, 31 Oct 2024 16:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG027B059469; Thu, 31 Oct 2024 16:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG02Su059462; Thu, 31 Oct 2024 16:00:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:02 GMT Message-Id: <202410311600.49VG02Su059462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: cd8c576d69d0 - stable/13 - ena: Add reset reason for corrupted RX cdescs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cd8c576d69d023af394a459c293cd1e13465920e Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=cd8c576d69d023af394a459c293cd1e13465920e commit cd8c576d69d023af394a459c293cd1e13465920e Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Add reset reason for corrupted RX cdescs RX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 4af71159db3cd4a37055b2b3d982ec53703c5c3d) --- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_datapath.c | 2 ++ sys/dev/ena/ena_netmap.c | 2 ++ sys/dev/ena/ena_sysctl.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 22c42a9346f7..b747736224d8 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -390,6 +390,7 @@ struct ena_stats_dev { counter_u64_t invalid_state; counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; + counter_u64_t rx_desc_malformed; }; struct ena_hw_stats { @@ -550,6 +551,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index e85d29d7f278..831189006f15 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -599,6 +599,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index fb2c5cb21e6d..54c8269be3b2 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -938,6 +938,8 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) if (rc == ENA_COM_NO_SPACE) { counter_u64_add(ctx->ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(ctx->ring->rx_stats.bad_req_id, 1); reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 71c25dd5e443..e46e835572fe 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -296,6 +296,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->missing_intr, "Missing interrupt count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD, &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD, + &dev_stats->rx_desc_malformed, "RX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:00:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGW5xhZz5bwZ3; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGW3SvQz4Nvw; Thu, 31 Oct 2024 16:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqJRVXk86QDemWptmP8yLXyq7EqxR643mPqENf0VKFs=; b=YFjblfjt7E5Tq7S6GX7vb6O7PPQHngdFUOcMSv7yD+TzFWJf+bPWThyI1BJkKbCIFe4zni G9zSazIo1DtRJSi7eOya21r8hdtBIxhc0R3m47jGBlNEcWhFpHltSo1Z+l/yHwrUiPp4U2 TwH18KsnT2cTXIr4BmuKfhQVSbicmtOM9MBuGzWOD3Luxuk2+WrKlgvhqhKaAWHX0KzIQy 4aQqqJI81jNc7vVtbYEFwHxRQ+jkderNJq2pIggPzAABJppRQwPa6NftW6tRB9uD0IpxA4 ms813VP7vhd5MZCmYv7XsSpvI7Hq3y+vonNj6AIG+K4u89UuO9Rotg7F5tOpOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqJRVXk86QDemWptmP8yLXyq7EqxR643mPqENf0VKFs=; b=fYlEzeYDjuXB1zNSPCPqFyvFeEBWCKwMNfo+7CMbTqoNU6NZ3PnDtdA+0afAH2V7wD9gVt 7fpFBLprv1eI9qlpEPfkQiISddnRwSCTsSbEGly28Me4dJy3FlovqflfKDowslEriWNMYD qVckJSXe1dbKRcEfGQJPF2kpMHtHSAxibPy2Rz4fIbUBKx4/Q+1Cwwg5eRfsYQ19iWPk7z 8cRX7wwGuPQH09SBJlyK5iyasa1n9p5HxWQBZceHx+A597PzuZbjRoW0LWt7M0xRncw+iA uERFSW+vvxV4Q+mUAq8NzzbXfGmjg4ij8OKpRqsNV8PXKtcQLjU414abiqO2Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390403; a=rsa-sha256; cv=none; b=LV4Q1E54hWeFzWNP4pcwwAXpYc6GJPAPPPhAc1aXlPZ0RtUM9+a5Tne07lE3kgMqlDnUhE tnZ1jnnh+cUnGW6NkLzaLi10KBdtSmwltGiqyF2q44azizk4yAt3GYq8HxBYbua7JkCoK1 UrMAv2ICUuGTrLcr/3uvE2MXTkF9v9JLiHjhQsh1jMNr0kqCajNOKCc5t59xFRzm/S7tRH ewoBvTqrcoLZODoZ4EdKwJC5all6NIpATZFK8rtpmFPLp9GpENsArX1RiMoTNcT91jmj3f xwcqwq93QfeIYg4tjM3c7sTzRBefmYpZnlsld+NQUQQSgp3yLWWm3ADgOk/R/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGW32DfzjV5; Thu, 31 Oct 2024 16:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG03jb060088; Thu, 31 Oct 2024 16:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG03jo060081; Thu, 31 Oct 2024 16:00:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:03 GMT Message-Id: <202410311600.49VG03jo060081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 298e32773ff2 - stable/13 - ena: Add reset reason for missing admin interrupt List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 298e32773ff2fd1652a668ae56f38df03c61a946 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=298e32773ff2fd1652a668ae56f38df03c61a946 commit 298e32773ff2fd1652a668ae56f38df03c61a946 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Add reset reason for missing admin interrupt There can be cases when we trigger reset if an admin interrupt is missing. In order to identify this use-case specifically, this commit adds a new reset reason. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 274319acb48424958242d55e1b0c7d4528da7f70) --- sys/dev/ena/ena.c | 13 +++++++++++-- sys/dev/ena/ena.h | 5 ++++- sys/dev/ena/ena_sysctl.c | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 32c93de821a3..a895ede8226f 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3030,6 +3030,7 @@ static void check_for_missing_keep_alive(struct ena_adapter *adapter) { sbintime_t timestamp, time; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; if (adapter->wd_active == 0) return; @@ -3041,7 +3042,10 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) time = getsbinuptime() - timestamp; if (unlikely(time > adapter->keep_alive_timeout)) { ena_log(adapter->pdev, ERR, "Keep alive watchdog timeout.\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO); + if (ena_com_aenq_has_keep_alive(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } @@ -3049,10 +3053,15 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) static void check_for_admin_com_state(struct ena_adapter *adapter) { + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_ADMIN_TO; if (unlikely(ena_com_get_admin_running_state(adapter->ena_dev) == false)) { ena_log(adapter->pdev, ERR, "ENA admin queue is not in running state!\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_ADMIN_TO); + counter_u64_add(adapter->dev_stats.admin_q_pause, 1); + if (ena_com_get_missing_admin_interrupt(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b747736224d8..1a436a702ba1 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -391,6 +391,8 @@ struct ena_stats_dev { counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; counter_u64_t rx_desc_malformed; + counter_u64_t missing_admin_interrupt; + counter_u64_t admin_to; }; struct ena_hw_stats { @@ -542,7 +544,7 @@ struct ena_reset_stats_offset { static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_RESET_LAST] = { ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_KEEP_ALIVE_TO, wd_expired), - ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_q_pause), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_to), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_OS_TRIGGER, os_trigger), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_TX_CMPL, missing_tx_cmpl), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_RX_REQ_ID, bad_rx_req_id), @@ -552,6 +554,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT, missing_admin_interrupt), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index e46e835572fe..c711ecf66d7a 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -298,6 +298,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD, &dev_stats->rx_desc_malformed, "RX descriptors malformed count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_admin_interrupt", CTLFLAG_RD, + &dev_stats->missing_admin_interrupt, "Missing admin interrupts count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_to", CTLFLAG_RD, + &dev_stats->admin_to, "Admin queue timeouts count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:00:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGY1Hjtz5bwl7; Thu, 31 Oct 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGX5kd9z4NsL; Thu, 31 Oct 2024 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SG0JZNdYlDqozurAD7R6V2c/ZmcbQZ6qi5KxOf9KdR4=; b=DUVb7BuNqEh2+KBpGa+kdolvyJOOykiHyhMY8HWlg8lmKg/qa/s9Tn7yZZD9R7AeZ8Ud8W ikp8an9ZmPYiL+4/0RUpCa52RNS3F1jw5rGPwXDYfc49U0WyFTafFQBZBxqGhYDSS8vz9z kmABg8I9mmN72JibvzGfaqaDgl9a0sDfwoNvs+RNMZJ3JE8Yu+G1e5Ypv/J8ZU1bmofd0z gHr/VoehwnqJTlBsDlDwtCwpKI9Rm57UFbwc1tj62cNOOfcc1fFL1qJdZtmsL8SHXSMw/b NSSYk2Gk2COlNvlLnpZNdRZ6vMhiVPSDugaaoembybctVS9E+LOs7A0r1qSseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SG0JZNdYlDqozurAD7R6V2c/ZmcbQZ6qi5KxOf9KdR4=; b=TmTVRRLr7xclg74M/JMSU3Ep+1stH1YgnSwnQ92mkq7fpy+3MdCcqFdybuBT5nxU8tMZjD O5zCMhrODfbfGoC4jaSNoIDM0I4wAWgs/19MIw+DYDWZjP+lOwPipOSKjBVZtq/Vc91xHt yDnmb+038j9EogXOFmS457Do6UhWYmMibsOdf84sjIFiOlQ0WlDIDLB4S5Ye3Xsx/7y5/G POpZtyY0fmz+QKDckm01qmV1pOCtUJ6sJVveqtY0kotevGx3zVMkYh3HvO2y69mfGTisJJ 83pb847z69urEAKlnXPqXCOizyfRr+aa7vVZcqJzBvhKZA7AAyde1UuNgSK1pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390404; a=rsa-sha256; cv=none; b=VC8SloY6Uffc4Qhe9HGMb0lnKr+XiWlktoCq0ws1OoKR+pqqNoTmxLWAK7RHS0aGdAto/m iYqm3EAS6fUg5Xw3SyKARZ7/toWDUn0OdATmJsKFFB30E0u65VR0801G6608BWFs4neX6V IMId2IF5K2++7ZrMOKUpD2yewWRW+OUtgo8q4atzKiiUMUjm/UTocGHSHpBMqseKx26qQk ujBxqQiC/dIOgGykO9Q01V/P4lF1peE3wiWMqe7UzzwPjYcPApEH0K4KX6sHJwHQDWPOMo +N9WBTL39yM4YRTcIKKEz3PZJcuHn0H3QMlVStV5Zvfy7kiuDZ53Qp+Tfl8kBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGX3p1zzj7V; Thu, 31 Oct 2024 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG042j060429; Thu, 31 Oct 2024 16:00:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG04Ym060425; Thu, 31 Oct 2024 16:00:04 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:04 GMT Message-Id: <202410311600.49VG04Ym060425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: d96267deb493 - stable/13 - ena: Set ena_min_poll_delay_us default value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d96267deb493add01e5e99700b866573e3342419 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=d96267deb493add01e5e99700b866573e3342419 commit d96267deb493add01e5e99700b866573e3342419 Author: osamaabb AuthorDate: 2024-09-23 08:06:41 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Set ena_min_poll_delay_us default value This commit sets the default value for ena_min_poll_delay_us to 100. This commit does not change the behavior of the driver, the delay is calculated as MAX(ENA_MIN_ADMIN_POLL_US, delay_us), where the first field is already defined as 100. The second parameter, delay_us is taken from ena_min_poll_delay_us which is currently unset - 0. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 637ff00f2f9bd6c8509d0e2ac8959c7a23f09650) --- sys/dev/ena/ena.c | 2 ++ sys/dev/ena/ena.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index a895ede8226f..6943480aecc5 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3737,6 +3737,8 @@ ena_attach(device_t pdev) goto err_bus_free; } + ena_dev->ena_min_poll_delay_us = ENA_ADMIN_POLL_DELAY_US; + /* Initially clear all the flags */ ENA_FLAG_ZERO(adapter); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 1a436a702ba1..876c3cd258aa 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -146,6 +146,8 @@ /* Max number of timeouted packets before device reset */ #define ENA_DEFAULT_TX_CMP_THRESHOLD (128) +#define ENA_ADMIN_POLL_DELAY_US 100 + /* * Supported PCI vendor and devices IDs */ From nobody Thu Oct 31 16:00:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGb0GLkz5bwVR; Thu, 31 Oct 2024 16:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGZ5R1jz4PDc; Thu, 31 Oct 2024 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+UDIuX/9nRKv8ZcGTXYZPh+QpR7d3hIi9DsKF9sH5PA=; b=gTG3wsTkZ2A3h8FfCqEO4q7hX4v+Z4mlmEA1bDiV3ArtEPpCmGNHkSQIEe1z0x7nvofBwm /3aHBL6Dh/KG61f3JkOg619HsUaGVnTotLfPUsXbsDFxV6bmOysIf4xzwhNyCkek+Ldiqa GcpbXGlYXyuSJD8U9mk75gMn5rozqDr0UyAqHMdGCU2yOSzYlDdiLPmfolaRRzM9OxaJv5 CDSUIXMQwFj9wmm+6U7+Lxi3babLJQB4PmCN9UCfeWpI4/2wcqECqh6UbBJFZ6U/MMOvrQ 7eBLaTCvHAEk3MoTcEBmvo6FD9Qri0lCKdsQV55fCeaw/OZE93tslt88z+Gm1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+UDIuX/9nRKv8ZcGTXYZPh+QpR7d3hIi9DsKF9sH5PA=; b=q/e7rdWA6NeKREUiIrpTcK6CSRwU3mqovyMB2hMmWB/YvLWifr74990bnSg001RykmBpZC HEwqQOrsK6CyoxpqFrEfMT+0igpVdILeETBOezGgWyzmR8T3H74SDe5/zDvgwtjdiJpn8q x0Z6kmRCnkxJlW3bT37P3qHz6JwR/UmyiU50Q4pLLB87LPhYE6EvSdMZJfKp0so7OYWCUR 3lkNKmgS+P4ndo8D1JimANYnYd9xJvkYIPT5qoVWbHCP5+nyg/QRJAMYdmy3u4fXfrvQu+ +n9Digksu29AbHxDur4aa2rQBwJ59WP15HB6mrAuSrE0su0qv01HcLug5MHZoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390406; a=rsa-sha256; cv=none; b=NvqJUdSP5y4LR1ROF6TXpLQO37QESbUpqCZ6chckfE5CPsUzOtvZlTjvOSpy907gbSFSD7 PFT7L0Re0RnP5TnxSG4x5+DmIDEgNDteKptrCNn/gqzeJU4rxbDgjfmEOhFuEsAHLolXdb 6VtDL0bz7eD9zgCBxEwFhRVwax7I3X7Zyhdy2oIY70MxPDoHwleLjKP155TvZF25J7PHc5 wDHt8LiPMPsBBPPHqE13wHYuNIx5hEvgou56UOrj9h1Ew9Fq8FhQn3hkwlFSmPs4IsE/+/ jiM3p+imNF02p6Ow3Y+HILjuYLA9mSvc8WUDaQw2QbHob0rSNEOmL0zUaPvHzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGZ4y6QzjV6; Thu, 31 Oct 2024 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG06EV061014; Thu, 31 Oct 2024 16:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG06Wc061010; Thu, 31 Oct 2024 16:00:06 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:06 GMT Message-Id: <202410311600.49VG06Wc061010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 6219b3398435 - stable/13 - ena: Trigger reset when mbuf is NULL error happens List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6219b33984353e81a4acb4c487569203ed2d87b2 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=6219b33984353e81a4acb4c487569203ed2d87b2 commit 6219b33984353e81a4acb4c487569203ed2d87b2 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Trigger reset when mbuf is NULL error happens The mbuf is NULL issue happens when the device sends the driver a completion with a wrong request id. Trigger a reset whenever this happens. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit da73e3a7d08c215a5d8530fea9a9730f8ac3709f) --- sys/dev/ena/ena_datapath.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 17a9c2c37f4d..90662cf9313b 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -434,7 +434,9 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, req_id = ena_bufs[buf].req_id; rx_info = &rx_ring->rx_buffer_info[req_id]; if (unlikely(rx_info->mbuf == NULL)) { - ena_log(pdev, ERR, "NULL mbuf in rx_info"); + ena_log(pdev, ERR, "NULL mbuf in rx_info. qid %u req_id %u\n", + rx_ring->qid, req_id); + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_RX_REQ_ID); return (NULL); } @@ -476,7 +478,8 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, rx_info = &rx_ring->rx_buffer_info[req_id]; if (unlikely(rx_info->mbuf == NULL)) { - ena_log(pdev, ERR, "NULL mbuf in rx_info"); + ena_log(pdev, ERR, "NULL mbuf in rx_info. qid %u req_id %u\n", + rx_ring->qid, req_id); /* * If one of the required mbufs was not allocated yet, * we can break there. @@ -488,6 +491,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, * with hw ring. */ m_freem(mbuf); + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_RX_REQ_ID); return (NULL); } From nobody Thu Oct 31 16:00:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGY5dywz5bwVP; Thu, 31 Oct 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGY4ntSz4NsV; Thu, 31 Oct 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOZspj0DUl8qZVqolC4o+NyKrAorBidq7/8zchdPyEg=; b=J2oMnqIz2d5amwC9X9scAf8J5gBiICEFwNMNRl236Z9k0L4VsjwkuU8UznFt6knIbse7jX fAS9bJXhv+EjXz5oOwm+Ser1hIFEeLUOvGGRjK1yBNCVMvvBBChFS/yR0II2qfqedbB14q 7SRXTOPS2kNuoveEBSISNSQ6i5LUPWr2SrwI0Rbb9GYDt0TUEF5KNxgSr+X6gbqoSdqOp/ +kp00lhri0C5i1FdanXWht6GB+cJwmqEwAmtoPpgQbUG+L0R6mxzCaBadHbYukfpq1nIQ2 iYdRzF6ToxFG5R01Tf8KiFSbOUaNcqUbGsqbzBcWaKlY34zdyjBcsQ4CSXl9CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOZspj0DUl8qZVqolC4o+NyKrAorBidq7/8zchdPyEg=; b=Cp4ZPwkg+wPG15RK6Re/kppG2ztnO0eImVh2ntLBRvC7f3kGoYB4VHCSk9/I7NMQBuJ9/+ V9Js604pv/1IDkJTHM/+keYF1xwnRpnuMjPAP6cHNWM3gISQ2sTjRqjVaBh+VEDE6c+xJf Qb3FWsbvIZ7d4sv5Ho/zbWK+HytpRHhQ9H5qioDHxfQ7SiR3ui3e0/3vWesqwoAOHA3tv8 vqkhwzqapmyL4Y6JIOcFjw/RmRaFGmBU+ZJy+39s97EQT7kpsPaxsrE0+e+sZjjLL3bPiF PnmYnKXWgdacUlwlwohqwInnQyxG/JjPjOHZppXqRdiMbQriyQ3xg5OYzIIxxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390405; a=rsa-sha256; cv=none; b=OOrOjP6oE6n7Im5pgPs1HkvmwYZZ6HkizxZ233ST/czQmpBMXpWqxApCgemYwUCgaHVAS5 t6b/K1I2JY8/jJ75y+57XbGM+tuw1tVy639YJY4jvgAmHPflVhvFymXtaBsFQgEhh9f4MU hCB/kZffdoBWYdzQXzRp0HF0DUi5Sl7TFQ4h9HNgvSC10fnmqcwPhH2pIcfbjt3s1oMRSz ITCyNo0XbM5mLEjE4kG55tKuN/nZu1HuYG3dvSnmZ4OdKcNgAGha0/2AgnWmiqQqWqiP7/ HiYWL2jCi7jtvcQZKfWrAaR72j94eaKA1XszEdJcOuydTP8lXXUe4lWSZECvJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGY4Pbtzj5F; Thu, 31 Oct 2024 16:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG05d0060723; Thu, 31 Oct 2024 16:00:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG05B1060718; Thu, 31 Oct 2024 16:00:05 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:05 GMT Message-Id: <202410311600.49VG05B1060718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 54aae6cbb12e - stable/13 - ena: Add differentiation for missing TX completions reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 54aae6cbb12e53bc1a585cc1e9baa3e4993480cc Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=54aae6cbb12e53bc1a585cc1e9baa3e4993480cc commit 54aae6cbb12e53bc1a585cc1e9baa3e4993480cc Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Add differentiation for missing TX completions reset This commit adds differentiation for a reset caused by missing tx completions, by verifying if the driver didn't receive tx completions caused by missing interrupts. The cleanup_running field was added to ena_ring because cleanup_task.ta_pending is zeroed before ena_cleanup() runs. Also ena_increment_reset_counter() API was added in order to support only incrementing the reset counter. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit a33ec635d1f6d574d54e6f6d74766d070183be4c) --- sys/dev/ena/ena.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- sys/dev/ena/ena.h | 29 ++++++++++++++++++----------- sys/dev/ena/ena_datapath.c | 21 +++++++++++++++------ 3 files changed, 77 insertions(+), 18 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 6943480aecc5..8402cf0a3229 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -169,6 +169,9 @@ static int ena_copy_eni_metrics(struct ena_adapter *); static int ena_copy_srd_metrics(struct ena_adapter *); static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); +static enum ena_regs_reset_reason_types check_cdesc_in_tx_cq(struct ena_adapter *, + struct ena_ring *); + static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME " v" ENA_DRV_MODULE_VERSION; @@ -3089,6 +3092,31 @@ check_for_rx_interrupt_queue(struct ena_adapter *adapter, return (0); } +static enum ena_regs_reset_reason_types +check_cdesc_in_tx_cq(struct ena_adapter *adapter, + struct ena_ring *tx_ring) +{ + device_t pdev = adapter->pdev; + int rc; + u16 req_id; + + rc = ena_com_tx_comp_req_id_get(tx_ring->ena_com_io_cq, &req_id); + /* TX CQ is empty */ + if (rc == ENA_COM_TRY_AGAIN) { + ena_log(pdev, ERR, + "No completion descriptors found in CQ %d\n", + tx_ring->qid); + return ENA_REGS_RESET_MISS_TX_CMPL; + } + + /* TX CQ has cdescs */ + ena_log(pdev, ERR, + "Completion descriptors found in CQ %d", + tx_ring->qid); + + return ENA_REGS_RESET_MISS_INTERRUPT; +} + static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) @@ -3101,6 +3129,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, int missing_tx_comp_to; sbintime_t time_offset; int i, rc = 0; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; + bool cleanup_scheduled, cleanup_running; getbinuptime(&curtime); @@ -3156,7 +3186,19 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, "The number of lost tx completion is above the threshold " "(%d > %d). Reset the device\n", missed_tx, adapter->missing_tx_threshold); - ena_trigger_reset(adapter, ENA_REGS_RESET_MISS_TX_CMPL); + /* Set the reset flag to prevent ena_cleanup() from running */ + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + /* Need to make sure that ENA_FLAG_TRIGGER_RESET is visible to ena_cleanup() and + * that cleanup_running is visible to check_missing_comp_in_tx_queue() to + * prevent the case of accessing CQ concurrently with check_cdesc_in_tx_cq() + */ + mb(); + cleanup_scheduled = !!(atomic_load_16(&tx_ring->que->cleanup_task.ta_pending)); + cleanup_running = !!(atomic_load_8((&tx_ring->cleanup_running))); + if (!(cleanup_scheduled || cleanup_running)) + reset_reason = check_cdesc_in_tx_cq(adapter, tx_ring); + + adapter->reset_reason = reset_reason; rc = EIO; } /* Add the newly discovered missing TX completions */ @@ -3619,6 +3661,7 @@ ena_reset_task(void *arg, int pending) ENA_LOCK_LOCK(); if (likely(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + ena_increment_reset_counter(adapter); ena_destroy_device(adapter, false); ena_restore_device(adapter); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 876c3cd258aa..c9eb9e8c43d3 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -327,6 +327,7 @@ struct ena_ring { }; uint8_t first_interrupt; + uint8_t cleanup_running; uint16_t no_interrupt_event_cnt; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; @@ -584,21 +585,27 @@ ena_mbuf_count(struct mbuf *mbuf) } static inline void -ena_trigger_reset(struct ena_adapter *adapter, - enum ena_regs_reset_reason_types reset_reason) +ena_increment_reset_counter(struct ena_adapter *adapter) { - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - const struct ena_reset_stats_offset *ena_reset_stats_offset = - &resets_to_stats_offset_map[reset_reason]; + enum ena_regs_reset_reason_types reset_reason = adapter->reset_reason; + const struct ena_reset_stats_offset *ena_reset_stats_offset = + &resets_to_stats_offset_map[reset_reason]; - if (ena_reset_stats_offset->has_counter) { - uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + - ena_reset_stats_offset->stat_offset; + if (ena_reset_stats_offset->has_counter) { + uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + + ena_reset_stats_offset->stat_offset; - counter_u64_add((counter_u64_t)(*stat_ptr), 1); - } + counter_u64_add((counter_u64_t)(*stat_ptr), 1); + } + + counter_u64_add(adapter->dev_stats.total_resets, 1); +} - counter_u64_add(adapter->dev_stats.total_resets, 1); +static inline void +ena_trigger_reset(struct ena_adapter *adapter, + enum ena_regs_reset_reason_types reset_reason) +{ + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { adapter->reset_reason = reset_reason; ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 831189006f15..17a9c2c37f4d 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -77,17 +77,24 @@ ena_cleanup(void *arg, int pending) int qid, ena_qid; int txc, rxc, i; - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - ena_log_io(adapter->pdev, DBG, "MSI-X TX/RX routine\n"); - tx_ring = que->tx_ring; rx_ring = que->rx_ring; qid = que->id; ena_qid = ENA_IO_TXQ_IDX(qid); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; + atomic_store_8(&tx_ring->cleanup_running, 1); + /* Need to make sure that ENA_FLAG_TRIGGER_RESET is visible to ena_cleanup() and + * that cleanup_running is visible to check_missing_comp_in_tx_queue() to + * prevent the case of accessing CQ concurrently with check_cdesc_in_tx_cq() + */ + mb(); + if (unlikely(((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) || + (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)))) + return; + + ena_log_io(adapter->pdev, DBG, "MSI-X TX/RX routine\n"); + atomic_store_8(&tx_ring->first_interrupt, 1); atomic_store_8(&rx_ring->first_interrupt, 1); @@ -95,7 +102,8 @@ ena_cleanup(void *arg, int pending) rxc = ena_rx_cleanup(rx_ring); txc = ena_tx_cleanup(tx_ring); - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) + if (unlikely(((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) || + (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)))) return; if ((txc != ENA_TX_BUDGET) && (rxc != ENA_RX_BUDGET)) @@ -107,6 +115,7 @@ ena_cleanup(void *arg, int pending) ENA_TX_IRQ_INTERVAL, true, false); counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); + atomic_store_8(&tx_ring->cleanup_running, 0); } void From nobody Thu Oct 31 16:00:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGc08yrz5bwZ4; Thu, 31 Oct 2024 16:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGb5zR4z4PKZ; Thu, 31 Oct 2024 16:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9YTo4BMj8lWrMnRGRtzKRGUN+n0c+5KtEqQ3fZVd+4=; b=s3FX1t8oL91TO3P2qqpAs+Cx98wOm6BUnYvPHzuh9HkePYbRn/WKmXVLV8E0DDBMzC6O31 E1Nef22xz2PTdSQZuSKDVM3/f0fXwB9sgEY6eoTFuKCX3qU8P8KHdtkirJH5fnD5B6I0Cj H1d88nGshi7nAJJIOm6nFRRsOXdrvfrpXaIxU55VfTEyzq7x4yOOJ2Qz9CcszE+GwkvliC LG2DVM5p+D+1167a3iizAUYxOdwlK+Nvj7Zu/UtODPajH2rqvo2Y5zFcwwBaLUwz2sANpw mpa9NAKN87ZdpXtYXMpDCS5humQcQ6ghPEBtwA6S9Cn9QUbfOMDBBY4lKHmRVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9YTo4BMj8lWrMnRGRtzKRGUN+n0c+5KtEqQ3fZVd+4=; b=QNGiWVEsLO8HGUiBHECpL7lZkdN6kj6FBr2TEvnlcNOFsnp01U3FVcRtlPagy7Th32RffP ZYIie92Rlu53afgHB9DwqtrGL7nKhtXib1SEPQ7nihoPH4TXdWz5NLazjy7Mc+Qv/FnvHL uZqc/hcXbdTys4wxDy8WfeSN2+kK0Kfw1fVLMnxdjP6d9QRxxgwgZMgpG2VzMy3dJq/Bz5 ZnMuFjU9WcChg8iCko80ymm0tO/Q/3dJqycpiXrnQ4hqMnVV+aUOcB9j+nitqQzfY0TrP+ Nud4pNswb4bQKQ2K4LspL13BlNM5D1T+9Is81iDWhmv5PRni0B5jNlK7tuZFnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390407; a=rsa-sha256; cv=none; b=kHsud9zAGWcYkdOA6c/5x4fNM+ZlP1gYm+Ex7n1X4QFFg2o5hW9Ru9fTYtopW1gMhuMS81 r92AE0y5+wSXearMsxLBuFm7jxa9vDEQ270bg7RnHFq2YxGb/xl19CTZJ0eEbDNv7pvlWF 4mkwmtfC8dmjv/SpQUuDzrSCZ8/kOLUFgZq1JaVlzY7lUh0TNls8GWYbUGCdrfV4GVdvTI qb+QXfTU4bjObkVfV0UuhynGFxj5y8sZM7VxdvbquRHgeevh35kaJAam6mHprr+sk9VzAj XnN8IIZkksiAwkTW6Ov30g3dmxBiuXjNCxwFuf6RgRdO4mE8YIQQCP3zfBXv+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGb5Xf3zj5G; Thu, 31 Oct 2024 16:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG07TH061299; Thu, 31 Oct 2024 16:00:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG07qI061295; Thu, 31 Oct 2024 16:00:07 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:07 GMT Message-Id: <202410311600.49VG07qI061295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: a6edd8f03342 - stable/13 - ena: Make global counters style unified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6edd8f033428c7f807beecb8eee09739e18c0bb Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=a6edd8f033428c7f807beecb8eee09739e18c0bb commit a6edd8f033428c7f807beecb8eee09739e18c0bb Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Make global counters style unified This commit changes the code so all global counters will have the same line break. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 90953d2f829a45669b0c88a6a03da481f2d54e46) --- sys/dev/ena/ena_sysctl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index c711ecf66d7a..e18328ddc8b2 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -275,11 +275,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->wd_expired, "Watchdog expiry count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_up", CTLFLAG_RD, &dev_stats->interface_up, "Network interface up count"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_down", - CTLFLAG_RD, &dev_stats->interface_down, - "Network interface down count"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", - CTLFLAG_RD, &dev_stats->admin_q_pause, "Admin queue pauses"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_down", CTLFLAG_RD, + &dev_stats->interface_down, "Network interface down count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", CTLFLAG_RD, + &dev_stats->admin_q_pause, "Admin queue pauses"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "os_trigger", CTLFLAG_RD, &dev_stats->os_trigger, "OS trigger count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_tx_cmpl", CTLFLAG_RD, From nobody Thu Oct 31 16:00:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGd1fMBz5bwcT; Thu, 31 Oct 2024 16:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGc6VPHz4PKm; Thu, 31 Oct 2024 16:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eh2Ltzn7YPt0LgJJxUkiDaU6ccsI1kK8voSVLXUZH8I=; b=vwArqJsazYBQktYaScozey5vkciR0QwSZ1oR3/VySdlatx0J88z/BgfcvhXkKlfx+l+aIl Uv4dr0RFpCO2UNOl0sELYk94OmO1fTarDFHwcsVZ11sdwR6gIOEFH2VJ9PknZaEUgBF2Ku yuoEOFWEsYGuf6OIjyOwCnjWIRZqxafCk8bPzS+azGcNde1cTesPUQVJ0rRk5UAGXMgC0U OUWpHVammbJHSghfTt1HF0IkJrCtl2biSe1d+Q5cMrRLoh/w4+awWf3GyiIwni4YyPnez+ DiRAtK7fjJ6/Cl7rODEELZAif3wJC9YL7MBcKu5xC6h/RZ7a41XXlxpI7dKMwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eh2Ltzn7YPt0LgJJxUkiDaU6ccsI1kK8voSVLXUZH8I=; b=RccPYFohHjC1zRwo129MtTpV+Bw3yshOd8SE1dF5XrTxyjD3xuAX75i39cxQzjt26b8yey oCqoExa7E8Lna48hcUCpeteH0QePOSudkkHg3UPxQCWlQfzZmlhMsdE55jiVbXAeNLRhUB Xywe8kz3Q8S9KHxT7aA5cw0hZTaFHE3xzNzhWyzPaZZl8/yBRHWi8UT6/gGUvI3G8sJCcT NwgeMZcPiPH+Gne3UMISTzrfZ5YlHY2Wo48Iu/dg6Fk04jifivSDQk3i1oAepcNX+dj/Eb LcnIWMf4WOfJhof+piYi0Dyq8+1nhTXMiaUPW3OHAK7XwuHg3zx6xcQytwPhww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390408; a=rsa-sha256; cv=none; b=inbNy9+vID61myMqBbYWCy4jij8w5dPrvQ/z/kQEIICY4eUNe8HjzAsCuNnLOAarUKTO4K NHfkSU3BBFhPsJ1zPQkKp44Eyttl2ZlGEiFU7qLL7682eYjfhZ1MpBPVl/iuKpA/gKtpOG yYdHkix1n2DDjrwrgi9YtLVinQM0AFWyjJ9aeYDIRbBhJXRrZSV0bjpgKmiGitRHnTrNzm 4KaV6QoLv4v3JsbkpmAiQtdk6ciN9UUFb1mqTC6As7Bg4n2lUOwHtal5Pa/SGhPdsnoHkZ 3BscKKFIvSr6j8GnXnIrs1kTimxBGALOAStbbLrRN8vvbXp/qwvk5f+Ak6uhDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGc65lyzjV7; Thu, 31 Oct 2024 16:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG08UD061625; Thu, 31 Oct 2024 16:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG08uE061620; Thu, 31 Oct 2024 16:00:08 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:08 GMT Message-Id: <202410311600.49VG08uE061620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: cd995601730a - stable/13 - ena: Properly unmap last socket chain in netmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cd995601730acb15c50044196fd8acc782e4cdbc Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=cd995601730acb15c50044196fd8acc782e4cdbc commit cd995601730acb15c50044196fd8acc782e4cdbc Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Properly unmap last socket chain in netmap In case ena_com_prepare_tx() fails within the netmap tx flow, the driver will unmap the last socket chain. Currently, the driver unmaps the wrong socket within ena_netmap_unmap_last_socket_chain(). Illustration of the flow: 1- ena_netmap_tx_frames() 2- ena_netmap_tx_frame() 3- ena_netmap_tx_map_slots() 3.1- Map slot 3.2- Advance to the next socket 4- ena_com_prepare_tx() 4.1- ena_com_prepare_tx() fails 5- ena_netmap_unmap_last_socket_chain() In step 5, where the driver unmaps the socket, the netmap index already points at the next entry, meaning we're unmapping the wrong socket in case ena_com_prepare_tx() fails. In order to fix that, the driver should first update the netmap index to point at the previous entry and only then update the socket parameters. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f236e544a2ff685ae151f3232e3785a6a9aab035) --- sys/dev/ena/ena_netmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 54c8269be3b2..ae269cca853a 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -783,10 +783,10 @@ ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *ctx, /* Next, retain the sockets back to the userspace */ n = nm_info->sockets_used; while (n--) { + ctx->nm_i = nm_prev(ctx->nm_i, ctx->lim); ctx->slots[ctx->nm_i].buf_idx = nm_info->socket_buf_idx[n]; ctx->slots[ctx->nm_i].flags = NS_BUF_CHANGED; nm_info->socket_buf_idx[n] = 0; - ctx->nm_i = nm_prev(ctx->nm_i, ctx->lim); } nm_info->sockets_used = 0; } From nobody Thu Oct 31 16:00:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGf17jZz5bwjX; Thu, 31 Oct 2024 16:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGd75Ttz4PHb; Thu, 31 Oct 2024 16:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQqLTEzab7Ubn/NBvgm69gll4vFn8v2SIHiSzBe3brQ=; b=RsR/UE0FfktYwk3VqM3kcZ9mKOIiIt9y8/T1z9lZuOcTie+JUvf6xpfqY1TSUSC5BWQEep u8/zgLyDW1b2akVroDRg1sJ7A83RRVL4PCne9xl3AHli1UqlojSCw+SwpWChYhV31D8nXc KfJZpXtrJwRJ/Tx2rDqaOyuiEBt/SkubOjguAmn1rNH9yHwalchJTLD68N0N5WaGgbkV28 8npFnx/V0as6VPrxI/dYJVNCNw6RzW7uTrmyUID6/91GhqYY5JQHnO9t3G9OqL5KVrWDHT pkwjJh0S6mcEgbFLYHcYR/UreQfrICL+A629XXKrqqf1VpqdEVyUzCcl5R0ysA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQqLTEzab7Ubn/NBvgm69gll4vFn8v2SIHiSzBe3brQ=; b=t0LuMk+6JMkhoMXUDTyVpC8KYvpUTwH+yAI9B+oS7K2zmWAIg1vZztSwksKFitGFv6wv60 Lim1u4sbnzKl4NdN7ymJNZUUr3IME+FK4PkN4zGB+LXwT1rHS93vu5BUQ+FMRZ0UMWkSxx /ACf05hZ0B38eURmw65VR5S2oB2atGzR0wlCtUhk00qoBjCC39wm2OpPwLtM9HcxUKah+X xyLkx4ohGcJT3bGnkLaT6gcKQha4PUEheGj/sZ8nLRpB6x/MSxoAKyid86n7z0gEQ7DEgf w+DqcFsYwa6tEnAv8EWwph6q9NzP3cMEwBTSFEJ0kA9CClDQx3ErFGUPs6CFtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390410; a=rsa-sha256; cv=none; b=dOZh3hPq58qYR9o2b5ydnclh41oX7Y0e9yhrKgzd/q5K6ASF/tClNHLjxWcvdE2f7rTDNo P9X6r63ojABjXqTeCkbgAP3zofzMbICBmF/d2R5Q4aIPq2FicYldQ180Tb9A/pQdfyidfx FXUJuIHsD9GIT8n2e8BKNV32VxyxoMwoh9UpJUktENlhNGNT+zUt5Kv2mbIa0zG+h5glZd 7EyidyKxVTGzxNGo4xtMowRd7rUpnuDV+t9+k+kD4dE4Won+XBly+fYO7UbtBXrCXqyIlF NDbU3yRcsLDWKP9vwUz+72i1xdH440TMW2d4j3Ko8VGS6rAC1Wtuc+qIB1p8JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGd6jRrzhdW; Thu, 31 Oct 2024 16:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG09xN062164; Thu, 31 Oct 2024 16:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG09kU062159; Thu, 31 Oct 2024 16:00:09 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:09 GMT Message-Id: <202410311600.49VG09kU062159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 5d5b31eb79aa - stable/13 - ena: Handle wrap around for prefetch in netmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d5b31eb79aac0e433c4de878f113f1506688fd2 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=5d5b31eb79aac0e433c4de878f113f1506688fd2 commit 5d5b31eb79aac0e433c4de878f113f1506688fd2 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Handle wrap around for prefetch in netmap Netmap index wraps around based on the number of netmap kernel ring slots. Currently the driver prefetches the next slot using nm_i + 1 which may be wrong since it does not handle wrap around. This patch fixes that by using the kernel API for fetching the next netmap index. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit ce20b51cb71bfb548fcaafc4bacb8290460f03d5) --- sys/dev/ena/ena_netmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index ae269cca853a..910b447b12c6 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -577,7 +577,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, remaining_len = *packet_len; delta = 0; - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); if (tx_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { /* * When the device is in LLQ mode, the driver will copy @@ -664,7 +664,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, * The first segment is already counted in. */ while (delta > 0) { - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); frag_len = slot->len; /* @@ -722,7 +722,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, /* Map all remaining data (regular routine for non-LLQ mode) */ while (remaining_len > 0) { - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); rc = ena_netmap_map_single_slot(ctx->na, slot, adapter->tx_buf_tag, *nm_maps, &vaddr, &paddr); From nobody Thu Oct 31 16:00:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGg3TYpz5bwjZ; Thu, 31 Oct 2024 16:00:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGg0cCjz4PLF; Thu, 31 Oct 2024 16:00:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9Mh9r/IrK5RfZF4+Qe54bWHuDMpaGRqwFQ2AqUlRhs=; b=sxLwtpjXiZ05r+twvniJ8euJn/kDcJC50LyrDXb0i0vwxrgzw8eTdFhxysv0XHtR/PDws+ 9N8DcmAY2rcF0RyYN3vRvF+EPEz8Kowz2ksiVtOGJ270qA9AtNe5cmz1hLuq01HmGoaV1K 6ILOgJpbvx4YxTC8UTvadRHQkxHY2y4cgh38FajGpQzZV8pLmI4IXW6sctJJUD4UaXFmZk g94fok+gKxbTh9uSxCFh9xw2R7iolEBPvc4k6l47GzmDlHxPByvN/mQ/Z0QDAU/o1MyG9p suu6xnP6tft0p4BKvJnLbd1bEwg3uML1Iv10tz+ApKcD20lwUl4CQX+DPzJb4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9Mh9r/IrK5RfZF4+Qe54bWHuDMpaGRqwFQ2AqUlRhs=; b=evS46n8FstfXCrfxBmxn+OjDnwMNAo1e1CeT2ZHpkIII3y+yNW+SWIkmc2eheoFwg3crF5 UdYCzi2dcXsk5pnRFjQx0Mxeut+7oepBhHYex8qOaymzZQE3KeS121+tClWbgAN9qqlZQx hZ46ucvg2XOw+9vL6GEog8ogbPbH1E6G6TywxQQ9oM1NDa083dwGtP+ftBS1/KzyCMKncO K+8qH18miYIAuo5Yz/a41viIDZayVYhZcw/DVGrQLGLCoIwEU41t6LeffEx8kgO67AOP2j FeO0cj/sbIIge7VjNzOAwtK++6uBsnXMM1dmg4BLRTouvSEqkFFF477KZLm0sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390411; a=rsa-sha256; cv=none; b=Qy/1FJP7khHrKE7eq7QHyaEj7s6DZ0wQuZ8dZepEwoo5rMnEo+/ySAiY213cZs7CG016Kt weYOLVpQMD/Wy6jWGQkXtbRAtOzm2gyJGpSjLJjJZF4p2DJWuKwZETwMd55nUEMrNKfqHU sDYixUpIR1hMqH2xFPvxGn6PqrUJtFdcxcMaR05d6W6ICdla+AB6r+xUb+q477/WMZIDFU HtFhUUdrp6jr50sf1EPrOjZs2E683cHY++MSmKUnv9dksiDp/jGPmGQPO1hfl4FH1Pgni/ PKygRIgA3t3llwmau8VDqPT8UXDTJpPH5zemhzQcf8e7JJf6fVlz/8mlz6s0Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGg0DDSzjV8; Thu, 31 Oct 2024 16:00:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0AIx062821; Thu, 31 Oct 2024 16:00:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0AfR062810; Thu, 31 Oct 2024 16:00:10 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:10 GMT Message-Id: <202410311600.49VG0AfR062810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 444a69c1951c - stable/13 - ena: Clear NS_MOREFRAG flag for last netmap slot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 444a69c1951c277b14191ff33b7d67e834300967 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=444a69c1951c277b14191ff33b7d67e834300967 commit 444a69c1951c277b14191ff33b7d67e834300967 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Clear NS_MOREFRAG flag for last netmap slot When processing packets within the rx-flow ena_netmap_rx_load_desc doesn't know the number of descriptors, so it sets NS_MOREFRAG to all the slots to indicate that there are more fragments for this packet. The code calls ena_netmap_rx_load_desc() for every descriptor in this packet to map the relevant buffer into the netmap shared memory. After ena_netmap_rx_load_desc() calls, we need to unset the NS_MOREFRAG for the last fragment to indicate that this is the last fragment, so we explicitly turn off NS_MOREFRAG flag. Current code overrides all other flags and sets NS_BUF_CHANGED. This patch unsets the relevant flag only. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 2f17afd19a3534dc1755c52edb0c2f70ea0eb1e4) --- sys/dev/ena/ena_netmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 910b447b12c6..41eb8abab39d 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -964,7 +964,7 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) * It just set flag NS_MOREFRAG to all slots, then here flag of * last slot is cleared. */ - ctx->slots[nm_prev(ctx->nm_i, ctx->lim)].flags = NS_BUF_CHANGED; + ctx->slots[nm_prev(ctx->nm_i, ctx->lim)].flags &= ~NS_MOREFRAG; if (rc != 0) { goto rx_clear_desc; From nobody Thu Oct 31 16:00:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGh2kyVz5bwgK; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGh0zkJz4PLR; Thu, 31 Oct 2024 16:00:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6JREqi16y8IaznrQZPzruYmAP7JA29SaAu7MKd1n0aw=; b=BuVSHrhJlag2rQ7UHB8UbutbxOyCfbFAcTB09GhMWtYCDrK2dKqO25Y6GR9tjI+S9JMhBF JpSSpeWJpmDCuCMTPcD+wsay3y0YciscPh4boNWDJkufcIVkg2T/zEHdLin+iZDed5LLNd +6csXuKKSoiFV/bhakiccNu2HtPqKkMrVeulWkFEmfxvL5tr0K6QBswJlGuw+p5MD30we6 lBnNle9kZN8u+POdS5GaHk+KBiOH7jKIAGPL1AWIOeYWalGXjOCVkXm427GlRY2F3JyxlH VFV0To7UI/VebC6riIp/LlcgTbatdr6ImDvGTnOlandwvagbv9yAkda1XjFfVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6JREqi16y8IaznrQZPzruYmAP7JA29SaAu7MKd1n0aw=; b=M6+1PN7VSibZPK1xMbvVeHgvIvR8sD4xTqBYJRrsW9ToPHgoXyfN1dh+qznNXeIItmGFNl dLieiz1bBT5r5DKg03j0Fxxjwzp640U+bXNqztagafZ67viRtp5OEC6U1ohMnGAo/12V9l QsBkfAX/rzPvTFGhmH1uSb05+piW1/2BoaauqepBongJEzEV1u5zkrpDvuZ4pPaYo+op4J dOlzArmp9PJkGKvcoRQAPX+I8KHUtrBqkWsczrYy3Qc/6+PV3h/sJPQHq0QNin83bkjWTb +b83tAvWhuNHaLXlnZTVLVtpTAuNXdvI2sBdhHoyh02OissVIX3TpnkjXG53uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390412; a=rsa-sha256; cv=none; b=b/KfCN1TZcnIW7EN9XNjnvh5D1MvnkimCkOPoqjglaa8IOQpYkAFkCEjs0kCYEEUJAFzT7 YR6eg/oDL9QGmJzFLgoAnc2GaBjjt3EQuq1ZZAF6aLhAZpnxV16sTRNm1whdG7xoW5z8FQ KzsgbuR87dRx+JfL5UR1PHustxqX3oX/Tl9lzFraSGD+XZ9JD17mI1SM88vKPTsVWNJk8T yEi193QfY19b6n2wbO2P+WcGB2CAFlukKO+Zpzg12CTNjqehpy5Op4xFVWdaqsruRvbtrD o2reFFx4/Jr5HcCpQFQcvblIvRL5dKlecbDTZyxI9tRTGFKTbpE8VoQyz2gMiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGh0ZgHzhdX; Thu, 31 Oct 2024 16:00:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0CQc063500; Thu, 31 Oct 2024 16:00:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0CS8063492; Thu, 31 Oct 2024 16:00:12 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:12 GMT Message-Id: <202410311600.49VG0CS8063492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 3a18e7a0bcc5 - stable/13 - ena: Reinit netmap adapter struct upon sysctl changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a18e7a0bcc5d4805c94063b43eba477cab82ed7 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=3a18e7a0bcc5d4805c94063b43eba477cab82ed7 commit 3a18e7a0bcc5d4805c94063b43eba477cab82ed7 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Reinit netmap adapter struct upon sysctl changes When attaching ENA driver, ena_netmap_attach() is invoked which, in turn calls netmap_attach which, initializes a struct netmap_adapter, allocating the struct's netmap_ring and the struct selinfo. When we change the interface number of queues we need to reinit the netmap adapter struct as well, so we need to detach it in order to free the memory allocated by netmap_attach and allocate new memory based on the new parameters like number of rings, ring size etc... Without detaching and attaching the netmap interface, if we're to change the number of queues from 8 to 2 for example and try to enable netmap, the kernel will panic since the original netmap struct within the kernel's possession still thinks that the driver has 8 queues which will eventually cause a non-allocated virtual address access fault. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f9c9c01de87e0440380b939c684d9939d48ce175) --- sys/dev/ena/ena.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 8402cf0a3229..b09deb162a12 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -171,7 +171,9 @@ static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); static enum ena_regs_reset_reason_types check_cdesc_in_tx_cq(struct ena_adapter *, struct ena_ring *); - +#ifdef DEV_NETMAP +static int ena_reinit_netmap(struct ena_adapter *adapter); +#endif static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME " v" ENA_DRV_MODULE_VERSION; @@ -1162,6 +1164,21 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) return (i); } +#ifdef DEV_NETMAP +static int +ena_reinit_netmap(struct ena_adapter *adapter) +{ + int rc; + + netmap_detach(adapter->ifp); + rc = ena_netmap_attach(adapter); + if (rc != 0) + ena_log(adapter->pdev, ERR, "netmap attach failed: %d\n", rc); + + return rc; +} + +#endif /* DEV_NETMAP */ int ena_update_buf_ring_size(struct ena_adapter *adapter, uint32_t new_buf_ring_size) @@ -1179,6 +1196,12 @@ ena_update_buf_ring_size(struct ena_adapter *adapter, /* Reconfigure buf ring for all Tx rings. */ ena_free_all_io_rings_resources(adapter); ena_init_io_rings_advanced(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; + +#endif /* DEV_NETMAP */ if (dev_was_up) { /* * If ena_up() fails, it's not because of recent buf_ring size @@ -1196,7 +1219,12 @@ ena_update_buf_ring_size(struct ena_adapter *adapter, adapter->buf_ring_size = old_buf_ring_size; ena_free_all_io_rings_resources(adapter); ena_init_io_rings_advanced(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); ena_trigger_reset(adapter, ENA_REGS_RESET_OS_TRIGGER); @@ -1224,6 +1252,12 @@ ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, /* Configure queues with new size. */ ena_init_io_rings_basic(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; + +#endif /* DEV_NETMAP */ if (dev_was_up) { rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1235,7 +1269,12 @@ ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, adapter->requested_tx_ring_size = old_tx_size; adapter->requested_rx_ring_size = old_rx_size; ena_init_io_rings_basic(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ /* And try again. */ rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1359,7 +1398,12 @@ ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) ena_down(adapter); ena_update_io_rings(adapter, new_num); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ if (dev_was_up) { rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1369,7 +1413,12 @@ ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) new_num, old_num); ena_update_io_rings(adapter, old_num); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ rc = ena_up(adapter); if (unlikely(rc != 0)) { ena_log(adapter->pdev, ERR, From nobody Thu Oct 31 16:00:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGk66rhz5bwZG; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGk2rwQz4PDH; Thu, 31 Oct 2024 16:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o2jSo/gZz5OP0nPKBRtBDvjw6nwtMVFpfdNjK55JTug=; b=jFHNI6xITlj8Pq5bDCkjP/WewyO9mL+txDwbKtdEbHi+PDinPyBFjyIJSBgKhvANFJbcFD eoohpUeYYOtVVwyUco/Lpy53QxswPq4z7oSDADIIJ/z6bQKEdsJRio/H7EEt0GcOA/MbpJ Dt+Vr1MRRcgfBugkZ6QBAKVDwBi6C5sAqSrEk2mv1Zu5XK/lRZ76LixMyg44GexZMWcdt2 VRqqCMt7OwtMB7EQGVLq55q+uDtysXKa1AkPBZ12fEtbOe6OJN/VYxkkAWNI5H/FX6EY6c S5+xmbwvQCFUQ6vAw1/Ly9kqoXcon8N3fRzanryQmhddNAZvZESWwwKcXmHQnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o2jSo/gZz5OP0nPKBRtBDvjw6nwtMVFpfdNjK55JTug=; b=S2AaZMgn33cPOfKv68OnfwUfz/zk7CpoS+zxGhIrJl7wi2uY/3N/rIr3C0PN3YAnrhS+cc FC4WvpD+oX+QpK2jwRDPJjEVFHeH4OgfcFD/jdcal17itTScIL52pFtHlAECJlTh7NG5G6 gMDuI8A6HcNShE8timXo/h5aXrSNqGKcoXkHtJ463DeTQIppjRo949Vr5yUWYa1EkUrbwd kgkcoiRby06zvLN9i2sWhreVyIu7Xs9fuP7FestN4jutluyTJfnt3BVQtsyhfxvBCsG33j U/UVNwJIE2y+ZHqZpMo2lDj2VXtN2TjKALgIqRW6/fclTD40G2qLUDPFATWuIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390414; a=rsa-sha256; cv=none; b=VTUFckw6I7QjuATEHprcIET+DS1nn1+EMEM3tRUFUqpVTHm0ywC8qhgzpnO4KVtpE+1GIu 2qAtLiT5DuWO/7uWq5YVNjBWUKwa35iqX5RQ6xzU8FGq4qY5BLtYyMr5Ny5wVv5VpoWKyE B3VkLIt+zE+PWtjEuSVH63z6EF/wvS4VgMWMptECQl0k1NIT9HMSsW9CG4AwzH07AfYkTW 0YWlYsh8LaOTAe67rP3+QboWWZb+MGXqi64Uo04rUztfZwpuGcnWFj+nXQJH33L3rwRl+s +QQFK0s+sP4FNlqoZQi3EbdepojO4wBoSTJ8cwo/PXx9ej8IsulOJo/MS8sJZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGk2B94zj7W; Thu, 31 Oct 2024 16:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0E0u064916; Thu, 31 Oct 2024 16:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0EIh064908; Thu, 31 Oct 2024 16:00:14 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:14 GMT Message-Id: <202410311600.49VG0EIh064908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 2e84b718b652 - stable/13 - ena: Support LLQ entry size recommendation from device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e84b718b652f8fd8b428580653b87cb645e304c Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=2e84b718b652f8fd8b428580653b87cb645e304c commit 2e84b718b652f8fd8b428580653b87cb645e304c Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Support LLQ entry size recommendation from device This commit adds support for receiving LLQ entry size recommendation from the device. The driver will use the recommended entry size, unless the user specifically chooses to use regular or large LLQ entry. Also added enum ena_llq_header_size_policy_t and llq_plociy field in order to support the new feature. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit b1c38df05d79c81ee1e9fd0942774820a4ffcb63) --- share/man/man4/ena.4 | 14 +++++++------- sys/dev/ena/ena.c | 39 +++++++++++++++++++++------------------ sys/dev/ena/ena.h | 11 +++++++++++ sys/dev/ena/ena_sysctl.c | 14 +++++++------- sys/dev/ena/ena_sysctl.h | 2 +- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index ab1db7e55b9d..fe91e1e6d1ca 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -137,17 +137,17 @@ This can further lead to OS instability, together with ENA driver reset and NVMe timeouts. If network performance is critical and memory capacity is sufficient, the 9k mbufs can be used. -.It Va hw.ena.force_large_llq_headers -Force the driver to use large LLQ headers (224 bytes). -The default is 0. +.It Va hw.ena.force_large_llq_header +Force the driver to use large (224 bytes) or regular (96 bytes) LLQ header size. +The default value is 2 and the recommended LLQ header size will be used. If the node value is set to 0, the regular size LLQ header will be used, which is 96B. In some cases, the packet header can be bigger than this (for example - IPv6 with multiple extensions). -In such a situation, the large LLQ headers should be used by setting this node -value to 1. -This will take effect only if the device supports both LLQ and large LLQ -headers. +In such a situation, the large LLQ header size which is 224B should be used, +and can be forced by setting this node value to 1. +Using large LLQ header size will take effect only if the device supports +both LLQ and large LLQ headers. Otherwise, it will fallback to the no LLQ mode or regular header size. .Pp Increasing LLQ header size reduces the size of the Tx queue by half, so it may diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 951fc6719aa3..ecb1629934b0 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -156,7 +156,7 @@ static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, static int ena_map_llq_mem_bar(device_t, struct ena_com_dev *); static uint32_t ena_calc_max_io_queue_num(device_t, struct ena_com_dev *, struct ena_com_dev_get_features_ctx *); -static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *); +static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *, struct ena_adapter *); static void ena_config_host_info(struct ena_com_dev *, device_t); static int ena_attach(device_t); static int ena_detach(device_t); @@ -2757,27 +2757,32 @@ ena_map_llq_mem_bar(device_t pdev, struct ena_com_dev *ena_dev) } static inline void -set_default_llq_configurations(struct ena_llq_configurations *llq_config, - struct ena_admin_feature_llq_desc *llq) +ena_set_llq_configurations(struct ena_llq_configurations *llq_config, + struct ena_admin_feature_llq_desc *llq, struct ena_adapter *adapter) { llq_config->llq_header_location = ENA_ADMIN_INLINE_HEADER; llq_config->llq_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; llq_config->llq_num_decs_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; - if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != - 0 && ena_force_large_llq_header) { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_256B; - llq_config->llq_ring_entry_size_value = 256; + if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0) { + if ((ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_LARGE) || + (ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT && + llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B)) { + llq_config->llq_ring_entry_size = + ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_config->llq_ring_entry_size_value = 256; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + } } else { llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_128B; llq_config->llq_ring_entry_size_value = 128; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_128B; } } static int -ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx) +ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, struct ena_adapter *adapter) { struct ena_admin_feature_llq_desc *llq = &ctx->get_feat_ctx->llq; struct ena_com_dev *ena_dev = ctx->ena_dev; @@ -2832,22 +2837,20 @@ ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx) max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); /* - * When forcing large headers, we multiply the entry size by 2, + * When using large headers, we multiply the entry size by 2, * and therefore divide the queue size by 2, leaving the amount * of memory used by the queues unchanged. */ - if (ena_force_large_llq_header) { - if ((llq->entry_size_ctrl_supported & - ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0 && - ena_dev->tx_mem_queue_type == + if (adapter->llq_policy == ENA_ADMIN_LIST_ENTRY_SIZE_256B) { + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { max_tx_queue_size /= 2; ena_log(ctx->pdev, INFO, - "Forcing large headers and decreasing maximum Tx queue size to %d\n", + "Using large headers and decreasing maximum Tx queue size to %d\n", max_tx_queue_size); } else { ena_log(ctx->pdev, WARN, - "Forcing large headers failed: LLQ is disabled or device does not support large headers\n"); + "Using large headers failed: LLQ is disabled or device does not support large headers\n"); } } @@ -3003,7 +3006,7 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, *wd_active = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE)); - set_default_llq_configurations(&llq_config, &get_feat_ctx->llq); + ena_set_llq_configurations(&llq_config, &get_feat_ctx->llq, adapter); rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx->llq, &llq_config); @@ -3862,7 +3865,7 @@ ena_attach(device_t pdev) /* Calculate initial and maximum IO queue number and size */ max_num_io_queues = ena_calc_max_io_queue_num(pdev, ena_dev, &get_feat_ctx); - rc = ena_calc_io_queue_size(&calc_queue_ctx); + rc = ena_calc_io_queue_size(&calc_queue_ctx, adapter); if (unlikely((rc != 0) || (max_num_io_queues <= 0))) { rc = EFAULT; goto err_com_free; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 7ec470638859..132d8882f12c 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -173,6 +173,15 @@ enum ena_flags_t { ENA_FLAGS_NUMBER = ENA_FLAG_RSS_ACTIVE }; +enum ena_llq_header_size_policy_t { + /* Policy for Regular LLQ entry size (128B) */ + ENA_LLQ_HEADER_SIZE_POLICY_REGULAR, + /* Policy for Large LLQ entry size (256B) */ + ENA_LLQ_HEADER_SIZE_POLICY_LARGE, + /* Policy for device recommended LLQ entry size */ + ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT +}; + BITSET_DEFINE(_ena_state, ENA_FLAGS_NUMBER); typedef struct _ena_state ena_state_t; @@ -459,6 +468,8 @@ struct ena_adapter { uint8_t mac_addr[ETHER_ADDR_LEN]; /* mdio and phy*/ + uint8_t llq_policy; + ena_state_t flags; /* IRQ CPU affinity */ diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index ce6e0b7375e6..a6076c57e3f5 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -148,17 +148,17 @@ SYSCTL_INT(_hw_ena, OID_AUTO, enable_9k_mbufs, CTLFLAG_RDTUN, &ena_enable_9k_mbufs, 0, "Use 9 kB mbufs for Rx descriptors"); /* - * Force the driver to use large LLQ (Low Latency Queue) header. Defaults to - * false. This option may be important for platforms, which often handle packet - * headers on Tx with total header size greater than 96B, as it may - * reduce the latency. + * Force the driver to use large or regular LLQ (Low Latency Queue) header size. + * Defaults to ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT. This option may be + * important for platforms, which often handle packet headers on Tx with total + * header size greater than 96B, as it may reduce the latency. * It also reduces the maximum Tx queue size by half, so it may cause more Tx * packet drops. */ -bool ena_force_large_llq_header = false; -SYSCTL_BOOL(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, +int ena_force_large_llq_header = ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT; +SYSCTL_INT(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, &ena_force_large_llq_header, 0, - "Increases maximum supported header size in LLQ mode to 224 bytes, while reducing the maximum Tx queue size by half.\n"); + "Change default LLQ entry size received from the device\n"); int ena_rss_table_size = ENA_RX_RSS_TABLE_SIZE; diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index df9cc8cb592f..9dcfa311d73e 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -46,6 +46,6 @@ extern int ena_enable_9k_mbufs; #define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) /* Force the driver to use large LLQ (Low Latency Queue) headers. */ -extern bool ena_force_large_llq_header; +extern int ena_force_large_llq_header; #endif /* !(ENA_SYSCTL_H) */ From nobody Thu Oct 31 16:00:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGk01DYz5bwnd; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGj2Cdqz4PP2; Thu, 31 Oct 2024 16:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3M8EvPs5Ms/2aajTn+mHbROAqtSvOqhwxkDUoRFbcgA=; b=XVQ671szo7N3TGsouT+4owx9CTsMbx9sqdc3Ij8TlWplUWp5NhDxMSpp/36POEX1LaWOXP GvjHnEb4PwJH7CHAlt9IBGRlmoC4cpvOefwJmVnsuQ+nCGCvtJ1kiPxkX7E8v0nLmG/7cU RWZVFrXHBQ1anHmCAXOjlk++x8CORMrW+E6TKiLqOhE1o0Z36/EujEm4KSE1y3pUUCPduu twmnDm9zqo16h17AtZB6EZDVMAxnkh6UOP3UimQy097SSNb7gDVaSbpvFJgdY4fTjiks/+ SpmUpLcq+TDHlWs1lmNTvd/hRWm1XIkpV3ZJehCdmVrlQdGbWaui4EZyWuDr4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3M8EvPs5Ms/2aajTn+mHbROAqtSvOqhwxkDUoRFbcgA=; b=hSTVD8AzZnhDVZH31JadA1eOyhq7TsV6crGGn+QodL96tL1VQPVwyuMd5zREDPGF/GBgfw 8SitXzQl3NpgdI2FEYoipHAPmg8WPv+3AnDcRcpPBiQdTCGWHFjYrVhSSpfC70X1wK0b2G kbI0E1alxGrLNberNSvv8BXJwArfoOf3zbXE4BlXTu1DfBRqGQw6rd1nrPhdJRW1Jqt7ar WNGQyfc6tR7TAGnwdrDz/qurmsaOJE+JgIrRsut+/KzbAHf7DLR7yFAeB5/MfYIdiFYvPA Qtoa1HNml15FwGStjjPQfSXzB/o1piX49lmk3b1wEzlUSOwK1D9koZpeOndhPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390413; a=rsa-sha256; cv=none; b=iwuASxpKrCBUj3ohC+ZpINwKVGLdMq/OmqfmXsFwqfqrArCBJFJqx6eFIkirgDmab3h1jN SQtTC8kQMfwHQwR+2u9PYzwwXWn4QlAYzYy7pl7WVU4KTIuRTfzTecuCWf7gm8pzyGqR+v KQJ5RGieCKUYNf56zyqZZ8w+CSAAQZkKyBJHkGzU6e7NdpBoz5fE9EEK0JCgjrZSFvbXDQ m0gDH2H1tb1U8iRes/BVCclMno3i7pVSnvOcXiQDLFUTASjRM8RissQaubPFET1oqkokN5 l1KsoYVDg+4c+G0Zdy6dzp4Ymiurkk3i6vI8p/0UlSdC0wOijRWoVH+0t59OQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGj1qVLzhdY; Thu, 31 Oct 2024 16:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0DcN064203; Thu, 31 Oct 2024 16:00:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0DUL064194; Thu, 31 Oct 2024 16:00:13 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:13 GMT Message-Id: <202410311600.49VG0DUL064194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: d5141ea592ea - stable/13 - ena: Add support for device request reset message over AENQ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5141ea592eaf1f7fbc24420fb9a6b32fe4b9c7d Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=d5141ea592eaf1f7fbc24420fb9a6b32fe4b9c7d commit d5141ea592eaf1f7fbc24420fb9a6b32fe4b9c7d Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Add support for device request reset message over AENQ This commit adds a handler for the new aenq message ENA_ADMIN_DEVICE_REQUEST_RESET, which in turn causes the driver to trigger reset of a new type: ENA_REGS_RESET_DEVICE_REQUEST. Also adds counting of such occurrences in a new statistic for it. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 705879424bc76fcc925e78eb7643dbf4bd9a11eb) --- sys/dev/ena/ena.c | 13 ++++++++++++- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_sysctl.c | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index b09deb162a12..951fc6719aa3 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2991,7 +2991,8 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, BIT(ENA_ADMIN_WARNING) | BIT(ENA_ADMIN_NOTIFICATION) | BIT(ENA_ADMIN_KEEP_ALIVE) | - BIT(ENA_ADMIN_CONF_NOTIFICATIONS); + BIT(ENA_ADMIN_CONF_NOTIFICATIONS) | + BIT(ENA_ADMIN_DEVICE_REQUEST_RESET); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); @@ -4196,12 +4197,22 @@ static void ena_conf_notification(void *adapter_data, } } +static void ena_admin_device_request_reset(void *adapter_data, + struct ena_admin_aenq_entry *aenq_e) +{ + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + ena_log(adapter->pdev, WARN, + "The device has detected an unhealthy state, reset is requested\n"); + ena_trigger_reset(adapter, ENA_REGS_RESET_DEVICE_REQUEST); +} + static struct ena_aenq_handlers aenq_handlers = { .handlers = { [ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change, [ENA_ADMIN_NOTIFICATION] = ena_notification, [ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd, [ENA_ADMIN_CONF_NOTIFICATIONS] = ena_conf_notification, + [ENA_ADMIN_DEVICE_REQUEST_RESET] = ena_admin_device_request_reset, }, .unimplemented_handler = unimplemented_aenq_handler }; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index c9eb9e8c43d3..7ec470638859 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -396,6 +396,7 @@ struct ena_stats_dev { counter_u64_t rx_desc_malformed; counter_u64_t missing_admin_interrupt; counter_u64_t admin_to; + counter_u64_t device_request_reset; }; struct ena_hw_stats { @@ -558,6 +559,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT, missing_admin_interrupt), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DEVICE_REQUEST, device_request_reset), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index e18328ddc8b2..ce6e0b7375e6 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -301,6 +301,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->missing_admin_interrupt, "Missing admin interrupts count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_to", CTLFLAG_RD, &dev_stats->admin_to, "Admin queue timeouts count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "device_request_reset", CTLFLAG_RD, + &dev_stats->device_request_reset, "Device reset requests count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:00:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGm0nqbz5bwPG; Thu, 31 Oct 2024 16:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGl385Mz4PJj; Thu, 31 Oct 2024 16:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pCl9u+tqvVAv182J+Ejblw3qntXhV1PkWUKTnAnFXg=; b=VMbTUQtcdip+hjzxxupgcBxBr2DIjGNpV36XO1Zcrb7yUVLdEtwwE84md9vlQwYfBYKlad XpCXiIjmT/UASy7fY6zHrFKXGbKkpqboWAIf/LJU4zKLfdS3Tsc1bIVH5VE3wSsDCwPpL0 FB/cHnqmtOWodFMKgOzd/4/zZURSS3M+RpCqz5ZFyc0YNPLj6/CvQP/i/BQFAoHrXAuSRP ZmbpBuXwxy6ABVXSpWG9STOuL8di07ZL7lYdpqIJqoUw+rWYjOVYaCKkth6onunz1qioK+ Wt1rOC7sXUtDHHDRmr7wU4PBtk6UWUeeOjZCQnz3aQoV6vHHw4aMyrCwFMVueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8pCl9u+tqvVAv182J+Ejblw3qntXhV1PkWUKTnAnFXg=; b=ucbeFLCq7T2F2sHFW6DI+/pHmCIpVapj2CdRn/juMmY0A462J1JrQRvrMH+VneC7Du1FIj TifxR6J3esBPgx7VL68nM6v0QPPruvNFgOjFNAK1GJiDv6Yo2/f6sAbrK0fft0R6EofYGX tlOOPs0HD2o+ZRHJUycDY6sdus3Sxb89PwtqGKu/CdVpF3i+blL9y2jpYUSenkVrk//WR2 eLad3yqYAJXXhw3rwHYmUqkdmzDmXx7HouVEi40gQA/dTZKXL5GGP8hmEiEPujeDgQUWVP aoeOIDc0IZAQXsiijl+80nH4gzHhkgoIcYhT3zojzkD61NvemDfHiHl+DZn08w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390415; a=rsa-sha256; cv=none; b=vMw8LIG/7PG9mcXjL7S3oq4z2F2Xdl7nVT2VQ1lRtKd+vYqCss82MyuaXgxtUjnqO4I6PE vOGQLNCspTd+5r7APNPb8uRovjmUPfQgU7aX3kxVIMAKJC37ZkYyankGRl59AmSRajU0pp KGu/wmMrkjl8qpZcgtWvJZyRZ+QDvIHZ46b6i/j6MurGJnClFZmAN07Lk1AAUH7KhYjkJC 6bCLqTvpjcJoVSvpbH+Wgao7E2JylgIbdT2YeVJAgr/I0LOk25RnwQfBd+42PxAS387B3n i4rYH2EiyJXVmIYIz1CELbrkcC/bpx/ZQTWzVsCGfUtzEmaA/ZmbKsmRuR29TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGl2j4Zzj5H; Thu, 31 Oct 2024 16:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0FPQ065642; Thu, 31 Oct 2024 16:00:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0F8W065633; Thu, 31 Oct 2024 16:00:15 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:15 GMT Message-Id: <202410311600.49VG0F8W065633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 8cc3352003fd - stable/13 - ena: Support max large LLQ depth from the device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8cc3352003fd7d93010beb85ea754853007bc493 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8cc3352003fd7d93010beb85ea754853007bc493 commit 8cc3352003fd7d93010beb85ea754853007bc493 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Support max large LLQ depth from the device Large LLQ depth size is currently calculated by dividing the maximum possible size of LLQ by 2. In newer paltforms, starting from r8g the size of BAR2, which contains LLQ, will be increased, and the maximum depth of wide LLQ will be set according to a value set by the device, instead of hardcoded division by 2. The new value will be stored by the device in max_wide_llq_depth field for drivers that expose ENA_ADMIN_LLQ_FEATURE_VERSION_1 or higher to the device. There is an assumption that max_llq_depth >= max_wide_llq_depth, since they both use the same bar, and if it is possible to have a wide LLQ of size max_wide_llq_depth, it is possible to have a normal LLQ of the same size, since it will occupy half of the space. Also moved the large LLQ case calculation of max_tx_queue_size before its rounddown. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit d0419551d96c8f995bdf6388a8e69684be33f9b5) --- sys/dev/ena/ena.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index ecb1629934b0..1455d29a1f4f 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2832,28 +2832,34 @@ ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, struct ena_adapter * max_queues->max_packet_rx_descs); } - /* round down to the nearest power of 2 */ - max_tx_queue_size = 1 << (flsl(max_tx_queue_size) - 1); - max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); - - /* - * When using large headers, we multiply the entry size by 2, - * and therefore divide the queue size by 2, leaving the amount - * of memory used by the queues unchanged. - */ if (adapter->llq_policy == ENA_ADMIN_LIST_ENTRY_SIZE_256B) { - if (ena_dev->tx_mem_queue_type == - ENA_ADMIN_PLACEMENT_POLICY_DEV) { - max_tx_queue_size /= 2; - ena_log(ctx->pdev, INFO, - "Using large headers and decreasing maximum Tx queue size to %d\n", - max_tx_queue_size); + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + if (llq->max_wide_llq_depth != max_tx_queue_size) { + if (llq->max_wide_llq_depth == 0) { + /* if there is no large llq max depth from device, we divide + * the queue size by 2, leaving the amount of memory + * used by the queues unchanged. + */ + max_tx_queue_size /= 2; + } else { + max_tx_queue_size = llq->max_wide_llq_depth; + } + ena_log(ctx->pdev, INFO, + "Using large LLQ headers and decreasing maximum Tx queue size to %d\n", + max_tx_queue_size); + } else { + ena_log(ctx->pdev, INFO, "Using large LLQ headers\n"); + } } else { ena_log(ctx->pdev, WARN, "Using large headers failed: LLQ is disabled or device does not support large headers\n"); } } + /* round down to the nearest power of 2 */ + max_tx_queue_size = 1 << (flsl(max_tx_queue_size) - 1); + max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); + tx_queue_size = clamp_val(tx_queue_size, ENA_MIN_RING_SIZE, max_tx_queue_size); rx_queue_size = clamp_val(rx_queue_size, ENA_MIN_RING_SIZE, From nobody Thu Oct 31 16:00:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGm6xLwz5bwnn; Thu, 31 Oct 2024 16:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGm472vz4PZ5; Thu, 31 Oct 2024 16:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KEGNarfgp8WvEsMYRuRjxSbA1O9IVwdfuUYGUUrjbEc=; b=Nme/fjAVnW2pYrlQRUIvzC1j3HzHkhBPUn11iJS35XoXnAI7JhVzpdvEX3ciLso/Qx64QO 9xNPOPIFMHCMyppfhmv4KvpXlKmWYv6GI/P9FFfa1dLeHPYyzu/prpY+VccbBbBqznwe67 ESqJG4knPKB2br16eiegU6zuJOxPiANO4e3IcWPhppmBq8PpthIISndRb/ch7X9UW/fTqP DMLbhmDaVt6f5h73peMrL3eGCBojOHX2xbCCsF2Al9b2hd8V8bFRnNUeNtuMlXNAU5hSTO YEfInLU3/l320M6xfhPA4SdXgurDXqlpt7pNAueBV5nyg0Ezg59rvzKIjxYQCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KEGNarfgp8WvEsMYRuRjxSbA1O9IVwdfuUYGUUrjbEc=; b=b82UICt51E7zpUqPfv5N0SmDSt1GKBJAHVYs22NGOb3LVuNusEo2n44DnS4wgL5Q5U18Dg 1yOb/qoO48DkS0zaC+1H2wTePu1S8JBAAS8nTSoAUgyF9XD38Lb8Sub6okLil5/fN/huvr mMTIen8AuUsBDui32IhH3m8URskroTntjVoGOQIenbX2WlQymDZAzpTgyIqOoS8ykNqhC2 jNYy44UxOXw9oBD+HQZKBzLkD3jo2UyM7kWqsVmTDLhHvSQkim1NGzkpllp6uHSiNZAhp9 T8Mqah7DmNFdhNoUELrOiKXydZ4RvXRcr1uy4lIgtEhbtxQS/3Do40GRQ5Q8GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390416; a=rsa-sha256; cv=none; b=DgCQO7SXogKr2aP/tI01lr8BC9HtLL+hVwPzkglsZhF8KIwlZga/zq5W8ia5DGxj6WbwtP Je+OahmIAzbAcKAFAzF6kfUVIHPD6elK2AdnDRTR7JrQg3mEb1DNW2Fvu1f8bCDJPQaIAt AzFjQX/COyv2NZ0Ktunw7BoTrdFzZDPdArC52GxsoJMF0e+d6jFU4mMO9ojujDJ+vEH1f1 z9LlNZqRcQyBMJuZwdEhfIi2OW0Yc5TZiNo/zgDg4gva0issJVWarziOIR7SHma7GqeWaK dClVmmY2BqagejYLlLx026E3izXQh6M4Y8durgmhrvle9dedWIi+TlLB1xNRtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGm3hJBzjV9; Thu, 31 Oct 2024 16:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0GQP066305; Thu, 31 Oct 2024 16:00:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0GT4066296; Thu, 31 Oct 2024 16:00:16 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:16 GMT Message-Id: <202410311600.49VG0GT4066296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: db775f50e947 - stable/13 - ena: Fix leaking ifmedia resources on detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db775f50e94744cfedd1f15e3aa5152ab1fbdcde Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=db775f50e94744cfedd1f15e3aa5152ab1fbdcde commit db775f50e94744cfedd1f15e3aa5152ab1fbdcde Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:21 +0000 ena: Fix leaking ifmedia resources on detach ifmedia_add() allocates an ifmedia_entry during ena_attach. Current code doesn't release this memory during ena_detach() This commit calls ifmedia_removeall() to properly free the allocated memory during ena_detach(). Also, in case ena_attach fails, we need to detach ifmedia which was allocated within ena_setup_ifnet(). This bug was first described in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278100 Reviewed by: zlei Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 449496eb28daec8d5b852fa4be1e337c2957345c) --- sys/dev/ena/ena.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 1455d29a1f4f..a0d3cf28861e 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3982,6 +3982,7 @@ ena_attach(device_t pdev) #ifdef DEV_NETMAP err_detach: ether_ifdetach(adapter->ifp); + ifmedia_removeall(&adapter->media); free(adapter->customer_metrics_array, M_DEVBUF); #endif /* DEV_NETMAP */ err_metrics_buffer_destroy: @@ -4032,6 +4033,8 @@ ena_detach(device_t pdev) ether_ifdetach(adapter->ifp); + ifmedia_removeall(&adapter->media); + /* Stop timer service */ ENA_LOCK_LOCK(); ENA_TIMER_DRAIN(adapter); From nobody Thu Oct 31 16:00:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGp3GWXz5bwPL; Thu, 31 Oct 2024 16:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGn4dtpz4PTc; Thu, 31 Oct 2024 16:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ljw40mi+lPlQjT6+Lvs/wpRwdHuGIzUqxMLdEKZQO68=; b=w7jhSM0xs2MNVoFTsqfMbgCTnEQjbxnK7ulhQD/v0+tN/NE1QP9K/0FSDpwyJ+OqSh/F8O iUz2S/ZzDxbEmJ8EnUkGiFhHQW3TsCQIhN1tO4IXR1d8kRDCftOh9TuPk1imd6ohCcAkEn 7GtwyPHx+pwp35IDHOUpuE5soW9/YzhWy4Q1xPpTVeAsbQGPb2z9lvfmZLXOgToFwpiND9 1BDWkn6wlsi/HkpjiCMX09fnW1NTY9ea5Rg9n/J+TRhhmaESjPUDPGIHHb44ktADWTR9Uk iiR3YqBXfUAP/YRUx91bJkMREFsJWTWuE85uMN3SimD3a/lGGjuBNrYUNE8nvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ljw40mi+lPlQjT6+Lvs/wpRwdHuGIzUqxMLdEKZQO68=; b=wgcxTuU4d+NoJnImamXJLbRrRPdbG8NgknTfFqHGgo3aXS2lXFd8RZDnk1BsHrnY6FGvU4 MQq0qUyz9JfkuI+EDBF1KSGLhgzSUSjIJ7vV/uUoyt4kVer3CkL0antQE5bhywS6ZD/g+k g3CFzUuM+8kIdfogRa8TkKoc1IuRHU+D8uYGhjgFSXz/rZEj/tgs8eiIPytB56uO9AGA9q km4KPgMcNmMne9xnJc2VRIP73Ko2Hwmh1t07T5b4+jhNAaRskwbID8ad5B4nUCy+llfdvI r4VOo14VQIbPMbrifCERbYqQGWNwWVyALSvVL5JnbANSyqTXPeBig9ZPhJr6mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390417; a=rsa-sha256; cv=none; b=fbfYmwfCBUCv+zqCf3kx/LDSbZ3+fkUOXwa9/m9su5K9dOpHfwwO9gH/xWfWKiYVeZweTv LON1eXYAX3VsnOzRTJCgODnuNwDTqbS2l+CVrgfBOPNRDZXw0JnBAg4Vn4kEEnPjhmLqyY mzhU5qJpwHtqEt+9hAJ7bsQ5Pyccj81699EPTx9AVDkHJYFufyGzH6yUL0gIKgcQ3cONAH EKLJu/zl0exzj72VhlJ15Sbh9QbVND3Bua22Int6cwURvg2Fulkza/TKzDv/iSxA3VTBOS EtkuXigQCP1LGsEe8gTelgqk9x8f+wCGQqY9ICqjVJ1+709Bu9n7t+CFbhHiGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGn4Fj9zj5J; Thu, 31 Oct 2024 16:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG0HEt066919; Thu, 31 Oct 2024 16:00:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG0HBs066914; Thu, 31 Oct 2024 16:00:17 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:17 GMT Message-Id: <202410311600.49VG0HBs066914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 2e7ba5d93e2d - stable/13 - ena: Update driver version to v2.8.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e7ba5d93e2d55e5d20aaa43fd5a3b67dd7bf25a Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7ba5d93e2d55e5d20aaa43fd5a3b67dd7bf25a commit 2e7ba5d93e2d55e5d20aaa43fd5a3b67dd7bf25a Author: osamaabb AuthorDate: 2024-08-07 08:06:49 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:21 +0000 ena: Update driver version to v2.8.0 Features: * Add support for device request reset message over AENQ * Support LLQ entry size recommendation from device * Support max large LLQ depth from the device * Expand PHC infrastructures * Configuration notification support Bug Fixes: * Fix leaking ifmedia resources on detach * Fix netmap socket chain unmapping issue * Properly reinit netmap structs upon sysctl changes * Correctly count missing TX completions Minor Changes: * Add reset reason for corrupted TX/RX completion descriptors * Add reset reason for missing admin interrupts * Improve reset reason statistics * Update licenses Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit ce4cc746bb4171a131ab9099947a500c0de18ff4) --- sys/dev/ena/ena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 132d8882f12c..06bdfad97ed4 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -38,7 +38,7 @@ #include "ena-com/ena_eth_com.h" #define ENA_DRV_MODULE_VER_MAJOR 2 -#define ENA_DRV_MODULE_VER_MINOR 7 +#define ENA_DRV_MODULE_VER_MINOR 8 #define ENA_DRV_MODULE_VER_SUBMINOR 0 #define ENA_DRV_MODULE_NAME "ena" From nobody Thu Oct 31 16:01:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ04H1lz5bwp9; Thu, 31 Oct 2024 16:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ027C0z4Sn5; Thu, 31 Oct 2024 16:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390480; h=from:from:reply-to:subject:subject: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+q9Chs+KtKBJKT4oEQhIcaB6auSJgsog3XSrAlKXQc=; b=FJWwVXYj0VvOZgqHU5eV99uiZQ7dbO8EChsoTB+sGdfWiDb8ey+6sbd3/OnfPwHwggm3g9 Ce+aR764buN5VNyyCJ1rhCEd9l83fTUtpJZl/mr/zBObEPQ0CcIFtYeoRu/hmlcFQAgnHw GVZkz4+anJ5tnK3wxssGNd/YdefNnRH26jbzf7NNII9P3hCWjL176j2LOIOiPadOd9jU/6 VmxA8/yw25Qc+jMIrnIc8I9qzw7tyeBPt1WL+NgKjDrrSGDEzjPGy/Mhw942L7oC8KgBV8 H7vuf54QSgvdeNj3I/c4f4hgmdol8BDdxhRmoTMqkVgdWD1qPW8fO4NCbTZaRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390480; h=from:from:reply-to:subject:subject: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+q9Chs+KtKBJKT4oEQhIcaB6auSJgsog3XSrAlKXQc=; b=rQS+/4u5kLNqJ/sRwQeeiLKDzF78fTa3W7+/i3Ba9rsJHbDQNsD1RyFmWJxjBw38jUO1gc 9UQeh+uK3rcafAXTx6EFQha3tRlSaFpfeqOo8POa+0eF1LfKzoL0AgkTOrsJdUa4qKJFlD atxjMKGrDgVOJDzhKzairun46U54vcA/XbPr9fEk2X8/xmU1lraxr1TKGYAxFPW6vW579H 8VC4E/ZDIhM+NlvkmrdIUYdfvlh+BqjczIQPduOljL1I2biPjNgBgexmEZ4pWSSqzIM0j/ SCGy6e1mW3qzF6J7THYJGrFcOcooiq2a4o9kGLXX6epLru/5v8s9rQ3RtgSO/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390480; a=rsa-sha256; cv=none; b=UqCEvsoawCGRFjrO92nkfcVvQtacqE16b53UxGc/GE/j0WL4SP9K/al4wHUPU/EaPhFLvV bJdFvnT1mkKVYONYrBszcxq7Cz+kgFszMH1ZNhhVIeGitMLdHs3S3DhbfQdgsNys6sB0dg RET/tDC7V24A7vKvMy6cwLXHuY8mrXckEo8KaBiueGAw8D1EDucEDUMG9M2Af5n/rS1vG9 oJBAVd/BM+kd9661hgbP9cxlg6ewBVsvBWgIe1wOGikBFOUACz3dOLZ1j1YIC/DQpAob3x ADZCP2Wbs31bCEvHrLDcpWYv/Sk1lcpGK3bVokOsbvM8m50LxJCxvtfAXSajYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ019DKzjsd; Thu, 31 Oct 2024 16:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1KRc069805; Thu, 31 Oct 2024 16:01:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1K7g069802; Thu, 31 Oct 2024 16:01:20 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:20 GMT Message-Id: <202410311601.49VG1K7g069802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 699706f80be9 - stable/14 - ena: Upgrade ena-com to freebsd v2.8.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 699706f80be9f8f8559f17f1db554b1671043ac4 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=699706f80be9f8f8559f17f1db554b1671043ac4 commit 699706f80be9f8f8559f17f1db554b1671043ac4 Author: Osama Abboud AuthorDate: 2024-10-15 17:02:26 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Upgrade ena-com to freebsd v2.8.0 Merge commit '0fd934a2fd12fa74ae409d3de1313e449be5d97e' Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f5f8d7c9cdf0341f7c5fdb3a7c3358ec0ed67a0c) --- sys/contrib/ena-com/ena_com.c | 257 ++++++++++++++++++------- sys/contrib/ena-com/ena_com.h | 61 +++++- sys/contrib/ena-com/ena_defs/ena_admin_defs.h | 112 ++++++++--- sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h | 43 ++++- sys/contrib/ena-com/ena_defs/ena_gen_info.h | 34 ---- sys/contrib/ena-com/ena_defs/ena_regs_defs.h | 5 + sys/contrib/ena-com/ena_eth_com.c | 38 ++-- sys/contrib/ena-com/ena_eth_com.h | 19 +- sys/contrib/ena-com/ena_plat.h | 7 +- 9 files changed, 425 insertions(+), 151 deletions(-) diff --git a/sys/contrib/ena-com/ena_com.c b/sys/contrib/ena-com/ena_com.c index 91c711eaa438..ae952c4e4435 100644 --- a/sys/contrib/ena-com/ena_com.c +++ b/sys/contrib/ena-com/ena_com.c @@ -70,15 +70,19 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_MAX_BACKOFF_DELAY_EXP 16U + #define ENA_MIN_ADMIN_POLL_US 100 #define ENA_MAX_ADMIN_POLL_US 5000 /* PHC definitions */ -#define ENA_PHC_DEFAULT_EXPIRE_TIMEOUT_USEC 20 +#define ENA_PHC_DEFAULT_EXPIRE_TIMEOUT_USEC 10 #define ENA_PHC_DEFAULT_BLOCK_TIMEOUT_USEC 1000 -#define ENA_PHC_TIMESTAMP_ERROR 0xFFFFFFFFFFFFFFFF +#define ENA_PHC_MAX_ERROR_BOUND 0xFFFFFFFF #define ENA_PHC_REQ_ID_OFFSET 0xDEAD +#define ENA_PHC_ERROR_FLAGS (ENA_ADMIN_PHC_ERROR_FLAG_TIMESTAMP | \ + ENA_ADMIN_PHC_ERROR_FLAG_ERROR_BOUND) /*****************************************************************************/ /*****************************************************************************/ @@ -111,7 +115,7 @@ static int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, struct ena_common_mem_addr *ena_addr, dma_addr_t addr) { - if ((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr) { + if (unlikely((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr)) { ena_trc_err(ena_dev, "DMA address has more bits that the device supports\n"); return ENA_COM_INVAL; } @@ -131,7 +135,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_queue *admin_queue) ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, sq->entries, sq->dma_addr, sq->mem_handle); - if (!sq->entries) { + if (unlikely(!sq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -154,7 +158,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_queue *admin_queue) ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, cq->entries, cq->dma_addr, cq->mem_handle); - if (!cq->entries) { + if (unlikely(!cq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -179,7 +183,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, aenq->dma_addr, aenq->mem_handle); - if (!aenq->entries) { + if (unlikely(!aenq->entries)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -213,6 +217,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, static void comp_ctxt_release(struct ena_com_admin_queue *queue, struct ena_comp_ctx *comp_ctx) { + comp_ctx->user_cqe = NULL; comp_ctx->occupied = false; ATOMIC32_DEC(&queue->outstanding_cmds); } @@ -264,7 +269,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu /* In case of queue FULL */ cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); - if (cnt >= admin_queue->q_depth) { + if (unlikely(cnt >= admin_queue->q_depth)) { ena_trc_dbg(admin_queue->ena_dev, "Admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(ENA_COM_NO_SPACE); @@ -388,7 +393,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, io_sq->desc_addr.mem_handle); } - if (!io_sq->desc_addr.virt_addr) { + if (unlikely(!io_sq->desc_addr.virt_addr)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -413,7 +418,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, if (!io_sq->bounce_buf_ctrl.base_buffer) io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); - if (!io_sq->bounce_buf_ctrl.base_buffer) { + if (unlikely(!io_sq->bounce_buf_ctrl.base_buffer)) { ena_trc_err(ena_dev, "Bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -478,7 +483,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, ENA_CDESC_RING_SIZE_ALIGNMENT); } - if (!io_cq->cdesc_addr.virt_addr) { + if (unlikely(!io_cq->cdesc_addr.virt_addr)) { ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -506,6 +511,9 @@ static void ena_com_handle_single_admin_completion(struct ena_com_admin_queue *a return; } + if (!comp_ctx->occupied) + return; + comp_ctx->status = ENA_CMD_COMPLETED; comp_ctx->comp_status = cqe->acq_common_descriptor.status; @@ -581,8 +589,9 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) { + exp = ENA_MIN32(ENA_MAX_BACKOFF_DELAY_EXP, exp); delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us); - delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US); + delay_us = ENA_MIN32(ENA_MAX_ADMIN_POLL_US, delay_us * (1U << exp)); ENA_USLEEP(delay_us); } @@ -604,7 +613,7 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c if (comp_ctx->status != ENA_CMD_SUBMITTED) break; - if (ENA_TIME_EXPIRE(timeout)) { + if (unlikely(ENA_TIME_EXPIRE(timeout))) { ena_trc_err(admin_queue->ena_dev, "Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ @@ -803,7 +812,7 @@ static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); - if (rc) + if (unlikely(rc)) ena_trc_err(ena_dev, "Cannot set LLQ configuration: %d\n", rc); return rc; @@ -830,6 +839,7 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); if (comp_ctx->status == ENA_CMD_COMPLETED) { + admin_queue->is_missing_admin_interrupt = true; ena_trc_err(admin_queue->ena_dev, "The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); @@ -850,8 +860,19 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com ret = ENA_COM_TIMER_EXPIRED; goto err; } + } else if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { + ena_trc_err(admin_queue->ena_dev, "Command was aborted\n"); + ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); + admin_queue->stats.aborted_cmd++; + ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); + ret = ENA_COM_NO_DEVICE; + goto err; } + ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED, + admin_queue->ena_dev, "Invalid comp status %d\n", + comp_ctx->status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); @@ -909,7 +930,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset) goto err; } - if (read_resp->reg_off != offset) { + if (unlikely(read_resp->reg_off != offset)) { ena_trc_err(ena_dev, "Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { @@ -1033,7 +1054,7 @@ static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, exp_state) return 0; - if (ENA_TIME_EXPIRE(timeout_stamp)) + if (unlikely(ENA_TIME_EXPIRE(timeout_stamp))) return ENA_COM_TIMER_EXPIRED; ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); @@ -1494,7 +1515,7 @@ int ena_com_get_io_handlers(struct ena_com_dev *ena_dev, u16 qid, struct ena_com_io_sq **io_sq, struct ena_com_io_cq **io_cq) { - if (qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Invalid queue number %d but the max is %d\n", qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; @@ -1602,7 +1623,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) int ret; ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); - if (ret) { + if (unlikely(ret)) { ena_trc_info(ena_dev, "Can't get aenq configuration\n"); return ret; } @@ -1649,7 +1670,7 @@ int ena_com_get_dma_width(struct ena_com_dev *ena_dev) ena_trc_dbg(ena_dev, "ENA dma width: %d\n", width); - if ((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS) { + if (unlikely((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS)) { ena_trc_err(ena_dev, "DMA width illegal value: %d\n", width); return ENA_COM_INVAL; } @@ -1811,16 +1832,21 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) struct ena_admin_set_feat_cmd set_feat_cmd; int ret = 0; - /* Get device PHC default configuration */ - ret = ena_com_get_feature(ena_dev, &get_feat_resp, ENA_ADMIN_PHC_CONFIG, 0); + /* Get default device PHC configuration */ + ret = ena_com_get_feature(ena_dev, + &get_feat_resp, + ENA_ADMIN_PHC_CONFIG, + ENA_ADMIN_PHC_FEATURE_VERSION_0); if (unlikely(ret)) { ena_trc_err(ena_dev, "Failed to get PHC feature configuration, error: %d\n", ret); return ret; } - /* Suporting only readless PHC retrieval */ - if (get_feat_resp.u.phc.type != ENA_ADMIN_PHC_TYPE_READLESS) { - ena_trc_err(ena_dev, "Unsupprted PHC type, error: %d\n", ENA_COM_UNSUPPORTED); + /* Supporting only PHC V0 (readless mode with error bound) */ + if (get_feat_resp.u.phc.version != ENA_ADMIN_PHC_FEATURE_VERSION_0) { + ena_trc_err(ena_dev, "Unsupprted PHC version (0x%X), error: %d\n", + get_feat_resp.u.phc.version, + ENA_COM_UNSUPPORTED); return ENA_COM_UNSUPPORTED; } @@ -1837,11 +1863,11 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) get_feat_resp.u.phc.block_timeout_usec : ENA_PHC_DEFAULT_BLOCK_TIMEOUT_USEC; - /* Sanity check - expire timeout must not be above skip timeout */ + /* Sanity check - expire timeout must not exceed block timeout */ if (phc->expire_timeout_usec > phc->block_timeout_usec) phc->expire_timeout_usec = phc->block_timeout_usec; - /* Prepare PHC feature command with PHC output address */ + /* Prepare PHC config feature command */ memset(&set_feat_cmd, 0x0, sizeof(set_feat_cmd)); set_feat_cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; set_feat_cmd.feat_common.feature_id = ENA_ADMIN_PHC_CONFIG; @@ -1873,13 +1899,16 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) void ena_com_phc_destroy(struct ena_com_dev *ena_dev) { struct ena_com_phc_info *phc = &ena_dev->phc; - - phc->active = false; + unsigned long flags = 0; /* In case PHC is not supported by the device, silently exiting */ if (!phc->virt_addr) return; + ENA_SPINLOCK_LOCK(phc->lock, flags); + phc->active = false; + ENA_SPINLOCK_UNLOCK(phc->lock, flags); + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, sizeof(*phc->virt_addr), phc->virt_addr, @@ -1890,15 +1919,14 @@ void ena_com_phc_destroy(struct ena_com_dev *ena_dev) ENA_SPINLOCK_DESTROY(phc->lock); } -int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) +int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp) { volatile struct ena_admin_phc_resp *read_resp = ena_dev->phc.virt_addr; + const ena_time_high_res_t zero_system_time = ENA_TIME_INIT_HIGH_RES(); struct ena_com_phc_info *phc = &ena_dev->phc; - ena_time_high_res_t initial_time = ENA_TIME_INIT_HIGH_RES(); - static ena_time_high_res_t start_time; - unsigned long flags = 0; ena_time_high_res_t expire_time; ena_time_high_res_t block_time; + unsigned long flags = 0; int ret = ENA_COM_OK; if (!phc->active) { @@ -1909,9 +1937,10 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) ENA_SPINLOCK_LOCK(phc->lock, flags); /* Check if PHC is in blocked state */ - if (unlikely(ENA_TIME_COMPARE_HIGH_RES(start_time, initial_time))) { + if (unlikely(ENA_TIME_COMPARE_HIGH_RES(phc->system_time, zero_system_time))) { /* Check if blocking time expired */ - block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->block_timeout_usec); + block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, + phc->block_timeout_usec); if (!ENA_TIME_EXPIRE_HIGH_RES(block_time)) { /* PHC is still in blocked state, skip PHC request */ phc->stats.phc_skp++; @@ -1919,9 +1948,9 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) goto skip; } - /* PHC is in active state, update statistics according to req_id and timestamp */ + /* PHC is in active state, update statistics according to req_id and error_flags */ if ((READ_ONCE16(read_resp->req_id) != phc->req_id) || - (read_resp->timestamp == ENA_PHC_TIMESTAMP_ERROR)) { + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) { /* Device didn't update req_id during blocking time or timestamp is invalid, * this indicates on a device error */ @@ -1933,9 +1962,9 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) } /* Setting relative timeouts */ - start_time = ENA_GET_SYSTEM_TIME_HIGH_RES(); - block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->block_timeout_usec); - expire_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(start_time, phc->expire_timeout_usec); + phc->system_time = ENA_GET_SYSTEM_TIME_HIGH_RES(); + block_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, phc->block_timeout_usec); + expire_time = ENA_GET_SYSTEM_TIMEOUT_HIGH_RES(phc->system_time, phc->expire_timeout_usec); /* We expect the device to return this req_id once the new PHC timestamp is updated */ phc->req_id++; @@ -1952,35 +1981,45 @@ int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp) while (1) { if (unlikely(ENA_TIME_EXPIRE_HIGH_RES(expire_time))) { /* Gave up waiting for updated req_id, PHC enters into blocked state until - * passing blocking time + * passing blocking time, during this time any get PHC timestamp or + * error bound requests will fail with device busy error */ + phc->error_bound = ENA_PHC_MAX_ERROR_BOUND; ret = ENA_COM_DEVICE_BUSY; break; } /* Check if req_id was updated by the device */ if (READ_ONCE16(read_resp->req_id) != phc->req_id) { - /* req_id was not updated by the device, check again on next loop */ + /* req_id was not updated by the device yet, check again on next loop */ continue; } - /* req_id was updated which indicates that PHC timestamp was updated too */ - *timestamp = read_resp->timestamp; - - /* PHC timestamp validty check */ - if (unlikely(*timestamp == ENA_PHC_TIMESTAMP_ERROR)) { - /* Retrieved invalid PHC timestamp, PHC enters into blocked state until - * passing blocking time + /* req_id was updated by the device which indicates that PHC timestamp, error_bound + * and error_flags are updated too, checking errors before retrieving timestamp and + * error_bound values + */ + if (unlikely(read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) { + /* Retrieved timestamp or error bound errors, PHC enters into blocked state + * until passing blocking time, during this time any get PHC timestamp or + * error bound requests will fail with device busy error */ + phc->error_bound = ENA_PHC_MAX_ERROR_BOUND; ret = ENA_COM_DEVICE_BUSY; break; } - /* Retrieved valid PHC timestamp */ + /* PHC timestamp value is returned to the caller */ + *timestamp = read_resp->timestamp; + + /* Error bound value is cached for future retrieval by caller */ + phc->error_bound = read_resp->error_bound; + + /* Update statistic on valid PHC timestamp retrieval */ phc->stats.phc_cnt++; /* This indicates PHC state is active */ - start_time = initial_time; + phc->system_time = zero_system_time; break; } @@ -1990,6 +2029,24 @@ skip: return ret; } +int ena_com_phc_get_error_bound(struct ena_com_dev *ena_dev, u32 *error_bound) +{ + struct ena_com_phc_info *phc = &ena_dev->phc; + u32 local_error_bound = phc->error_bound; + + if (!phc->active) { + ena_trc_err(ena_dev, "PHC feature is not active in the device\n"); + return ENA_COM_UNSUPPORTED; + } + + if (local_error_bound == ENA_PHC_MAX_ERROR_BOUND) + return ENA_COM_DEVICE_BUSY; + + *error_bound = local_error_bound; + + return ENA_COM_OK; +} + int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev) { struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read; @@ -2083,15 +2140,15 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ENA_SPINLOCK_INIT(admin_queue->q_lock); ret = ena_com_init_comp_ctxt(admin_queue); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_admin_init_sq(admin_queue); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_admin_init_cq(admin_queue); - if (ret) + if (unlikely(ret)) goto error; admin_queue->sq.db_addr = (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + @@ -2124,11 +2181,12 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ENA_REG_WRITE32(ena_dev->bus, aq_caps, ena_dev->reg_bar + ENA_REGS_AQ_CAPS_OFF); ENA_REG_WRITE32(ena_dev->bus, acq_caps, ena_dev->reg_bar + ENA_REGS_ACQ_CAPS_OFF); ret = ena_com_admin_init_aenq(ena_dev, aenq_handlers); - if (ret) + if (unlikely(ret)) goto error; admin_queue->ena_dev = ena_dev; admin_queue->running_state = true; + admin_queue->is_missing_admin_interrupt = false; return 0; error: @@ -2144,7 +2202,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, struct ena_com_io_cq *io_cq; int ret; - if (ctx->qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(ctx->qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", ctx->qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; @@ -2175,18 +2233,18 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, ENA_MIN32(ena_dev->tx_max_header_size, SZ_256); ret = ena_com_init_io_sq(ena_dev, ctx, io_sq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_init_io_cq(ena_dev, ctx, io_cq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_create_io_cq(ena_dev, io_cq); - if (ret) + if (unlikely(ret)) goto error; ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx); - if (ret) + if (unlikely(ret)) goto destroy_io_cq; return 0; @@ -2203,7 +2261,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_dev, u16 qid) struct ena_com_io_sq *io_sq; struct ena_com_io_cq *io_cq; - if (qid >= ENA_TOTAL_NUM_QUEUES) { + if (unlikely(qid >= ENA_TOTAL_NUM_QUEUES)) { ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", qid, ENA_TOTAL_NUM_QUEUES); return; @@ -2345,7 +2403,8 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, else return rc; - rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_LLQ, 0); + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_LLQ, ENA_ADMIN_LLQ_FEATURE_VERSION_1); if (!rc) memcpy(&get_feat_ctx->llq, &get_resp.u.llq, sizeof(get_resp.u.llq)); @@ -2400,8 +2459,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) /* Go over all the events */ while ((READ_ONCE8(aenq_common->flags) & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { - /* Make sure the phase bit (ownership) is as expected before - * reading the rest of the descriptor. + /* Make sure the device finished writing the rest of the descriptor + * before reading it. */ dma_rmb(); @@ -2443,6 +2502,45 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) ena_dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); mmiowb(); } + +bool ena_com_aenq_has_keep_alive(struct ena_com_dev *ena_dev) +{ + struct ena_admin_aenq_common_desc *aenq_common; + struct ena_com_aenq *aenq = &ena_dev->aenq; + struct ena_admin_aenq_entry *aenq_e; + u8 phase = aenq->phase; + u16 masked_head; + + masked_head = aenq->head & (aenq->q_depth - 1); + aenq_e = &aenq->entries[masked_head]; /* Get first entry */ + aenq_common = &aenq_e->aenq_common_desc; + + /* Go over all the events */ + while ((READ_ONCE8(aenq_common->flags) & + ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { + /* Make sure the device finished writing the rest of the descriptor + * before reading it. + */ + dma_rmb(); + + if (aenq_common->group == ENA_ADMIN_KEEP_ALIVE) + return true; + + /* Get next event entry */ + masked_head++; + + if (unlikely(masked_head == aenq->q_depth)) { + masked_head = 0; + phase = !phase; + } + + aenq_e = &aenq->entries[masked_head]; + aenq_common = &aenq_e->aenq_common_desc; + } + + return false; +} + #ifdef ENA_EXTENDED_STATS /* * Sets the function Idx and Queue Idx to be used for @@ -2468,6 +2566,7 @@ int ena_com_extended_stats_set_func_queue(struct ena_com_dev *ena_dev, int ena_com_dev_reset(struct ena_com_dev *ena_dev, enum ena_regs_reset_reason_types reset_reason) { + u32 reset_reason_msb, reset_reason_lsb; u32 stat, timeout, cap, reset_val; int rc; @@ -2494,8 +2593,28 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, /* start reset */ reset_val = ENA_REGS_DEV_CTL_DEV_RESET_MASK; - reset_val |= (reset_reason << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT) & - ENA_REGS_DEV_CTL_RESET_REASON_MASK; + + /* For backward compatibility, device will interpret + * bits 24-27 as MSB, bits 28-31 as LSB + */ + reset_reason_lsb = ENA_FIELD_GET(reset_reason, ENA_RESET_REASON_LSB_MASK, + ENA_RESET_REASON_LSB_OFFSET); + + reset_reason_msb = ENA_FIELD_GET(reset_reason, ENA_RESET_REASON_MSB_MASK, + ENA_RESET_REASON_MSB_OFFSET); + + reset_val |= reset_reason_lsb << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT; + + if (ena_com_get_cap(ena_dev, ENA_ADMIN_EXTENDED_RESET_REASONS)) + reset_val |= reset_reason_msb << ENA_REGS_DEV_CTL_RESET_REASON_EXT_SHIFT; + else if (reset_reason_msb) { + /* In case the device does not support intended + * extended reset reason fallback to generic + */ + reset_val = ENA_REGS_DEV_CTL_DEV_RESET_MASK; + reset_val |= (ENA_REGS_RESET_GENERIC << ENA_REGS_DEV_CTL_RESET_REASON_SHIFT) & + ENA_REGS_DEV_CTL_RESET_REASON_MASK; + } ENA_REG_WRITE32(ena_dev->bus, reset_val, ena_dev->reg_bar + ENA_REGS_DEV_CTL_OFF); /* Write again the MMIO read request address */ @@ -2503,7 +2622,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, rc = wait_for_reset_state(ena_dev, timeout, ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK); - if (rc != 0) { + if (unlikely(rc)) { ena_trc_err(ena_dev, "Reset indication didn't turn on\n"); return rc; } @@ -2511,7 +2630,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, /* reset done */ ENA_REG_WRITE32(ena_dev->bus, 0, ena_dev->reg_bar + ENA_REGS_DEV_CTL_OFF); rc = wait_for_reset_state(ena_dev, timeout, 0); - if (rc != 0) { + if (unlikely(rc)) { ena_trc_err(ena_dev, "Reset indication didn't turn off\n"); return rc; } @@ -2614,7 +2733,7 @@ int ena_com_get_dev_extended_stats(struct ena_com_dev *ena_dev, char *buff, ret = ena_get_dev_stats(ena_dev, &ctx, ENA_ADMIN_GET_STATS_TYPE_EXTENDED); - if (ret < 0) + if (unlikely(ret < 0)) goto free_ext_stats_mem; ret = snprintf(buff, len, "%s", (char *)virt_addr); @@ -3222,7 +3341,7 @@ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev) customer_metrics->buffer_virt_addr, customer_metrics->buffer_dma_addr, customer_metrics->buffer_dma_handle); - if (!customer_metrics->buffer_virt_addr) + if (unlikely(!customer_metrics->buffer_virt_addr)) return ENA_COM_NO_MEM; return 0; @@ -3416,7 +3535,7 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, } rc = ena_com_config_llq_info(ena_dev, llq_features, llq_default_cfg); - if (rc) + if (unlikely(rc)) return rc; ena_dev->tx_max_header_size = llq_info->desc_list_entry_size - diff --git a/sys/contrib/ena-com/ena_com.h b/sys/contrib/ena-com/ena_com.h index 5b091c64572c..87d0662351b0 100644 --- a/sys/contrib/ena-com/ena_com.h +++ b/sys/contrib/ena-com/ena_com.h @@ -51,6 +51,14 @@ #define ADMIN_CQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_acq_entry)) #define ADMIN_AENQ_SIZE(depth) ((depth) * sizeof(struct ena_admin_aenq_entry)) +/* Macros used to extract LSB/MSB from the + * enums defining the reset reasons + */ +#define ENA_RESET_REASON_LSB_OFFSET 0 +#define ENA_RESET_REASON_LSB_MASK 0xf +#define ENA_RESET_REASON_MSB_OFFSET 4 +#define ENA_RESET_REASON_MSB_MASK 0xf0 + #define ENA_CUSTOMER_METRICS_BUFFER_SIZE 512 /*****************************************************************************/ @@ -257,6 +265,8 @@ struct ena_com_admin_queue { */ bool running_state; + bool is_missing_admin_interrupt; + /* Count the number of outstanding admin commands */ ena_atomic32_t outstanding_cmds; @@ -294,6 +304,9 @@ struct ena_com_phc_info { /* PHC shared memory - virtual address */ struct ena_admin_phc_resp *virt_addr; + /* System time of last PHC request */ + ena_time_high_res_t system_time; + /* Spin lock to ensure a single outstanding PHC read */ ena_spinlock_t lock; @@ -313,17 +326,20 @@ struct ena_com_phc_info { */ u32 block_timeout_usec; + /* PHC shared memory - physical address */ + dma_addr_t phys_addr; + + /* PHC shared memory handle */ + ena_mem_handle_t mem_handle; + + /* Cached error bound per timestamp sample */ + u32 error_bound; + /* Request id sent to the device */ u16 req_id; /* True if PHC is active in the device */ bool active; - - /* PHC shared memory - memory handle */ - ena_mem_handle_t mem_handle; - - /* PHC shared memory - physical address */ - dma_addr_t phys_addr; }; struct ena_rss { @@ -488,12 +504,19 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev); */ void ena_com_phc_destroy(struct ena_com_dev *ena_dev); -/* ena_com_phc_get - Retrieve PHC timestamp +/* ena_com_phc_get_timestamp - Retrieve PHC timestamp * @ena_dev: ENA communication layer struct - * @timestamp: Retrieve PHC timestamp + * @timestamp: Retrieved PHC timestamp * @return - 0 on success, negative value on failure */ -int ena_com_phc_get(struct ena_com_dev *ena_dev, u64 *timestamp); +int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp); + +/* ena_com_phc_get_error_bound - Retrieve cached PHC error bound + * @ena_dev: ENA communication layer struct + * @error_bound: Cached PHC error bound + * @return - 0 on success, negative value on failure + */ +int ena_com_phc_get_error_bound(struct ena_com_dev *ena_dev, u32 *error_bound); /* ena_com_set_mmio_read_mode - Enable/disable the indirect mmio reg read mechanism * @ena_dev: ENA communication layer struct @@ -644,6 +667,16 @@ void ena_com_admin_q_comp_intr_handler(struct ena_com_dev *ena_dev); */ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data); +/* ena_com_aenq_has_keep_alive - Retrieve if there is a keep alive notification in the aenq + * @ena_dev: ENA communication layer struct + * + * This method goes over the async event notification queue and returns if there + * is a keep alive notification. + * + * @return - true if there is a keep alive notification in the aenq or false otherwise + */ +bool ena_com_aenq_has_keep_alive(struct ena_com_dev *ena_dev); + /* ena_com_abort_admin_commands - Abort all the outstanding admin commands. * @ena_dev: ENA communication layer struct * @@ -1096,6 +1129,16 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, struct ena_admin_feature_llq_desc *llq_features, struct ena_llq_configurations *llq_default_config); +/* ena_com_get_missing_admin_interrupt - Return if there is a missing admin interrupt + * @ena_dev: ENA communication layer struct + * + * @return - true if there is a missing admin interrupt or false otherwise + */ +static inline bool ena_com_get_missing_admin_interrupt(struct ena_com_dev *ena_dev) +{ + return ena_dev->admin_queue.is_missing_admin_interrupt; +} + /* ena_com_io_sq_to_ena_dev - Extract ena_com_dev using contained field io_sq. * @io_sq: IO submit queue struct * diff --git a/sys/contrib/ena-com/ena_defs/ena_admin_defs.h b/sys/contrib/ena-com/ena_defs/ena_admin_defs.h index abd1ae5d57fb..5437f629712f 100644 --- a/sys/contrib/ena-com/ena_defs/ena_admin_defs.h +++ b/sys/contrib/ena-com/ena_defs/ena_admin_defs.h @@ -98,12 +98,22 @@ enum ena_admin_aq_feature_id { ENA_ADMIN_FEATURES_OPCODE_NUM = 32, }; +/* feature version for the set/get ENA_ADMIN_LLQ feature admin commands */ +enum ena_admin_llq_feature_version { + /* legacy base version in older drivers */ + ENA_ADMIN_LLQ_FEATURE_VERSION_0_LEGACY = 0, + /* support entry_size recommendation by device */ + ENA_ADMIN_LLQ_FEATURE_VERSION_1 = 1, +}; + /* device capabilities */ enum ena_admin_aq_caps_id { ENA_ADMIN_ENI_STATS = 0, /* ENA SRD customer metrics */ ENA_ADMIN_ENA_SRD_INFO = 1, ENA_ADMIN_CUSTOMER_METRICS = 2, + ENA_ADMIN_EXTENDED_RESET_REASONS = 3, + ENA_ADMIN_CDESC_MBZ = 4, }; enum ena_admin_placement_policy_type { @@ -163,8 +173,14 @@ enum ena_admin_get_stats_scope { ENA_ADMIN_ETH_TRAFFIC = 1, }; -enum ena_admin_get_phc_type { - ENA_ADMIN_PHC_TYPE_READLESS = 0, +enum ena_admin_phc_feature_version { + /* Readless with error_bound */ + ENA_ADMIN_PHC_FEATURE_VERSION_0 = 0, +}; + +enum ena_admin_phc_error_flags { + ENA_ADMIN_PHC_ERROR_FLAG_TIMESTAMP = BIT(0), + ENA_ADMIN_PHC_ERROR_FLAG_ERROR_BOUND = BIT(1), }; /* ENA SRD configuration for ENI */ @@ -464,6 +480,10 @@ struct ena_admin_basic_stats { uint32_t tx_drops_low; uint32_t tx_drops_high; + + uint32_t rx_overruns_low; + + uint32_t rx_overruns_high; }; /* ENI Statistics Command. */ @@ -696,8 +716,17 @@ struct ena_admin_feature_llq_desc { /* the stride control the driver selected to use */ uint16_t descriptors_stride_ctrl_enabled; - /* reserved */ - uint32_t reserved1; + /* feature version of device resp to either GET/SET commands. */ + uint8_t feature_version; + + /* llq entry size recommended by the device, + * values correlated to enum ena_admin_llq_ring_entry_size. + * used only for GET command. + */ + uint8_t entry_size_recommended; + + /* max depth of wide llq, or 0 for N/A */ + uint16_t max_wide_llq_depth; /* accelerated low latency queues requirement. driver needs to * support those requirements in order to use accelerated llq @@ -933,19 +962,8 @@ struct ena_admin_feature_rss_flow_hash_input { uint16_t enabled_input_sort; }; -enum ena_admin_os_type { - ENA_ADMIN_OS_LINUX = 1, - ENA_ADMIN_OS_WIN = 2, - ENA_ADMIN_OS_DPDK = 3, - ENA_ADMIN_OS_FREEBSD = 4, - ENA_ADMIN_OS_IPXE = 5, - ENA_ADMIN_OS_ESXI = 6, - ENA_ADMIN_OS_MACOS = 7, - ENA_ADMIN_OS_GROUPS_NUM = 7, -}; - struct ena_admin_host_info { - /* defined in enum ena_admin_os_type */ + /* Host OS type defined as ENA_ADMIN_OS_* */ uint32_t os_type; /* os distribution string format */ @@ -992,7 +1010,9 @@ struct ena_admin_host_info { * 4 : rss_configurable_function_key * 5 : reserved * 6 : rx_page_reuse - * 31:7 : reserved + * 7 : tx_ipv6_csum_offload + * 8 : phc + * 31:9 : reserved */ uint32_t driver_supported_features; }; @@ -1078,10 +1098,10 @@ struct ena_admin_queue_ext_feature_desc { }; struct ena_admin_feature_phc_desc { - /* PHC type as defined in enum ena_admin_get_phc_type, - * used only for GET command. + /* PHC version as defined in enum ena_admin_phc_feature_version, + * used only for GET command as max supported PHC version by the device. */ - uint8_t type; + uint8_t version; /* Reserved - MBZ */ uint8_t reserved1[3]; @@ -1221,7 +1241,9 @@ enum ena_admin_aenq_group { ENA_ADMIN_NOTIFICATION = 3, ENA_ADMIN_KEEP_ALIVE = 4, ENA_ADMIN_REFRESH_CAPABILITIES = 5, - ENA_ADMIN_AENQ_GROUPS_NUM = 6, + ENA_ADMIN_CONF_NOTIFICATIONS = 6, + ENA_ADMIN_DEVICE_REQUEST_RESET = 7, + ENA_ADMIN_AENQ_GROUPS_NUM = 8, }; enum ena_admin_aenq_notification_syndrome { @@ -1252,6 +1274,18 @@ struct ena_admin_aenq_keep_alive_desc { uint32_t tx_drops_low; uint32_t tx_drops_high; + + uint32_t rx_overruns_low; + + uint32_t rx_overruns_high; +}; + +struct ena_admin_aenq_conf_notifications_desc { + struct ena_admin_aenq_common_desc aenq_common_desc; + + uint64_t notifications_bitmap; + + uint64_t reserved; }; struct ena_admin_ena_mmio_req_read_less_resp { @@ -1264,13 +1298,23 @@ struct ena_admin_ena_mmio_req_read_less_resp { }; struct ena_admin_phc_resp { + /* Request Id, received from DB register */ uint16_t req_id; uint8_t reserved1[6]; + /* PHC timestamp (nsec) */ uint64_t timestamp; - uint8_t reserved2[48]; + uint8_t reserved2[8]; + + /* Timestamp error limit (nsec) */ + uint32_t error_bound; + + /* Bit field of enum ena_admin_phc_error_flags */ + uint32_t error_flags; + + uint8_t reserved3[32]; }; /* aq_common_desc */ @@ -1371,6 +1415,10 @@ struct ena_admin_phc_resp { #define ENA_ADMIN_HOST_INFO_RSS_CONFIGURABLE_FUNCTION_KEY_MASK BIT(4) #define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_SHIFT 6 #define ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_MASK BIT(6) +#define ENA_ADMIN_HOST_INFO_TX_IPV6_CSUM_OFFLOAD_SHIFT 7 +#define ENA_ADMIN_HOST_INFO_TX_IPV6_CSUM_OFFLOAD_MASK BIT(7) +#define ENA_ADMIN_HOST_INFO_PHC_SHIFT 8 +#define ENA_ADMIN_HOST_INFO_PHC_MASK BIT(8) /* feature_rss_ind_table */ #define ENA_ADMIN_FEATURE_RSS_IND_TABLE_ONE_ENTRY_UPDATE_MASK BIT(0) @@ -1842,6 +1890,16 @@ static inline void set_ena_admin_host_info_rx_page_reuse(struct ena_admin_host_i p->driver_supported_features |= (val << ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_SHIFT) & ENA_ADMIN_HOST_INFO_RX_PAGE_REUSE_MASK; } +static inline uint32_t get_ena_admin_host_info_tx_ipv6_csum_offload(const struct ena_admin_host_info *p) *** 391 LINES SKIPPED *** From nobody Thu Oct 31 16:01:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ13nlZz5bwd8; Thu, 31 Oct 2024 16:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ12pm5z4SW6; Thu, 31 Oct 2024 16:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMw3PSpLeIGU9LwtzRDivjV3X6lQ1EqqwL73f4okzdk=; b=kQgrBZlGqnnEauZRBGLAnq+foUTI9DGbFiImyuBYUF4if71TLiQYUU+H61WkrQ97Doz3ZB swWT1onPvE0VuxcUitt30cy1LNxkGfaTIaPCWhU80s25ApeqqREwTr+HCCQ8VzaN8X89g8 T1GyDFZr6/scLXaPARXR2sYFtL56Z68kI4/4b1v2AlNsDbUkNtcZ5v/g+gh4kWf1/079wx gZNWKiwqKjoh6r2jRJ0G8d3X5V74FZqTImkWIhQFJc3p02doFPTQmaSZf8PvJx+sTLhBz8 JR3gnPCzh7JYwf6hvX8Eg0oVYMa7fu5sMxZiLyvtJnMXkTBE9UZriHO6Y65Fag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMw3PSpLeIGU9LwtzRDivjV3X6lQ1EqqwL73f4okzdk=; b=K1qBtEHp6nLt4ybX/y7npOTex3SNRzNt98ghlVWggd+4WrY84z5LyStGD75NBOqQnfsFRL 63epoVaWVpBOEtppC3V8SUsXfGwwQtLXeo37VGM8/Nkxi7u67cAszkbwlQmPGRSFlAB9ny vCOcSRY6nVWMakp3lcA1RhwuZSiPewUc6w9sCk33bGoXmwuMV1t2A5VnjdmqsBKrG/bC+Q jBgDUL2gkPfXbO6N2gpZHpS+MLHSGGeMAXI1CPKf0CM7fh73GURycDw5tO7RSpiQeRUzWK mBsQgb8YNLXnZjKTdPP+FtGheXOEg2Y8Eq/aWYyrnH/vkFWAgBj+6QeTC+J0tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390481; a=rsa-sha256; cv=none; b=N0kNAdcUThuDXlCA3cd/lDey+6e05Zx/UesKSWPcf2QL+DQnCZppgBP1z8M18xY4FBCggQ kaZI5dMpxZ9vjjmfgQtXTHUOTffLBGjoDUeNBcRnjrgXD9VALNHJXJe6owgbi2ixhIVszO bNofz0erpvyfn8gV7w9K+CEpjYaFDfMf183coXG5MSFveytA4owDRS1hn/Lgmf+f09tHsC eWibNqugWCZRCGrDV5gXfT8tNmky2LpmLDM0Y0m84u3ibDBLA+P4uk+/9e+wl0RJwPrJIQ Y4/VswHvNnTqXz1S9NzipoV7fIA3E1C6+0/WLMOxSgtvaQeC65UxUzKgKGjUlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ129cbzjVm; Thu, 31 Oct 2024 16:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1Ldg069855; Thu, 31 Oct 2024 16:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1L8c069852; Thu, 31 Oct 2024 16:01:21 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:21 GMT Message-Id: <202410311601.49VG1L8c069852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 418d3190d73c - stable/14 - ena: Fix customer metrics deallocation statement place List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 418d3190d73cdca08bc91ad313bf39ebab3b32af Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=418d3190d73cdca08bc91ad313bf39ebab3b32af commit 418d3190d73cdca08bc91ad313bf39ebab3b32af Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Fix customer metrics deallocation statement place Upstream commit [1] made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). Upstream commit [2] removed the NULL check conducted by the driver. This commit also removes err_customer_metrics_alloc goto label. Commit [2] leaves behind a floating free() statement that deallocates customer_metrics_array. This commit places the deallocation statement where it belongs. [1] commit 4787572d0580 ("ifnet: make if_alloc_domain() never fail") [2] commit aa3860851b9f ("net: Remove unneeded NULL check for the allocated ifnet") Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a) --- sys/dev/ena/ena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 47d066a2e4f1..9d047cc89b30 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3841,8 +3841,8 @@ ena_attach(device_t pdev) #ifdef DEV_NETMAP err_detach: ether_ifdetach(adapter->ifp); -#endif /* DEV_NETMAP */ free(adapter->customer_metrics_array, M_DEVBUF); +#endif /* DEV_NETMAP */ err_metrics_buffer_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); err_msix_free: From nobody Thu Oct 31 16:01:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ35n37z5bwmM; Thu, 31 Oct 2024 16:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ34dCfz4Svk; Thu, 31 Oct 2024 16:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5cEaYHjykoU7+DW09my1SFEq3YiraRFtNx+6vucDtk=; b=vwSoX1lGqRGBxRKyEc/jJSIN8nLLANkgfFCyRHalbCv7m4Atd2/j914oDyRkzpP7t7m9k3 xaS6871G223935sVNSo+CInNUk8eFzTyVfB8r4WyhoDrTYMkh1e+ujQ2vh3J+dIXXPGx99 jNziSqWZEV0GWTE9jXSm5GmHppN0sIelXHYlpd04Q/eQqERfqlIjL9uPfd/Y7xbCmM6NR7 NmnR/LbpT9Ur5A+brlttpPwa4r3CbHODyuWy7AwQuY5Wm0ymK2SDAVfJ+19Tbq31N6+gus kDjuweoGUkc3tRThtKjZXS7XjEytm2WEGy0JxuyppDFQiCyx83GRBKA83DDkBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5cEaYHjykoU7+DW09my1SFEq3YiraRFtNx+6vucDtk=; b=YCk6l155X/4wnD0zO1bY33U0WjT7ETim2hmjXwrsjH2VsE6+2yPOlSjJW2VUEOfRPQAZx5 o39l+7tYPdAGL5DCWS1H96eBgepS+Zm8qQSgQa3wXREl14JrH8jvq36LpOckES6G0+7dR6 wPAPuSqgucud9bBqJwPHXSiK+u4VosF3og4SL5lHzId7mNGaglpxcP8KriMRZH8xwGUO+H AhUoVyrWPvp1yZeSumgbE6aves1OCxnf9jy907nVJlfziD3SJOvJ58QJ5Sd6IQaUwrpTuK eJ0+6+fv3z1HAUEARj04Eawoj3JY/Hendv8HXRFCv2urR2mIss+xfPdnJcVXAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390483; a=rsa-sha256; cv=none; b=OLNtN+S+wjRRZ5lxxrtPPvjS9+YRDAAUrYhjv7rq7U4TkHSIKRL7SlniAEKlUqKmi+sc6z q0pxbFVZ3oSzRU3/Z1QrUOsecWtidOqygyVMLJiSplkJbov2Bad5Z3vzk5y+YXdxzAGCgT wRz478SUZqaAZs1V+hHiYdL5jkS9bhRsYsfig+hmsLUgejQPs6OZd76cZaJtJthjhs6c03 uNuB/nPSBuwxVDepkpMNHYcv6pLxEQJXiT+oeEdeI8PoA1nWhTTPH8ib/V0+3NFYZW6DO/ fITc8HkXW9z7T7OvmOU7oTQeBgdsq91MjXZ5is7YuI7JKNQoXY3HADaa5rbT7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ33js5zhs9; Thu, 31 Oct 2024 16:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1NO9069956; Thu, 31 Oct 2024 16:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1NV8069953; Thu, 31 Oct 2024 16:01:23 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:23 GMT Message-Id: <202410311601.49VG1NV8069953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 740fb85ba285 - stable/14 - ena: Add configuration notifications interface support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 740fb85ba28512a7ea7b5408691b5a8e697435a7 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=740fb85ba28512a7ea7b5408691b5a8e697435a7 commit 740fb85ba28512a7ea7b5408691b5a8e697435a7 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Add configuration notifications interface support This commit is part of the effort of notifying the user of non-optimal or performance impacting practices. A new interface is serving as a communication channel between the device and the driver. One of the goals of this channel is to create a new mechanism of notifying the driver and user in case of sub-optimal configuration using a bitmap. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 8cd86b51be4ab0fe70bad4830e608d56db5c850f) --- sys/dev/ena/ena.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 6c1cbb6701de..3f2b9c1fb138 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2911,7 +2911,8 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, BIT(ENA_ADMIN_FATAL_ERROR) | BIT(ENA_ADMIN_WARNING) | BIT(ENA_ADMIN_NOTIFICATION) | - BIT(ENA_ADMIN_KEEP_ALIVE); + BIT(ENA_ADMIN_KEEP_ALIVE) | + BIT(ENA_ADMIN_CONF_NOTIFICATIONS); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); @@ -4041,11 +4042,38 @@ unimplemented_aenq_handler(void *adapter_data, "Unknown event was received or event with unimplemented handler\n"); } +static void ena_conf_notification(void *adapter_data, + struct ena_admin_aenq_entry *aenq_e) +{ + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + struct ena_admin_aenq_conf_notifications_desc *desc; + u64 bitmap, bit; + + desc = (struct ena_admin_aenq_conf_notifications_desc *)aenq_e; + bitmap = desc->notifications_bitmap; + + if (bitmap == 0) { + ena_log(adapter->pdev, INFO, + "Empty configuration notification bitmap\n"); + return; + } + + for (bit = ffsll(bitmap); bit != 0; bit = ffsll(bitmap)) { + bit--; + ena_log(adapter->pdev, INFO, + "Sub-optimal configuration notification code: %" PRIu64 " Refer to AWS ENA documentation for additional details and mitigation options.\n", + bit + 1); + // Clear the processed bit + bitmap &= ~(1UL << bit); + } +} + static struct ena_aenq_handlers aenq_handlers = { .handlers = { [ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change, [ENA_ADMIN_NOTIFICATION] = ena_notification, [ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd, + [ENA_ADMIN_CONF_NOTIFICATIONS] = ena_conf_notification, }, .unimplemented_handler = unimplemented_aenq_handler }; From nobody Thu Oct 31 16:01:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ270fwz5bx26; Thu, 31 Oct 2024 16:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ23Qkqz4ShW; Thu, 31 Oct 2024 16:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJ42nr9WkkkhF56aIXSDownkilKZ7wuej3nMSXOkHVM=; b=UFRY2wY0JySoUr4iHi7YO8JJpo65NtzwWKGzzl6lKaMZ1AxO8StVstE4IwWxn0ce7IzPBH rHOZqRaOrSUyLp8FMYiiObXYcybbbeR4gsKs8Zy4vbZRmOJtE/nQFRNrLH1o90KoDajfLW M9oc5/ZL5ch99p1rSdhWw2pbKk5jmB2oGbNqCFGUnKubOc15W4CEDJBNLt82bT7mxk7g60 hadVsYZbE4FIqgXzojZ+BY+5A4BCD++SBqL/x6pRuGpD/I0jqz05kdqF1AAPASd+kHtVHi 2GP5XNVoDExYuM5H6MTu/hLG+wn/90GkHCgR2IWMzIowtWmeOetIvdVSIugEDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJ42nr9WkkkhF56aIXSDownkilKZ7wuej3nMSXOkHVM=; b=Ma+/mQKjjq4nUe1xlNn+LwThudFi4XGFhBbg2krKNdhlecKaOmIC1M2mtRiTdjUINgRPe9 yU5J0MxnzSfz0l0X2+be40lyIOZ1d9xiHKGjGC2dSy+WTZK8JBr4Itx4DVRuzPsXJHtYqz Ipf87YSMBTXcsSkaH/qysNP38hZPQodQRWaL1dOs7HsJYw5T35juKuHvE3y9QshrJwsTsq odBmU9/FHld8L4rmsLKyfXpCwPZRT0JST9Sxq2M4S/4fWY9Nu8jDte29P9BdJ5+ypekwOt r9C5RAaTx1bT3V505j0TVzp62H97wsnzC95bTSzendSWfNN7+0oxlv1iim8rfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390482; a=rsa-sha256; cv=none; b=dnwTccobJYaJlrbZ76cd9hxrxGBSKd3S32wGzvXxa7FguuuxwfStfBC72gntL0zFdDLZcA BT449bx82ygXt2p2PvUte9v/AeqNyMB4Hsyu3MDJGe0nUgrcw4yiSCudbMhQx2oY+QAP9r A4sSbxgNQHQUau+/Lq+Q0nFrFCerwTWy31qjacQ1OXTvgyeghbfWW3wMEcdYPBmByilGoe +61hdjhtQEuTiANExSHnuQLVPug0ywQeLrhV9VRM9cbFaUqupWlhh82IH6WP/X2hegK0ki yaeTLJt3HTpzRhqTi6LKJb8wcY6DSnCf6Z5IPt0obYyJCKKyVUZ3kKXImx98CA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ22lgrzjd6; Thu, 31 Oct 2024 16:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1M4J069909; Thu, 31 Oct 2024 16:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1MwT069906; Thu, 31 Oct 2024 16:01:22 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:22 GMT Message-Id: <202410311601.49VG1MwT069906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: e31fe28929a7 - stable/14 - ena: Count all currently missing TX completions in check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e31fe28929a76ca552189ddc907345cd4e32d62b Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=e31fe28929a76ca552189ddc907345cd4e32d62b commit e31fe28929a76ca552189ddc907345cd4e32d62b Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Count all currently missing TX completions in check Currently we count all of the newly added and already existing missing tx completions in each iteration of check_missing_comp_in_tx_queue() causing duplicate counts to missing_tx_comp stat. This commit adds a new counter new_missed_tx within the relevant function which only counts the newly added missing tx completions in each iteration of check_missing_comp_in_tx_queue(). This will allow us to update missing_tx_comp stat accurately without counting duplicates. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 1f67704e2cd85a507776312b52dc63d8690b9260) --- sys/dev/ena/ena.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 9d047cc89b30..6c1cbb6701de 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3058,13 +3058,13 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) { + uint32_t missed_tx = 0, new_missed_tx = 0; device_t pdev = adapter->pdev; struct bintime curtime, time; struct ena_tx_buffer *tx_buf; int time_since_last_cleanup; int missing_tx_comp_to; sbintime_t time_offset; - uint32_t missed_tx = 0; int i, rc = 0; getbinuptime(&curtime); @@ -3107,13 +3107,15 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, "%d msecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", tx_ring->qid, i, time_since_last_cleanup, missing_tx_comp_to); + /* Add new TX completions which are missed */ + new_missed_tx++; } tx_buf->print_once = false; missed_tx++; } } - + /* Checking if this TX ring missing TX completions have passed the threshold */ if (unlikely(missed_tx > adapter->missing_tx_threshold)) { ena_log(pdev, ERR, "The number of lost tx completion is above the threshold " @@ -3122,8 +3124,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, ena_trigger_reset(adapter, ENA_REGS_RESET_MISS_TX_CMPL); rc = EIO; } - - counter_u64_add(tx_ring->tx_stats.missing_tx_comp, missed_tx); + /* Add the newly discovered missing TX completions */ + counter_u64_add(tx_ring->tx_stats.missing_tx_comp, new_missed_tx); return (rc); } From nobody Thu Oct 31 16:01:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ51JdPz5bwXf; Thu, 31 Oct 2024 16:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ45Dp4z4SwG; Thu, 31 Oct 2024 16:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BGOhokvcv+8D9mA3qFFWev0haA8JXZZHf+5Y1O9T5tM=; b=u9QqjiPxfwtJAMFjKajqQA6ImlZkUIusVfgB9KFON+CpX+bcptiH+rkPfjcJKBylD0Uxz8 8AkApbtIDq2UhPa0uK65eaqoKoGGsRB92ZsofOCWrvcinscVPoEtRWCqKVcLuD1h4W27NK J+q1cj8jG5wCo59WoTpJLLCnm2DiTZCcQrYxCMPyU2s4hiKg2+Tijuvs0JB1Bcftq98eFh 3JQBycsX7tWpkjHGaKZ8omSSdc4rUL/fk8GHkwFxYH70SHUHDpJJsaGSDfRDCgjT4/GwmW En0Xl4Yv02w4Xe8zkhbM+k2ebhEr4S4lnxWDcaHO1h6vbaqifg8+UaxfBMMiZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BGOhokvcv+8D9mA3qFFWev0haA8JXZZHf+5Y1O9T5tM=; b=OpTXbnV1qO7k6/8ghwKZuxDS6QOh6hmUqzmjsvksI0PjmH42fVoXRujhFyp7MPyqp++64V uYcogehni5DXCEFVgAVhiFde8r0SeL7WSw7xVEts05RMU3Roq7ESOabkZLzEnWqXed9UBI s0pgd5htUyKdm9I0ulHUEhq9xobk7LOiLOiAN6cXp3fspf0JfcX5YyzNd4jPNubFbFW7Xk 91+4U38WkeOeJrHAXfIEVW9YeKkNHPb/XI7OfHWw4qmMNKzCEB6Ia+7c9mLCnE63tVERHh wF7Gz63NexoaTrbF2NcxZqkPXVavFUcmR1QQfGCVAXlg8nQW/RwhT1lH0gPWNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390484; a=rsa-sha256; cv=none; b=wvEQFgO2m8Eh+s5Fnc8udYqiFJYj/VHzXLVjHrlKLqjOvjPaCvxOnVnY8vWIkukjRFUlv6 E69uxqwZ6I5tasF/CXOWSfGfbvat7hPwl9GnKEuozuI32eQA2Lo6P3ZThtnYNDys8rMIYO +SXKOGJk7udVTO/jk5WyryFZJj+RDzJERwqXjDCLHhLj3qXxBOTGvZ2v+fcz8Ai1qwlmbF yRymrsRfEE2n4fckpog2yTsfGh6lcE2Z+OlHbaIoe1lLJYoV+NBPpOBybdHuXeQ+c0W8jk faam6Df2+40SpBwsoAOer0Wh/gdIqwPC6EUtbWIVJdZo4yBoxxJHGsoChCgC7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ44nGMzjB7; Thu, 31 Oct 2024 16:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1OXW070005; Thu, 31 Oct 2024 16:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1OWQ070002; Thu, 31 Oct 2024 16:01:24 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:24 GMT Message-Id: <202410311601.49VG1OWQ070002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: b1718de62f16 - stable/14 - ena: Update license signatures to 2024 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b1718de62f16b203fcaef236d5699a4aba90d003 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=b1718de62f16b203fcaef236d5699a4aba90d003 commit b1718de62f16b203fcaef236d5699a4aba90d003 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Update license signatures to 2024 This commit updates all the license signatures to 2024. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 8d6806cd08c093fc001db1f94cf122368b8d1549) --- share/man/man4/ena.4 | 2 +- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena.h | 2 +- sys/dev/ena/ena_datapath.c | 2 +- sys/dev/ena/ena_datapath.h | 2 +- sys/dev/ena/ena_netmap.c | 2 +- sys/dev/ena/ena_netmap.h | 2 +- sys/dev/ena/ena_rss.c | 2 +- sys/dev/ena/ena_rss.h | 2 +- sys/dev/ena/ena_sysctl.c | 2 +- sys/dev/ena/ena_sysctl.h | 2 +- sys/modules/ena/Makefile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index 50a180871627..0fbe0819978c 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. +.\" Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 3f2b9c1fb138..fd92b5046f84 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 3e42568ba8a9..be55f63bdb7b 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 66a93bbe7a6c..0691444f5357 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_datapath.h b/sys/dev/ena/ena_datapath.h index 43292b5abbe9..9edf54fe502a 100644 --- a/sys/dev/ena/ena_datapath.h +++ b/sys/dev/ena/ena_datapath.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index d95f48f7380c..ae2140d1217c 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_netmap.h b/sys/dev/ena/ena_netmap.h index 598fcf1f08b2..4ee8338e4009 100644 --- a/sys/dev/ena/ena_netmap.h +++ b/sys/dev/ena/ena_netmap.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c index 41fa9c62f94a..b7706e33065d 100644 --- a/sys/dev/ena/ena_rss.c +++ b/sys/dev/ena/ena_rss.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_rss.h b/sys/dev/ena/ena_rss.h index 1c1c89261b35..64dd41851fec 100644 --- a/sys/dev/ena/ena_rss.h +++ b/sys/dev/ena/ena_rss.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index ea651837ebb6..a94bcbccdc98 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index 4f5834214005..df9cc8cb592f 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/modules/ena/Makefile b/sys/modules/ena/Makefile index f8b71588afa1..bfa4cf6da430 100644 --- a/sys/modules/ena/Makefile +++ b/sys/modules/ena/Makefile @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2015-2023 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2015-2024 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From nobody Thu Oct 31 16:01:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ61V4Nz5bwZp; Thu, 31 Oct 2024 16:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ56Gjqz4StQ; Thu, 31 Oct 2024 16:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1rBUTh8Ie54t6fyrm/OSwBkVhK8O5zHSt56MXh/y+Q=; b=SEwQLXJgRy9Fx8ZaaOG7GYl5yBm92VPTXnMQEll/pyiiRVKn3NbEzmVVvaZhhOYycPmqVk gf+17FRPO4+O5bnwD0a4DN/nm5OWZPGEMlQWkf5BIec9jgZrdjBQMj8Y3z34xf9zTBffHA Ne0lHDBmLPEubsuMS+2aoj/DE37NoLVhL9hoIFg25/8MvvFZAeS4Zr0lHOBNdgXvBotCAb unAlcUgob+kJFQ/jzsxqgN4l0ZlJRnGhLqHDwFB8j8lSL6JxsNkZS9ObU7TNKAAKjkoulr 6ZWIQvbalmUJSzsinQEFmblg2ewoqNiW4najyYwzbDN0D79Brd/YvAkE+uZxmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1rBUTh8Ie54t6fyrm/OSwBkVhK8O5zHSt56MXh/y+Q=; b=K9Pmji8+rzkSNcROnKGWvELpvvi5vczA9gtfXrCDvezGWcHfXRyapMPOExz50LpWI0kh5r 3dfkJWV/P7GRX3nP59Mn55V5sZhcNNpJB1Vb0zt23TmFZ1AAyVDcuxM+pxA+3v1s26J3nC BnxiEf+o9b33EYBQa7/Qvw/4qJ0TnyHuWEE68MCR+7MoziT/UQ/7Vi/Vdzk7hmQtSitUs4 vJP2i0M5kTb/zp6VhDGBOTED8xPhTcwf6gtfB4gfEVaErCwizvfL8PCTy3sGVhx+I5Ax2N TQSjaZKmxicSn8nEyAppBUAEJ+7K9+EPi5ZfSCaJygB+jXa3nODpw055GsLgaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390485; a=rsa-sha256; cv=none; b=X3LwYfwvQUkbhjfeJKh3uMAgmaG+jDAAV/R/dKRn0OZVRA7WM80D/Rv4GVWOUUKC25Aj2F 95nks+ZkfEjCdzRYlibiyU8jI73RqY0GakE/vFcc47/q8aNFZ9L7RAqtHEi8wm+CO+cjnf zjzLUeeziaG7y5JpHjBnvX4axkGmDXEaS3q+cklhkt5M9f7XgEFaVGbQ7CA4Ml+Q6w1+rE ZD/vB/HSkkV7/aCMlX+3a+BC3vA5qP+RnBhzhse4jRmSkKV/rgDwbixmxZdPJOaRjAYKVU kcRgY9223tYzIE4O+AeVWMoJja1ZoJC5cehBSHlJZ0Aid+t9qvs+H/BSgqEkzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ55mkSzjVn; Thu, 31 Oct 2024 16:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1Pbd070055; Thu, 31 Oct 2024 16:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1P56070052; Thu, 31 Oct 2024 16:01:25 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:25 GMT Message-Id: <202410311601.49VG1P56070052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 89940eed9118 - stable/14 - ena: Improve reset reason statistics List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 89940eed91182f4dbb20c14bdbb689fc622dad9b Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=89940eed91182f4dbb20c14bdbb689fc622dad9b commit 89940eed91182f4dbb20c14bdbb689fc622dad9b Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Improve reset reason statistics The driver uses different reset reasons. Some of them are counted and presented in the driver statistics. There are cases where statistics are counted on a ring level, but these are zeroed after a reset procedure takes place. This commit makes the following changes: 1. Add statistics for the unrepresented reset reasons. 2. Add reset reasons which are counted on a ring level, to be also global for better tracking. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 89ce3f6314f6feba0e6626be51832d44df611218) --- sys/dev/ena/ena.c | 2 -- sys/dev/ena/ena.h | 42 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/ena/ena_sysctl.c | 16 ++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index fd92b5046f84..7c86c0594daf 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3014,7 +3014,6 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) time = getsbinuptime() - timestamp; if (unlikely(time > adapter->keep_alive_timeout)) { ena_log(adapter->pdev, ERR, "Keep alive watchdog timeout.\n"); - counter_u64_add(adapter->dev_stats.wd_expired, 1); ena_trigger_reset(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO); } } @@ -3026,7 +3025,6 @@ check_for_admin_com_state(struct ena_adapter *adapter) if (unlikely(ena_com_get_admin_running_state(adapter->ena_dev) == false)) { ena_log(adapter->pdev, ERR, "ENA admin queue is not in running state!\n"); - counter_u64_add(adapter->dev_stats.admin_q_pause, 1); ena_trigger_reset(adapter, ENA_REGS_RESET_ADMIN_TO); } } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index be55f63bdb7b..4ac79edd0016 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -381,6 +381,14 @@ struct ena_stats_dev { counter_u64_t interface_up; counter_u64_t interface_down; counter_u64_t admin_q_pause; + counter_u64_t total_resets; + counter_u64_t os_trigger; + counter_u64_t missing_tx_cmpl; + counter_u64_t bad_rx_req_id; + counter_u64_t bad_tx_req_id; + counter_u64_t bad_rx_desc_num; + counter_u64_t invalid_state; + counter_u64_t missing_intr; }; struct ena_hw_stats { @@ -519,6 +527,29 @@ struct ena_adapter { extern struct sx ena_global_lock; +#define ENA_RESET_STATS_ENTRY(reset_reason, stat) \ + [reset_reason] = { \ + .stat_offset = offsetof(struct ena_stats_dev, stat) / sizeof(u64), \ + .has_counter = true \ +} + +struct ena_reset_stats_offset { + int stat_offset; + bool has_counter; +}; + +static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_RESET_LAST] = { + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_KEEP_ALIVE_TO, wd_expired), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_q_pause), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_OS_TRIGGER, os_trigger), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_TX_CMPL, missing_tx_cmpl), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_RX_REQ_ID, bad_rx_req_id), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_TX_REQ_ID, bad_tx_req_id), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TOO_MANY_RX_DESCS, bad_rx_desc_num), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), +}; + int ena_up(struct ena_adapter *adapter); void ena_down(struct ena_adapter *adapter); int ena_restore_device(struct ena_adapter *adapter); @@ -547,6 +578,17 @@ ena_trigger_reset(struct ena_adapter *adapter, enum ena_regs_reset_reason_types reset_reason) { if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + const struct ena_reset_stats_offset *ena_reset_stats_offset = + &resets_to_stats_offset_map[reset_reason]; + + if (ena_reset_stats_offset->has_counter) { + uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + + ena_reset_stats_offset->stat_offset; + + counter_u64_add((counter_u64_t)(*stat_ptr), 1); + } + + counter_u64_add(adapter->dev_stats.total_resets, 1); adapter->reset_reason = reset_reason; ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index a94bcbccdc98..6eafe2a8c052 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -280,6 +280,22 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "Network interface down count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", CTLFLAG_RD, &dev_stats->admin_q_pause, "Admin queue pauses"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "os_trigger", CTLFLAG_RD, + &dev_stats->os_trigger, "OS trigger count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_tx_cmpl", CTLFLAG_RD, + &dev_stats->missing_tx_cmpl, "Missing TX completions resets count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_rx_req_id", CTLFLAG_RD, + &dev_stats->bad_rx_req_id, "Bad RX req id count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_tx_req_id", CTLFLAG_RD, + &dev_stats->bad_tx_req_id, "Bad TX req id count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "bad_rx_desc_num", CTLFLAG_RD, + &dev_stats->bad_rx_desc_num, "Bad RX descriptors number count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "invalid_state", CTLFLAG_RD, + &dev_stats->invalid_state, "Driver invalid state count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_intr", CTLFLAG_RD, + &dev_stats->missing_intr, "Missing interrupt count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, + &dev_stats->total_resets, "Total resets count"); for (i = 0; i < adapter->num_io_queues; ++i, ++tx_ring, ++rx_ring) { snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); From nobody Thu Oct 31 16:01:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ72Cvdz5bwgq; Thu, 31 Oct 2024 16:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ673dWz4Swk; Thu, 31 Oct 2024 16:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=itL/qKcmfzSAn9ktw6G5C0hCW9/q2kCNHZACUZ+C5v8=; b=QGVB8JATPvPu4Y45t4LEoSA7fElzl5cu9Ngcfv4JPPSPJam68vRhG4kioc481wbVY/61qj 9fwNmkjJXpQtK/TNHPrGAsNiL8tP47Gp9lzCEEKClg844mx1zeMLlOYKHWL0WNeOoO3uon raxct+1jwEvUHPdZsT2K+YQxuNNUxK0p6FD4gBy39bFES2aEp5gb59Ck5+sUiJTODOlfY5 ag5bevRqDZSbvoKt/M86oaVlzavo0Os/9w8YHe2gdZZDJxRsdZCaqONQQGqC/v/QZuHEN9 OjkyewkOGfUOXA1tdkkLbNXC1Hihj800CU+75vydqa9A7alLAPdWQ7RlQve5Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=itL/qKcmfzSAn9ktw6G5C0hCW9/q2kCNHZACUZ+C5v8=; b=f9bTrvWSlLKCDB5VfqtOWq683VggOykYy5d3bAh0lLjS5rVj4iKv9nCz//aS8GRxHdFv53 GeBF+ziXCUBwe0yefcJAgLPQDNQrM044NOwoWTzxix3W9ibUUcVqESKVWyOgZNvgCZNkgh c7P6YXo7Z9CHgXH98KloGBFtQB1eNXSbpwHRQ+DutJUKrMZC/uZhTZd0oIj7jRFM0SEPAK pOchEIxwME7z3+QS78eb4r4nqjV1mzcX9zplAZMDcZFq60qKifIEMx5HGpC8O68e0Qhq3q saz+sLY+b4RxmgW1Hit/dSK7VObCrV8U/lZaxFUq9u9pbCpAT4v/z/ZQOni6Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390487; a=rsa-sha256; cv=none; b=xGgYQ/ogbwHeWAJ499q9cwLyywSaa/rLhaquomy52iHHl10/qixn69MBGLjMhevHzlCyrZ bFp2odLLcV3L/Txkq6RCWikgXmcfTNzIs0+p93kbthzmiSUl+87IKRJVB5vw+hfbIJies3 WBuM6xSLn4pZ7vb3axU7on5a3+Z6bv+iZ2U2fg2xnBeC4PGNkkKDQr3adaIE8ctswkvbMK f8LU69Qd/jDR7cqKfj/FLTLa9fRlReuMiQDzB1P9TQJQaXrkwdY69vHFSGYiBCfubOEpNK GfxcEXBpUrA2SwSOwHW8qu1/JbYhhOAERkdd3HWTmnYnhGZ5AgsZSkbYIoqnVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ66YVwzjXJ; Thu, 31 Oct 2024 16:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1Q8A070106; Thu, 31 Oct 2024 16:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1QoR070103; Thu, 31 Oct 2024 16:01:26 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:26 GMT Message-Id: <202410311601.49VG1QoR070103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 189bc23fd0e4 - stable/14 - ena: Add reset reason for corrupted TX cdescs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 189bc23fd0e4ddc0485dd52b2925728d321ab8ec Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=189bc23fd0e4ddc0485dd52b2925728d321ab8ec commit 189bc23fd0e4ddc0485dd52b2925728d321ab8ec Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Add reset reason for corrupted TX cdescs TX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 38727218460008a500fbc18f08c90082ed678895) --- sys/dev/ena/ena.c | 26 ++++++++++++++++++++++++++ sys/dev/ena/ena.h | 3 +++ sys/dev/ena/ena_datapath.c | 27 ++++++++++----------------- sys/dev/ena/ena_netmap.c | 38 ++++++++++++++------------------------ sys/dev/ena/ena_sysctl.c | 2 ++ 5 files changed, 55 insertions(+), 41 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 7c86c0594daf..3f3a4946ccca 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -560,6 +560,32 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } +int +validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id, int tx_req_id_rc) +{ + struct ena_adapter *adapter = tx_ring->adapter; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; + + if (unlikely(tx_req_id_rc != 0)) { + if (tx_req_id_rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED; + ena_log(adapter->pdev, ERR, + "TX descriptor malformed. req_id %hu qid %hu\n", + req_id, tx_ring->qid); + } else if (tx_req_id_rc == ENA_COM_INVAL) { + ena_log_nm(adapter->pdev, WARN, + "Invalid req_id %hu in qid %hu\n", + req_id, tx_ring->qid); + counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); + } + + ena_trigger_reset(adapter, reset_reason); + return (EFAULT); + } + + return (0); +} + static void ena_release_all_tx_dmamap(struct ena_ring *tx_ring) { diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 4ac79edd0016..22c42a9346f7 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -389,6 +389,7 @@ struct ena_stats_dev { counter_u64_t bad_rx_desc_num; counter_u64_t invalid_state; counter_u64_t missing_intr; + counter_u64_t tx_desc_malformed; }; struct ena_hw_stats { @@ -548,6 +549,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TOO_MANY_RX_DESCS, bad_rx_desc_num), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), }; int ena_up(struct ena_adapter *adapter); @@ -562,6 +564,7 @@ int ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, int ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num); int ena_update_base_cpu(struct ena_adapter *adapter, int new_num); int ena_update_cpu_stride(struct ena_adapter *adapter, uint32_t new_num); +int validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id, int tx_req_id_rc); static inline int ena_mbuf_count(struct mbuf *mbuf) { diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 0691444f5357..c63a8914f9c2 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -200,29 +200,22 @@ ena_get_tx_req_id(struct ena_ring *tx_ring, struct ena_com_io_cq *io_cq, uint16_t *req_id) { struct ena_adapter *adapter = tx_ring->adapter; - int rc; + int rc = ena_com_tx_comp_req_id_get(io_cq, req_id); - rc = ena_com_tx_comp_req_id_get(io_cq, req_id); - if (rc == ENA_COM_TRY_AGAIN) + if (unlikely(rc == ENA_COM_TRY_AGAIN)) return (EAGAIN); - if (unlikely(rc != 0)) { - ena_log(adapter->pdev, ERR, "Invalid req_id %hu in qid %hu\n", + rc = validate_tx_req_id(tx_ring, *req_id, rc); + + if (unlikely(tx_ring->tx_buffer_info[*req_id].mbuf == NULL)) { + ena_log(adapter->pdev, ERR, + "tx_info doesn't have valid mbuf. req_id %hu qid %hu\n", *req_id, tx_ring->qid); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - goto err; + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); + rc = EFAULT; } - if (tx_ring->tx_buffer_info[*req_id].mbuf != NULL) - return (0); - - ena_log(adapter->pdev, ERR, - "tx_info doesn't have valid mbuf. req_id %hu qid %hu\n", - *req_id, tx_ring->qid); -err: - ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); - - return (EFAULT); + return (rc); } /** diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index ae2140d1217c..618d25a07f67 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -71,7 +71,6 @@ static void ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *, struct ena_tx_buffer *); static void ena_netmap_tx_cleanup(struct ena_netmap_ctx *); static uint16_t ena_netmap_tx_clean_one(struct ena_netmap_ctx *, uint16_t); -static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static int ena_netmap_rx_frames(struct ena_netmap_ctx *); static int ena_netmap_rx_frame(struct ena_netmap_ctx *); static int ena_netmap_rx_load_desc(struct ena_netmap_ctx *, uint16_t, int *); @@ -795,25 +794,33 @@ ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *ctx, static void ena_netmap_tx_cleanup(struct ena_netmap_ctx *ctx) { + struct ena_ring *tx_ring = ctx->ring; + int rc; uint16_t req_id; uint16_t total_tx_descs = 0; ctx->nm_i = ctx->kring->nr_hwtail; - ctx->nt = ctx->ring->next_to_clean; + ctx->nt = tx_ring->next_to_clean; /* Reclaim buffers for completed transmissions */ - while (ena_com_tx_comp_req_id_get(ctx->io_cq, &req_id) >= 0) { - if (validate_tx_req_id(ctx->ring, req_id) != 0) + do { + rc = ena_com_tx_comp_req_id_get(ctx->io_cq, &req_id); + if(unlikely(rc == ENA_COM_TRY_AGAIN)) break; + + rc = validate_tx_req_id(tx_ring, req_id, rc); + if(unlikely(rc != 0)) + break; + total_tx_descs += ena_netmap_tx_clean_one(ctx, req_id); - } + } while (1); ctx->kring->nr_hwtail = ctx->nm_i; if (total_tx_descs > 0) { /* acknowledge completion of sent packets */ - ctx->ring->next_to_clean = ctx->nt; - ena_com_comp_ack(ctx->ring->ena_com_io_sq, total_tx_descs); + tx_ring->next_to_clean = ctx->nt; + ena_com_comp_ack(tx_ring->ena_com_io_sq, total_tx_descs); } } @@ -856,23 +863,6 @@ ena_netmap_tx_clean_one(struct ena_netmap_ctx *ctx, uint16_t req_id) return tx_info->tx_descs; } -static inline int -validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) -{ - struct ena_adapter *adapter = tx_ring->adapter; - - if (likely(req_id < tx_ring->ring_size)) - return (0); - - ena_log_nm(adapter->pdev, WARN, "Invalid req_id %hu in qid %hu\n", - req_id, tx_ring->qid); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - - ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID); - - return (EFAULT); -} - static int ena_netmap_rxsync(struct netmap_kring *kring, int flags) { diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 6eafe2a8c052..71c25dd5e443 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -294,6 +294,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->invalid_state, "Driver invalid state count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_intr", CTLFLAG_RD, &dev_stats->missing_intr, "Missing interrupt count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD, + &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:01:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ912qxz5bx2L; Thu, 31 Oct 2024 16:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ81RKGz4Sts; Thu, 31 Oct 2024 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ub3jYicBymug8yvIyWCPd+acU8J07jsHem3+FlhaR+s=; b=TWrB0gC6346X3JLzyRM1ck7eIvYfB1nBkDnQvxbbowhqBtqXEtIE+QG0AL7n/TeRqqW6Kz MiTxmmH4cwt7sWbTnQ77DhF+hKOnvl6L0oTccmOP3BtntCkcJXOSDYAAJxmlQSlLTsE5v9 8TqjklDJdUD6M+esUX5WFdlZWAeoeHqRkriWVoRoACBuMiwFI1thhsYxCdFzN5U3UEPsqj P41aEB+ryFUSJJTKDRe1+Gk0xt0H90ga5m1Jkm31wd6qhWVuweJYuFzRV0BGKGRxMV4kFa RUBhpsT+Me20P2q3Lof89bWEbNLDJfZoLNz1zUv14b142WALLKMSF6p7veXltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ub3jYicBymug8yvIyWCPd+acU8J07jsHem3+FlhaR+s=; b=kmx1tf3BskNhcYaiyDvf4d7oZ3+bgzm/xI2TUJLR5Sosk7CWdxevNLY9j6AwlGFhhT5/3L fK3CsOjCck/EyqbVqP7p2Nky0OvZvlU0tVk1Nfvzpw1FYkkbn5ZwI0APoy5hMwSPK4BSSW iVqA8/kEMAra0b+SResc01JNbLQX2XPlitHvXsbmc8kzOJDihav64yzcNJH5XLXbfxzTdp 1FiMyv3XtSsu840Nu8QIXAhwFBEowB7FthyDZye3/WpNLVG3KE7/Q8t3xJkfTu41g4DP/g rs8p/E3Yod1+j289qBJvZ3ggrcqOlPQe6FqTAai0DkrrLAkqaesSO/BEdKvIjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390488; a=rsa-sha256; cv=none; b=cVBwYT/ptA0Ceo3AGVMQTbQ9c4qaaxAmNgw8MclQqRMW08ceec1lrcT9nFZE15aJfORaWb yipU353gz2Pbz+g0i9n/dPs6RZwNDY1bj8OA611rau7cKdDOyAbNOKXQWu4W9thnNku3ro aS/VU1wHYUi+kL0y8h6I7C7x9l/gZ9L0YAk1QwnaEbxmnXGVZK6Z5NPQ7Nthlob37+h+OX fHkjYJ9CqPj0qfBCqd/ghfYndXWb93yN8/G5Tnr6x2YhkY/gsEa9VNEKuTx/gabGpSwkt+ pGJRrJnGortugwgld1f4L5qSaueNzdIGkNJZbZu4esqL/4gedGu5EVl2CIypCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ80p7fzjXK; Thu, 31 Oct 2024 16:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1Sbs070157; Thu, 31 Oct 2024 16:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1Svo070154; Thu, 31 Oct 2024 16:01:28 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:28 GMT Message-Id: <202410311601.49VG1Svo070154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: e445e3afde09 - stable/14 - ena: Add reset reason for corrupted RX cdescs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e445e3afde09d931cdfef0cbf45f23aa8556537d Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=e445e3afde09d931cdfef0cbf45f23aa8556537d commit e445e3afde09d931cdfef0cbf45f23aa8556537d Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Add reset reason for corrupted RX cdescs RX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 4af71159db3cd4a37055b2b3d982ec53703c5c3d) --- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_datapath.c | 2 ++ sys/dev/ena/ena_netmap.c | 2 ++ sys/dev/ena/ena_sysctl.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 22c42a9346f7..b747736224d8 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -390,6 +390,7 @@ struct ena_stats_dev { counter_u64_t invalid_state; counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; + counter_u64_t rx_desc_malformed; }; struct ena_hw_stats { @@ -550,6 +551,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index c63a8914f9c2..6cbe46cead3e 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -599,6 +599,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 618d25a07f67..0666d7deb827 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -938,6 +938,8 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) if (rc == ENA_COM_NO_SPACE) { counter_u64_add(ctx->ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(ctx->ring->rx_stats.bad_req_id, 1); reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 71c25dd5e443..e46e835572fe 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -296,6 +296,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->missing_intr, "Missing interrupt count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD, &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD, + &dev_stats->rx_desc_malformed, "RX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:01:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJ970Xnz5bwgs; Thu, 31 Oct 2024 16:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ921Xpz4T4P; Thu, 31 Oct 2024 16:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddwXBCE3u+YKoYXx6pZlcz/X7+xVUiyo87vrgDHPxz0=; b=RW9WWnjGdxuSFxvJIbfld0YXVY9PDCz4iDr7BZ2mlEkSncAQgjsZB56gF1d2a7Gw/bKlw4 k/AlorsGKFbQRpKK0HHBp2pp0l45XOjqH3lXmKQFsTUX42TmvIqqnHGbRArhXXEacE6ADN tEDjFz6hu5ruDAYhnVSaCH8XC56/QsmM3utj7gMid/Tkazw+UdbXy7l2cv1hv15mjv6QaW WKv1WVDDMNsZ+FJZQTpSc4tnLroZVhvVZr+QK3E3nPI6KXwuzkKIVkIpF2eibeo7IWBC5w Bx6yl+0OtqOszv+jRVYKQ2kWbSgaBFpfyESt+SfYAubrk3ebvpjdVr/weBdz4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ddwXBCE3u+YKoYXx6pZlcz/X7+xVUiyo87vrgDHPxz0=; b=LuU/PyAUWapwRKzHkQXGH0TCC5Nu3ieKmwZFJgY9Zv+YKE+OIh0kNVBClg2ggXgIS4AloM KMMaSFcvDA9/3cCMzpTVQzWHZPl4IK7XxsPz/Yo/td5SDbxh8IDxekQ6P36CQDvNZqCvVZ 6UDdBhYyHZoEY/2hciBvM33/c2p3jDYCRM6a5VvLF2vxBu5QXtKBY9J/d6wA4HKqECOIyx x9dDeIdSOmcEVfpgSV0kaFuVNY9Eolf8XqIOzz9GuXQqCu0LKeKM80HdOZW7vfXiZ/2AQx 6hzd29wmNhUwFXfPatXN5lUA2Yt89NQW2IW69qPBl8qPEBXcS96P+Q1BfgOesg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390489; a=rsa-sha256; cv=none; b=YCFbtBPHDExA9upgRYuRJXOIt+AA6WVzR0iVnEz7SjHtSQ+YK2034dl1yVTN8be6Ox2j5L tewzhB3iHEVV6cyBaZMIT4p4hRGpnFLPlP0PBNqwrzBwfqAoO8Y+h3aomrIKwCElAmL3iU +moXxmMbP018ACHh+y+Yorik1MvZWX3N2UTFsyK9WeGcgKpERd3F5e51Vn+o4wc6Jo5vma vXiGvQ2gbobbzEcpuU+9W9qC9OMz+f2p/NPfg5XhhFnn6Rt0Es6laG9Lee6NEj7ohGlNxt zIjjPE/NSnCguW9oSGExdLMBM/7m8FBZSl9zhWlPIIW37tD8P8f0d3HMm2optA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJ91d93zjVp; Thu, 31 Oct 2024 16:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1TCv070208; Thu, 31 Oct 2024 16:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1Tbp070205; Thu, 31 Oct 2024 16:01:29 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:29 GMT Message-Id: <202410311601.49VG1Tbp070205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: a0594d1f65d6 - stable/14 - ena: Add reset reason for missing admin interrupt List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a0594d1f65d67b2ff91cf9c0caa94cdebae7e04e Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=a0594d1f65d67b2ff91cf9c0caa94cdebae7e04e commit a0594d1f65d67b2ff91cf9c0caa94cdebae7e04e Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +0000 ena: Add reset reason for missing admin interrupt There can be cases when we trigger reset if an admin interrupt is missing. In order to identify this use-case specifically, this commit adds a new reset reason. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 274319acb48424958242d55e1b0c7d4528da7f70) --- sys/dev/ena/ena.c | 13 +++++++++++-- sys/dev/ena/ena.h | 5 ++++- sys/dev/ena/ena_sysctl.c | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 3f3a4946ccca..36e9ac15e8ff 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3029,6 +3029,7 @@ static void check_for_missing_keep_alive(struct ena_adapter *adapter) { sbintime_t timestamp, time; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; if (adapter->wd_active == 0) return; @@ -3040,7 +3041,10 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) time = getsbinuptime() - timestamp; if (unlikely(time > adapter->keep_alive_timeout)) { ena_log(adapter->pdev, ERR, "Keep alive watchdog timeout.\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO); + if (ena_com_aenq_has_keep_alive(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } @@ -3048,10 +3052,15 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) static void check_for_admin_com_state(struct ena_adapter *adapter) { + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_ADMIN_TO; if (unlikely(ena_com_get_admin_running_state(adapter->ena_dev) == false)) { ena_log(adapter->pdev, ERR, "ENA admin queue is not in running state!\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_ADMIN_TO); + counter_u64_add(adapter->dev_stats.admin_q_pause, 1); + if (ena_com_get_missing_admin_interrupt(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b747736224d8..1a436a702ba1 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -391,6 +391,8 @@ struct ena_stats_dev { counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; counter_u64_t rx_desc_malformed; + counter_u64_t missing_admin_interrupt; + counter_u64_t admin_to; }; struct ena_hw_stats { @@ -542,7 +544,7 @@ struct ena_reset_stats_offset { static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_RESET_LAST] = { ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_KEEP_ALIVE_TO, wd_expired), - ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_q_pause), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_to), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_OS_TRIGGER, os_trigger), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_TX_CMPL, missing_tx_cmpl), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_RX_REQ_ID, bad_rx_req_id), @@ -552,6 +554,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT, missing_admin_interrupt), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index e46e835572fe..c711ecf66d7a 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -298,6 +298,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD, &dev_stats->rx_desc_malformed, "RX descriptors malformed count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_admin_interrupt", CTLFLAG_RD, + &dev_stats->missing_admin_interrupt, "Missing admin interrupts count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_to", CTLFLAG_RD, + &dev_stats->admin_to, "Admin queue timeouts count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:01:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJB53K5z5bx3B; Thu, 31 Oct 2024 16:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJB3T1qz4T7F; Thu, 31 Oct 2024 16:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ovM6AbE5zsdSbkx608Y+HUXmPQTkF49M9KtMJDoHE4=; b=FnG4DUFT/ZYbufz6aPrOJmQvjyV6YSmWaiB2y7WgaApEJPGlLkwF86eI4p55GEIYLtCSnv LfzLy4aunTSIZ9J3IIIb6SWm3Arqw5rOEaPgEo/ZEsyH+IMaYjRZ1OD+7cnV00wLiuGYiD ylTuv10I4rxq7r4z+YEyMtnXl7k/pjmPepejTeFszmdA4av7YkmVJwwpoBJgcH/6bf6ZPn 5savaBUU31CQ7ksrKo+B+QlQzPyupoXz1GM4fW2RfqGqAR5kYZHJTvpFk+Tnj0uZrpaTfY vzAPWnKVOVOXMFYpzSqisq7O1kxYg7stIsPkWMmzTZsIROuGiuwNUi78+gWN8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ovM6AbE5zsdSbkx608Y+HUXmPQTkF49M9KtMJDoHE4=; b=hqOaKz2bAOuqNEezl8JvcVoGpKqpKatGnoENdQEUGyG7ufTtBfY9JbPx7R9kgjw/bIIUvK Q/j8tVmQQYV+j9K/8xA0PGsGR8Rk2UY4BF2m9uY7/w7CmXIfBfTWKY1fEZd+B1ArVtR5zy Il8o2myuiMkoTYvmhsqJ9Qnc6U14moPDIzD7iLOD5VfF6gBsuxG33PV7rCpCExlYBUCRpk DQibAAH1PjCUfWqVgMY0sZCKEL1+nEU3JVj5q9/+7hLs0ZUMyeRREIms4CJXVT23+MOm25 9D7bqjd+n6SBkj3dGnsACVABgr0djkcSPsvqiPUus9BWd5iVcl05/gJRnNO8vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390490; a=rsa-sha256; cv=none; b=pnuJcLVdj826zmOanKkd8V448+aFwazUN8Rb7l30KsEiAYiKJjj3zLq02Evruui1rmXXEs ZofH3IjmxHxCk0aEocmHbJW69SNHDQF7NtquqQ+YG56/L0COun/+o25Y9T3M0xMWSX9NkX mpvK3SkghX0o/0vKIytmAqtQjTw4zFAG0pobgb7B3xhRb0VKAJWjvPnJczOYWUz+xcYDfX LzrBuFfEJPlvB4SR9XhQZXXJVbGugDzVndDI5AN7eb9QQKbQ3T7W5vMkgkAbXyZ2wSWpd9 q4bsWKAT0h8tWRMKfIoOfnD9v8MOO8CtW2NFygWKOIY8Lz7nMQYoQmEw+w1I2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJB2xCwzjsg; Thu, 31 Oct 2024 16:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1UwI070250; Thu, 31 Oct 2024 16:01:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1U1k070247; Thu, 31 Oct 2024 16:01:30 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:30 GMT Message-Id: <202410311601.49VG1U1k070247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: a20c06c6f181 - stable/14 - ena: Set ena_min_poll_delay_us default value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a20c06c6f1813562e46ee10c6f19bb5d5a5b6143 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=a20c06c6f1813562e46ee10c6f19bb5d5a5b6143 commit a20c06c6f1813562e46ee10c6f19bb5d5a5b6143 Author: osamaabb AuthorDate: 2024-09-23 08:06:41 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Set ena_min_poll_delay_us default value This commit sets the default value for ena_min_poll_delay_us to 100. This commit does not change the behavior of the driver, the delay is calculated as MAX(ENA_MIN_ADMIN_POLL_US, delay_us), where the first field is already defined as 100. The second parameter, delay_us is taken from ena_min_poll_delay_us which is currently unset - 0. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 637ff00f2f9bd6c8509d0e2ac8959c7a23f09650) --- sys/dev/ena/ena.c | 2 ++ sys/dev/ena/ena.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 36e9ac15e8ff..8c20596d3d23 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3736,6 +3736,8 @@ ena_attach(device_t pdev) goto err_bus_free; } + ena_dev->ena_min_poll_delay_us = ENA_ADMIN_POLL_DELAY_US; + /* Initially clear all the flags */ ENA_FLAG_ZERO(adapter); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 1a436a702ba1..876c3cd258aa 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -146,6 +146,8 @@ /* Max number of timeouted packets before device reset */ #define ENA_DEFAULT_TX_CMP_THRESHOLD (128) +#define ENA_ADMIN_POLL_DELAY_US 100 + /* * Supported PCI vendor and devices IDs */ From nobody Thu Oct 31 16:01:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJD05RDz5bwmh; Thu, 31 Oct 2024 16:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJC4Hdcz4T4n; Thu, 31 Oct 2024 16:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewqgePUmWqbb9fx8PbZlm3wyu9ayBGBcLMX984ioCuI=; b=nS8yMSoigoQtTD4RBbFXkG4skAhlJ9letN9a3yxI9PE3R5dKlwoeb2i34YT7TzcuINmT/M YhIkdPZlDOn2/Gr+ruYetPb9BDrjX7ZthMTuRsWYXk41kzG9lWruTw1ShZL+ZRLzw6jYHK KZE/RVY5EsOhHoZkyAe09PNAdhHp8nH9MDGxYnP3MncqBRksyegVfenCVmjCUzV69jSMeS C417VYiSg/i4ZLq5gHhmW6zcRd5l6b7CBtWiqjOXFH10cP3K1qegcrBZgwDTIw4nIIpiTu ENQ7mRXb8QG8krOX+3u7o4qoD7CNFzPVpN5tPfJL02w6SLjDDqPgDDdMNOEdRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewqgePUmWqbb9fx8PbZlm3wyu9ayBGBcLMX984ioCuI=; b=AF79WkEtwajF5123xauH+72FDXsqkCKU8KnWA1MAaH6K0LSBokBuo10RWhf9NGica11tJr PRZUxtLaWUvukufwBHltSaSYa1WEvT6JeePJXNoWDQnbg6XrniTm6jM71FsuFnrMt9luHb k52OUSrercM8gRDjUvUMd8cwWBXKFJzUZj7Jm6Ul1H4wkUUJqL/nSOr5u6Q6MB3Yg4ZjUO +DlPKwi+KooFb+AzzOSN6fzPSzl4Lw1qk3/hiXzBEJdf4PgR0xrl8AzK1+8CFkKoERAMJP jY/3SMtN652HNWjC6unikQZh5O3V63XOai7Y02xTaD11IgqCEVDQXEZqnM/cWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390491; a=rsa-sha256; cv=none; b=YuqEACmKsBCB0ks1vVEc1ScKGyhZoA2YxgvKCCDdNB3rF8/fxsuQ5EDBLjXfpVo2rcChXn /4RG9ODjkYiHgHDXBbp66Ax1GbqBkGM8PqMta9UGYjmGgHmo9yxzon3Ipx/yA0SpHSm3cy xuqckeIebgoaCtayw4zQPHi9+AjJtxR+ie6x+D6zmwH9Vk9p0dN9OLVONu8fiXOTMvR5P2 m37kCLj93F2uw1eMPR06kOcmStVZc22u7XFfo1o461hyR2Z8NHDar0DSscUeanWRYtsSTL iQGYcA8OrLt72ur4Iph/esp9A6qvr4a8/dz3NEuS5nw9Ffhm6ALIDBkirqQ5YQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJC3vFczjZv; Thu, 31 Oct 2024 16:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1VTD070309; Thu, 31 Oct 2024 16:01:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1VwQ070306; Thu, 31 Oct 2024 16:01:31 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:31 GMT Message-Id: <202410311601.49VG1VwQ070306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: db0c751ed7f1 - stable/14 - ena: Add differentiation for missing TX completions reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: db0c751ed7f1dc1c2c3daeaafa9c5354f48b8589 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=db0c751ed7f1dc1c2c3daeaafa9c5354f48b8589 commit db0c751ed7f1dc1c2c3daeaafa9c5354f48b8589 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Add differentiation for missing TX completions reset This commit adds differentiation for a reset caused by missing tx completions, by verifying if the driver didn't receive tx completions caused by missing interrupts. The cleanup_running field was added to ena_ring because cleanup_task.ta_pending is zeroed before ena_cleanup() runs. Also ena_increment_reset_counter() API was added in order to support only incrementing the reset counter. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit a33ec635d1f6d574d54e6f6d74766d070183be4c) --- sys/dev/ena/ena.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- sys/dev/ena/ena.h | 29 ++++++++++++++++++----------- sys/dev/ena/ena_datapath.c | 21 +++++++++++++++------ 3 files changed, 77 insertions(+), 18 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 8c20596d3d23..bbc857004671 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -169,6 +169,9 @@ static int ena_copy_eni_metrics(struct ena_adapter *); static int ena_copy_srd_metrics(struct ena_adapter *); static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); +static enum ena_regs_reset_reason_types check_cdesc_in_tx_cq(struct ena_adapter *, + struct ena_ring *); + static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME " v" ENA_DRV_MODULE_VERSION; @@ -3088,6 +3091,31 @@ check_for_rx_interrupt_queue(struct ena_adapter *adapter, return (0); } +static enum ena_regs_reset_reason_types +check_cdesc_in_tx_cq(struct ena_adapter *adapter, + struct ena_ring *tx_ring) +{ + device_t pdev = adapter->pdev; + int rc; + u16 req_id; + + rc = ena_com_tx_comp_req_id_get(tx_ring->ena_com_io_cq, &req_id); + /* TX CQ is empty */ + if (rc == ENA_COM_TRY_AGAIN) { + ena_log(pdev, ERR, + "No completion descriptors found in CQ %d\n", + tx_ring->qid); + return ENA_REGS_RESET_MISS_TX_CMPL; + } + + /* TX CQ has cdescs */ + ena_log(pdev, ERR, + "Completion descriptors found in CQ %d", + tx_ring->qid); + + return ENA_REGS_RESET_MISS_INTERRUPT; +} + static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) @@ -3100,6 +3128,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, int missing_tx_comp_to; sbintime_t time_offset; int i, rc = 0; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; + bool cleanup_scheduled, cleanup_running; getbinuptime(&curtime); @@ -3155,7 +3185,19 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, "The number of lost tx completion is above the threshold " "(%d > %d). Reset the device\n", missed_tx, adapter->missing_tx_threshold); - ena_trigger_reset(adapter, ENA_REGS_RESET_MISS_TX_CMPL); + /* Set the reset flag to prevent ena_cleanup() from running */ + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + /* Need to make sure that ENA_FLAG_TRIGGER_RESET is visible to ena_cleanup() and + * that cleanup_running is visible to check_missing_comp_in_tx_queue() to + * prevent the case of accessing CQ concurrently with check_cdesc_in_tx_cq() + */ + mb(); + cleanup_scheduled = !!(atomic_load_16(&tx_ring->que->cleanup_task.ta_pending)); + cleanup_running = !!(atomic_load_8((&tx_ring->cleanup_running))); + if (!(cleanup_scheduled || cleanup_running)) + reset_reason = check_cdesc_in_tx_cq(adapter, tx_ring); + + adapter->reset_reason = reset_reason; rc = EIO; } /* Add the newly discovered missing TX completions */ @@ -3618,6 +3660,7 @@ ena_reset_task(void *arg, int pending) ENA_LOCK_LOCK(); if (likely(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + ena_increment_reset_counter(adapter); ena_destroy_device(adapter, false); ena_restore_device(adapter); diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 876c3cd258aa..c9eb9e8c43d3 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -327,6 +327,7 @@ struct ena_ring { }; uint8_t first_interrupt; + uint8_t cleanup_running; uint16_t no_interrupt_event_cnt; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; @@ -584,21 +585,27 @@ ena_mbuf_count(struct mbuf *mbuf) } static inline void -ena_trigger_reset(struct ena_adapter *adapter, - enum ena_regs_reset_reason_types reset_reason) +ena_increment_reset_counter(struct ena_adapter *adapter) { - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - const struct ena_reset_stats_offset *ena_reset_stats_offset = - &resets_to_stats_offset_map[reset_reason]; + enum ena_regs_reset_reason_types reset_reason = adapter->reset_reason; + const struct ena_reset_stats_offset *ena_reset_stats_offset = + &resets_to_stats_offset_map[reset_reason]; - if (ena_reset_stats_offset->has_counter) { - uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + - ena_reset_stats_offset->stat_offset; + if (ena_reset_stats_offset->has_counter) { + uint64_t *stat_ptr = (uint64_t *)&adapter->dev_stats + + ena_reset_stats_offset->stat_offset; - counter_u64_add((counter_u64_t)(*stat_ptr), 1); - } + counter_u64_add((counter_u64_t)(*stat_ptr), 1); + } + + counter_u64_add(adapter->dev_stats.total_resets, 1); +} - counter_u64_add(adapter->dev_stats.total_resets, 1); +static inline void +ena_trigger_reset(struct ena_adapter *adapter, + enum ena_regs_reset_reason_types reset_reason) +{ + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { adapter->reset_reason = reset_reason; ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 6cbe46cead3e..20864d0d2df6 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -77,17 +77,24 @@ ena_cleanup(void *arg, int pending) int qid, ena_qid; int txc, rxc, i; - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - ena_log_io(adapter->pdev, DBG, "MSI-X TX/RX routine\n"); - tx_ring = que->tx_ring; rx_ring = que->rx_ring; qid = que->id; ena_qid = ENA_IO_TXQ_IDX(qid); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; + atomic_store_8(&tx_ring->cleanup_running, 1); + /* Need to make sure that ENA_FLAG_TRIGGER_RESET is visible to ena_cleanup() and + * that cleanup_running is visible to check_missing_comp_in_tx_queue() to + * prevent the case of accessing CQ concurrently with check_cdesc_in_tx_cq() + */ + mb(); + if (unlikely(((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) || + (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)))) + return; + + ena_log_io(adapter->pdev, DBG, "MSI-X TX/RX routine\n"); + atomic_store_8(&tx_ring->first_interrupt, 1); atomic_store_8(&rx_ring->first_interrupt, 1); @@ -95,7 +102,8 @@ ena_cleanup(void *arg, int pending) rxc = ena_rx_cleanup(rx_ring); txc = ena_tx_cleanup(tx_ring); - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) + if (unlikely(((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) || + (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)))) return; if ((txc != ENA_TX_BUDGET) && (rxc != ENA_RX_BUDGET)) @@ -107,6 +115,7 @@ ena_cleanup(void *arg, int pending) ENA_TX_IRQ_INTERVAL, true, false); counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1); ena_com_unmask_intr(io_cq, &intr_reg); + atomic_store_8(&tx_ring->cleanup_running, 0); } void From nobody Thu Oct 31 16:01:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJF14q1z5bx2R; Thu, 31 Oct 2024 16:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJD5fmgz4Sxd; Thu, 31 Oct 2024 16:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liS+S87AoROmJP4iRYWt1omEFQqtsGYTKw7He310eCg=; b=TD2+qldLpmLI3TD1g1898MchWHkBSRZxZc4NL0QmhTCiN87o6moaJjaNoy42O5y2jr33nS XNsYur19NGp0m5PoSwNlhPeYnmX0YGCLuUwTF09vDtFNGTqb2uC7i/yAPdnRzhrOV+jNHf cG9HmyDAIUlb5bSI+W8bpj8St/c55HsW/Lu7yM75nrwqalmC5YuS2dFn6e/9wzcmHKLdIX 0iADwBAKP8cAEgJyVjfl2aSK5M+tyAB6v2W6iyGThVEukZUeuEP1uF2yp4NbmyV+J5epFC /x+1LCrKh5Kuaajs2gEyEoS2j0IrJ0o/2rvkxcVaQDPNlKNm5QjB3MbyvzJcSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=liS+S87AoROmJP4iRYWt1omEFQqtsGYTKw7He310eCg=; b=MOEB37xSyv6IkJSOn3JDz52wnLYUxT9kFUD2zlC5GzCLD4+4xBTdFtDYxnoPt0dN9frON3 1bUf4nAHC8favGebAVSx7oPG7+TBRuoBSQhrse4ITP0FBiXRGTE/43949rIBKaqwx9Wb4u nRWe96JvKJq8tlwWZZNUlDZadEWLf/cgnVt2Mt9HOKjBCFuruNv+uMmcLPQgOfKwtfK0xo GVj4+sj3ZocCbO7NUXWh23H1meDSKL0v4Uuq7yH8eySp9YXDkNcyKge9lG0Wcm8A8U/GYr OZSCFVoUcKM6UlEtBUfGBumvg1mtKd/kbowADoDFgzFHESLFC+Psq+TMDlQiog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390492; a=rsa-sha256; cv=none; b=Vq/5KY3nqPSjNWB3i+codNVtn9PmRVcLA06GYrF7vWy+i7OHEltmMo9oRqCOLY4TWMSdDd RdxI0AJSXl/o6tYZR2LnP2x3SnuukikIyBLFZMpjBn6rlpStuyiDkhsDUaKitwa/wsH2q5 OpIsZVTEZjiPWCB1k2xr44gG97T3YN4vKh1iTiy63Cj3YUsaA5M0gR9G4YxCSphNIG/WRJ kHpZEecm68+0offqGh/1E6g9DxFU6lrJjATZ5K93K6TEujW8uV1kHShtT3tk77nttlSm46 URGvDMFucVebAOwa7zXQ01dvCNcSgG7P+EVBMhA1WowhASf/M7D/FrRra+k6vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJD4w2SzjXL; Thu, 31 Oct 2024 16:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1WEl070373; Thu, 31 Oct 2024 16:01:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1WdP070370; Thu, 31 Oct 2024 16:01:32 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:32 GMT Message-Id: <202410311601.49VG1WdP070370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: cc489c17d2ac - stable/14 - ena: Trigger reset when mbuf is NULL error happens List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc489c17d2ac7b0a18b5dac8ed31d2fa2d7a06ed Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=cc489c17d2ac7b0a18b5dac8ed31d2fa2d7a06ed commit cc489c17d2ac7b0a18b5dac8ed31d2fa2d7a06ed Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Trigger reset when mbuf is NULL error happens The mbuf is NULL issue happens when the device sends the driver a completion with a wrong request id. Trigger a reset whenever this happens. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit da73e3a7d08c215a5d8530fea9a9730f8ac3709f) --- sys/dev/ena/ena_datapath.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index 20864d0d2df6..ab082fa1810f 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -434,7 +434,9 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, req_id = ena_bufs[buf].req_id; rx_info = &rx_ring->rx_buffer_info[req_id]; if (unlikely(rx_info->mbuf == NULL)) { - ena_log(pdev, ERR, "NULL mbuf in rx_info"); + ena_log(pdev, ERR, "NULL mbuf in rx_info. qid %u req_id %u\n", + rx_ring->qid, req_id); + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_RX_REQ_ID); return (NULL); } @@ -476,7 +478,8 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, rx_info = &rx_ring->rx_buffer_info[req_id]; if (unlikely(rx_info->mbuf == NULL)) { - ena_log(pdev, ERR, "NULL mbuf in rx_info"); + ena_log(pdev, ERR, "NULL mbuf in rx_info. qid %u req_id %u\n", + rx_ring->qid, req_id); /* * If one of the required mbufs was not allocated yet, * we can break there. @@ -488,6 +491,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, * with hw ring. */ m_freem(mbuf); + ena_trigger_reset(adapter, ENA_REGS_RESET_INV_RX_REQ_ID); return (NULL); } From nobody Thu Oct 31 16:01:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJG1Zxgz5bwdQ; Thu, 31 Oct 2024 16:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJF6h4nz4TB7; Thu, 31 Oct 2024 16:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GFF1SvwybaHv2BF7byjrcX6fy5L+V5/h+H79sFeQgX4=; b=igwEq2sBaTiuNio1oMK/EFMSDCOWAtRpWnk4sCAHvmFgqSWeUx7k9hhj46CV/jag+QwYsA vuzOcfR8FOYw1S/r0A4KpMcHtlFVepgm7VWuDnXZ7WTQZM+kE6ISAVGYfqz+fvyMSYezCz j7nQMHHMWTM9n+o+B7WkFFfSmfjy0hhhMUI6t/6UhX97rL2/oND4J0mIYDHxnpW8Bkr+v4 1A15NvpM/1eQ6txkd6hTAq0yqCuR2j++8e83CRerLB5EbUZzBY6/gysC5qzCKNAEriraS0 qLcUMqeUpUKq21OA7tmqpJIwFL4iRR4oGvbj62vC1TNuWklbaQu/Kb9/E5rHJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GFF1SvwybaHv2BF7byjrcX6fy5L+V5/h+H79sFeQgX4=; b=F5kr7BsbGkCMG5qPV7LQ8qYbYZLsr28zyACKTxaX6bnUJOa3Tt79gNhDxwGpaKePjaDA7l K6Uf0ydlKRdQtjTLWZ150gef+5JgbVp5O7ALDjZbAiiappfd67Koc6MIoZdSkYDTiJ2TrG 5ix2onWucaJmjdHG0XebB/+KoiVYKmwE4zBXjezQgiAs1Bx852t21IRBEADQ8YqRjf+cWe dvq//+hFZ6tbbQsh6is64xwn7oM8lw7A7ow9f8VqeKBXLF7KnkJZAwPOJP8gUwW17ItJR8 Unfpc50zLIgbxXMs4x0fP/Qq5Gfp3rs+1LDDu34PLikkHbobTZjFgx/KQEhnPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390493; a=rsa-sha256; cv=none; b=ru4qNoyOnP3Jmi6BsKv9NkXC+uYfZfUmrV1evcfJo84tbw1HzV1DVUrug0RFQUgvLhr/hr 9MHddICxZb8CUEyLJXjAdCGmE093Q+1kc8S8WxDNJS01e/l0PWJIReW5sCabj6UUYcgHJo odGWlkW1Ezxoa3PpdEM7yqxRKS0RgVTZY1AaFK/kMtujtgO4O9Mvc/Wo9XDNCE8RhDJvyI awVJ6tTH0Kgb0/CM/+MW2PA/gaua+lymXiHzeme8AT7+ueFofoEPvxBLaLnj6s/vpX8PBJ Rrn8KDKvZYDxPcWZ7AjNwz4f80FeDi7vP1hbEO8Ubq62WwaGOsUMJSNu9aoOMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJF5k0Czjd7; Thu, 31 Oct 2024 16:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1X6C070427; Thu, 31 Oct 2024 16:01:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1XcE070424; Thu, 31 Oct 2024 16:01:33 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:33 GMT Message-Id: <202410311601.49VG1XcE070424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: d38362c0eed0 - stable/14 - ena: Make global counters style unified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d38362c0eed00fdd72755ba186eb28ff51fe4ad0 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=d38362c0eed00fdd72755ba186eb28ff51fe4ad0 commit d38362c0eed00fdd72755ba186eb28ff51fe4ad0 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Make global counters style unified This commit changes the code so all global counters will have the same line break. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 90953d2f829a45669b0c88a6a03da481f2d54e46) --- sys/dev/ena/ena_sysctl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index c711ecf66d7a..e18328ddc8b2 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -275,11 +275,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->wd_expired, "Watchdog expiry count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_up", CTLFLAG_RD, &dev_stats->interface_up, "Network interface up count"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_down", - CTLFLAG_RD, &dev_stats->interface_down, - "Network interface down count"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", - CTLFLAG_RD, &dev_stats->admin_q_pause, "Admin queue pauses"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "interface_down", CTLFLAG_RD, + &dev_stats->interface_down, "Network interface down count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_q_pause", CTLFLAG_RD, + &dev_stats->admin_q_pause, "Admin queue pauses"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "os_trigger", CTLFLAG_RD, &dev_stats->os_trigger, "OS trigger count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_tx_cmpl", CTLFLAG_RD, From nobody Thu Oct 31 16:01:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJH17tmz5bx2S; Thu, 31 Oct 2024 16:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJG6TPtz4TDX; Thu, 31 Oct 2024 16:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+NkBaTZyYHvL08r5+5i9RP2mpQCmfV3dSTkejMOkWc=; b=RRIT0gsLcs2+K5J7JkxVJKOGIw+/61bfGd/YvHsfNCeFxWzdLyW6yFpsDwxPpeuaj1WEpD ALOswuSaeJIT+K9H0/skt+b/TdT0hxvj3dgoyQtHudEnbm82sf9PW5j6TgeJ2gg6PthU/u 49CMlZ012Fiz3OEcN9AS2TpCpRMKkooBBRnlaAf9PF4pZhcF0KxuORqzI1N5MaEG+IuKtx Bzxm0cwXN5NzC4N6VDlnRib6ewKuXZf6NEEDfK9837ItHSc/0JKNX2qPJWzDvz0N8xQvws jEXePKjqQ9EaocvmTnXVqd3Lbt2yTMn93BorEsTh9Y1z2MEGxMFJnvQlLumHeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+NkBaTZyYHvL08r5+5i9RP2mpQCmfV3dSTkejMOkWc=; b=p0bPils+mE9eOuqJtH9sYjEOYoKhgicbzVDNWcnP7x9pY0fmywdwgzoPwZqnxUDI1m5q8w MUMIIYbQVVcgYl3ex/4pNrKitu3yMtGPI8g+VNUdTJs3JFHbAFs+9BvANR/8nOdM9uswxG RNYTR22LjAdC0kZRRG48yKKuSglak1KQjJy8D7APcVZRML7pFlS/lF6Ka1JV60Xr7yPefy INK9sut+J+20v/chzQkM/FeWcRKEyaLRaQBCaI3h2RHFOv9JOyRerzbtm1c1w2k6q1jgEh XTrX6s0dXggvnGVSAhpVn05AMhRjBK21e1KE4U1F1yskqdhdMjz0HuGdJf6RoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390494; a=rsa-sha256; cv=none; b=kU5CJgQHR5tuiZJY26ZmRdpIGyo/XBXNMHjIGxqN6X8155UIehk0SAHtisO7+R71de+N2y 84NRI5QNgB5WiRBrhCDhHNHMZ+lffOaXPoVrMMTmSngiY7J2R6PLvi7eBIrbYPyRwWPns2 +6p7Oan1fLHJYs5kDxBxMUNRZLGbzyGJkY1nLfMD6EhMqJCrSxF6x67uhYYcerg+7vnB+m BpXh8DDBGU0K5SoO5pDFWlH11ULmwQJtjN3WOdCyo1EOdBdWGIIVdpnfd7LGECIB0O/dr9 nkWlxZ+zujRHHSuXkKHR37eFN/Bh1VYAjuz5iQLwzi4fwsEsxHGamBl11jHrng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJG5zlrzjgy; Thu, 31 Oct 2024 16:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1Yuo070479; Thu, 31 Oct 2024 16:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1Ypc070476; Thu, 31 Oct 2024 16:01:34 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:34 GMT Message-Id: <202410311601.49VG1Ypc070476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: b47eb2848ad8 - stable/14 - ena: Properly unmap last socket chain in netmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b47eb2848ad8537c5213b036e81f1c8f9dd81a25 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=b47eb2848ad8537c5213b036e81f1c8f9dd81a25 commit b47eb2848ad8537c5213b036e81f1c8f9dd81a25 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Properly unmap last socket chain in netmap In case ena_com_prepare_tx() fails within the netmap tx flow, the driver will unmap the last socket chain. Currently, the driver unmaps the wrong socket within ena_netmap_unmap_last_socket_chain(). Illustration of the flow: 1- ena_netmap_tx_frames() 2- ena_netmap_tx_frame() 3- ena_netmap_tx_map_slots() 3.1- Map slot 3.2- Advance to the next socket 4- ena_com_prepare_tx() 4.1- ena_com_prepare_tx() fails 5- ena_netmap_unmap_last_socket_chain() In step 5, where the driver unmaps the socket, the netmap index already points at the next entry, meaning we're unmapping the wrong socket in case ena_com_prepare_tx() fails. In order to fix that, the driver should first update the netmap index to point at the previous entry and only then update the socket parameters. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f236e544a2ff685ae151f3232e3785a6a9aab035) --- sys/dev/ena/ena_netmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index 0666d7deb827..f14a4a9539d1 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -783,10 +783,10 @@ ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *ctx, /* Next, retain the sockets back to the userspace */ n = nm_info->sockets_used; while (n--) { + ctx->nm_i = nm_prev(ctx->nm_i, ctx->lim); ctx->slots[ctx->nm_i].buf_idx = nm_info->socket_buf_idx[n]; ctx->slots[ctx->nm_i].flags = NS_BUF_CHANGED; nm_info->socket_buf_idx[n] = 0; - ctx->nm_i = nm_prev(ctx->nm_i, ctx->lim); } nm_info->sockets_used = 0; } From nobody Thu Oct 31 16:01:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJJ1cb7z5bwh1; Thu, 31 Oct 2024 16:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJH6xTmz4TDl; Thu, 31 Oct 2024 16:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLNOEJwEACZLR/CbyVTrwHS3c1+IXeUUrV0c6t/6ckg=; b=yRzRZLdwyoj29Tt50nskpEW1HLN/E0uY32nwRise+dZ9ejBkrcrL6NIST/LwnhYOv9IAQf p6faFQW1Y5GHbCohwI7sbFRJw2aCiTRO1b0EZtCsXOJbBLZPRNM/TiSIXdB0RoI2Oaan0A ck3tTT/scltbV2KxmQlDhSX8IPun6oyWF2Z0fgAOJP5dMJIcz+oOt4NuvETFDdowDO7KUu ayQh7qb0c7M6SnVqxSoSnjgsT+a9WpHdgA/fRVevIulmD0Rff412Wjj+Cun5Htt9eRrGzg tKKVdJyfrhcdJmPOHEWc+4cYMQnv7lcm258FzHwj4EXuABFovfOZuvee8PD58Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLNOEJwEACZLR/CbyVTrwHS3c1+IXeUUrV0c6t/6ckg=; b=O20MZ1OwZjvLSy+D0N4XNvsvO56iR+TIBpoVpWGWQLLSphCQHjGeBKUMNe1CFXI3zPicEp t0cEDFDxVgo62pAN+zIbov7tBFAIo7YAtxu/IJER2bskD2nQuFfh/+LZKqQGMO2YOhgzsU 7Qptx8K90dO92app/oD+8VLCKNbNc1jsAnjUstNqSso7ghCQZMWaU9e4MYKe4D/KI91qKh hCvy2qCZweKKFMO2vi/d88nLKTVb/bPMfWnS0qzmKFTsp/3MEUo+5x3R2u86/bLlJAPjVY tRqKXgwdgra5dO+b8tHLokP5v7nKZYfNGjAyXx+J9puQjzD0OKF1knceuC/Ajg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390496; a=rsa-sha256; cv=none; b=KddsAuKgUzvSMP1J1fEk4rC5sQrFmtGb5R3Qr0rtdx9o5kdaeHTCWSh3ROOkUpfynMRxUE tM0PRW9aZZaThbw6zaqQF+N/0H83vFMHCA9gJol9RV1Vyeln8Z/GWMbY55Mzr53SblQNya ao+YELlCUJBrwKTLcf0bUHLrdmxWcDRYvtipF+Lo6ufATuAFa7x4KcbOXiW1kct0MvrcFT hRE/pYmrVaj8GQjbxq/C8gr055YgCwMx3CCeDoSv7o2Hgvon2oqiGJbZyBFiPHSWCLOrdj Nj8pAcu5iViCeK/cbqLyWuxdkpCE3fzX+b4G5Fg8Fb5QdiKPtV5oqmDrR2tuQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJH6WSDzjZy; Thu, 31 Oct 2024 16:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1ZOJ071465; Thu, 31 Oct 2024 16:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1ZVn071450; Thu, 31 Oct 2024 16:01:35 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:35 GMT Message-Id: <202410311601.49VG1ZVn071450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: b0830d2b6bbc - stable/14 - ena: Handle wrap around for prefetch in netmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b0830d2b6bbc76fcbfe937f674e06e14933ad3ef Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=b0830d2b6bbc76fcbfe937f674e06e14933ad3ef commit b0830d2b6bbc76fcbfe937f674e06e14933ad3ef Author: Osama Abboud AuthorDate: 2024-08-07 06:24:20 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Handle wrap around for prefetch in netmap Netmap index wraps around based on the number of netmap kernel ring slots. Currently the driver prefetches the next slot using nm_i + 1 which may be wrong since it does not handle wrap around. This patch fixes that by using the kernel API for fetching the next netmap index. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit ce20b51cb71bfb548fcaafc4bacb8290460f03d5) --- sys/dev/ena/ena_netmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index f14a4a9539d1..eef8021b8569 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -577,7 +577,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, remaining_len = *packet_len; delta = 0; - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); if (tx_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { /* * When the device is in LLQ mode, the driver will copy @@ -664,7 +664,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, * The first segment is already counted in. */ while (delta > 0) { - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); frag_len = slot->len; /* @@ -722,7 +722,7 @@ ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, /* Map all remaining data (regular routine for non-LLQ mode) */ while (remaining_len > 0) { - __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + __builtin_prefetch(&ctx->slots[nm_next(ctx->nm_i, ctx->lim)]); rc = ena_netmap_map_single_slot(ctx->na, slot, adapter->tx_buf_tag, *nm_maps, &vaddr, &paddr); From nobody Thu Oct 31 16:01:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJK2yG6z5bwms; Thu, 31 Oct 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJK15skz4TGp; Thu, 31 Oct 2024 16: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=1730390497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1NP0woE+/+XEz3jmToCbxPvu59KPfs3qUQwlp3Ggx0=; b=e3cgKmlMiN0kZMVZz/B26P0bV29jQUlWJC93bVn6vz6sAXCgJz8p2t+6g2ixIRV8oHMgEz X8AUY/FlMMfqhzMbo6cUzmgMC4fTXpylbCes2O+XedL6FGGfQ4VYWTTVXoKiPZi9OwbYRM EYZ8tDjkmRm8Wg1vBXrnJOfRsIZ4M4NJqvGiB8V8QqsZUSAli3t0Qg6r8aycfRyvzo4gVa khOBRKd47+mBtT6LzAHGh1BZBAw7fSrN+zLxvON35giVE5PCfxC7pGyXCvQJqY16LHv14E 5vq6HfHkwmMA1RCNRUm8e2VnWSfIrgUkhLFG/QZ7YeROfUqmdxNeYTrfTlEGUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1NP0woE+/+XEz3jmToCbxPvu59KPfs3qUQwlp3Ggx0=; b=huTC4nlVKkIFSDY7WVpEhbFv/uyIKQOMVSKo7V4hO89XD0oGk/QpPZbxMu/IFhI6dcgV3h zhWD6BBiAHkhv8A5edkoaZNJCNtY0vsPZ502Q2KPILjiv5hxKK8W5ybhrbWTwIml120UJR iI81/qlndGf9GKxrpfcvqUimnP9QjIjJmS+I0FXLLOm90vcwlzMbxemJVtdw5mMr7kj2EU /CaVyl/289XzzQitrHoKh7yCdhN/dk56m0Mjp8C5jrZlGrjlB2hA9u3AVcr9on2c6sD7q+ fv1PicYh6CmEssHeKejVNSnroWNj3snof4qIQGx06kMzg0Ms6FcdyFTD5zfMWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390497; a=rsa-sha256; cv=none; b=hMhTrfHNhqHMpS2WlLm/E1+zy+nYvMGAtaTlmA9UAxkujF2YW0+Lbd0ybt5ckmb9kvwwJT Prc8nY3p/M/mtyFjxAAE0931Zd1hxnM9RnKn8y4uxvNaVjXbbhdIZDbk1o6S1GB4GDIX9c gnJu8W6dpFlZVUV1pf1z7EmLaL1IhzJKx4etYk2VU42+QoeXUYKc/E5cGcl9ulQnwH3j9I oQQPskzQx7LrsVDOM25cYjZuDd2l7CjujeJ6czz5+T/etyfj5aQyAaYYOWiWkwugUYVJXQ qL9Ko98IX3PFNB1pmUW2FU8YorUq1VDe+RFTduzaqYEunlUrqytVF6JsXVe+EQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJK0Qd3zjVq; Thu, 31 Oct 2024 16:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1aWA072985; Thu, 31 Oct 2024 16:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1ahP072975; Thu, 31 Oct 2024 16:01:36 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:36 GMT Message-Id: <202410311601.49VG1ahP072975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 8b43095ad8cd - stable/14 - ena: Clear NS_MOREFRAG flag for last netmap slot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b43095ad8cdddfd0cdb11bb6e14aea60e607b5d Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8b43095ad8cdddfd0cdb11bb6e14aea60e607b5d commit 8b43095ad8cdddfd0cdb11bb6e14aea60e607b5d Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Clear NS_MOREFRAG flag for last netmap slot When processing packets within the rx-flow ena_netmap_rx_load_desc doesn't know the number of descriptors, so it sets NS_MOREFRAG to all the slots to indicate that there are more fragments for this packet. The code calls ena_netmap_rx_load_desc() for every descriptor in this packet to map the relevant buffer into the netmap shared memory. After ena_netmap_rx_load_desc() calls, we need to unset the NS_MOREFRAG for the last fragment to indicate that this is the last fragment, so we explicitly turn off NS_MOREFRAG flag. Current code overrides all other flags and sets NS_BUF_CHANGED. This patch unsets the relevant flag only. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 2f17afd19a3534dc1755c52edb0c2f70ea0eb1e4) --- sys/dev/ena/ena_netmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index eef8021b8569..8a220373ec3f 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -964,7 +964,7 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) * It just set flag NS_MOREFRAG to all slots, then here flag of * last slot is cleared. */ - ctx->slots[nm_prev(ctx->nm_i, ctx->lim)].flags = NS_BUF_CHANGED; + ctx->slots[nm_prev(ctx->nm_i, ctx->lim)].flags &= ~NS_MOREFRAG; if (rc != 0) { goto rx_clear_desc; From nobody Thu Oct 31 16:01:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJL3cBFz5bwrc; Thu, 31 Oct 2024 16:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJL206xz4TH0; Thu, 31 Oct 2024 16:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuTTRKay8oOBV6vzI0neHfBT9A5Qo67HTLJTuUqZJ/4=; b=iZXTcN1YEPGvTJMwMGf9/zWRxnYVc4Hzl7DYZxLidDuO7cfD6L/S1v1c2GCYkllTKk3Cke Xla+W0XAcRW1ZF1zlBvaBAoPzjEDUTx1PKkArl8HsVitCPXBhKsMvDgOfdZ6LRp41BoOQY TSZfmF1d//i6IY0NA/K7mwinaT4nYNVwOeR6+QS6WP63Lx5iYcWte5iwyu8jZQ7oJyx/5o Sv+nWjfrk2o46AYiEuIyfe/c5F5ccSHzSIpsUxguCGJm/vlugOrb1+JcU9Cj3U3w2VguEV IOSk250gABXI1XHR1WLZANZbsSdV+kW77xC3SZ02mmajyHqX7jerEzt38eD+7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuTTRKay8oOBV6vzI0neHfBT9A5Qo67HTLJTuUqZJ/4=; b=TpodT22DooPS2OolqREODYU/aXcBb79k9scsR9zlxoWH1pp9y2fyDBoFC51DenX22l71Mv 1qJmgYIz+B45LAz0JXmkwj58CXVBvymlAEfM2gqMCUgsjTUp8DRuNqLNdx7Lxu+A5cEPAg hf9lr05hb9lzTpGTPRK88k4VtzFChLNGp/ivagzJq1dcDmk/gGIUMJAE6wMrRz+qi7b+1U W4upwQ4jLz+uBRFB2fk+91qfd5L0yQhfX0c9vKWkbI3FYsxDx4JD4BGkyqm58+VGgEgJIR 8RCHE72sTrJ4V8ZqmHwU7oORhBB+I0i/1NUsLuSP3mEfR/GTtChqIclEs4nsiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390498; a=rsa-sha256; cv=none; b=eUtE8KiWOefjOfIViC9GnE0SzkAvv5HDgnozom6LuMULdeL39iFNudzbAdxD2UjBimd0sg e6OG2iJ9aDLua071XLLCsl/x7AUg6J5GKEl08lXeqPXwjNHIF3GThpyoPnGJSkxBSAiB48 Bo0gJqdE38elK6266BlJqonXpckgtjSmZexIgXbiwxt3rXGfoCXYQx/rLfpTb11AFSHwfj 7uJZ5IKiCARSh8Qc1y/Z4qGvDUlpB43jGtrj7B9n2DyU2DeytHm6fIYx2jAbkTd3a3tk4K swB+b8Dngz5rKCA11K30f9WQHMySxF3jrIWsrXrSFiAFzEWe769n1rAHSfbvxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJL1bGMzjsk; Thu, 31 Oct 2024 16:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1ctn073255; Thu, 31 Oct 2024 16:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1cwu073252; Thu, 31 Oct 2024 16:01:38 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:38 GMT Message-Id: <202410311601.49VG1cwu073252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 9aa14351c104 - stable/14 - ena: Reinit netmap adapter struct upon sysctl changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9aa14351c104d0d1603dd2484095116b86d9702c Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=9aa14351c104d0d1603dd2484095116b86d9702c commit 9aa14351c104d0d1603dd2484095116b86d9702c Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Reinit netmap adapter struct upon sysctl changes When attaching ENA driver, ena_netmap_attach() is invoked which, in turn calls netmap_attach which, initializes a struct netmap_adapter, allocating the struct's netmap_ring and the struct selinfo. When we change the interface number of queues we need to reinit the netmap adapter struct as well, so we need to detach it in order to free the memory allocated by netmap_attach and allocate new memory based on the new parameters like number of rings, ring size etc... Without detaching and attaching the netmap interface, if we're to change the number of queues from 8 to 2 for example and try to enable netmap, the kernel will panic since the original netmap struct within the kernel's possession still thinks that the driver has 8 queues which will eventually cause a non-allocated virtual address access fault. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit f9c9c01de87e0440380b939c684d9939d48ce175) --- sys/dev/ena/ena.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index bbc857004671..bfde950cb2b1 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -171,7 +171,9 @@ static int ena_copy_customer_metrics(struct ena_adapter *); static void ena_timer_service(void *); static enum ena_regs_reset_reason_types check_cdesc_in_tx_cq(struct ena_adapter *, struct ena_ring *); - +#ifdef DEV_NETMAP +static int ena_reinit_netmap(struct ena_adapter *adapter); +#endif static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME " v" ENA_DRV_MODULE_VERSION; @@ -1162,6 +1164,21 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) return (i); } +#ifdef DEV_NETMAP +static int +ena_reinit_netmap(struct ena_adapter *adapter) +{ + int rc; + + netmap_detach(adapter->ifp); + rc = ena_netmap_attach(adapter); + if (rc != 0) + ena_log(adapter->pdev, ERR, "netmap attach failed: %d\n", rc); + + return rc; +} + +#endif /* DEV_NETMAP */ int ena_update_buf_ring_size(struct ena_adapter *adapter, uint32_t new_buf_ring_size) @@ -1179,6 +1196,12 @@ ena_update_buf_ring_size(struct ena_adapter *adapter, /* Reconfigure buf ring for all Tx rings. */ ena_free_all_io_rings_resources(adapter); ena_init_io_rings_advanced(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; + +#endif /* DEV_NETMAP */ if (dev_was_up) { /* * If ena_up() fails, it's not because of recent buf_ring size @@ -1196,7 +1219,12 @@ ena_update_buf_ring_size(struct ena_adapter *adapter, adapter->buf_ring_size = old_buf_ring_size; ena_free_all_io_rings_resources(adapter); ena_init_io_rings_advanced(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); ena_trigger_reset(adapter, ENA_REGS_RESET_OS_TRIGGER); @@ -1224,6 +1252,12 @@ ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, /* Configure queues with new size. */ ena_init_io_rings_basic(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; + +#endif /* DEV_NETMAP */ if (dev_was_up) { rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1235,7 +1269,12 @@ ena_update_queue_size(struct ena_adapter *adapter, uint32_t new_tx_size, adapter->requested_tx_ring_size = old_tx_size; adapter->requested_rx_ring_size = old_rx_size; ena_init_io_rings_basic(adapter); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ /* And try again. */ rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1359,7 +1398,12 @@ ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) ena_down(adapter); ena_update_io_rings(adapter, new_num); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ if (dev_was_up) { rc = ena_up(adapter); if (unlikely(rc != 0)) { @@ -1369,7 +1413,12 @@ ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num) new_num, old_num); ena_update_io_rings(adapter, old_num); +#ifdef DEV_NETMAP + rc = ena_reinit_netmap(adapter); + if (rc != 0) + return rc; +#endif /* DEV_NETMAP */ rc = ena_up(adapter); if (unlikely(rc != 0)) { ena_log(adapter->pdev, ERR, From nobody Thu Oct 31 16:01:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJM5dDlz5bwmw; Thu, 31 Oct 2024 16:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJM3nHrz4THD; Thu, 31 Oct 2024 16:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fPd/P8HcCLeb2jWf7gKHE3gxcstvBj4cW033l3T3bk=; b=DoeUgFnOEN4FYujfaB8lKHiGL819SSdSxeyXCWSSEiFtxWM722IjutGBtHg4+8m744b62C P/ieLMNleLG7AH9cPROsZ2Lm/rEUca+Ab8ism+lSqUpU4smjqnpPOIDiiPKpJu5BzAy9fJ Rg/jQ3pMReWicdMYUKRU8loubriuQnjPe3aVnvK2vlSIt+QeY+KizZV+S7YwLucLI/NSu3 c9yhycVLXDIIcLDV/71I++Qu60K4nXuQ5fC/vopkvUm45y+KNLGpEwcUA/RtQQgd0rL2OW JsvKHMjyGliKErIQisl1p2zsNdmJdRBUUVOGnBY38m/zcCzqWQ6W+udMs5FP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fPd/P8HcCLeb2jWf7gKHE3gxcstvBj4cW033l3T3bk=; b=ed3KnEB/U2w6HjGA2n0DcIEo5bZfqpYjTG4s+LgTWk/qFHTWAW5v3bZJWuHuDDMW4gNO/q su4b0V+JFev9yf/YLsnyg1XF6tvpWfyFj37MnDZ6FrRuh+Hmt+vvaqyui1nOTfHhKQBA9I Y3/+kH3jqKIkWJVLVv+7cgbZdynBx+bkhhSEU9hyw1nikq9BJuOZJ5ECeRGXTEvthV+a0U 0bE+uutW41fwzUxJ3RXr191btn0vDI2/5176Me6mVjgCp67VwbktRQNGjq5NURh7O8lTpb R5ntDphQi5rm6JEQ4ZCVqlJKztFcmeV4Ty4I7YDFNI1o4Nbqu8EeuLFJ6N/stg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390499; a=rsa-sha256; cv=none; b=qS8aYjOvVYWJImVT9lryUIScIDgxgVXGpDDDQgocfdXcWm7Y+ZRcm8iNLRv1fQPwFKwY0H xQ30bjv5X6ge1GmQZI80fVdSXv9L4Ipp8noaYangB98L0K4BRBeMcLBDmOddt2p17RXArU +CEXNEacx75bR7nOCPawZpDopJwrUu8oos4SLZO6L8qNhoHx5MvVk8ANObUJn5h7WMSqcJ CSbxviGnYWPwAU969xEK81pB6IPh8jqD8kgWbGk2PikGLgFJLhL2gWX4PNuFUrdUNFBIKv oGA5nyJ7AwRfB0HIB6JQaP/i436noc6Oy5dk6g/WfUf275g7Wh6/nUmVz2L8Hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJM2crJzjh1; Thu, 31 Oct 2024 16:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1dYt073312; Thu, 31 Oct 2024 16:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1dkr073309; Thu, 31 Oct 2024 16:01:39 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:39 GMT Message-Id: <202410311601.49VG1dkr073309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: ebb857f4ce31 - stable/14 - ena: Add support for device request reset message over AENQ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ebb857f4ce31065ade247919ee7e4e71706bad08 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=ebb857f4ce31065ade247919ee7e4e71706bad08 commit ebb857f4ce31065ade247919ee7e4e71706bad08 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Add support for device request reset message over AENQ This commit adds a handler for the new aenq message ENA_ADMIN_DEVICE_REQUEST_RESET, which in turn causes the driver to trigger reset of a new type: ENA_REGS_RESET_DEVICE_REQUEST. Also adds counting of such occurrences in a new statistic for it. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 705879424bc76fcc925e78eb7643dbf4bd9a11eb) --- sys/dev/ena/ena.c | 13 ++++++++++++- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_sysctl.c | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index bfde950cb2b1..2c96f8def20a 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2990,7 +2990,8 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, BIT(ENA_ADMIN_WARNING) | BIT(ENA_ADMIN_NOTIFICATION) | BIT(ENA_ADMIN_KEEP_ALIVE) | - BIT(ENA_ADMIN_CONF_NOTIFICATIONS); + BIT(ENA_ADMIN_CONF_NOTIFICATIONS) | + BIT(ENA_ADMIN_DEVICE_REQUEST_RESET); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); @@ -4195,12 +4196,22 @@ static void ena_conf_notification(void *adapter_data, } } +static void ena_admin_device_request_reset(void *adapter_data, + struct ena_admin_aenq_entry *aenq_e) +{ + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + ena_log(adapter->pdev, WARN, + "The device has detected an unhealthy state, reset is requested\n"); + ena_trigger_reset(adapter, ENA_REGS_RESET_DEVICE_REQUEST); +} + static struct ena_aenq_handlers aenq_handlers = { .handlers = { [ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change, [ENA_ADMIN_NOTIFICATION] = ena_notification, [ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd, [ENA_ADMIN_CONF_NOTIFICATIONS] = ena_conf_notification, + [ENA_ADMIN_DEVICE_REQUEST_RESET] = ena_admin_device_request_reset, }, .unimplemented_handler = unimplemented_aenq_handler }; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index c9eb9e8c43d3..7ec470638859 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -396,6 +396,7 @@ struct ena_stats_dev { counter_u64_t rx_desc_malformed; counter_u64_t missing_admin_interrupt; counter_u64_t admin_to; + counter_u64_t device_request_reset; }; struct ena_hw_stats { @@ -558,6 +559,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT, missing_admin_interrupt), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DEVICE_REQUEST, device_request_reset), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index e18328ddc8b2..ce6e0b7375e6 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -301,6 +301,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->missing_admin_interrupt, "Missing admin interrupts count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_to", CTLFLAG_RD, &dev_stats->admin_to, "Admin queue timeouts count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "device_request_reset", CTLFLAG_RD, + &dev_stats->device_request_reset, "Device reset requests count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count"); From nobody Thu Oct 31 16:01:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJN5hThz5bwb6; Thu, 31 Oct 2024 16:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJN3kwpz4TC7; Thu, 31 Oct 2024 16:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TrrVHl2VDSFSm/45pFjaVEcOBNgZBO2gP+RU4jkr1+k=; b=SVh1BQ5NsnRGSYS/eYzzkZR7q72OjFbAyt5f/xwGc7M1UIxKoezasWFTcUHwE7YrWrFS/X cZ8e/56xgvu490zaZfiWH+EejiWub6TmGAas5H+fUoxbkr1VCuA9rebp/a8Rx3cUOvKtza Wn55ptWWEv+NCb7plrgwK/2vkemINmBjbXilalfK1d9CCsSbXp85aVUMtnSJMnUo4s2wr8 XTNXEVF9bkUBMD9H+6ON7B57Tg+gr39mgW79mM3RIy87zP6oi8hHmWzHWnlpUj5Dw25JQ8 WhvyhwFEIcJW4RhZySOqr+4yD+KjW+PcL81u7vtUguQOcuPC83Upzo+xGFdoqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TrrVHl2VDSFSm/45pFjaVEcOBNgZBO2gP+RU4jkr1+k=; b=D8GFPIBv2wGMIHOyQmP29IfOZKWa+6eWDzBEIaWaZVh7t7u6X2Vo4xgZK5woD+HseKYE7j dc0xBbjurnYmo0o2Gbxu7cMr/k77ex8HfciRGKTQC/5K/kAEjjRb2ZOOkgUbxRAyWXyWNE K9nCdNWfa18Parhut8sLAcv0Iz6cfVzHPr3v7qEAZFQIXbj8vvS2cVPitwwd035VZ6bID+ +fruK6nNERpsIl5Mu3J2Q0XBo6459dm1sYL8PByWs18ZiuvYwW/1/cHOAXa3aXUnZhisnH mHotyJ+rxD74+xKbx/yZVwRYKOe8JpVOlrGzLdnRjQpbm1iVzPBivxTQ+psqjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390500; a=rsa-sha256; cv=none; b=Z8tdGR7oNOcbzoFx2JrCB8dM55hvC4eX9l6OgrcFceG+zq8eeA97ov56WBjyJQpHcTu31e ZiOPf+Tt2eETyPQhddGeUPPZMwYPryr6egS3uYdRnZwxCGA2sVmRjqdA4ORN096c7zG1K9 +i6cXbmNynQJv96Vy/gsd1tjSGw/ZXgOwlO+T9GXR6N2c5xIXguSRB9lEFlwWNsEEOWHO5 mY4QtwRHM5oWRsIfgK8BWfX20o/TWE/Q0jqvV5TA9k7ZhZe7eInWjb+S7yobBTDgXx73jI yn+BpXK3CqhaYs3TSJw7UnxvcHK7bP4tlh7L4QTCmexBttJkYGL3FffVInJ3lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJN3LcJzjVt; Thu, 31 Oct 2024 16:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1eEj073367; Thu, 31 Oct 2024 16:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1e11073364; Thu, 31 Oct 2024 16:01:40 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:40 GMT Message-Id: <202410311601.49VG1e11073364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 4d18878ada2e - stable/14 - ena: Support LLQ entry size recommendation from device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d18878ada2e1520384d2ab28df142a2dd303842 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=4d18878ada2e1520384d2ab28df142a2dd303842 commit 4d18878ada2e1520384d2ab28df142a2dd303842 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:21 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Support LLQ entry size recommendation from device This commit adds support for receiving LLQ entry size recommendation from the device. The driver will use the recommended entry size, unless the user specifically chooses to use regular or large LLQ entry. Also added enum ena_llq_header_size_policy_t and llq_plociy field in order to support the new feature. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit b1c38df05d79c81ee1e9fd0942774820a4ffcb63) --- share/man/man4/ena.4 | 14 +++++++------- sys/dev/ena/ena.c | 39 +++++++++++++++++++++------------------ sys/dev/ena/ena.h | 11 +++++++++++ sys/dev/ena/ena_sysctl.c | 14 +++++++------- sys/dev/ena/ena_sysctl.h | 2 +- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/share/man/man4/ena.4 b/share/man/man4/ena.4 index 0fbe0819978c..a3cb9ef5b37a 100644 --- a/share/man/man4/ena.4 +++ b/share/man/man4/ena.4 @@ -133,17 +133,17 @@ This can further lead to OS instability, together with ENA driver reset and NVMe timeouts. If network performance is critical and memory capacity is sufficient, the 9k mbufs can be used. -.It Va hw.ena.force_large_llq_headers -Force the driver to use large LLQ headers (224 bytes). -The default is 0. +.It Va hw.ena.force_large_llq_header +Force the driver to use large (224 bytes) or regular (96 bytes) LLQ header size. +The default value is 2 and the recommended LLQ header size will be used. If the node value is set to 0, the regular size LLQ header will be used, which is 96B. In some cases, the packet header can be bigger than this (for example - IPv6 with multiple extensions). -In such a situation, the large LLQ headers should be used by setting this node -value to 1. -This will take effect only if the device supports both LLQ and large LLQ -headers. +In such a situation, the large LLQ header size which is 224B should be used, +and can be forced by setting this node value to 1. +Using large LLQ header size will take effect only if the device supports +both LLQ and large LLQ headers. Otherwise, it will fallback to the no LLQ mode or regular header size. .Pp Increasing LLQ header size reduces the size of the Tx queue by half, so it may diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 2c96f8def20a..fadba819652b 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -156,7 +156,7 @@ static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, static int ena_map_llq_mem_bar(device_t, struct ena_com_dev *); static uint32_t ena_calc_max_io_queue_num(device_t, struct ena_com_dev *, struct ena_com_dev_get_features_ctx *); -static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *); +static int ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *, struct ena_adapter *); static void ena_config_host_info(struct ena_com_dev *, device_t); static int ena_attach(device_t); static int ena_detach(device_t); @@ -2756,27 +2756,32 @@ ena_map_llq_mem_bar(device_t pdev, struct ena_com_dev *ena_dev) } static inline void -set_default_llq_configurations(struct ena_llq_configurations *llq_config, - struct ena_admin_feature_llq_desc *llq) +ena_set_llq_configurations(struct ena_llq_configurations *llq_config, + struct ena_admin_feature_llq_desc *llq, struct ena_adapter *adapter) { llq_config->llq_header_location = ENA_ADMIN_INLINE_HEADER; llq_config->llq_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; llq_config->llq_num_decs_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; - if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != - 0 && ena_force_large_llq_header) { - llq_config->llq_ring_entry_size = - ENA_ADMIN_LIST_ENTRY_SIZE_256B; - llq_config->llq_ring_entry_size_value = 256; + if ((llq->entry_size_ctrl_supported & ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0) { + if ((ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_LARGE) || + (ena_force_large_llq_header == ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT && + llq->entry_size_recommended == ENA_ADMIN_LIST_ENTRY_SIZE_256B)) { + llq_config->llq_ring_entry_size = + ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_config->llq_ring_entry_size_value = 256; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + } } else { llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_128B; llq_config->llq_ring_entry_size_value = 128; + adapter->llq_policy = ENA_ADMIN_LIST_ENTRY_SIZE_128B; } } static int -ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx) +ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, struct ena_adapter *adapter) { struct ena_admin_feature_llq_desc *llq = &ctx->get_feat_ctx->llq; struct ena_com_dev *ena_dev = ctx->ena_dev; @@ -2831,22 +2836,20 @@ ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx) max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); /* - * When forcing large headers, we multiply the entry size by 2, + * When using large headers, we multiply the entry size by 2, * and therefore divide the queue size by 2, leaving the amount * of memory used by the queues unchanged. */ - if (ena_force_large_llq_header) { - if ((llq->entry_size_ctrl_supported & - ENA_ADMIN_LIST_ENTRY_SIZE_256B) != 0 && - ena_dev->tx_mem_queue_type == + if (adapter->llq_policy == ENA_ADMIN_LIST_ENTRY_SIZE_256B) { + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { max_tx_queue_size /= 2; ena_log(ctx->pdev, INFO, - "Forcing large headers and decreasing maximum Tx queue size to %d\n", + "Using large headers and decreasing maximum Tx queue size to %d\n", max_tx_queue_size); } else { ena_log(ctx->pdev, WARN, - "Forcing large headers failed: LLQ is disabled or device does not support large headers\n"); + "Using large headers failed: LLQ is disabled or device does not support large headers\n"); } } @@ -3002,7 +3005,7 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev, *wd_active = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE)); - set_default_llq_configurations(&llq_config, &get_feat_ctx->llq); + ena_set_llq_configurations(&llq_config, &get_feat_ctx->llq, adapter); rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx->llq, &llq_config); @@ -3861,7 +3864,7 @@ ena_attach(device_t pdev) /* Calculate initial and maximum IO queue number and size */ max_num_io_queues = ena_calc_max_io_queue_num(pdev, ena_dev, &get_feat_ctx); - rc = ena_calc_io_queue_size(&calc_queue_ctx); + rc = ena_calc_io_queue_size(&calc_queue_ctx, adapter); if (unlikely((rc != 0) || (max_num_io_queues <= 0))) { rc = EFAULT; goto err_com_free; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 7ec470638859..132d8882f12c 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -173,6 +173,15 @@ enum ena_flags_t { ENA_FLAGS_NUMBER = ENA_FLAG_RSS_ACTIVE }; +enum ena_llq_header_size_policy_t { + /* Policy for Regular LLQ entry size (128B) */ + ENA_LLQ_HEADER_SIZE_POLICY_REGULAR, + /* Policy for Large LLQ entry size (256B) */ + ENA_LLQ_HEADER_SIZE_POLICY_LARGE, + /* Policy for device recommended LLQ entry size */ + ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT +}; + BITSET_DEFINE(_ena_state, ENA_FLAGS_NUMBER); typedef struct _ena_state ena_state_t; @@ -459,6 +468,8 @@ struct ena_adapter { uint8_t mac_addr[ETHER_ADDR_LEN]; /* mdio and phy*/ + uint8_t llq_policy; + ena_state_t flags; /* IRQ CPU affinity */ diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index ce6e0b7375e6..a6076c57e3f5 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -148,17 +148,17 @@ SYSCTL_INT(_hw_ena, OID_AUTO, enable_9k_mbufs, CTLFLAG_RDTUN, &ena_enable_9k_mbufs, 0, "Use 9 kB mbufs for Rx descriptors"); /* - * Force the driver to use large LLQ (Low Latency Queue) header. Defaults to - * false. This option may be important for platforms, which often handle packet - * headers on Tx with total header size greater than 96B, as it may - * reduce the latency. + * Force the driver to use large or regular LLQ (Low Latency Queue) header size. + * Defaults to ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT. This option may be + * important for platforms, which often handle packet headers on Tx with total + * header size greater than 96B, as it may reduce the latency. * It also reduces the maximum Tx queue size by half, so it may cause more Tx * packet drops. */ -bool ena_force_large_llq_header = false; -SYSCTL_BOOL(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, +int ena_force_large_llq_header = ENA_LLQ_HEADER_SIZE_POLICY_DEFAULT; +SYSCTL_INT(_hw_ena, OID_AUTO, force_large_llq_header, CTLFLAG_RDTUN, &ena_force_large_llq_header, 0, - "Increases maximum supported header size in LLQ mode to 224 bytes, while reducing the maximum Tx queue size by half.\n"); + "Change default LLQ entry size received from the device\n"); int ena_rss_table_size = ENA_RX_RSS_TABLE_SIZE; diff --git a/sys/dev/ena/ena_sysctl.h b/sys/dev/ena/ena_sysctl.h index df9cc8cb592f..9dcfa311d73e 100644 --- a/sys/dev/ena/ena_sysctl.h +++ b/sys/dev/ena/ena_sysctl.h @@ -46,6 +46,6 @@ extern int ena_enable_9k_mbufs; #define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) /* Force the driver to use large LLQ (Low Latency Queue) headers. */ -extern bool ena_force_large_llq_header; +extern int ena_force_large_llq_header; #endif /* !(ENA_SYSCTL_H) */ From nobody Thu Oct 31 16:01:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJQ1Vd9z5bwhB; Thu, 31 Oct 2024 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJP4M6mz4TFn; Thu, 31 Oct 2024 16:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKzJAP/Quvbb7b4tteumDyPVyVDFJmkMO/DVs86tCFY=; b=QdJP1K7CgRh+uTu9zTTWZN37joDkO4uj9upRl7emj63SpW9vKftCCAtnwFljc7Irjj6zIG TUU5OheNSJRv8NWBtKv4IGb2fpcxMYsOGUclrBatl7S33gMhBZ7Lti3a0fkeIn25TMxwyX NX1jQMJ0YdwEJR7yAh475fZbPrSe7/J2o85jvRyr4dENZJy22pJecMAm58L4OhlWDbcYVb McYDSSCdcXhKE9zlDwwv1LTbmUiSrdbnzhbdymJrHcxQOKKfF0K0oL2Clvv6w+mX8YPN62 Pb4BZMxVTz8Qde/48B+KhZdbBRz3QEZeUz3DPwW2F105vJyTZJ4wRv/kT9XCOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKzJAP/Quvbb7b4tteumDyPVyVDFJmkMO/DVs86tCFY=; b=n7hhXlqJzqg7/pKCq908mkTQaIW9f0jM2Qf6Ob0OsSafCvMrie4n6zkjIx8hUOv43mrvfp WBTuE3s/iYADIFAHGFZkW45q8aq1o9Usi5BEr1mF5n/GYcM0F5A+lH3jjZDGRqBFWu/oT2 coU8A89n0Na3VUKut6q/eMjKmbYe9KuygUfkiy90PeqWrGQikOgSRueJPwg62zegf6CNhc JSwXNRhdziU0B/ATm80Ga4RjaRee+UNMXrt6DkUToRYJo3WbrwPIjSler0ajEY93ueaMaN xnvdq7En/ctZI/8L2a3WD2TtEAE1hWk0N/LznhTP/ZDsnjHRlSoOpJGAyR2iJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390501; a=rsa-sha256; cv=none; b=C1bVlZnGV0k7+R4TXERdVaaed7avmbZwwJCcZW6z3mXalSQnW6T/2LoWaRGCMP1EHgcNJj kMLeysazWS7VjuLkW3+0I9MxaaRLUYBW1QI9y/ZH78sS3Qagp+fHohu0yY984RShkjvvUD 5AwcUwwvziIvCwalnmLN2uec5aOYkvgpT2sWchCYtYo4koebpl6j2L+dG+ctjoiCUR1shQ L5Bm+VpotlXOWI5hJxk63W+34Xv24uqGTynRg0DzXavomQ20h9KzjNsO+WmfM4b4eWAiIO srLonGBoSsrAzSvZfezR6QCbB44h90jQDFGiyollL4ua4wT2zWf/IquBYRAW7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJP3xGnzjb1; Thu, 31 Oct 2024 16:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1fAK073427; Thu, 31 Oct 2024 16:01:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1f6e073424; Thu, 31 Oct 2024 16:01:41 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:41 GMT Message-Id: <202410311601.49VG1f6e073424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 86ec26e7a9b8 - stable/14 - ena: Support max large LLQ depth from the device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 86ec26e7a9b878397c3b664d66fdfc8ecfdee10d Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=86ec26e7a9b878397c3b664d66fdfc8ecfdee10d commit 86ec26e7a9b878397c3b664d66fdfc8ecfdee10d Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:11 +0000 ena: Support max large LLQ depth from the device Large LLQ depth size is currently calculated by dividing the maximum possible size of LLQ by 2. In newer paltforms, starting from r8g the size of BAR2, which contains LLQ, will be increased, and the maximum depth of wide LLQ will be set according to a value set by the device, instead of hardcoded division by 2. The new value will be stored by the device in max_wide_llq_depth field for drivers that expose ENA_ADMIN_LLQ_FEATURE_VERSION_1 or higher to the device. There is an assumption that max_llq_depth >= max_wide_llq_depth, since they both use the same bar, and if it is possible to have a wide LLQ of size max_wide_llq_depth, it is possible to have a normal LLQ of the same size, since it will occupy half of the space. Also moved the large LLQ case calculation of max_tx_queue_size before its rounddown. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit d0419551d96c8f995bdf6388a8e69684be33f9b5) --- sys/dev/ena/ena.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index fadba819652b..28a4d7842306 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2831,28 +2831,34 @@ ena_calc_io_queue_size(struct ena_calc_queue_size_ctx *ctx, struct ena_adapter * max_queues->max_packet_rx_descs); } - /* round down to the nearest power of 2 */ - max_tx_queue_size = 1 << (flsl(max_tx_queue_size) - 1); - max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); - - /* - * When using large headers, we multiply the entry size by 2, - * and therefore divide the queue size by 2, leaving the amount - * of memory used by the queues unchanged. - */ if (adapter->llq_policy == ENA_ADMIN_LIST_ENTRY_SIZE_256B) { - if (ena_dev->tx_mem_queue_type == - ENA_ADMIN_PLACEMENT_POLICY_DEV) { - max_tx_queue_size /= 2; - ena_log(ctx->pdev, INFO, - "Using large headers and decreasing maximum Tx queue size to %d\n", - max_tx_queue_size); + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + if (llq->max_wide_llq_depth != max_tx_queue_size) { + if (llq->max_wide_llq_depth == 0) { + /* if there is no large llq max depth from device, we divide + * the queue size by 2, leaving the amount of memory + * used by the queues unchanged. + */ + max_tx_queue_size /= 2; + } else { + max_tx_queue_size = llq->max_wide_llq_depth; + } + ena_log(ctx->pdev, INFO, + "Using large LLQ headers and decreasing maximum Tx queue size to %d\n", + max_tx_queue_size); + } else { + ena_log(ctx->pdev, INFO, "Using large LLQ headers\n"); + } } else { ena_log(ctx->pdev, WARN, "Using large headers failed: LLQ is disabled or device does not support large headers\n"); } } + /* round down to the nearest power of 2 */ + max_tx_queue_size = 1 << (flsl(max_tx_queue_size) - 1); + max_rx_queue_size = 1 << (flsl(max_rx_queue_size) - 1); + tx_queue_size = clamp_val(tx_queue_size, ENA_MIN_RING_SIZE, max_tx_queue_size); rx_queue_size = clamp_val(rx_queue_size, ENA_MIN_RING_SIZE, From nobody Thu Oct 31 16:01:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJR3SPbz5bwb9; Thu, 31 Oct 2024 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJQ599dz4TSK; Thu, 31 Oct 2024 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zz+jl2qu5VgelcCmFecS4auHHyprqk+st0SxCNXgiTc=; b=ZMZX0jwj+lWsdLQ8orqyfTDuY3EQkl9MpoSR0tJIIW/+oyPbGHI0Lm1Ad7IirKiA49RytE df/Ifrv/gvRr6q9dj6446EbhjQDTgfVhoXb0ElCplPYYDK/tk4ugJmGexDBlv9xlSMtsG+ q+h4dkU8H7EJ96hpc9/zK+p81bnQkcFE23xtc0CcY75uUFR8/BXggibujUacMaB3+CnWza lrnYJsFNWfHv9mqfrmcQQmsHKiNX8moh4vJexbx1f6Cs3swCrkZIIllDR15UEXrCh0InhG QHMKsHVUkPmheTrQdvhZ4Kb+24o0GRSMRDvxAtuo5w1mu3DO6F+AqNoZhFruCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zz+jl2qu5VgelcCmFecS4auHHyprqk+st0SxCNXgiTc=; b=LZGUSnyLlD4UZIl9tdBwBPhpv1vSSUwoP4pBs2+STT2kI7a9s7iW+y76O6o2HFEVJX4YJk xEsWk3dLPig6wWvkpwjcBWm8y0KfDncMDH0yUeYm7DD61qs90DgDWrQd8K9SOV1VSwCUcL NVJLsyi6cH2c0qm4UhM50OD9fIJLs47ctgjECsh20s2qgdyRhxljKphe4+okCuqKPoe7vh q5KoRsP39Tpu14+dL72g171K7+3f6k4VWf9vcDMeUAJ2oRt0MlalkthKi+zAkUXrncSRHV ep5CaEmH7TlApi5KdCbEG0htYaP1xBQ2KqTq4Qh4znFuKdQZ5gk58mgFGZ4WLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390502; a=rsa-sha256; cv=none; b=B+ECIjGIxtD3QHo8vG21TBac5TZwLmDezSCUymLjwzvUbWC2hQbg5PxGpWasP5iSwIu/x6 y4gs9DRCDNyaEDvCpHdeiuYe5A4F/pXmMsUneTRys5l0gtcMuavvNJwtw1R7xQc1N+/KBJ 7YCm+VoNpr8+s5rQKQZ0ib68mUxbf6tXPF8Iwl77lg9ozYTfge0ZQEXlo7RH1C0xiL+AX+ VJJykTaqTMWOikgIKxhpFb3/WnspWM0Lc/LO62Qt/R3o5kbzQYi70emoBUildcSBFNnQTT 1bEeVJff6Ew/p0ytYB7k3qVfLqkBJZZlRVShmFyc62jJNebQcIaYvz8DuJEVyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJQ4jfFzjXQ; Thu, 31 Oct 2024 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1g4D073478; Thu, 31 Oct 2024 16:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1gnu073474; Thu, 31 Oct 2024 16:01:42 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:42 GMT Message-Id: <202410311601.49VG1gnu073474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 7a39823d8e53 - stable/14 - ena: Fix leaking ifmedia resources on detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a39823d8e53788b2ee38d908a16d2c312c6afe9 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=7a39823d8e53788b2ee38d908a16d2c312c6afe9 commit 7a39823d8e53788b2ee38d908a16d2c312c6afe9 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:12 +0000 ena: Fix leaking ifmedia resources on detach ifmedia_add() allocates an ifmedia_entry during ena_attach. Current code doesn't release this memory during ena_detach() This commit calls ifmedia_removeall() to properly free the allocated memory during ena_detach(). Also, in case ena_attach fails, we need to detach ifmedia which was allocated within ena_setup_ifnet(). This bug was first described in: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278100 Reviewed by: zlei Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 449496eb28daec8d5b852fa4be1e337c2957345c) --- sys/dev/ena/ena.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 28a4d7842306..e9d4530e9085 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3981,6 +3981,7 @@ ena_attach(device_t pdev) #ifdef DEV_NETMAP err_detach: ether_ifdetach(adapter->ifp); + ifmedia_removeall(&adapter->media); free(adapter->customer_metrics_array, M_DEVBUF); #endif /* DEV_NETMAP */ err_metrics_buffer_destroy: @@ -4031,6 +4032,8 @@ ena_detach(device_t pdev) ether_ifdetach(adapter->ifp); + ifmedia_removeall(&adapter->media); + /* Stop timer service */ ENA_LOCK_LOCK(); ENA_TIMER_DRAIN(adapter); From nobody Thu Oct 31 16:01:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTJS0qLgz5bwrj; Thu, 31 Oct 2024 16:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJR65lNz4TLL; Thu, 31 Oct 2024 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgp+Q1XrdOrtoiKFCIXztYPdUyvuQG7oxEnoTPygOkY=; b=XF9jTAEcf38p5P+2Sj7ni0Z8hTX/cEjzJ4/+cozWg8Tk3e9hhC7aIqCPUKhW4WHpL4a6B3 X+kYV6PkrAiYxerE85okstRN2PjqX1rg3w57IboT0rDqRindm+KRBaq5aS+sgw7H3XY/pl /jbm6W8jTV9oKbqIptZEVbl9ohFtGZ8fehtv+9iqyIUBzqh+As5pxifOWbyhA8xJTjl9gt u4RxxX2JsVRVO0WTXqmUow4+3m+M8eBOtHgSo5p+WPoJ+l/kKW/tFqTrPfDT9bFJEv9lZc R2qg0RyYw3Dcw7TUObeWHzDNRihqZ8Rm6il6lETPtFN91/1fxSIhEukz2NjqXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgp+Q1XrdOrtoiKFCIXztYPdUyvuQG7oxEnoTPygOkY=; b=QN1LKZ3xJ0hBHRgnF2G+6fQ9ONO0ImAZ2EjE2pC6tvSdgZ0K6mE6q8lo2oQ571mmLrRkMU lQN0RqG2m7NB1IyderhI0qJkvpGxyeY9N21MAtCYuZE6MzaiBfbK9oigQLaRzYVicCmaPm tpEUptUyGrRB2DrZD8GLGpy9e7iMQTPJC74roL818tuAfchsyvjwXacmEM9xSMSeO4h5Qp NF2PUmo9vJOgD6rk6ajcWuZ4l8Nqs+EylTCQzPfwYmwcC9l7sY2D9xRU0zh8DUh2QQV11U CqtCz9BnhvUY+ElsHTVAOjHua/lGs/c81VNtb0Trpht5oSy5kuAhttp8Hfdbww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390503; a=rsa-sha256; cv=none; b=s9fkEJiQiPNJs+3UV94jtw/AEc2allfI5fq/pMeFH7N+lcLa/ixPmQO4FGUEIP3N1KUSk3 8Cw84syXn9cAd8/reC6ADWt5RlcvoDbO0kS0+CkG5apSHRM4NHyWCZQk4TH0wZ1U0X8V2O EeQLjIDOXyZ8KsV9Kqz3LqFtza/nXW4QX9r1qOYx+SSLGMzJ+rO0TbimXp5O8+4CPmuJ0/ YK31KmuXALYxclDbFkSwNdADi+s5eZROsaHyfxy3mGXm01ArVaCZ3L5En/U1SxakjZmZiw rSq9uDd1uGWQnJQydCic8GPq7V8oA2lORFS99kex9QEaRWb6/xiPShkru1EBTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTJR5XJFzjd9; Thu, 31 Oct 2024 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VG1hUp073526; Thu, 31 Oct 2024 16:01:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1h25073523; Thu, 31 Oct 2024 16:01:43 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:43 GMT Message-Id: <202410311601.49VG1h25073523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 6bf02434bd9a - stable/14 - ena: Update driver version to v2.8.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6bf02434bd9ae508e84d770fba336cf12fce4b34 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=6bf02434bd9ae508e84d770fba336cf12fce4b34 commit 6bf02434bd9ae508e84d770fba336cf12fce4b34 Author: osamaabb AuthorDate: 2024-08-07 08:06:49 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:12 +0000 ena: Update driver version to v2.8.0 Features: * Add support for device request reset message over AENQ * Support LLQ entry size recommendation from device * Support max large LLQ depth from the device * Expand PHC infrastructures * Configuration notification support Bug Fixes: * Fix leaking ifmedia resources on detach * Fix netmap socket chain unmapping issue * Properly reinit netmap structs upon sysctl changes * Correctly count missing TX completions Minor Changes: * Add reset reason for corrupted TX/RX completion descriptors * Add reset reason for missing admin interrupts * Improve reset reason statistics * Update licenses Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit ce4cc746bb4171a131ab9099947a500c0de18ff4) --- sys/dev/ena/ena.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 132d8882f12c..06bdfad97ed4 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -38,7 +38,7 @@ #include "ena-com/ena_eth_com.h" #define ENA_DRV_MODULE_VER_MAJOR 2 -#define ENA_DRV_MODULE_VER_MINOR 7 +#define ENA_DRV_MODULE_VER_MINOR 8 #define ENA_DRV_MODULE_VER_SUBMINOR 0 #define ENA_DRV_MODULE_NAME "ena" From nobody Thu Oct 31 16:22:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTlx5Bm8z5byVL; Thu, 31 Oct 2024 16:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTlx4dSDz4dxK; Thu, 31 Oct 2024 16:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730391725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QzkVlIrk7fgfgm+I57x1oXjU8eATkaVXRx/5IcOZJC4=; b=I7qmJz2r/HBWNtUTxWsDEOA17c41+OD9wfw47q2bfvqlPxHNcDquZMw16RdgRxT3Dc92Ww Q8YDmVmNa+fGDrxkRgy+Ftabc8s9kMAifR5rk2VayVXCVxIxURXjJfLISDpPi6PJHJPzhr ri/EpIwLTDUh6NbwSzDntET5QS1rYGxlcXYKgYG0WOeBbneJFWLjtiBbMcM2jYInU72ATX LICucmf4EjIQer2MduQ/3EK4bNsadUyFN4iZ/E3MKCnw5JSllEucGF7DD8cRCWg9Nrw2Ec b8s+pVEkzdoDgHak/ymViVEBMPNsgqfrO83xhvlFMYJXnGjBXI2dDc3GPkdi8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730391725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QzkVlIrk7fgfgm+I57x1oXjU8eATkaVXRx/5IcOZJC4=; b=MzALAWdbjafmQXrM1mH0EdjMLXIjsY4Cy+I+MJe7ag7GbHo84hLD93M05ii5C8t3viK6Wh pu5l8MpfDJvXEIvTpyO9xE1MUIshiG+NItZJN2ojZLnKAed/WZvjTbhmyDjutbeoQ/Ku0x 6//Pxu2PDATvktygrZ5QdEEHMcxrVHRum8H8TjrXao7wfPyqonWMWQQhmApHjehrn3S76W HAIlL89gvD2i0EToo+twA3R5bQXMg5LkMAEPFc8mXyMNcpZ0FUtSspat/0WZRAi44o3t6y U99SSEhWZXd6S3HyQKnKxUhHuaH99TdWmqBZ9oB0JnQJYAVne8xEodxvzU2O+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730391725; a=rsa-sha256; cv=none; b=qm42BO0Fc7bbkeOdgcZYiCZH4rogyyUy2Qegcpy0f8+8sPhflMR6IxL0iQQSjdiBVxpWhZ ld4Itq2ze21EQaLE5HhkkCSX9Fa2mMLjJnjHMPEyY0jHRjVmqAm7GcDZwdaXRxa+tR8DOS JJR9Xa+6aNWsvUe1w5R3+7Fm58EDihbwmA460rI4uarFJb8nozK3UfHKTx+vZkJucflagc dDrscI98NOihAtwoylsq0daVEpZ1myUI1WSWa0EUFmWlFN2CpGDrCtJFn0dptK/BnslKdH J6ar4fhn/4/IivmSYU7LZD2VHkgwQGUNw36cPST2EteULbdDJuZMriQ/Ui3HmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTlx4FCxzjYl; Thu, 31 Oct 2024 16:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGM5Mt009681; Thu, 31 Oct 2024 16:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGM51e009678; Thu, 31 Oct 2024 16:22:05 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:22:05 GMT Message-Id: <202410311622.49VGM51e009678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 1e8db1f74e42 - stable/14 - pkgbase: don't remove the 'latest' symlink until the repo is final List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e8db1f74e4230e13cd0c85b21745f4a70e2aef9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1e8db1f74e4230e13cd0c85b21745f4a70e2aef9 commit 1e8db1f74e4230e13cd0c85b21745f4a70e2aef9 Author: Kyle Evans AuthorDate: 2024-10-29 20:50:49 +0000 Commit: Kyle Evans CommitDate: 2024-10-31 16:21:58 +0000 pkgbase: don't remove the 'latest' symlink until the repo is final We can encounter many issues in the pkg-repo(8) process which would currently leave us with no more 'latest' symlink in the repository. The main problems with this are that we've now broken a subsequent `update-packages` because we can't determine a PKG_VERSION_FROM, but also we break configured clients that are still expecting to see *some* repository. Switch to just replacing the `latest` symlink entirely after we have made it past the pkg-repo(8) step so that we only swap over when we have a finished repository. Reviewed by: bapt, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47303 (cherry picked from commit 8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b) --- Makefile.inc1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 605b8098b742..1927a69ef732 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2280,14 +2280,13 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @[ -L "${REPODIR}/${PKG_ABI}/latest" ] && unlink ${REPODIR}/${PKG_ABI}/latest; \ - ${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ + @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${PKG_REPO_SIGNING_KEY} ; \ cd ${REPODIR}/${PKG_ABI}; \ - ln -s ${PKG_OUTPUT_DIR} latest + ln -hfs ${PKG_OUTPUT_DIR} latest # # From nobody Thu Oct 31 16:34:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV1k3ByZz5c08f; Thu, 31 Oct 2024 16:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV1k2fffz4fqf; Thu, 31 Oct 2024 16:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3NfX0IdJbvv4hNLYTBuJb2xcdyrImR3MG3vgtD4cRs=; b=uxKqBu25i9Ip5OfiarMf7nNfiJikapJkSiBSY+6CAUXPca/LaU4EYgZPtTY0l+Wix0bY9c oI0vgRB+hnKc6VdznG/0b1e5jnbirKuVgsgYnR8CKpWoLzaliGm6rPjr/M7Jk71ghkXYuL qbOyCK+AdAlKErt2QdNs4QASmRrJAdc6RAIlaSVlpOX+9arUpaOS7j/zoaWBDjVKnXSR3F VaUbI69mBADb5HtUc0hBYA6O6UF4NPSclLJ0A/f3GGoyAyB5ih5kCXyujThQ8e/D1wC1DV oG2R0/B4d+GOvLQTh4M3hgdeu9eXx5R19JrNICI41Q/HbBKq6oMYkH4hgApJMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3NfX0IdJbvv4hNLYTBuJb2xcdyrImR3MG3vgtD4cRs=; b=LKz48KtXf27azuoGpv5Ulvvrqe4t5MuXlV8iRFO7Q2VUNiHwAhogMBvq6j0retSgsHRqVp kHBJu9J2OjtSGUtGWE1DaZi3JqNt2AeGVb5jkUjkHtOEnS5HoTkrzGCMDl510KaZ1RjwkE qX5HwiH6dkvt9cMrTUf1glgDT6hCtU8U4xxmhw5SPvWXSvrhWLeGZUp42kNLyDyRINZGUE 3Hrkp3VK+6zHs/wR19bw52u9unc5/eBoXSeA/hEED8qYo+f6VFcQR67M9TvxEGYxQH3MWu ZTw3E/y4mOYAtZM8jmat4WWcPpMQPqkmn1FSJ0NRnYBmirA0hLm10qIU3PvZ2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392442; a=rsa-sha256; cv=none; b=TPw4hcUwSwAWBVCKV2rDVcfDo59QoT054NEPU2ndk8xBJsu7SYcfoINIjMACVFOdZuGlcr fZSPHUaJZWJ4hzJ7ki3ajwK6t1dglZ69lOXWV2TjGZa+7cUdrWtyDoJtwO0FABmh/k5o5f Fzeiv99d0Cvjv0Ifgbv+c4wy+MuBTallHCCaStWsDsRRcRLJY8xSrKlI+SdSUccEB7z1Ca c4OXOlREzF6Quw4amoKAztmWNwg3OJrvfJi63tIF2TVDM9+wd1+G5DR9+p7f66q6VIoawi a1Tvt6n8tAEbcRxUnn57sX8lppMkCJe89TIDaS2eIowx1l8IB6s0KDEtpOAB4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV1k2G2MzkWM; Thu, 31 Oct 2024 16:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGY2aP032130; Thu, 31 Oct 2024 16:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGY2tK032127; Thu, 31 Oct 2024 16:34:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:34:02 GMT Message-Id: <202410311634.49VGY2tK032127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 12c04071cf18 - main - ndp: Move the global variable repeat into struct ndp_opts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12c04071cf18d1b00ffcc7058fb01f4393163ede Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=12c04071cf18d1b00ffcc7058fb01f4393163ede commit 12c04071cf18d1b00ffcc7058fb01f4393163ede Author: Zhenlei Huang AuthorDate: 2024-10-31 16:32:13 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 16:32:13 +0000 ndp: Move the global variable repeat into struct ndp_opts An upcoming fix for the netlink based implementation requires this refactoring. No functional change intended. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47233 --- usr.sbin/ndp/ndp.c | 9 ++++----- usr.sbin/ndp/ndp.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 9a249a4987a7..6e6f40c3ff64 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -121,7 +121,6 @@ static pid_t pid; static int32_t thiszone; /* time difference with gmt */ static int s = -1; -static int repeat = 0; static char host_buf[NI_MAXHOST]; /* getnameinfo() */ static char ifix_buf[IFNAMSIZ]; /* if_indextoname() */ @@ -249,8 +248,8 @@ main(int argc, char **argv) /*NOTREACHED*/ } mode = 'a'; - repeat = atoi(optarg); - if (repeat < 0) { + opts.repeat = atoi(optarg); + if (opts.repeat < 0) { usage(); /*NOTREACHED*/ } @@ -828,10 +827,10 @@ again: if (buf != NULL) free(buf); - if (repeat) { + if (opts.repeat) { xo_emit("\n"); xo_flush(); - sleep(repeat); + sleep(opts.repeat); goto again; } diff --git a/usr.sbin/ndp/ndp.h b/usr.sbin/ndp/ndp.h index f89ab19a9d3f..7bd4ddcbfdd8 100644 --- a/usr.sbin/ndp/ndp.h +++ b/usr.sbin/ndp/ndp.h @@ -10,6 +10,7 @@ struct ndp_opts { bool tflag; int flags; time_t expire_time; + int repeat; }; extern struct ndp_opts opts; From nobody Thu Oct 31 16:34:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV1l4TBMz5c0Q0; Thu, 31 Oct 2024 16:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV1l40L9z4g8s; Thu, 31 Oct 2024 16:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxOoa/ngKVxvbhPh6YVhHbC9b/XPjV0DRija4624Ke8=; b=HRBA9oUb+K3H8fQCxFKv3NVXQ+LQAIEYJnE8Vub53S2tVS2VZMKzdTu9at77AAwWK9u8Gz x16owM1uyW65QA9JhGrj0e5epK4qMRKAG35CIZtQpay9nY8wHC/LKZ/zqNQv6XZHhQvKKc R+ObIN16DiJcOTfmtsCMGIO8v9M23n+3P70jkp3KnsNcUNlB8/ypwbLKG6NCE2YOfoPta7 TVNfyU8NT6wNG82m15lHgVmVGjZlWN/gL9TQTNgvUJy+YFQLkxSPaQ7j0L1+cYc5xBuKu8 mC4Tkbd18i9J5GVK+FOavRaUXzV4lsXwnvkxlcx/RU4xyWDNLt1XOXCbgEPkag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxOoa/ngKVxvbhPh6YVhHbC9b/XPjV0DRija4624Ke8=; b=TnuPzBeSgpafVpRi35/bMDzHK9xMGn4xkGCpB1D/CYimFkstabxUc4J+7lOFK3LUOSZ4n1 u3TJaaul+LmNWz6CvDMFuiTt0Mj4cgb4R+WsS1hIDokc434Pa8e/Qun31OOoe9fM3RXm3H jgwKCdE5s8gTJoNW5QUsAyEd6lq628JCpdMmMTydQKbL7DK0JTuWJSekqDNObprCb21qpH P8GQJV0W9eAoLAwiJd39LCRwONigOoSZztZTkpu8vajJ6ZK6sQWF6s8Pm6CGXQE0Fx2s+k 5hzuSIFEPlqdgDuS5Ksq0Hvnb3e+7jykEX7EHxUeK8OBkyUY/Jp34mES51hoPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392443; a=rsa-sha256; cv=none; b=CwNMbiImXCESjyGBiu8J4dlweCbodgo51wQ/70/X0iY/ZNk37NOS0Ah218d/MUoAQo27JY dFli2FxowbaWJB73IGgEQ2tVcGpQ8oIDu+lqtZVmhdOepFh38sMtGrV+vSSEFtbKrU7CCi XLkyGt3REcRRCrCHgl243KvzwSQU9GAXiYmqBX0DKiM9OJD1sVY9gqEhv1zKfA6/tZP++b IkgwklOMRN1/N6YsOG3TOAaplQ9IsSZeEfSwuXbkkoxJenO1eLJRYIkuXEgKcnbwLmG7cL DktMlw/YxmPIpvleCuvpjS3xcZEYoqxhWgE/pg4cBwOX4ZxZy7vjmMUCxAK57A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV1l3bSrzkVn; Thu, 31 Oct 2024 16:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGY3Pw032193; Thu, 31 Oct 2024 16:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGY3O0032190; Thu, 31 Oct 2024 16:34:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:34:03 GMT Message-Id: <202410311634.49VGY3O0032190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: b6d4e3bee350 - main - ndp: Bring back the -A option for the netlink implementation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6d4e3bee350b881b5efea03068c1247985b12fe Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b6d4e3bee350b881b5efea03068c1247985b12fe commit b6d4e3bee350b881b5efea03068c1247985b12fe Author: Zhenlei Huang AuthorDate: 2024-10-31 16:32:14 +0000 Commit: Zhenlei Huang CommitDate: 2024-10-31 16:32:14 +0000 ndp: Bring back the -A option for the netlink implementation This was lost during the conversion to netlink. Reviewed by: kp Fixes: 91fbe0819bb9 ndp: convert ndp(8) to netlink MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47234 --- usr.sbin/ndp/ndp_netlink.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c index 546057e5e552..7bd3252f0943 100644 --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -314,12 +314,24 @@ print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag) struct snl_state ss_req = {}, ss_cmd = {}; struct snl_parsed_link_simple link = {}; struct snl_writer nw; + struct nlmsghdr *hdr; + struct ndmsg *ndmsg; nl_init_socket(&ss_req); snl_init_writer(&ss_req, &nw); - struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETNEIGH); - struct ndmsg *ndmsg = snl_reserve_msg_object(&nw, struct ndmsg); + /* Print header */ + if (!opts.tflag && !cflag) { + char xobuf[200]; + snprintf(xobuf, sizeof(xobuf), + "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n", + W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF); + xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags"); + } + +again: + hdr = snl_create_msg_request(&nw, RTM_GETNEIGH); + ndmsg = snl_reserve_msg_object(&nw, struct ndmsg); if (ndmsg != NULL) { ndmsg->ndm_family = AF_INET6; ndmsg->ndm_ifindex = ifindex; @@ -335,14 +347,6 @@ print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag) int count = 0; nl_init_socket(&ss_cmd); - /* Print header */ - if (!opts.tflag && !cflag) { - char xobuf[200]; - snprintf(xobuf, sizeof(xobuf), - "{T:/%%-%d.%ds} {T:/%%-%d.%ds} {T:/%%%d.%ds} {T:/%%-9.9s} {T:/%%1s} {T:/%%5s}\n", - W_ADDR, W_ADDR, W_LL, W_LL, W_IF, W_IF); - xo_emit(xobuf, "Neighbor", "Linklayer Address", "Netif", "Expire", "S", "Flags"); - } xo_open_list("neighbor-cache"); while ((hdr = snl_read_reply_multi(&ss_req, nlmsg_seq, &e)) != NULL) { @@ -381,6 +385,12 @@ print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag) count++; snl_clear_lb(&ss_req); } + if (opts.repeat) { + xo_emit("\n"); + xo_flush(); + sleep(opts.repeat); + goto again; + } xo_close_list("neighbor-cache"); snl_free(&ss_req); From nobody Thu Oct 31 16:36:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV4d6gtZz5c0Rm; Thu, 31 Oct 2024 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV4d68C2z4glT; Thu, 31 Oct 2024 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ru+AvV9pgwKrp0QuHMtoYqHAaNOMfNdFjY2Cdi8V/s=; b=SPGNDxvga8vQhUD+sWYK8v+jxuV7DXqD7UC6IrCBfSGAdOn71/0MB0MLGpj2u7spBhGNrk /wFtrE1OI6Wq7S26G0nnWmqkMPQUP7sMoOS7b5664cYHqygM55pJa6s+G4UIkmp64xhHKS 3wj169qN1yraY6YfwCpV27Mtiye175flr27H56NASA+eNdZu5Lv7+hy6Ek+KykGPbVE8Ht XhT50SpedMBO2A1g6kky36djlfRnc76J8zNFqqN5GNPGUhX1zGrkAchbrzxqNRXjJzujVh ezETSXQdEP5bO050aqQiEmkIz39pZizHb3+SdgTpzZGt3w51WEun7PlDWa//UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ru+AvV9pgwKrp0QuHMtoYqHAaNOMfNdFjY2Cdi8V/s=; b=e5TjrL2IxTT28wRi6MbpFl7PaXMaagR2rJ+9EL5+gTq0ziAO2Zm8zVejUYSWg7YpHsM6nX TetK3ofkLKWKewwcI+XHYUD0wxyfUU3E9GSG9bWoc2DwE3mp3fi7nA6LLwg37CPn51EHz/ gnh9e4MmmhYKE/b2EYCrPc47H1G2ntMli/F2yeiveHbZ1LL6/kFwczcqs7DYafuzt16WuW mv508hVr6VzRWFgvjAXugDiEP4AhBQSbmxKGJp4zHEZ/NojKV5z5w9s5VKwXljOihRe2rz wch89Rya0GcWUvgKU66DoQZaDUS/JyJNMQIm3sVjsbaE9u1ssD+bEwbkjzNAtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392593; a=rsa-sha256; cv=none; b=R5cXUa5c3U6+x7Wmf1pj3jasxr3zr5dbLRc4R4q92vjHFq8IBznVmtbCwVukx7ibVBY/aM ly3pS9/fqh81nFNoy4ihP5xDIdfCXBgR57KhNxc2+7SD9Y+WuDILPtkkKeAKTXV8tVBlpP sH950/F8LQW6o+aRZyHiR0/aCvxCxikoeIFW7StEcWU6rVSWdHUpWBdld7HKZW4xegnl17 MT4/LdPHXLbYM0JpCz6vtc0LP0L8dc74eFHGdMXuR6eWMzkXQMmik7NpBn6bQmugu8yMdG TDgRimgm5q4wvdqCtJQnHBH1pq74hLLGgdSTBl2oPSV6l1bEYvkQBuYG0pvWyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV4d5cLyzjyT; Thu, 31 Oct 2024 16:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGaXTF033079; Thu, 31 Oct 2024 16:36:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGaXGr033076; Thu, 31 Oct 2024 16:36:33 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:36:33 GMT Message-Id: <202410311636.49VGaXGr033076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3e8226cb8c83 - stable/13 - tcp rack, bbr: improve handling of soft errors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e8226cb8c8333c4e0a1118fe09d0a7b6e5711cd Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3e8226cb8c8333c4e0a1118fe09d0a7b6e5711cd commit 3e8226cb8c8333c4e0a1118fe09d0a7b6e5711cd Author: Michael Tuexen AuthorDate: 2024-08-30 07:26:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:36:28 +0000 tcp rack, bbr: improve handling of soft errors Do not report an error, if it is stored as a soft error. This avoids, for example, the dropping of TCP connections using an interface, while enabling or disabling LRO on that interface. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46427 (cherry picked from commit b2044c4557443bbce974101f04e2b465d1bbe769) --- sys/netinet/tcp_stacks/bbr.c | 1 + sys/netinet/tcp_stacks/rack.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 8fde062c0dc7..5ebf82eb97d9 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -13961,6 +13961,7 @@ nomore: case ENETUNREACH: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 7429dcac5d5b..ce1f2b88cef8 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -18571,6 +18571,7 @@ nomore: case ENETDOWN: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; + error = 0; } /* FALLTHROUGH */ default: From nobody Thu Oct 31 16:37:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV5L52PLz5c0pw; Thu, 31 Oct 2024 16:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV5L478Pz4h5M; Thu, 31 Oct 2024 16: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=1730392630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7PAsrQ8eJo+T0YBNk3bVoRFi/vTOcS3mCj3otA5k5+k=; b=RJGdmau2geyvZESvPW0nQWPIU/lTBraNNMfxCMDH7X9TTZOwpGgY+3n88xtR2pwSMEh1e2 D+gbkeTrJcr0b5v3Te9bfDn95cfICCRAfvRwj0snj/DCCJK21rK/SWj7gpzq80HhrINWmx OsK2VGCLXj/gPl28mdUmKdrtFEZTkHpIZ/GSwobu0CJgBL0cvGBsty3wWIQmHHROh9YSeG 2bls+K/LcHNYZFJpQKVRzv2+k0SsPlFsVWk1W7vJc1R4uU7XrEw66zEtFgD48z7WBAQm/Z Mg858WtB/8++8/iGqtmgRcxLQPnbd9+phkM9jxA0BeS/Nxj30yKA/3+jG8e6Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7PAsrQ8eJo+T0YBNk3bVoRFi/vTOcS3mCj3otA5k5+k=; b=SzgWcipsxLDszFz+R57ld646DQIQ1padqNj6cFqah+cALvkhDrBcPsaNp/hLQ3moFyrTNK EBk9WfKb1ltpfgrZVOvkG61iufryPEX4XObosYfGfGF61iwNQWiGuSZ2r0slwbWukgp8Fb 42HXnZYmD6cBiW8Visy3ygy0T1q9SQZoEF26IJ+B0OEnF9Mel9Y3Q4B6VH7DoWeFFyXL0R 7/9+H6ify5Kn//njBVBzc6/uVdbMI34ktd7Y5pff1zD6VluhhKOGAUAeNc/b8PPyLx9rJm MvJKsxyLcjFF7lbWfXx6t1Z+DH4LY2IN/Xw1i200mBC8xnKCcnxBZF1MkOBYDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392630; a=rsa-sha256; cv=none; b=FmuZed1HD+0bK96O1mDya4gUpl8eBQa16yEdoYA6MjTKwM8P+7A2gu0WHrfPoaoKAE5vZB aD5dOOOK07AQo6vKyW7H17KPXP3JmdSihXXRH1+4dxfuEpsF71hiR1D0+vP4OQNXFzy2Ud eF+UOba3aqr3YOfJqNFxz2c49EurqwpOuCjo8LZOq43z1QVILbU57ESx2WZ2+k/oKTTkN+ YxosuynrLsVCLk51paNI+dDH/lA9T1FH8Id3HO+TuIPHO/ODvWMlWAYugUgC3+oEh8l6J+ o0bht2k1qDEoC9dm8VZBaBpWDHiTkDqu1Q8Zj4dVXhBysQ5RbNNqQD03ZJ2ZXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV5L310kzjhP; Thu, 31 Oct 2024 16:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGbAkQ033396; Thu, 31 Oct 2024 16:37:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGbAgx033391; Thu, 31 Oct 2024 16:37:10 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:37:10 GMT Message-Id: <202410311637.49VGbAgx033391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0567f7cc1a46 - stable/13 - tcp: improve consistency of syncache_respond() failure handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0567f7cc1a4669085f29a8d8e9175eaf83f9877d Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0567f7cc1a4669085f29a8d8e9175eaf83f9877d commit 0567f7cc1a4669085f29a8d8e9175eaf83f9877d Author: Michael Tuexen AuthorDate: 2024-09-05 01:33:13 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:36:46 +0000 tcp: improve consistency of syncache_respond() failure handling When the initial sending of the SYN ACK segment using syncache_respond() fails, it is handled as a permanent error. To improve consistency, apply this policy in all cases, where syncache_respond() is called. These include * timer based retransmissions of the SYN ACK * retransmitting a SYN ACK in response to a SYN retransmission * sending of challenge ACKs in response to received RST segments In these cases, fall back to SYN cookies, if enabled. While there, also improve consistency of the TCP stats counters. Reviewed by: cc, glebius (earlier version) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46428 (cherry picked from commit ef438f7706be48f1cf7fd4c8a60329e1619cfe30) --- sys/netinet/tcp_syncache.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 86df6c747ea4..111f591c5851 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -531,10 +531,16 @@ syncache_timer(void *xsch) } NET_EPOCH_ENTER(et); - syncache_respond(sc, NULL, TH_SYN|TH_ACK); + if (syncache_respond(sc, NULL, TH_SYN|TH_ACK) == 0) { + syncache_timeout(sc, sch, 0); + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + TCPSTAT_INC(tcps_sc_retransmitted); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } NET_EPOCH_EXIT(et); - TCPSTAT_INC(tcps_sc_retransmitted); - syncache_timeout(sc, sch, 0); } if (!TAILQ_EMPTY(&(sch)->sch_bucket)) callout_reset(&(sch)->sch_timer, (sch)->sch_nextc - tick, @@ -692,7 +698,13 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - syncache_respond(sc, m, TH_ACK); + if (syncache_respond(sc, m, TH_ACK) == 0) { + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); + } } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1589,6 +1601,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); + } else { + syncache_drop(sc, sch); + TCPSTAT_INC(tcps_sc_dropped); } SCH_UNLOCK(sch); goto donenoprobe; From nobody Thu Oct 31 16:37:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV6F1R2qz5c0tg; Thu, 31 Oct 2024 16:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV6F0t5Nz4hCm; Thu, 31 Oct 2024 16:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ruWu/URPa1wHTnl/cw1PZQ0VptPpuSbEM9eLg6Y9cC4=; b=d1FlpmrYh2LCjVIWpIjMcIkLMDjjZJB5Mq0+zgP9jW5RjBJio/pOqvCKqe9BeLDl6xXuGk 4aQiX7ZPOqAJSHGkWKb32+S7MpOdB3fumvb5Fvh428MMVwcYdK4UrOyrVVw9SzkRmeH3hQ RRUfx+YXT6+mEJVjeL5LqQEVLOplXrnhSo+gIzeZSRw0XgGNuIUezNYJYn4d9utTJaq7OW N2UlYlnHNFkWtdxu0AVAXunHji00BwDEACRok/DDq/nA8GJZl3hlPwf9xBpKDr65vkbJhE XOd12YFAFO5BmSHSRaWbZ6+EucuXJrKD5WMO0KpjAo/RL7q9Csjb/mt6cKAQIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ruWu/URPa1wHTnl/cw1PZQ0VptPpuSbEM9eLg6Y9cC4=; b=E3VOIlp0cnZqFdDQGz6qPKYVFRne+gqweJD2YBX4xH7o8q1yKtG1fEWPaQw5P8hBze6o2m QCw5NjwAtw0SmGJ+7M+rn2zup1b638EhLVHP5gzznUj2mXr63MInehgMpZMwkpsGaeKu4T 0U/gkHRp5/dCgRoDA0zjwwGryjRNYQRvlC+Pv80/Oic7MKfgp5RE8ZmSCFQhKUPE9G2z3p cd2QsvjZeJNNV1i1PqHke+9v9kbaoQ9GVP+K2Z23/gaVp3fejh8q99Ul4C9jA9mmXkAAUM Q6VL2YhXSwnDUlRxvyeWEh6fmPU5Z9ej0NkmkXCa2trwy/nhgQ9+rvMVh5VRYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392677; a=rsa-sha256; cv=none; b=r4j3178YqAAQMWgc8wdT7CICdLPq5kBjqwt3h9edPx1QuwAeuDI1NNtVGNCODQaj9v7Boy rGeAmHFVLN0CHjuarDtZmP9Wj/Hm5LaHXlkofHflQ1X5bRgCsYHTT3yTwBr5XejBmEUdja Y+uoWnfVdRcGgwo3NXVXbSgqDx/laBmNZZOCQkjL0wMM06Nqr65NelOQycxGI5GSLQUax/ 2ZeUdImxR3UsPF9P2M3NOZIXumQoLqCuOrVi4FmOQNDtLiPd9hIeR2g30KH5S81CNsHSqI EfUdOzMKYQk8CwA0nJYaSeKDbIj7/ljHQFI58G2rBix6raMAORzrevdz+BqGdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV6D6H0PzkWN; Thu, 31 Oct 2024 16:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGbujN033737; Thu, 31 Oct 2024 16:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGbuof033734; Thu, 31 Oct 2024 16:37:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:37:56 GMT Message-Id: <202410311637.49VGbuof033734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b245bcc1460e - stable/13 - neta: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b245bcc1460ef5ec0b7e97abd45afdb57c4d5bfc Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b245bcc1460ef5ec0b7e97abd45afdb57c4d5bfc commit b245bcc1460ef5ec0b7e97abd45afdb57c4d5bfc Author: Michael Tuexen AuthorDate: 2024-09-05 15:31:31 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:37:34 +0000 neta: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46433 (cherry picked from commit 5203dcce2527fd235648e2b855a13f62247eb2de) --- sys/dev/neta/if_mvneta.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index fa5b9a38ac73..af0d1add0e1a 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -3018,8 +3018,6 @@ mvneta_rx_queue(struct mvneta_softc *sc, int q, int npkt) struct mvneta_rx_desc *r; struct mvneta_buf *rxbuf; struct mbuf *m; - struct lro_ctrl *lro; - struct lro_entry *queued; void *pktbuf; int i, pktlen, processed, ndma; @@ -3133,11 +3131,7 @@ rx_lro: /* * Flush any outstanding LRO work */ - lro = &rx->lro; - while (__predict_false((queued = LIST_FIRST(&lro->lro_active)) != NULL)) { - LIST_REMOVE(LIST_FIRST((&lro->lro_active)), next); - tcp_lro_flush(lro, queued); - } + tcp_lro_flush_all(&rx->lro); } STATIC void From nobody Thu Oct 31 16:38:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfV6x02q0z5c0Rv; Thu, 31 Oct 2024 16:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfV6w6Ld7z4hGv; Thu, 31 Oct 2024 16:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SdPAFb2eyIDKtuktErwhrjuMGvWRk3S7Fxl/T0018J8=; b=PiWXz1wnFdNbuSyba399ZfVUL0mEvYBH21GSIipSG4Ja/n9gml1B5/VnDuESGsCP6uVZJf l7JXOWbbgdXYTad0AnvPoIRW9iO2GiGZqu6UojL36dxiXApWxnKeQzmGrKiLkO78K8HZ3o 9wR2mC5gWC6QQ1u/ifl/NiWDOmfwivZctt355oAAwfgvhEdKZJdjXKY2YWRVHU96c9Sw+6 ODtwvXF6NLUdTgMnt0tAvaYM9Hcs3WvFVsOqZwGGCAhnG0vy5/GYT6ga2H4Lmb4p2l7RGU J4au4tVCP+GSmTUztsahofoKBwPWXlAEhGZQXQigosOSGsmLm+gAC4xDh11RVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730392712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SdPAFb2eyIDKtuktErwhrjuMGvWRk3S7Fxl/T0018J8=; b=NPnDWIDbUjmX83WWajUxOfUwNm6Kai1cJdSCXxXtMRc8ooOui2D3vUqHkAwkAQjSnMZw5Y HbNXurSlwXYRhwEjFqTNtWctdVXJvSaTQclc9s5+Q+df7D0L/wnoZflr9e3P3b0l2Ca9SW xegslebF7dLwE49+vfTOORVwkALknpXmUkbjFVKughOnWINQQ2MfReIyzXW25QSrNHi+8S kBXK+2YIk3rqcfdq0zh42S7z0KWaCstvO+JH19AOnzFC29/g7fIqBvdm/oIdfImsQTJgfi Zrm3XUj28jtr7OpzQKBb/Itm/S29lruzi3bQCIfdDM5lmzAYwXKRjB3JvIHwdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730392712; a=rsa-sha256; cv=none; b=sJqhvUloZ+rznEeXM8O8GtRtVqgByYR8P0+S/lz5QmJ1uGN2bJIX7j8TzaxJez3G4O7N7p Oc3QO4grACakyfIZ6pIUYPYruKxQgtQQ4bI3uvy7Gd7xDiWRqL1Gh3AgAwG4hN59Y4dZyw jtYw+z26WVALEAGAtHqO7bzbir3K5BrLpfwwL76TRx0qMVqmmt6izQ1/dicsnHKSZhoBsv QT/NhSgnW+eVpX5/FekJuJr67CzxtKmLdw76HSOBS6bGRxMb8q+fF+15tkXaEPAdky2yxL W075SpymwgKHcWZPMcaGFnWWMc26IMSEA28/9oFyC5YJ9VZTrMsUf19qrXAlvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfV6w5rszzjch; Thu, 31 Oct 2024 16:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGcWqk034046; Thu, 31 Oct 2024 16:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGcWWZ034043; Thu, 31 Oct 2024 16:38:32 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:38:32 GMT Message-Id: <202410311638.49VGcWWZ034043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 822e06011ed9 - stable/13 - al_eth: improve TCP LRO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 822e06011ed997442a98b9932753bec4697363d1 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=822e06011ed997442a98b9932753bec4697363d1 commit 822e06011ed997442a98b9932753bec4697363d1 Author: Michael Tuexen AuthorDate: 2024-09-05 15:35:40 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:38:11 +0000 al_eth: improve TCP LRO Use the appropriate function to flush correctly all entries. The old code does not remove the element from the hash table, only from the active queue. Reviewed by: Peter Lei, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46434 (cherry picked from commit 0b45d36510d8c629fcc49805bc64e5893f4ba63c) --- sys/dev/al_eth/al_eth.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c index 409769b5ee5f..afdf4a160917 100644 --- a/sys/dev/al_eth/al_eth.c +++ b/sys/dev/al_eth/al_eth.c @@ -1585,7 +1585,6 @@ al_eth_rx_recv_work(void *arg, int pending) { struct al_eth_ring *rx_ring = arg; struct mbuf *mbuf; - struct lro_entry *queued; unsigned int qid = rx_ring->ring_id; struct al_eth_pkt *hal_pkt = &rx_ring->hal_pkt; uint16_t next_to_clean = rx_ring->next_to_clean; @@ -1676,10 +1675,7 @@ al_eth_rx_recv_work(void *arg, int pending) "%s: not filling rx queue %d\n", __func__, qid); } - while (((queued = LIST_FIRST(&rx_ring->lro.lro_active)) != NULL)) { - LIST_REMOVE(queued, next); - tcp_lro_flush(&rx_ring->lro, queued); - } + tcp_lro_flush_all(&rx_ring->lro); if (napi != 0) { rx_ring->enqueue_is_running = 0; From nobody Thu Oct 31 16:46:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVJP3gWDz5c1dq; Thu, 31 Oct 2024 16:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVJP2vRJz4jMZ; Thu, 31 Oct 2024 16:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzifCIJAIO+ynPN6dUDTTICBMZfTEMKkYX5P5tTAbQg=; b=hvAdQkqmhEzAWxUAZmSzPo65KgRW9eHm2NI4XG+vabIOI+pYBtGEEVk9hjvq+55wA/LF4u s9JGkVTrnVuEMdxBP8HYc+NXCepaP/jg+h4a0Jje347vgwMl5Oo63dbiWMQQvuqmQ1r28J k+W1p6JTZ1KqehLLCFCYYS0i9S3CXTFVjn9n2aT5GdiTlKVT/yCagsRAYUhQs2Ax0nfciA CQ62bHLCZUcXRz6b4bZhM0M2bAyZAzHKMl6YG1AThfuR58P9SKZP1CHrOYdynAmEBsN9Lw HMaHnpil2+9WfESJ4t6jwZfuVZFF+vTkA3npumMJo31IeEtHbf34h9jjxhnqGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzifCIJAIO+ynPN6dUDTTICBMZfTEMKkYX5P5tTAbQg=; b=RNpQLoxsiELEkSvTPflyMtsNHn8s9qr3MrCZst4xSkZyuaihJeWBVOQD1M53IBFz16j3KQ ggM60118741IaAfmVzJ3NER+wZX1gsFoxdI/VPmxdUOFe9v/Uic18+jqbNe/6nWMSSjgVk rKVRF3ag9UZftgCJ1kJeSaI1GHB5vw6HcjBthphO/taxYh/ooBsSmm/rOxIu7NhfJa/APa ivo3zJBRMl1cT+jzAe9lOVJn+Slhjp16N3FPAIxtRyzCXcfNhjauAZpCKLDjApl2MStDOT BB2ss7Z0tdLH4uxyJygtVkevgTBVO0NQWmVjNBl5MxqV4Cbt698NzEIDG/7p1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393205; a=rsa-sha256; cv=none; b=uZQZm/I5XjGU1HT+kVBHdkrWEfEV7UY2qa9Lj8R/OxaNFqnoQTFXS43BgGMxeCh3HeoBE+ 1D/GpYvTaExLq13NgXANDKo1mXc93PLPkwQrANFTAKTFc52Gr0ntX/cZVCH9fPxkvTLHJ9 yxGh7TjQhsb86s9BTzgPnHy/u09L7P95r009D5v0J8RnCds0n4lH3xgI3zCHauC2k9y9gq /9cy5VR2msJs5Ypjz3/Py13kpdPI1ByJJYFVyAbQqmPzomGV976adjMDv/YvDOsXidDwEm E9Cgn/VPC1RjJjwzYyD7I61tce40FRvpB77WPqGtA5fz7nBXXgWlOLq0Avk7nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVJP2VhQzkrt; Thu, 31 Oct 2024 16:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGkjNH051479; Thu, 31 Oct 2024 16:46:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGkjX2051476; Thu, 31 Oct 2024 16:46:45 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:46:45 GMT Message-Id: <202410311646.49VGkjX2051476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c7e7794e9546 - stable/13 - MAC: improve consistency in error handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7e7794e954604048ecfe9468237b2bb3d95bd1c Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c7e7794e954604048ecfe9468237b2bb3d95bd1c commit c7e7794e954604048ecfe9468237b2bb3d95bd1c Author: Michael Tuexen AuthorDate: 2024-09-26 06:02:06 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:45:49 +0000 MAC: improve consistency in error handling Whenever mac_syncache_init() returns an error, ensure that *label = NULL. This simplifies the error handling by the caller. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46701 (cherry picked from commit 3f2792166aeed4baf07d351bcb12a9d196c443eb) --- sys/security/mac/mac_inet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/security/mac/mac_inet.c b/sys/security/mac/mac_inet.c index 231887e4e73c..c88d573719a6 100644 --- a/sys/security/mac/mac_inet.c +++ b/sys/security/mac/mac_inet.c @@ -474,6 +474,7 @@ mac_syncache_init(struct label **label) MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label, *label); mac_labelzone_free(*label); + *label = NULL; } return (error); } else From nobody Thu Oct 31 16:49:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVM413BXz5c1QC; Thu, 31 Oct 2024 16:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVM404tHz4jXR; Thu, 31 Oct 2024 16:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RL2EewRvBHVxBaGSA0xyl2nI64IeyFAMPTsQfGOQK0o=; b=YXynFwmnBoaomaA8MXEwSnB6Z2WnqN4wnh6QCa4pQGp1F6mBeR+KiPwbEFjivfhO12HiEo CqdL/TmUr45UI/a+qayqQtEFgntzPL/pSGn3jya1651iTzQ8Bq3F2Z7437W2PwnSDUMG8T TTTJT2uh9m1Nzn+vv3NleLGYPOHM7C2OiIpAeUGFLDY00+oGLIwpJStlPFNkdNqkjkg5Ve fNB/9Zt9Y++czBa3QkohkLLLosUzMLzef/HzmHOW4zb98LZCQYLv47AIammWgVlkZ6X8sw D0725x9lalJguy8ncgdQ1bDYFlk3r+dx2/1hDpO0oW9FOGx930ZFZQ2trAebcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RL2EewRvBHVxBaGSA0xyl2nI64IeyFAMPTsQfGOQK0o=; b=Nd6ILwQuaKNdUkMwrXGcxWPcDxPPc43OaT0WRNQwqFMVWGLNncl9SwwyjSclOuJrulomN6 iwIbP9aUTBUENH0GS4IL+jOFiZcqxtMYzt2kvTgmtLA0dYkPW+WsZUETS6phS+I1JaZJic Z/7EZruRkiLoGY/y/iuhCi4g32IDXneXISo+rUXzRF20omh9GgmIe16KLDXlnwpVU812kk XmOVyAbzMVLZGvEzzyzVYnVr8LWCljqIkD8TVxmXjgJ/XQPNgvM/VeWsiFZttXblZGDBbs jz4pDRWr01kvIWhkJFNIszLGDMDb3dT5JBsUW3l9yVVR8mdPrWyht+aF14dvVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393344; a=rsa-sha256; cv=none; b=e5i35JzcDsp7ern+Fga/Mz1QMgLjAHnT6YBs84nebVP563HPRyr9se+C+/RyK9uodVdQVI n04+zjvQUoV48bIQ0Q2MtR2jXbbNZSvVoOYbAfISaoFwog6ee+MNdB6VmcCcDWktIYqHtv uGP6iA0jMiQydxiVGfAG1lCRrh973ABsqCoamLtcyxTPAZGnoiww2B7wD5ebM3c6JQzUKm L+i7JrW/erDm6HxSJakLCWc2DaIOBqlQjz+R3gszL4hdB32iugVBu3JssVk6DSpDVwSlA5 Hbw66mPv2AvQr8Z8hFO6zy1dLjCQFyPJ8AT8PEYGg+Chlb4eqcELWNi+vNu0YA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVM36p0gzkLQ; Thu, 31 Oct 2024 16:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGn3pZ052274; Thu, 31 Oct 2024 16:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGn3h3052271; Thu, 31 Oct 2024 16:49:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:49:03 GMT Message-Id: <202410311649.49VGn3h3052271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6421a70e6238 - stable/13 - MAC: improve handling of listening sockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6421a70e6238833fed219c756fbe0b914282ff7b Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6421a70e6238833fed219c756fbe0b914282ff7b commit 6421a70e6238833fed219c756fbe0b914282ff7b Author: Michael Tuexen AuthorDate: 2024-09-26 06:06:24 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:48:38 +0000 MAC: improve handling of listening sockets so_peerlabel can only be used when the socket is not listening. Reviewed by: markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46755 (cherry picked from commit 2fb778fab893b4a8a86ecfa20acf2e23bb2cdae8) --- sys/kern/uipc_socket.c | 5 +++++ sys/security/mac/mac_internal.h | 1 + sys/security/mac/mac_socket.c | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index bcf0ad2ade2c..9cbc5c1f2f7a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -151,6 +151,7 @@ #include #include +#include #include @@ -936,6 +937,10 @@ solisten_proto(struct socket *so, int backlog) sbrcv_timeo = so->so_rcv.sb_timeo; sbsnd_timeo = so->so_snd.sb_timeo; +#ifdef MAC + mac_socketpeer_label_free(so->so_peerlabel); +#endif + sbdestroy(&so->so_snd, so); sbdestroy(&so->so_rcv, so); sx_destroy(&so->so_snd.sb_sx); diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index d1ee1af09c0b..4b2be98b4e03 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -242,6 +242,7 @@ struct label *mac_pipe_label_alloc(void); void mac_pipe_label_free(struct label *label); struct label *mac_socket_label_alloc(int flag); void mac_socket_label_free(struct label *label); +void mac_socketpeer_label_free(struct label *label); struct label *mac_vnode_label_alloc(void); void mac_vnode_label_free(struct label *label); diff --git a/sys/security/mac/mac_socket.c b/sys/security/mac/mac_socket.c index c21f4e148076..da84f2e45fd5 100644 --- a/sys/security/mac/mac_socket.c +++ b/sys/security/mac/mac_socket.c @@ -170,7 +170,7 @@ mac_socket_label_free(struct label *label) mac_labelzone_free(label); } -static void +void mac_socketpeer_label_free(struct label *label) { @@ -185,8 +185,10 @@ mac_socket_destroy(struct socket *so) if (so->so_label != NULL) { mac_socket_label_free(so->so_label); so->so_label = NULL; - mac_socketpeer_label_free(so->so_peerlabel); - so->so_peerlabel = NULL; + if (!SOLISTENING(so)) { + mac_socketpeer_label_free(so->so_peerlabel); + so->so_peerlabel = NULL; + } } } @@ -616,10 +618,15 @@ mac_getsockopt_peerlabel(struct ucred *cred, struct socket *so, buffer = malloc(mac->m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); - mac_socket_copy_label(so->so_peerlabel, intlabel); + if (SOLISTENING(so)) + error = EINVAL; + else + mac_socket_copy_label(so->so_peerlabel, intlabel); SOCK_UNLOCK(so); - error = mac_socketpeer_externalize_label(intlabel, elements, buffer, - mac->m_buflen); + if (error == 0) { + error = mac_socketpeer_externalize_label(intlabel, elements, buffer, + mac->m_buflen); + } mac_socket_label_free(intlabel); if (error == 0) error = copyout(buffer, mac->m_string, strlen(buffer)+1); From nobody Thu Oct 31 16:49:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVN14KWZz5c1lr; Thu, 31 Oct 2024 16:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVN13XHZz4jl6; Thu, 31 Oct 2024 16:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPzh4t+AObM4djCyeWQbPl1DfADn6QCVmfJ/unv5Gbk=; b=t0Dhwtd038gbpaX65/YBDeh6oo8igJhJoKZf6P9dV/6MGRM3sz/vDDHSscVoBy5eSgpV09 U9yWcftW2P3AoOVmtsOA56gpq/+W+8ryJxwb4rHQE+AqwsEghJ7fnNCYPF7oJEnDBf4cX7 j8wOjWn1wQJULEIS9oh6Yy6pdR0v96Dji6khvvV/BTiapaiNgfW5Dorv6ZLrdzuHc8fRe0 Z/A9iIUtOl7KJBROwv/hnRge04Bgvm6lFI7SRBPxJCfMUJa8y2bNVudjegJYVcu6apbXlt zi9/q7d63vSjevTwSbDjnQe5BQ8Vz92n40ycAF6/8+DS6dQ2N9Z3wbLXWe06Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yPzh4t+AObM4djCyeWQbPl1DfADn6QCVmfJ/unv5Gbk=; b=SNdaPTbGAR1Jy3R6q1CtWRKoJbzsI+YVJbWDmQOY2NqzHAXT1yCNfeUDevdxWRniEODcif B/q35FJFPsH3LoMIHoiuiA+upkB8pD/OOsvJ0vRP893aSN/HrFucjgwiEOhB7c2cSB4wkJ GKWksacBprw7M8gOHnB2sWJciZVGwn2puogJKgeXY15Mt/awwv1R/iTbjgdPHEZNweOItS jTZS8JzXb5VTJk6uAoYlp7cRsa3SA6WpC/St+nvX9MfDeMldTaNxuOPlqj3f6E/qePPASl UnNGmHnk+ZSMpjBZq6Bf1QUKCCL8dXkUJRnSNRGNLC2N/P5tXJK7kcuZYsv5FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393393; a=rsa-sha256; cv=none; b=cZYMP5kEIUwBIIsJFUYyfkHFU/DXPBW3s5I4fc7FgD/OtGrpXFNy7st6E929/6bmXVquWS nluCk6KMeTYpNaZRRthysgvjUaqKnBwXZ7/b7pVuAw4rplMXk5whIDY/+ca9yZEtXE/xdg zSMVuundsodhE5WW3rHVyphwXqWT1Fz2oDa8KK3gGj1DBe8S+KYTqAt1f/2FygIxwZ6+Lp KZ224ctH3vDsKbdk83wwM+9Tst47hrSJ1Wwtl6eMtBm5thsGBRDf4nQRG6li03D0YexG3p 32CxmVnegYTJkJD4SitoIgKx23YQc2hi58SDcPd6m716/xM+cO8DWeF44l1gJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVN137TfzkZS; Thu, 31 Oct 2024 16:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGnr6N052781; Thu, 31 Oct 2024 16:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGnr2R052778; Thu, 31 Oct 2024 16:49:53 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:49:53 GMT Message-Id: <202410311649.49VGnr2R052778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: cdd0ab2374a0 - stable/13 - tcp: improve MAC error handling for SYN segments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdd0ab2374a033dadefefab94977aaa38a4af57f Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd0ab2374a033dadefefab94977aaa38a4af57f commit cdd0ab2374a033dadefefab94977aaa38a4af57f Author: Michael Tuexen AuthorDate: 2024-09-26 06:10:01 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:49:27 +0000 tcp: improve MAC error handling for SYN segments Don't leak a maclabel when SYN segments are processed which results in an error due to MD5 signature handling. Tweak the #idef MAC to allow additional upcoming changes. Reviewed by: markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46766 (cherry picked from commit 78e1b031d2e8ef0e1cbc8874891f5476dc7868bc) --- sys/netinet/tcp_syncache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 111f591c5851..d4e21edc1713 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1408,7 +1408,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, int autoflowlabel = 0; #endif #ifdef MAC - struct label *maclabel; + struct label *maclabel = NULL; #endif struct syncache scs; struct ucred *cred; @@ -1806,10 +1806,11 @@ donenoprobe: tfo_expanded: if (cred != NULL) crfree(cred); + if (sc == NULL || sc == &scs) { #ifdef MAC - if (sc == &scs) mac_syncache_destroy(&maclabel); #endif + } return (rv); } From nobody Thu Oct 31 16:53:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVSM1S1lz5c20Y; Thu, 31 Oct 2024 16:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVSM0bSGz4kMj; Thu, 31 Oct 2024 16:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+mkoKl69XwVLkbHWkpvkU++/aQiKPa7Pi/1CDrPYq4=; b=Rx1ItAojmKPL06knLlxfzU1pdbM0OUgqpWyJoYuh5IgzCw39weaZ4ekYpE7XYK3tKlwaTA sNhmeG3FdmqkcSWf2dPlzZe+YjuUfvhMLz8C+gXfz41Ng5FgdahukT8LVcZbsWy5QI1VN/ 0kLWuiPxnNhcsBC4wVFymvU1dY4+OHTpb0RmEUF9qyQdFYhIx7FZ+JGh3Vsnqo+FEeRCDx 8I0qDSwkIvGZRK2ucIgFPsrAyut+NtfbVZLf/JB9/z+JlJrO3k03QQDrD6lgRt+bXM0s4o o82nPRYqtlNpv+1Hkuz1gJTalTM9IEZeiaD2DahxjLQVmLlVgI/9Yzc4NChttg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+mkoKl69XwVLkbHWkpvkU++/aQiKPa7Pi/1CDrPYq4=; b=ANmI9Hxp1mR8vnYD4XEcr8fY1IOP8X/Jbb67dwS9OU2MPvbGJiZTWqijtdRSJO1k+KeOiA JEjDGl58Jt+nJPOLtf49HcoJyOy+n/GqADkdye+bfCSiQ8jLb2HC9efG7nEEA8BvbBdDqO 0WOctqg6VXrdrgG9KIMRI6JgwsxcOSy33HGz2E6Pao58B+O+mW1t2pgeWJpPJsuxRdgvo9 9StJhzE78rJvOnVBt9o4BrBo98ndVnGtMzfqVUSfhF7EBYKwjD1AtNFAPmw22FkSpaSz76 F0R5Sgv00w6MZxIPhnlcf9he8RDP/a9SiDnQ3+Y05K1O6XRQoXESroU55IihRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393619; a=rsa-sha256; cv=none; b=jMqfn0wXAy3nVCqlZ54qMtGOaumq1/Mx3TMeR4vy8BL5aOFpQW/ezWUZWqOTifhXylFELf GXX9XdStwD7zFW6xtGYXChBU3wHdcGfwtjByiC5TohfsrMRlU8xlzdZqp4Uj9MpaUzwNhB 4AZhLDhuNnLnBeqmjoL91M/tVAGnRLSCRs/LSweZUeMRq3Zf182OwxaySAdxbFCAEXVQWo 5iyFWeQh8xTcXgvJxLUmr9BOBIShEXejMMwxmuRPpVqZp51pfK9nMfFK4Ph3EFNKzMzRao shzhxeJtVASeSXQYJPCdpJvruvizw/ExQag3CysZu6kp9CxOxETeG7MjLyry9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVSM0BgTzl4c; Thu, 31 Oct 2024 16:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGrcL4069894; Thu, 31 Oct 2024 16:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGrcnE069891; Thu, 31 Oct 2024 16:53:38 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:53:38 GMT Message-Id: <202410311653.49VGrcnE069891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: e53a21abdf29 - main - iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e53a21abdf2953714e44e3c54b4bb78557cb096c Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e53a21abdf2953714e44e3c54b4bb78557cb096c commit e53a21abdf2953714e44e3c54b4bb78557cb096c Author: Eric Joyner AuthorDate: 2024-08-30 00:58:55 +0000 Commit: Eric Joyner CommitDate: 2024-10-31 16:50:48 +0000 iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it This allows iavf to load on E830 devices since those devices place their MSI-X BAR at a different location than in previous 800 series products. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46952 --- sys/dev/iavf/iavf_lib.c | 7 ++++--- sys/dev/iavf/if_iavf_iflib.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index f80e3765448f..3116ce0501c2 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1479,10 +1479,11 @@ iavf_update_msix_devinfo(device_t dev) { struct pci_devinfo *dinfo; u32 msix_ctrl; + u8 msix_location; dinfo = (struct pci_devinfo *)device_get_ivars(dev); - /* We can hardcode this offset since we know the device */ - msix_ctrl = pci_read_config(dev, 0x70 + PCIR_MSIX_CTRL, 2); + msix_location = dinfo->cfg.msix.msix_location; + msix_ctrl = pci_read_config(dev, msix_location + PCIR_MSIX_CTRL, 2); dinfo->cfg.msix.msix_ctrl = msix_ctrl; dinfo->cfg.msix.msix_msgnum = (msix_ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; } diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 714d34eeebe5..d460df6e0d25 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -370,7 +370,7 @@ iavf_if_attach_pre(if_ctx_t ctx) } scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union iavf_32byte_rx_desc), DBA_ALIGN); - scctx->isc_msix_bar = PCIR_BAR(IAVF_MSIX_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_nsegments = IAVF_MAX_TX_SEGS; scctx->isc_tx_tso_segments_max = IAVF_MAX_TSO_SEGS; scctx->isc_tx_tso_size_max = IAVF_TSO_SIZE; From nobody Thu Oct 31 16:55:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVTz5w4Kz5c2QY; Thu, 31 Oct 2024 16:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVTz3gHHz4kmr; Thu, 31 Oct 2024 16:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fv87ny5AGY9WksmTKb5p7IgCmFGnyWMUSNDxf6VIDBM=; b=d0/LJ6ppur3AXk2zEZ/TXloorluDZ5vSaBAZqoMNEfxaipEHHSvq9+SbaHGMjLeBNniDFg iE/Ui6pPPKeCUSkxVl+EeJXhVapnNPo5pyz1YmaeUPWTR9fyDa5xh1wAASmniv6hQW903c TLUruRrw8aLZwUqX1QMru2kj6Po4PRCrlArp9CUNmNzYCMRqNvGR+9RAKCpqmFMs4vzHSn 4aHKs8PrSgCLA2wKQD8GswIonGuD330leS7JwF8NWNqeK4IY7ngX17//el5lI05GtyWtq3 S2D3M7my66yyqvRFCRz2WdblGT0hMTLmDwI0UGIk6KTjgrk9gYFxAYD+LlfFMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fv87ny5AGY9WksmTKb5p7IgCmFGnyWMUSNDxf6VIDBM=; b=IwqrUgRdaGf5Q2GPlZqSZrlLaSVHTN0JxEQ4LfqK5TFIsrnVdQzjNR1GRog0BkkYoIqhYa uywVkW0CKe+0XC1vja9LhCHzgDl51zuKdRfgHamWZPGzqQZidhKzDtvzELg83Pz66srGE5 j1VVfTq0WBbYPNbbwj+CL64JpiU87lj4DAM6z5u0cOKOWFqESLPmljSK1kE1C59GYUYLz8 i5BAwKdHNDiDn2oP/i7RjUpUklnTQGCY/QKItGhjvL8o2TAQUf4WkkUW3MXpqgu1LFr9O4 DfoifUs0+X1cf2+XZ6WQYR2ZOfYKqJC+qDlbYU+f5qVB6QaOaneePq74GFkn3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393703; a=rsa-sha256; cv=none; b=xi7U1aKnqLz1s0D6yLus0NeeNqNFH4zjFuUmSeVwCGX7S5ZuQWyld/PMqLQzBNhIc1YJ/h wiH7TTJTYai6/yhW9IpCAkUQ/X5Q/k+IjU3e7UM1qXCvT8d6Ajfg7zyM/9TAxfAj5QGn3i 49rtWsi1RaUWAYPjemG088iLRIqbzlZTjKsfPl0U3kXh6g57aCWLEZe1L6G0Gbk2AtEtY9 WZRFd814p3j6pdXOLgGdgbh9tlKmp956axwa46M7uVdYeLI+UH4ZnjwkKVL+6yvtbC9i4O uOToJSeql7PIdg9Zi6PufT8iC03IPzbhXeR86rfpT4BWx3nuRbTvkkjVEAoY7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVTz2zSDzkq0; Thu, 31 Oct 2024 16:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGt3GY070521; Thu, 31 Oct 2024 16:55:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGt3JJ070518; Thu, 31 Oct 2024 16:55:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:55:03 GMT Message-Id: <202410311655.49VGt3JJ070518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: b8ab635de4b5 - stable/14 - iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 commit b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 Author: Eric Joyner AuthorDate: 2024-08-30 00:58:55 +0000 Commit: Eric Joyner CommitDate: 2024-10-31 16:54:24 +0000 iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it This allows iavf to load on E830 devices since those devices place their MSI-X BAR at a different location than in previous 800 series products. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46952 (cherry picked from commit e53a21abdf2953714e44e3c54b4bb78557cb096c) --- sys/dev/iavf/iavf_lib.c | 7 ++++--- sys/dev/iavf/if_iavf_iflib.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index f80e3765448f..3116ce0501c2 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1479,10 +1479,11 @@ iavf_update_msix_devinfo(device_t dev) { struct pci_devinfo *dinfo; u32 msix_ctrl; + u8 msix_location; dinfo = (struct pci_devinfo *)device_get_ivars(dev); - /* We can hardcode this offset since we know the device */ - msix_ctrl = pci_read_config(dev, 0x70 + PCIR_MSIX_CTRL, 2); + msix_location = dinfo->cfg.msix.msix_location; + msix_ctrl = pci_read_config(dev, msix_location + PCIR_MSIX_CTRL, 2); dinfo->cfg.msix.msix_ctrl = msix_ctrl; dinfo->cfg.msix.msix_msgnum = (msix_ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; } diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 714d34eeebe5..d460df6e0d25 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -370,7 +370,7 @@ iavf_if_attach_pre(if_ctx_t ctx) } scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union iavf_32byte_rx_desc), DBA_ALIGN); - scctx->isc_msix_bar = PCIR_BAR(IAVF_MSIX_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_nsegments = IAVF_MAX_TX_SEGS; scctx->isc_tx_tso_segments_max = IAVF_MAX_TSO_SEGS; scctx->isc_tx_tso_size_max = IAVF_TSO_SIZE; From nobody Thu Oct 31 16:56:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVWs1yKvz5c227; Thu, 31 Oct 2024 16:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVWs12SXz4lCG; Thu, 31 Oct 2024 16:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lHHUsjL1yzRHAQQ9hyNohATG0mBEAKeeuRn8NjCw0dw=; b=ccbK8HnKrRiVUhS7Yr2VzefzcoqPI7ZFD5I994w+oIishCdkvlFvTf1b2pDKg1pCvA4L9P OcjZew+DAATiC8gPcBeNinFb5AmwoixP0CfEhmStyv/mrwtgiLm2QECb3h2vQ13EkFnBNU zrXZm8/z0KauwT040FipN/te5UuzsgqAdBMjGlpf0/Y7SH+z1R6J2ORUxLRQZoh6Uac69Y QTVjS89zJsksfmb9Ej7l70gwIa/HmNh2SNLShRiTrzo9ZEI5BT0yrSdinmPxaiAdbvRwJ3 xENvR4m+eXYEpS6iW79Au+/lk9mT9k53jY5F/zZn6Ha18STdPMLLxiMA8vYuuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lHHUsjL1yzRHAQQ9hyNohATG0mBEAKeeuRn8NjCw0dw=; b=I14f7Ox8SgzW+MY/7CBY+HWvgkftwTdz14pLcf9dsM7SuYO7n6w2nCBOJxoWYQhynW07H3 A9BsOr0SwqRHhTondMAjkGkqiwjM4qDDWwNmooGM5+tog0AwS5Ciuwkf0LAIjPsy2FwuzD +vuQ3YkNdJlNDx8Ax23P0GKddXbySF9p5eyupPAhfjf/mdBjGIEg2V3qjsU9Bi/pLCIscZ 3ibkyLf/25zeqIZH2wxaSrEV082qFEHHoom69gnzDq20OGhO0CQR2I9eSFH3+5q88+8C0M TU27lBTgJLVjKKFP65dm6S7Nkcl4VOwvc2KlgBHrCidcr31uSJV56YE8RKA+uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393801; a=rsa-sha256; cv=none; b=lsW8CcPxMiX9LpOw7MZn0ucPX5XetI/OOqbG+JUXXpUd/LJjI9gDptLI14qTeNduCsfIK6 CZZUTAVyAuhifUqCBNrmZH4IUpe5Y1RA+hoKNfSdGeCNHwEVhELLWx2lS82HCHlZjH2tZP FKPJug/JAHC/8jlhYsQHLJO7ncrjAirAX59rYKampiPieUQtKf/V6x0e332CIBwaW6VpqQ GVmd3y0E/3yapQgr4NeDuPMxOvIIxTxXNB4WqxStjAU9kVvAofmL4gJFpMMAcF2Wf/153E 5FCtvorkqG7TROIDpq1S1RtY41i9dB1GI5Egb2E86yNXMesvKbuME4nj8sdMCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVWs0dphzkq1; Thu, 31 Oct 2024 16:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGue31071213; Thu, 31 Oct 2024 16:56:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGueqE071210; Thu, 31 Oct 2024 16:56:40 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:56:40 GMT Message-Id: <202410311656.49VGueqE071210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 5414cef63485 - stable/13 - tcp: whitespace cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5414cef63485efd305466233e317facb33665287 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5414cef63485efd305466233e317facb33665287 commit 5414cef63485efd305466233e317facb33665287 Author: Michael Tuexen AuthorDate: 2024-09-30 17:53:57 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:55:56 +0000 tcp: whitespace cleanup No functional change intended. Reported by: markj Sponsored by: Netflix, Inc. (cherry picked from commit a2e4f45480c248036b002904ddbceef20ba7c523) --- sys/netinet/tcp_syncache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index d4e21edc1713..4544788e8318 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -233,7 +233,7 @@ syncache_free(struct syncache *sc) { if (sc->sc_ipopts) - (void) m_free(sc->sc_ipopts); + (void)m_free(sc->sc_ipopts); if (sc->sc_cred) crfree(sc->sc_cred); #ifdef MAC @@ -1563,7 +1563,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, * forget it and use the new one we've been given. */ if (sc->sc_ipopts) - (void) m_free(sc->sc_ipopts); + (void)m_free(sc->sc_ipopts); sc->sc_ipopts = ipopts; } /* @@ -1647,7 +1647,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, __func__)); SCH_UNLOCK(sch); if (ipopts) - (void) m_free(ipopts); + (void)m_free(ipopts); goto done; } } From nobody Thu Oct 31 16:58:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVYx3YPQz5c229; Thu, 31 Oct 2024 16:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVYx2k0dz4lV5; Thu, 31 Oct 2024 16:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UIhUPp5tXoQqKxlxmnURdXQLCx0qY7/9NYbFkVXTHLE=; b=Xuv0mKLe2kOkRclQJ0vmZJBduEZWcYWlKcTDRst/TkgeDsqVZDzuji92jZWEvGgCoeswHw fSs0Q7tGDblMcwMYGlf/KzGMjMReO8cmVACw05kYPJrbU+AKZxIbn3VDM43x05ZKLXCHo4 2+ciNnJeDCsLy4R1GCQM/shM2XSOK6Zhfcve3jgp98N1VBgOmn/Mj4q20DWq6aWlOjfWVI OmNtDPefvIgNONb+fad8ohsA25DYsvtT+Wcqe9ZOIeZpa3mVA4Y1i2U3a0JX0OSnpiWIOg LP+n+EsMtlZye75mnFLrPsbSt92rBWoVwRC6a7sPfYYSWReDXXjZCX6yLx/e8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UIhUPp5tXoQqKxlxmnURdXQLCx0qY7/9NYbFkVXTHLE=; b=vauXokaDH3b964ERJ5s9leYr+Ev7yMmFc4bYz8vhQq0Wna04GFbWltbxq6+PMQ/OvZST9K QcjQGgZxqeuAymYxyPMBi0PBvrJS9avdYHT6bT6rQBlcLTUQio/E+AAfFfI+SqnF3n9OVi V55R0/9C/fhyw6caqQTCOf4H87P+Bb5+b9iTZWEF7/62UACw8gNKYl0+VhLJpqVjx7FdHq swnpsBDHybJb0oEq5iyqJ0BD1XPw0+tI0ehnL/YBKps+J9JhPjOw2cTxJ4ojJbxZCaF40S ociyLskv9RJB/uhqrLPwxyJfN9Vx4EK7q+CxEW0z7ZmlKlpKdc451UX7pRlNaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393909; a=rsa-sha256; cv=none; b=EDzkxRXdnuZvBL9H3lXsDHrIMUawy3UV0IHVVWNVizj9Cr189nvl4aQMa4vsaJS9u+IW0c ZjvKhW4QL0UbF9a12shHtprTgW/4fdcS8ExiDqDT5KriHfWfYXD/tlFkjw6Q1tUNatcLy0 wv3tUx5LU/bad/NV3OgbV6bcJb+1IDUiystGlzJPIEL41bXB3JbaJEByFsRo7q7ys/VOfO xAyt+UvXg9MigYXiJv2vjHhktpVuHwMguXBo1yrWMGLttAHZpi8+awQ2TsbTPyYfaDj3Oj WV/wGIirbw4t84YtHy1rIhnEqUkpBTVNsmENG1nH9b+P92YlHji+bgT1NPqrnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVYx2GHlzl4f; Thu, 31 Oct 2024 16:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGwTuo071932; Thu, 31 Oct 2024 16:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGwTdh071929; Thu, 31 Oct 2024 16:58:29 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:58:29 GMT Message-Id: <202410311658.49VGwTdh071929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 7174ef705c03 - stable/13 - tcp: improve mbuf handling when processing SYN segments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7174ef705c036b5a47e4d4903f57ddc005465b0c Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7174ef705c036b5a47e4d4903f57ddc005465b0c commit 7174ef705c036b5a47e4d4903f57ddc005465b0c Author: Michael Tuexen AuthorDate: 2024-09-30 18:00:04 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:57:58 +0000 tcp: improve mbuf handling when processing SYN segments When the sysctl-variable net.inet.ip.accept_sourceroute is non-zero, an mbuf would be leaked when processing a SYN-segment containing an IPv4 strict or loose source routing option, when the on-stack syncache entry is used or there is an error related to processing TCP MD5 options. Fix this by freeing the mbuf whenever an error occurred or the on-stack syncache entry is used. Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46839 (cherry picked from commit 01eb635d12953e24ee5fae69692c28e4aab4f0f6) --- sys/netinet/tcp_syncache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 4544788e8318..b5b7e90ebefd 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1646,8 +1646,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, ("%s: bucket unexpectedly unlocked", __func__)); SCH_UNLOCK(sch); - if (ipopts) - (void)m_free(ipopts); goto done; } } @@ -1810,6 +1808,8 @@ tfo_expanded: #ifdef MAC mac_syncache_destroy(&maclabel); #endif + if (ipopts) + (void)m_free(ipopts); } return (rv); } From nobody Thu Oct 31 16:59:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVZq70qlz5c2Cw; Thu, 31 Oct 2024 16:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVZq4rzjz4lT1; Thu, 31 Oct 2024 16:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EWj6IuxrCIOp8C7re8bnAKCKqlG+RjI6+/iUpHHHy1s=; b=bz5pFzTDWKUa4jUSRflQ9o1ZMB/q8GtK875kDl334Bi/p7/bfuwUnBkysUTKEMAWOv1HZw wbegUuMhtHU7N1boV7pcRtmkvBn3KT5cMqvsgCX+jPxb0cRSPkdQ/hGpamtXMknLY2eiHY lDLIusgO/3DdkdKDzxLpFzTzaIwE2P1zltVGdPMpTbJhdv3xLqTvF2xMlVWLXGLJu1I3aE XUa/e1rI3l8Z33ELc/nORTSu2x44sk0FpWU6j/QprNYVEedlkkocGNTvG4qzMP1OISnPDH EL4h/BEdFYU9LT7K7GmN6zoZXBaamfBtSn5+PloJ9Pt26yKFHH/dAZOfgH5gVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EWj6IuxrCIOp8C7re8bnAKCKqlG+RjI6+/iUpHHHy1s=; b=JAvh912AyU26sta/93IRxZw40EJdc5mVfYzwwIp2p6qikf/My2k+KS2wdbEcNrGe3Se84P 3Vu/Mx8f6UgVgtW86oEJmZLqMXxh4rhsCLBDLKGG7WP2yid0vyS533jSXXZrCPnkMGL3I9 aEp9iDo7SQXH2Im14EvsXP7ISz5MdgwXprGj6H20w2LlTumGH7DFB/BD77TcBj695bHlJP ipyxCv7X9RXeivk58vsUo13YGY0lu6MZzdQOZByhKt7dsMlIKKwAcl7HGmUjlB2XQT6aRz +cRvwv/cfn+k53Wm9Z5QRMJ8W65KpkPY3rhyutuVSV0AaClOeMs5y+zp0Yp9Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393955; a=rsa-sha256; cv=none; b=QnV89+sh7b6ov5mM1esrNUP9w4ztJfKaD/zDi51vsLFhnFugeCgDsm9ay2+Z/gdU4HeYc9 9S0hqiGSxNTsh444jvf9wMYhQm73wmtYrygeHMS5RH+2aPaV7l800/3NmCpoOgZLuhKRES cUW4fb7cnkrfUEY7yb0HoUAmY3PQGLsvy09kKsxbV90jK9o7XUhXkhBv77bK9+2+P0bu0v XGmeyUg0kFoz7TVqeJg+D8SLWp+uqasIXx3AMmde4aadaV7Z6SVsgFJZG2D4E398B5KDjv D7trPR5zIl7HSKVM/t6UizRziBYRBJRqnsRDperP6CMWF8ia5QaIdmEY5SskTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVZq49LGzkbJ; Thu, 31 Oct 2024 16:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VGxFCN072284; Thu, 31 Oct 2024 16:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGxFdw072281; Thu, 31 Oct 2024 16:59:15 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:59:15 GMT Message-Id: <202410311659.49VGxFdw072281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 5818c74e34a8 - stable/13 - tcp: small cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5818c74e34a8e5139cda8d57cea51b23d24dfde5 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5818c74e34a8e5139cda8d57cea51b23d24dfde5 commit 5818c74e34a8e5139cda8d57cea51b23d24dfde5 Author: Michael Tuexen AuthorDate: 2024-10-01 15:32:18 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:58:53 +0000 tcp: small cleanup No functional change intended. Reviewed by: cc, glebius, markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46850 (cherry picked from commit 2eacb0841c7dfc92030abc433e53cd31383a0648) --- sys/netinet/tcp_syncache.c | 59 ++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index b5b7e90ebefd..f3d7d626b7ca 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1609,49 +1609,46 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, goto donenoprobe; } - if (tfo_cookie_valid) { - bzero(&scs, sizeof(scs)); - sc = &scs; - goto skip_alloc; - } - + KASSERT(sc == NULL, ("sc(%p) != NULL", sc)); /* * Skip allocating a syncache entry if we are just going to discard * it later. */ - if (!locked) { + if (!locked || tfo_cookie_valid) { bzero(&scs, sizeof(scs)); sc = &scs; - } else - sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); - if (sc == NULL) { - /* - * The zone allocator couldn't provide more entries. - * Treat this as if the cache was full; drop the oldest - * entry and insert the new one. - */ - TCPSTAT_INC(tcps_sc_zonefail); - if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) { - sch->sch_last_overflow = time_uptime; - syncache_drop(sc, sch); - syncache_pause(inc); - } + } else { sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { - if (V_tcp_syncookies) { - bzero(&scs, sizeof(scs)); - sc = &scs; - } else { - KASSERT(locked, - ("%s: bucket unexpectedly unlocked", - __func__)); - SCH_UNLOCK(sch); - goto done; + /* + * The zone allocator couldn't provide more entries. + * Treat this as if the cache was full; drop the oldest + * entry and insert the new one. + */ + TCPSTAT_INC(tcps_sc_zonefail); + sc = TAILQ_LAST(&sch->sch_bucket, sch_head); + if (sc != NULL) { + sch->sch_last_overflow = time_uptime; + syncache_drop(sc, sch); + syncache_pause(inc); + } + sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); + if (sc == NULL) { + if (V_tcp_syncookies) { + bzero(&scs, sizeof(scs)); + sc = &scs; + } else { + KASSERT(locked, + ("%s: bucket unexpectedly unlocked", + __func__)); + SCH_UNLOCK(sch); + goto done; + } } } } -skip_alloc: + KASSERT(sc != NULL, ("sc == NULL")); if (!tfo_cookie_valid && tfo_response_cookie_valid) sc->sc_tfo_cookie = &tfo_response_cookie; From nobody Thu Oct 31 17:00:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVbk5Z0Rz5c2bN; Thu, 31 Oct 2024 17:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVbk4C8fz4m2x; Thu, 31 Oct 2024 17:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfJQ9mJ3a+AKf2c3Zx7nNrl7c5ucvrZizhzBw+LEjT8=; b=jGT/P3eHtuuS4h4ToljZXmOQy4vwC0FMXl7xlfCzIpI3eRuANb1jHk5m6nZVS6tc1hJk4W t0lm0W54GcrGWW4kIiDUGRYzM/Z9KSh4QZ6NtiMGYNzLkzDow3jYXeRWYXicoThR70ZzaN DXhdk9M86BBBwsmU6jE0N1u2HYt/AKqjIwXeiIX5REDaMJ7CIyXhvWDUdhY0P45ReZIuzx xGeUO7Oxl3FL4ue1RmBrZRNfVm0Jd7B0Sz1SLJCxSieai/Zw7+Zo3lfETcaBzNA1yY2xCc vXecwvKEhlHYxuVaYZgGMRQ8uxkaQqYqAbyBQ+IdIcW+yz2Nl0gZG5la+ogffQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfJQ9mJ3a+AKf2c3Zx7nNrl7c5ucvrZizhzBw+LEjT8=; b=mFErq6jeCuYa/7DWFghkYvWVsOoRR3yrX+/qeGJIJwHfXecdTcaRzSRyPnuixn75M3NQiQ JyT9VuejiyZ/RlBv+jkPkGUPhwT3yjBZIHNvD88ic5VQEcQw2KEa6+YBEV0g+VlZxz0jUH PYaVzsOaozz2MKPLnD5dERevI0+F5d65YwRtIVJUbx9q5Q7xUClUM5KfqzRx2PKofv+JAM uJMJPxjmHH5LfsOTJo9LfhkebKFIoGexXv5YslgOm392Iq7o4LZ/DM0touPskXlUCc0GMR tIIkeSxezQtTsCWcZGddyViuMbH23L36v+CKBZSnqTNQrXc8gnYvjQOKspp0Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394002; a=rsa-sha256; cv=none; b=DNcXXHZSY2Q6Nw/4CioFA4QT7QQr6UpdujOw6JsCheax2AOXH3cTM4kRs7ljrg1NymfYDJ C3L+NI0bi9UtcCpUTq2icvtbXL4RxWg9PcZ+Zv7wZo+aR/Xl7KBE0nEB4dLJN+1W6vXL+H 574O+O8kUsLSgJWXfA5tAchfi+ho7FGdS940HDsotLTVjoC6A85JeYip6JrJjpC+znDcpq IRTS27nqS42h1F1e/Wdmnkk+6kaBu6iz0w+kLVD6Z+lIMF0xIyFqIfOgQUZis+fH1fqAmP zjR4ErjalJKqjP3Bpy78EwjLrqrACpFVwwns6lIJxlaT2nNy7G4nyeqQE7Q/5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVbk3hw9zkq3; Thu, 31 Oct 2024 17:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH02bu075496; Thu, 31 Oct 2024 17:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH02S7075488; Thu, 31 Oct 2024 17:00:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:00:02 GMT Message-Id: <202410311700.49VH02S7075488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6fb92db1b362 - stable/13 - getsockopt: improve locking for SOL_SOCKET level socket options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6fb92db1b36221e7025f36085ea04aca1561ca58 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6fb92db1b36221e7025f36085ea04aca1561ca58 commit 6fb92db1b36221e7025f36085ea04aca1561ca58 Author: Michael Tuexen AuthorDate: 2024-10-07 14:46:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 16:59:34 +0000 getsockopt: improve locking for SOL_SOCKET level socket options Ensure SOLISTENING() is done inside SOCK_LOCK()/SOCK_UNLOCK() for getsockopt() handling of SOL_SOCKET-level socket options. Reviewed by: markj, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46881 (cherry picked from commit 3326ab87cc22cb70a41e13aefd8684ff0feed01f) --- sys/kern/uipc_socket.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9cbc5c1f2f7a..81145ff1e1ac 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3331,23 +3331,31 @@ integer: goto integer; case SO_SNDBUF: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbsnd_hiwat : so->so_snd.sb_hiwat; + SOCK_UNLOCK(so); goto integer; case SO_RCVBUF: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbrcv_hiwat : so->so_rcv.sb_hiwat; + SOCK_UNLOCK(so); goto integer; case SO_SNDLOWAT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbsnd_lowat : so->so_snd.sb_lowat; + SOCK_UNLOCK(so); goto integer; case SO_RCVLOWAT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_sbrcv_lowat : so->so_rcv.sb_lowat; + SOCK_UNLOCK(so); goto integer; case SO_SNDTIMEO: @@ -3404,15 +3412,21 @@ integer: break; case SO_LISTENQLIMIT: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_qlimit : 0; + SOCK_UNLOCK(so); goto integer; case SO_LISTENQLEN: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_qlen : 0; + SOCK_UNLOCK(so); goto integer; case SO_LISTENINCQLEN: + SOCK_LOCK(so); optval = SOLISTENING(so) ? so->sol_incqlen : 0; + SOCK_UNLOCK(so); goto integer; case SO_TS_CLOCK: From nobody Thu Oct 31 17:00:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVcS1kmqz5c2Rs; Thu, 31 Oct 2024 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVcS1Czcz4mMl; Thu, 31 Oct 2024 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HL8DhytjhTZ6N1QkBSSn+1fujlOq5jOa9fzcuf6Y5Nk=; b=vOejkmpnHExnRNCi0KRGRrmLUhL9zsNCh0iofqs47pih+dx70WWHrv9VGF04QoQIReelbf IVE5ckDMWm8VEFXSJNVoFnD2ulClNQFvA0hFaznUcOJnBu8bsC93okFPFfFBcoYXgAfyB8 bi2PlALRgMp8FY/YGz9bCgVYTy2NAoqrH/MtsL/LGRJLBaNJC95Uc6Maw2Vt2rwzVq0SDd eKLGz7clSwIzoHm/l9+mPrUXv3BfOTeo+FqrYbCiAbwr3T1m96CdjErvG8gVSgmW+wC5YP tNPorAjJFtYrKu+iLSWFP5FjagKLbbcJCVKACiaB+Vr47Al/5T9FHV8zlgLRGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HL8DhytjhTZ6N1QkBSSn+1fujlOq5jOa9fzcuf6Y5Nk=; b=bSt5J9Hy0dUf+Mywo0yAMEscKjSzf5UE59of1S8yQt5rWzFec/OdVEPgfQWzkaEdOL3TOg z7x6MZhz0aRIi2jJxSW45eLYiUKfs1+HS+SA7qeY8+jxKp36Oycf6YzOmsYVFhb29rcMPH 1iZe7xVOTWEOx90CD9OQVnBRjbnKoWCfmKibJQ7W16Zatvc1NYC9xE1Qs49I+TTHd8XvA9 sXOpq+ZxKvSMOyGVlDAHn6DRTwIsAg/7XH8KVRKMSM6/r0hvWCzIolX6b+bFxA5q7xSEs/ Kqi0qjrRnUjydASv2aPunje1WeLZ2+DYgqeNk0J4U2EW0VwUK6/TYL/fBTCAhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394040; a=rsa-sha256; cv=none; b=TdVrOPTPFKoP0fVImWuYeTcFFiNytDwwYvWguRIhXTZ1BDXU7SXKybUCpMrioKq2nZ9K3p hbIzxFVfHJhFZcstDLdhH2nmssRu5Kzcw4a0WpEL1FpOkfUa2glpA6TycEkC/sH0TuDzAt laMvaa/+LiWyrAE8KJK17CeYlLdf807RkdpvKHWlWGwlwCKtrwLydCHshpBRN6exo/JDXR /DanoXIlDtE2+g+qIeTnYC0Icqhzg8aYDXn2nhxxAwRmOch7Qn9v9APJP5d6pX7qlxXnGr 7w/EhrNi9JjkPuH5f6Ki1QbaoUE3LEkze5bA12gYxO+g0e8/kTn1n9bU/C3o6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVcS0jv2zkbM; Thu, 31 Oct 2024 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH0eBZ082666; Thu, 31 Oct 2024 17:00:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH0eXl082663; Thu, 31 Oct 2024 17:00:40 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:00:40 GMT Message-Id: <202410311700.49VH0eXl082663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 258e38014cad - stable/13 - sctp: cleanup sctp_delete_ifn List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 258e38014cadada0c1a7d48185935369167d8527 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=258e38014cadada0c1a7d48185935369167d8527 commit 258e38014cadada0c1a7d48185935369167d8527 Author: Michael Tuexen AuthorDate: 2024-10-10 08:36:00 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:00:16 +0000 sctp: cleanup sctp_delete_ifn The address lock is always held, so no need for the second parameter. No functional change intended. (cherry picked from commit 2e9761eb80f3e58c116efc10c739ed0d8497c1d6) --- sys/netinet/sctp_pcb.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index f3b51b796df0..489da8b1a5ed 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -277,25 +277,16 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap) } static void -sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) +sctp_delete_ifn(struct sctp_ifn *sctp_ifnp) { - struct sctp_ifn *found; - found = sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index); - if (found == NULL) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); + if (sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index) == NULL) { /* Not in the list.. sorry */ return; } - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WLOCK(); - } else { - SCTP_IPI_ADDR_WLOCK_ASSERT(); - } LIST_REMOVE(sctp_ifnp, next_bucket); LIST_REMOVE(sctp_ifnp, next_ifn); - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WUNLOCK(); - } /* Take away the reference, and possibly free it */ sctp_free_ifn(sctp_ifnp); } @@ -450,7 +441,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) if (LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { /* remove the ifn, possibly freeing it */ - sctp_delete_ifn(sctp_ifap->ifn_p, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifap->ifn_p); } else { /* re-register address family type, if needed */ if ((sctp_ifap->ifn_p->num_v6 == 0) && @@ -555,7 +546,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ - sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifnp); } if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { /* easy to solve, just switch back to active */ From nobody Thu Oct 31 17:01:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVd75FNNz5c2dJ; Thu, 31 Oct 2024 17:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVd74ZCjz4mD4; Thu, 31 Oct 2024 17:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq/RrdPok0pHrDOaTXZuPvoVXv61xJjHuxgjaZUlSzI=; b=WuucAH3Aq3Y/x6abe6FjSNfji9MVayGpcJ/pJMRkG2dphMkfRe4ZWMnAE3zLWNqWdd6psF XJEXmYkgbQh4cKplGxl1TclDZPTXe93n6B+kvxbOpBQNl/OVRWj3of9Gihte3KNXnrwGaz zQXeRhOma53Pg4xW7Y5vawuKVJTi6uOKAMJ9sdnh1RpyMtDdXulA1s/+Bfq6GmULh18LrQ 8lIUMLibxSMhU2ctUqs5uW2fOX4VlVo6JrcwdRy8LGcXvg68QdgOFH9ub6p927+vMnd5R/ EI7Dhp8YbNTFRoOw89ZK5mZlBNaytz3M04cIhbC91M+EKCmWU7ohtFFigrChNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq/RrdPok0pHrDOaTXZuPvoVXv61xJjHuxgjaZUlSzI=; b=MV0RMRNQqIF6i7EIcClMNL4ABNAVWX6vB1+/x1GaRMj0uXkiz2cEYOXsER2LYrDrB5hvlA zp28oD4ostf7jpWJW1v0ALBJy9stXCk0znJ5gz/D20nOeuYXl4uz85dzHVlIcecLBFOMxm EaJmFhsDgzx1IQUZqhwlFLwo068t6PDZ7y9D8CG4Kbn64pNWyf7v2g1gu2gdRIJPqd+1K6 EKi4uvLdo4Jvw2GQV/w9AjdCWi1+dBcegO1J1JP/Wv4NYDgcyzbayQttKurs9OpinjwKyt 1Md37hbRCMJtqnMCILTxwXvuk5O2+tqLBc+Wd/sPRAapClV3X4ICfrC9maWoXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394075; a=rsa-sha256; cv=none; b=Cplven3VSGyNqj3vBhZHprYn0KdzvKr4lAH8xAdJtep0aHzJ7/TQ1ePPdpzC4tg/k//2Re FROgvnql+D0jcudDHpSsUGu6HoYfJrvKAr3hnc/Ld7lmZtkzkgtJFub4i1uvva7sSTM94p oAMHPH6rpFeNpTSMpFkVUsWcOw5JkVx3SoisoThIHUTKdXBXq043K+vo3UwHuPF0lUppqj nTB2w4GsBEoNz3Un0Utl/WN/EpiDXCsQE8qjQvgO2gF79MF4npBWG5tnGW0esOmXvswG+A K0cV8uJNwPvgzisUcjdq193KeBUeq9JRzZMXBn3f/2SZj8TLwPU2jyhYjxIdSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVd7429Pzkd6; Thu, 31 Oct 2024 17:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH1F8Z085086; Thu, 31 Oct 2024 17:01:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH1F6B085083; Thu, 31 Oct 2024 17:01:15 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:01:15 GMT Message-Id: <202410311701.49VH1F6B085083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 9830fed0de06 - stable/13 - sctp: make sctp_free_ifn() static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9830fed0de06354926a837d1ab368c85333d5f96 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9830fed0de06354926a837d1ab368c85333d5f96 commit 9830fed0de06354926a837d1ab368c85333d5f96 Author: Michael Tuexen AuthorDate: 2024-10-10 08:42:35 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:00:52 +0000 sctp: make sctp_free_ifn() static It is not used outside of the file. No functional change intended. (cherry picked from commit e1a09d1e9df30347c279604191a04ce2ef20bf0c) --- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_pcb.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 489da8b1a5ed..2cc91d8afe81 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -239,7 +239,7 @@ sctp_free_vrf(struct sctp_vrf *vrf) } } -void +static void sctp_free_ifn(struct sctp_ifn *sctp_ifnp) { if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&sctp_ifnp->refcount)) { diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index ae062c553a57..51d5a2bad239 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -507,7 +507,6 @@ sctp_add_addr_to_vrf(uint32_t vrfid, void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu); -void sctp_free_ifn(struct sctp_ifn *sctp_ifnp); void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void From nobody Thu Oct 31 17:01:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVdm61K0z5c2y3; Thu, 31 Oct 2024 17:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVdm5bTVz4mf3; Thu, 31 Oct 2024 17:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qNdwDbG0d3U9dirALchcBeLZtOU5HX4nRcweUpQ7TsY=; b=NuELiCK28P9eM+puXNbjqvO+HxbE8MlAYrCXPjMcp34dvL2cKBu5kTSjzppFVzJptlBm62 d4+TzFlf0Sw4MtXVZio1YuOqbexISi/y3jQPmeIQTnE4IzcBFa3RtRbjJaHE+093qMH4Si PdOj3izrLHZZ6i6JspjT946NHwEOi+goyp1so/ge996wSrDDvoV34quxDItzO1E31yrjIZ U+5V6KT4MvOqAtTr52fx/1NkzbhoAcgyP+5EbMxCYXSkQsMjGUc0vTpYCMQie8mQT1SNhP tbSWr/dq+U0R0lgWPQyo3rgH8taJOhsJhgBWvY4xKPk2vxu2hCA2P13vQzov1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qNdwDbG0d3U9dirALchcBeLZtOU5HX4nRcweUpQ7TsY=; b=Eo6NjgCOnOy51iH5EfJwVWVbJ1EaFKElN7Kyz2z9moP5RStQ9j5kVlXsm6pn+Q6wuFHM96 kitnF2ekEu/BM6yJ5NAkfGQOPiGprInJpBUwp3Xl5v93wzVakWBwTsKE2lu+bNaE2WeAEB TboDYXjXrFO2QklP/nkzH39EYMTcnMU7WorEw4nQjC6mjZegrbrOOW9s2/MF0dyels8Gi5 ibA4D+OLQLWSufdAuR+Tkity5I8KnLPTEn50bJK0B83CwgAaz4qDQtYZ18w1QuAGCetycm yFBxNrUQUi0BqAm8ECVBQRLX9Vcw6/noX8V4eA1OMDyYpEOhIMozK425CdKWng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394108; a=rsa-sha256; cv=none; b=MU9MKhP3mK/N9DoDWs1giKhJAQtDoOcaPBKOJGgcS30XdWmNTmyqE8leFcPI9by9UDXY9k qrbXhvMivB5bkxtRuIK5mI9gsj/Ejj1+kIvJJz+uhy0mYF+2N0fp02HVvJMpMgIvZVZije 67kT9sewSoc09eDjS03tNFmCP+e6mIMWAmVMiDPU+O49z9fsdC1o2bsPTI9dRiWTuGfu88 gBnPuPA6Ct4Ueve7PLAIIcWYUi+6ZJagC2kZdP/OWBZ1bXhkRxgdid7GncSChIKrrkECT2 3NsidGci4hV1LPdwM0LDGGrUoDICB4yG6E3S62HE9ImS4KwzUYvD7vfd3lWijg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVdm5BklzkdH; Thu, 31 Oct 2024 17:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH1mgQ089839; Thu, 31 Oct 2024 17:01:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH1mhg089836; Thu, 31 Oct 2024 17:01:48 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:01:48 GMT Message-Id: <202410311701.49VH1mhg089836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 88dfcee5521a - stable/13 - sctp: check locking requirements List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 88dfcee5521afe21fecf231ae5d7a6ce54d418b9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=88dfcee5521afe21fecf231ae5d7a6ce54d418b9 commit 88dfcee5521afe21fecf231ae5d7a6ce54d418b9 Author: Michael Tuexen AuthorDate: 2024-10-10 13:50:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:01:28 +0000 sctp: check locking requirements Actually assert the locking instead of describing it in a comment. No functional change intended. (cherry picked from commit 4466a97e83fd9484cb22dd2867b6972f6b185e8b) --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2cc91d8afe81..e9ba04be57ea 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -378,13 +378,13 @@ out: /*- * Add an ifa to an ifn. * Register the interface as necessary. - * NOTE: ADDR write lock MUST be held. */ static void sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) { int ifa_af; + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_INSERT_HEAD(&sctp_ifnp->ifalist, sctp_ifap, next_ifa); sctp_ifap->ifn_p = sctp_ifnp; atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); @@ -415,11 +415,11 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register * the interface based on the remaining address families left. - * NOTE: ADDR write lock MUST be held. */ static void sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_REMOVE(sctp_ifap, next_ifa); if (sctp_ifap->ifn_p) { /* update address counts */ From nobody Thu Oct 31 17:02:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVfV72hDz5c2Y0; Thu, 31 Oct 2024 17:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVfV6YJlz4n6J; Thu, 31 Oct 2024 17:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3pQtgRj2jejInbqITN5BRJBNZgPCGgpldxPNLdFlgPs=; b=MqEW3MPDNmzDS8TN+tJooz4XTkFAgJmQCkzbFMv4ymgSHpKXY1Bl4snGA7on9OoWOl7dnK Eq6+VKjQEZEffkzT2HMrjY4iuSNteagcwN+iglj044+p1lUC/hpO9LOSrsrj30PTkosXtR EIQv77Bw3/cFPNeMMuMsd9nD8izUTfx/I91Qd17FQ3N+NrRD19S49nYO25GD/QY2EOHccg o0wSqdr53pQrxwR4E6ne/7F9JynvQLC5Dj/L76bHecWFVibCJEHeTsXZ/gSf2t6YIWbV2Q 7t6q7oRIVX24VkRljo2YkrS0AqJMWok36+jMBuwFAPWWejE4Tw3Vu9P9KHtv9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3pQtgRj2jejInbqITN5BRJBNZgPCGgpldxPNLdFlgPs=; b=VAHVvBWjbNr4+Ex3vZ/WuA9OM90+2qWkigO+HKGMpUVdcQO6b9/X30OsSKiS40CrkuwxaL XhzIOmrvODCpU3126dxVPnELRDGhXWtk4KTrqvsjcQBXGAkrXGkC/wzUvewah+5zgxKZTP h4OxqxEY+uIG5SpdTXcZ81FB+0D1HZoEmrWPo/6bIz+74ETXNZTkZ3PxqCEMKd22vGPI35 DxUGxG3V+eV5J3U5+iVEdjdlytUAgu70NHi84rQjusfau7aELBIa1v6fjqDKvmpO1oQiwK czKldQc0An2C3BpGXFonTb2VIE67U1rbFhOofSUvC/sPr8/cFobvba7WYMKJ9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394146; a=rsa-sha256; cv=none; b=SvT3f6+scxpuZMqPEFauuuXwxZZe9YZhym5gQUJ6nExrsm+hpjFCClTMv/bfN62yv3Y7uS cQK7x58MP7ZoF7hgKKAZU2pF6GT0z20h1s4lG07Cd149HGmkSX/RbjuiAsCkRd5qZTABer luAMuETafMwQPLF/Rx29UEm7VejLcee6rQqjMX0tPZa4Z1+DT4JFptMgD+8gBOeXLRPAWN 5Fvj5OZX2lrPTqsUIW7hdT8bzyrvAeszzaXtTSPVnvpFtyeG/MvZi8lFlpmXYvjJO/cIwC MesWfHxI2LnUvk9/DpEnHurpZ7nY/YqA5PEeEWOuK/dN5u9aq+uNjitxOrkRRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVfV61rNzkwS; Thu, 31 Oct 2024 17:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH2Q4B090230; Thu, 31 Oct 2024 17:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH2Qoo090227; Thu, 31 Oct 2024 17:02:26 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:02:26 GMT Message-Id: <202410311702.49VH2Qoo090227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c7f2035e1fc4 - stable/13 - sctp: improve debug output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7f2035e1fc40c6a2db7b0d3c547ca0a694ac7cf Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f2035e1fc40c6a2db7b0d3c547ca0a694ac7cf commit c7f2035e1fc40c6a2db7b0d3c547ca0a694ac7cf Author: Michael Tuexen AuthorDate: 2024-10-24 11:18:22 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:02:03 +0000 sctp: improve debug output (cherry picked from commit ce20b48a60fbae275085237dd48075d426f00d37) --- sys/netinet/sctp_asconf.c | 6 +++--- sys/netinet/sctp_output.c | 8 ++++---- sys/netinet/sctp_pcb.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 3a30b0ba3740..6b98557c45a6 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -1313,13 +1313,13 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, #ifdef SCTP_DEBUG if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) { if (type == SCTP_ADD_IP_ADDRESS) { - SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else if (type == SCTP_DEL_IP_ADDRESS) { - SCTP_PRINTF("asconf_queue_mgmt: appended asconf DEL_IP_ADDRESS: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: appended asconf DEL_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else { - SCTP_PRINTF("asconf_queue_mgmt: appended asconf SET_PRIM_ADDR: "); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_mgmt: appended asconf SET_PRIM_ADDR: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } } diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index bf4d383d732c..13d5f1d68f5e 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -13772,15 +13772,15 @@ sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro) mask = (struct sockaddr_in *)(ifa->ifa_netmask); sin = &sifa->address.sin; srcnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: src address is "); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "match_nexthop4: src address is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &sifa->address.sa); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "network address is %x\n", srcnetaddr.s_addr); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "network address is %x\n", srcnetaddr.s_addr); sin = &ro->ro_nh->gw4_sa; gwnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: nexthop is "); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "match_nexthop4: nexthop is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &ro->ro_nh->gw_sa); - SCTPDBG(SCTP_DEBUG_OUTPUT1, "network address is %x\n", gwnetaddr.s_addr); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "network address is %x\n", gwnetaddr.s_addr); if (srcnetaddr.s_addr == gwnetaddr.s_addr) { return (1); } diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index e9ba04be57ea..080cb81fa09a 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -769,7 +769,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, else { SCTPDBG(SCTP_DEBUG_PCB4, "Del Addr-ifn:%d Could not find address:", ifn_index); - SCTPDBG_ADDR(SCTP_DEBUG_PCB1, addr); + SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr); } #endif From nobody Thu Oct 31 17:02:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVg252hBz5c2SH; Thu, 31 Oct 2024 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVg24X6Kz4nhk; Thu, 31 Oct 2024 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a3A9GcG/NWS8SP/01W6/paZEdI67fCS1lRQID5npRaQ=; b=QjJjV3k+Wa+QpcBxHPDPwk68cn3o24T0viM1Pehu1fzzze29d3byeT60+kEFwu4nMZypLE 9EvN6xN49N8pgKHr3Xkfwo7YNjbjze2/mjlPZqc0hcfCi6ZLA5xIsutMs8S2ZnrRFGK6+g 3fFaJsIGKYhtqvdZ7GsQHmlV1hlNx76rlrRVCGf85blfVK+t021NVGaUhA4TL4xZ63bXUC +m7BFffU7SWws+vIrYJeaw+8S0SrXb9EiWadteLQiz/ndXu4RNhrht63HWLkoAnY3jd1jC A+F+nbqanPMXZ+3hA95z0LrAivM7QfJ2rhnHqNGogJMEOTwK0/1zkPbBtP4yVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a3A9GcG/NWS8SP/01W6/paZEdI67fCS1lRQID5npRaQ=; b=HXagZ51oULysfDYzvY93jL0Y0fzLXsHgm1fvu1SnoNEgb6a6UCsFyqp3VkTNAvU2//gRnC 5csIx4Wb056CmGentpjYTkARImhJnHf2GvES8KL+H3820Gi5zLRkVhZCzOHnfH7pp0+2li tOL7Ba0SGyVrdMh77Jly/x0QVvPSho07X52XCIEn5HLhyNNryi+SzD0SRaBL6eMOHCDsS5 E/PpiFIk8mbU0EntFUTuSffK06V0Cij5v5Zte0PrwJFa0i8AsRWHt1N4og2tZ1BmdzByp/ 6zsPNo7AYZkSELsNyY3tgZDwHAhySJ3PnNwDV0yOio8QcvtQsx7ee6Sw9IQv3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394174; a=rsa-sha256; cv=none; b=kxij/+fCJqJybocYpSsOl/AIB6EkP6127jUXKPsnNs+dsneA17Qkuzt9OBbQPsDoFjvLUo W4Slizk24GEA8kCSSFVcwm6vlz41f9+DImDech3z/VCy8YTXN6i0mphyVeYZK/f9BI8bVs hJCcpOSS4TwEsDbll73jMMLdizMdCJKSoxWhqx66yoyQftCdry1aPnPf723DK4YiUsAYlj aWt9QvdEfOcThXf8aw6/l+X7e2e6SuL3H1yuP2VUQXHeSyyKpSzU/AWQL0VLc7J3R5HoGq +EJSFYWZq3TAXV2QlB3z/Siu/3zD4CWhyNMLhHmOfeNoivRHZUfynCTHzkJg2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVg247TRzkYN; Thu, 31 Oct 2024 17:02:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH2sMv090455; Thu, 31 Oct 2024 17:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH2s2s090452; Thu, 31 Oct 2024 17:02:54 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:02:54 GMT Message-Id: <202410311702.49VH2s2s090452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 76c6a76ea1dd - stable/13 - sctp: cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76c6a76ea1dd2f4cc47853c5b9f9ab41fd9a1017 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=76c6a76ea1dd2f4cc47853c5b9f9ab41fd9a1017 commit 76c6a76ea1dd2f4cc47853c5b9f9ab41fd9a1017 Author: Michael Tuexen AuthorDate: 2024-10-24 11:24:49 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:02:42 +0000 sctp: cleanup No functional change intended. (cherry picked from commit e4ac0183a1a846ef6556c9876dab76c06f5fea9c) --- sys/netinet/sctp_pcb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 080cb81fa09a..cfac25c90891 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -192,21 +192,17 @@ sctp_find_ifn(void *ifn, uint32_t ifn_index) struct sctp_ifn *sctp_ifnp; struct sctp_ifnlist *hash_ifn_head; - /* - * We assume the lock is held for the addresses if that's wrong - * problems could occur :-) - */ SCTP_IPI_ADDR_LOCK_ASSERT(); hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_FOREACH(sctp_ifnp, hash_ifn_head, next_bucket) { if (sctp_ifnp->ifn_index == ifn_index) { - return (sctp_ifnp); + break; } - if (sctp_ifnp->ifn_p && ifn && (sctp_ifnp->ifn_p == ifn)) { - return (sctp_ifnp); + if (ifn != NULL && sctp_ifnp->ifn_p == ifn) { + break; } } - return (NULL); + return (sctp_ifnp); } struct sctp_vrf * From nobody Thu Oct 31 17:03:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVhC2KkTz5c2Y9; Thu, 31 Oct 2024 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVhC1q9Rz4nvb; Thu, 31 Oct 2024 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2DFE8q0HdIT0ESHTATxXEYBvDFs5ROsoPFWOWDJ63w=; b=iLQnT+GxGVyWNS0blhW/F75wOhW3VbNPRkp4hy8j8bAnWEBKcw3NmH/ZJvmQevCIW4Bnau U08urOVgUtKbS/c58c1cfOsPvuRNBwpLPztLt+mOmBwfW2WuzOiNYke1Yd0Cq3X8KCSdtn j0cp2ozauMXkK/70zV1nzogjOp7hDsdxLiRd0f0PPWOiY0i+jSH7JcWiRrhMVY4HJVvnUs BrjYv4MdupUKInHpRF2lSqYe9KVb3hRcA4qBGuKyPEKk2xsBapRy+Rd/jTAXPUgpLIc73r FweOWqfl9dcJw4dlwnmQTe3FhvkKOFeoyk5NLHSh4OW6PQJnHJZ4qP04UU4NEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2DFE8q0HdIT0ESHTATxXEYBvDFs5ROsoPFWOWDJ63w=; b=yJU17uP3kLDfenDS0tjI8P0V9y9gIyjS8fgJ/BB3kNtbE0fOgxBYp1Cxv4f5BGBNMc+MMT OA618XS3GbmAG/8Z+IqHQ+A4wKbPYFTu1sfwGBpgjQUIpb1A9C+px/+voi5bficE9SVm39 vyx5fXrSwbtWRCVMa5odMmM/PUB0jme5HpfA1bLKaScwvZkTHBzl4lMgp0DZ32j/0k1Hzn 2o5b2FO9ccZ8qzY15oTYqVIvBOGdtbwxUNoLe/pvCYM8PeiD1lyhccxUshGjM/3D0ch9Sw +nRKqe9nJvP+5QEMm5meFKBLNQrjaqQoGbPamNbhcf1BfONWBTzu/ySanbM4sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394235; a=rsa-sha256; cv=none; b=ZxtxlTGeTk5Ds8KOmysxcgTDK7qQqDrR4wVGOkf75HH0gwYq6PeGJcjR9LRgub4jVeHe6l EFntDQBNdaNNqnVr92u7CqHNB6XYpcJC/Chqrs5n5lMcCFOEMUiOFJFZ/TTVgd1Fhkuk1H ElPLv7mBPbEjvWNpPhDjDvU9QA6UqDi1mPQBKASk6Oe29qFUEoVL7qnBvi2Z3SL/lYrlnf BCLDtIQBMKPkUa84psr0rHpaDyYc3noJ+rpRKiizYlZ2FEz225UZZEGd7hJjzI/fsurmxi wQ3gSIJ8es1KjxaGEE6XWRKvDcNmAs+VHvZa0FSOxwLdIDlPZUvrt450MJ71ZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVhC1QY5zlJK; Thu, 31 Oct 2024 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH3tdt090871; Thu, 31 Oct 2024 17:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH3tc6090868; Thu, 31 Oct 2024 17:03:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:03:55 GMT Message-Id: <202410311703.49VH3tc6090868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f735547b21a0 - stable/13 - sctp garbage collect sctp_update_ifn_mtu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f735547b21a02068abb0cddc84b7e34e9cc81865 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f735547b21a02068abb0cddc84b7e34e9cc81865 commit f735547b21a02068abb0cddc84b7e34e9cc81865 Author: Michael Tuexen AuthorDate: 2024-10-24 20:00:59 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:03:29 +0000 sctp garbage collect sctp_update_ifn_mtu (cherry picked from commit ce5b5361d4d1b3868631baa6870ba6e1e6ec8330) --- sys/netinet/sctp_pcb.c | 11 ----------- sys/netinet/sctp_pcb.h | 2 -- 2 files changed, 13 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index cfac25c90891..2bc3958af3de 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -248,17 +248,6 @@ sctp_free_ifn(struct sctp_ifn *sctp_ifnp) } } -void -sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu) -{ - struct sctp_ifn *sctp_ifnp; - - sctp_ifnp = sctp_find_ifn((void *)NULL, ifn_index); - if (sctp_ifnp != NULL) { - sctp_ifnp->ifn_mtu = mtu; - } -} - void sctp_free_ifa(struct sctp_ifa *sctp_ifap) { diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 51d5a2bad239..d349519e4ce1 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -505,8 +505,6 @@ sctp_add_addr_to_vrf(uint32_t vrfid, void *ifa, struct sockaddr *addr, uint32_t ifa_flags, int dynamic_add); -void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu); - void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void From nobody Thu Oct 31 17:05:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVk70T5jz5c37Y; Thu, 31 Oct 2024 17:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVk663lhz4p9B; Thu, 31 Oct 2024 17: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=1730394334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIb5CAp6ON7fsf5YvpW21JNkFezB64HoD5eYaRk0ggk=; b=UYgmlCg2VdBb1ijkJtfx1T/sPRwmS3av/SEklQvuy13uipI76CI8e8w9VCMLfEvgSyVgrt F2VyGdL4yE7pdQxTw7O2NjEcVhaMOB5qummp6jBKNS6qC+9PzsRgb0DH8EPPRUEQaPTMjA xO1f0pofKnk1a1ZIh48zxW02mZgK3lQWRsK9SaRzFiWPuqi5FOuFuhjeaMjNVl8KIQnMe1 mf770cp4WUE1GQUj8ih2nJEDmPW/J8XvqKlWMTU1LCdfniyiNNbyTEhDQU2ZKwdsm+jV92 07jdgEzhBFjlPkjTDt16CN4sYY1bbieklAlXCMae3CqwUBb/e5U2vXmUn3b/qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SIb5CAp6ON7fsf5YvpW21JNkFezB64HoD5eYaRk0ggk=; b=jVuLt5mZ/E+d7Xye+pNsNXkA9XuYO4FBhZ0FIHXpGdSs1YFhfLOUBDWooP/F10jzf6QvSE etqj/X/JlM7Vhr3JpzVHBuFE5wgtK87L65b2vwJCBWUxqJFJvt3p0egdfi3sGmEygbSaAh KZfHU92Gq/y+88OGhAFgcnCZnhZ0HXeB17hMFAIXyLSmatQV7J0IsT55YFymxZMa2AgylB HLA2zuzdRjApM5U7BYH3b6ssXPs77RdIbshnbvMT/5DqlpU86YD9HRLxe7oSB7rShUQI7k kTJfnIc3kbwJNjX1cq8hplxLSfykgpN80lmo/svSbJal7Aw/D2JmHDSTPF4euw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394334; a=rsa-sha256; cv=none; b=q7rhkNB6Z47hRHrLXB/1BleSlhQC9+MCaQlGb+s/z78zJmXhgZ9isVjM3b0huMNjyW4Cl6 5m7IcYi0oUcKlkxIpIEvuY/Nfn5yVHK9Y/3r05wThz6WxT3PMqYk1bLEqm73pPp3cga+Tr VVkZG9PDHhOnRWQIJDs6pgD6JEQK/JAbCJgg3sr+z8Z8Gjs7Lvo5PNPAYDCBk9UtLY5I87 UmHGcoHJCZPjMz4V9f7Le+iZQst4kQqdVzzMptypcnFSHHdnuco5bXitgKNM1P87oKNsP4 S2FCHHAPUxdVzNqm0tnDIs13fJ15LKsfyhuyIFf4J68i2JksfWNWBWe/eDhcvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVk65fZrzl72; Thu, 31 Oct 2024 17:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH5YO2091500; Thu, 31 Oct 2024 17:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH5Yks091497; Thu, 31 Oct 2024 17:05:34 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:05:34 GMT Message-Id: <202410311705.49VH5Yks091497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 03de3fc2ca00 - stable/13 - sctp: further cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03de3fc2ca00dddc3b80045d2926f5d7e557ea01 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=03de3fc2ca00dddc3b80045d2926f5d7e557ea01 commit 03de3fc2ca00dddc3b80045d2926f5d7e557ea01 Author: Michael Tuexen AuthorDate: 2024-10-25 11:47:43 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:04:10 +0000 sctp: further cleanup (cherry picked from commit 02478e65910ab1ef53511ebb2271cdcf0e9a14cf) --- sys/netinet/sctp_pcb.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2bc3958af3de..251cceca68bb 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -455,7 +455,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, struct sctp_ifalist *hash_addr_head; struct sctp_ifnlist *hash_ifn_head; uint32_t hash_of_addr; - int new_ifn_af = 0; #ifdef SCTP_DEBUG SCTPDBG(SCTP_DEBUG_PCB4, "vrf_id 0x%x: adding address: ", vrf_id); @@ -519,7 +518,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, LIST_INSERT_HEAD(hash_ifn_head, sctp_ifnp, next_bucket); LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn); atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifns), 1); - new_ifn_af = 1; } sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); if (sctp_ifap) { @@ -529,7 +527,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, (void *)sctp_ifap); - if (new_ifn_af) { + if (new_sctp_ifnp == NULL) { /* Remove the created one that we don't want */ sctp_delete_ifn(sctp_ifnp); } @@ -597,8 +595,8 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifap->src_is_priv = 1; } sctp_ifnp->num_v4++; - if (new_ifn_af) - new_ifn_af = AF_INET; + if (new_sctp_ifnp == NULL) + sctp_ifnp->registered_af = AF_INET; break; } #endif @@ -617,13 +615,12 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifap->src_is_priv = 1; } sctp_ifnp->num_v6++; - if (new_ifn_af) - new_ifn_af = AF_INET6; + if (new_sctp_ifnp == NULL) + sctp_ifnp->registered_af = AF_INET6; break; } #endif default: - new_ifn_af = 0; break; } hash_of_addr = sctp_get_ifa_hash_val(&sctp_ifap->address.sa); @@ -639,9 +636,6 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, sctp_ifnp->ifa_count++; vrf->total_ifa_count++; atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifas), 1); - if (new_ifn_af) { - sctp_ifnp->registered_af = new_ifn_af; - } SCTP_IPI_ADDR_WUNLOCK(); if (new_sctp_ifnp != NULL) { SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); From nobody Thu Oct 31 17:06:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVkm5GMZz5c2gr; Thu, 31 Oct 2024 17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVkm4jSCz4pRx; Thu, 31 Oct 2024 17:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NIvspK+MsbU/fVfReIOiI+f00rrKeT5lMbPnMpf5aU=; b=TcJuoihXUPpjm5r3hC8+vRlmEdc2Nggq2Z77KyE9UT3zgClumd2Qukfn6kmfBfCKdJCRvp T+T0LVVal6fAkgGB6fdM7WZY1CGgXKd0R0FHL3RarncB8P2LO8LPaJ/UdVaL99ShBMIstc uaNLrs4DxbRjS712KDcUJmUZKONNBqTU0KX7ZophaZi8B20qUnoZX9MCOSCtmPYRASM3EF BK3OkcxKnBk82x/8KlC3E2Hhjf1FaVnOjH6btPBdXRJMrxZ7Lh37UBwwS9TVOBLz5qC4Gq EXRYQK6Qt0J20meRFzReEglLAb8MbTz7JVaAa7RTwK3OHg+8Jf95ycrA/vbFVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NIvspK+MsbU/fVfReIOiI+f00rrKeT5lMbPnMpf5aU=; b=jptu1t1DXQVHvyc082EUOJfkFszr8gI2gMDrSOEx1vFM6xY/C/Zt+mGqKB5yvkbvoTlBYo +8mi+fmZUzmnTV4oDkASRtmHJsU3OjpGnRGVqElQFrYrNz5bwCy8c6RXIdue23X6+GgCXD 3fAMrXG1Rqsu62uvo9acg8u73efOPN0kR6qjY83ydpKfnM0FaEnyyJev2jJZhx5TSUG2F8 JaTAEieDwYE6B/l2DsHc4PXihobqU8ENVbKGaJkF+f0ScvaQQNCF6gv1h9Q6JkMSPVonUC mDmiGVScZEt+Xhv9EaVp+dUJZAValFhXd3VJYSnn7G1K/TSFJ3BqZAW/92u3Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394368; a=rsa-sha256; cv=none; b=uc9f3bFESUAuhzM1CiguAxncY8oJQgP41fUlu0HU8EhX1OtfC/tS/ibaJPq6UTEu218gE8 9zrRXbJU37ryTnGLfOlWvbRZkUqHOQxdZO7rcCwVKsYwUqtweAt94rBjLLDIyoDiZNgkZC duST5DZcggzJQBrKynevk96ahX6JMFJzx21/JFhUzgtrWvfnJDZjwY+9MUjsal8wwJ3ikx jZkVogERoKyUtuGasVQOCSk776wzM4/bf7DzihJHj+08AoeYfB9UHnjsYCDG4Y02bCrD3g GcAhM8WskuLwWgvl6rikR40OAi/k8VEo3QKiy6TqcYA2FB5YLYm+Zi2cEtK3MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVkm4JMFzkYQ; Thu, 31 Oct 2024 17:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH68Wv091800; Thu, 31 Oct 2024 17:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH687W091798; Thu, 31 Oct 2024 17:06:08 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:06:08 GMT Message-Id: <202410311706.49VH687W091798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c274b69f43cc - stable/13 - sctp: cleanup the addition of addresses which are already known List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c274b69f43cc8408ac2af0b64fba334d6967f365 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c274b69f43cc8408ac2af0b64fba334d6967f365 commit c274b69f43cc8408ac2af0b64fba334d6967f365 Author: Michael Tuexen AuthorDate: 2024-10-25 12:11:09 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:05:48 +0000 sctp: cleanup the addition of addresses which are already known No functional change intended. (cherry picked from commit a05620b0f67fe526350bf386882262ca8005533f) --- sys/netinet/sctp_pcb.c | 83 ++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 251cceca68bb..2423aef5a89d 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -520,56 +520,61 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, atomic_add_int(&SCTP_BASE_INFO(ipi_count_ifns), 1); } sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap) { - /* Hmm, it already exists? */ - if ((sctp_ifap->ifn_p) && - (sctp_ifap->ifn_p->ifn_index == ifn_index)) { - SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", - sctp_ifap->ifn_p->ifn_name, ifn_index, - (void *)sctp_ifap); - if (new_sctp_ifnp == NULL) { - /* Remove the created one that we don't want */ - sctp_delete_ifn(sctp_ifnp); - } - if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { - /* easy to solve, just switch back to active */ - SCTPDBG(SCTP_DEBUG_PCB4, "Clearing deleted ifa flag\n"); - sctp_ifap->localifa_flags = SCTP_ADDR_VALID; - sctp_ifap->ifn_p = sctp_ifnp; - atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); - } - exit_stage_left: - SCTP_IPI_ADDR_WUNLOCK(); - if (new_sctp_ifnp != NULL) { - SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); - } - SCTP_FREE(new_sctp_ifap, SCTP_M_IFA); - return (sctp_ifap); - } else { - if (sctp_ifap->ifn_p) { + if (sctp_ifap != NULL) { + /* The address being added is already or still known. */ + if (sctp_ifap->ifn_p != NULL) { + if (sctp_ifap->ifn_p->ifn_index == ifn_index) { + SCTPDBG(SCTP_DEBUG_PCB4, + "Using existing ifn %s (0x%x) for ifa %p\n", + sctp_ifap->ifn_p->ifn_name, ifn_index, + (void *)sctp_ifap); + if (new_sctp_ifnp == NULL) { + /* Remove the created one not used. */ + sctp_delete_ifn(sctp_ifnp); + } + if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { + /* Switch back to active. */ + SCTPDBG(SCTP_DEBUG_PCB4, + "Clearing deleted ifa flag\n"); + sctp_ifap->localifa_flags = SCTP_ADDR_VALID; + sctp_ifap->ifn_p = sctp_ifnp; + atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); + } + } else { /* * The last IFN gets the address, remove the * old one */ - SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", - (void *)sctp_ifap, sctp_ifap->ifn_p->ifn_name, + SCTPDBG(SCTP_DEBUG_PCB4, + "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", + (void *)sctp_ifap, + sctp_ifap->ifn_p->ifn_name, sctp_ifap->ifn_p->ifn_index, if_name, ifn_index); /* remove the address from the old ifn */ sctp_remove_ifa_from_ifn(sctp_ifap); /* move the address over to the new ifn */ sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); - goto exit_stage_left; - } else { - /* repair ifnp which was NULL ? */ - sctp_ifap->localifa_flags = SCTP_ADDR_VALID; - SCTPDBG(SCTP_DEBUG_PCB4, "Repairing ifn %p for ifa %p\n", - (void *)sctp_ifnp, (void *)sctp_ifap); - sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); } - goto exit_stage_left; - } - } + } else { + /* Repair ifn_p, which was NULL... */ + sctp_ifap->localifa_flags = SCTP_ADDR_VALID; + SCTPDBG(SCTP_DEBUG_PCB4, + "Repairing ifn %p for ifa %p\n", + (void *)sctp_ifnp, (void *)sctp_ifap); + sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); + } + SCTP_IPI_ADDR_WUNLOCK(); + if (new_sctp_ifnp != NULL) { + SCTP_FREE(new_sctp_ifnp, SCTP_M_IFN); + } + SCTP_FREE(new_sctp_ifap, SCTP_M_IFA); + return (sctp_ifap); + } + KASSERT(sctp_ifnp != NULL, + ("sctp_add_addr_to_vrf: sctp_ifnp == NULL")); + KASSERT(sctp_ifap == NULL, + ("sctp_add_addr_to_vrf: sctp_ifap (%p) != NULL", sctp_ifap)); sctp_ifap = new_sctp_ifap; memset(sctp_ifap, 0, sizeof(struct sctp_ifa)); sctp_ifap->ifn_p = sctp_ifnp; From nobody Thu Oct 31 17:06:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfVlR0plsz5c2xf; Thu, 31 Oct 2024 17:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVlR0676z4pnM; Thu, 31 Oct 2024 17:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCSAzlVsHI4Mt/MmwJ+CFbW1FTJWTEeyKlqw/f9AzEU=; b=ZzYqtA9c46A2lJksxkvQLnlsZJSNBdHvl7EgfLMK7NRlsdADDjXjmFwBkAGLQanixj0h2I tWAzAwBlxhudF8rK3DU9Xgs13IeiLnJ6UeSEeSd3ch7soG9Q4R4Uzf6LdDqQf39tCo9z2y 3T+ArhoivgkS/+KnFxShkPaWQhJawfEGHJjRmXpsKLDGbuelPljurZOpLV1FhYNEHPqs9S 1sGsU59OrWoKiCzfKJE3zTwmANqucmIf91eZ1tHm36rqs1sK39ty+CiD0RtQ/ABYmck9e5 TI/oafuUbdqdSvqwGNx17Pwtt73vBG9x8yq80qY3fvq7hEORy1FEr/X1PiayNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCSAzlVsHI4Mt/MmwJ+CFbW1FTJWTEeyKlqw/f9AzEU=; b=MktSnX4rQj1BwTRlVHst4irjELwNEDoHe+dpWmfPsJmPP1VoqqDuuZlb/YWeFRXOiTfzQv 79yTzTgMdOEp6mdpMewcFYpy6SbBV3XLBTPlsa36Rfj+65Ltw84x2MByhrnAbhWKzUiel5 GVP2sipysqUwjENQkvRPj1gBylMB54lzj1hHxQAlKwRGcpQaXyd9BbEKSZqeQ62PUgDozg LnVwkUhwB5p1z1+2sbQtBsPC5aLu6I5GT7H4LKhLtBcXRLzdzgXGCb5YeteQ970wfrC/ly /gzWQKY/DYfG+6A1ucIFBJzjy86jXFi9fSuNgYPjajADWL9XtMkeuLdTxu7S8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394403; a=rsa-sha256; cv=none; b=WTHVYSVUaSKt2MQaDMaXqa/ytiPFjNohZwgbmKakyek5tC9wYUjJz70ww9TUyauCFVI7EO 6xBSre8niJwsKvBkU7GE9bEesqHoI4Bo17GRzDh5Bdc18Iht3gHMeSFWdItBHHnwmGdvNq N/ipUTURhvhYWvQVmhVog1hsasLWNFHR96i234JMqf/VSKfA5buEsUXUbXnC+zavuwkyUY bQbVV7itqzHMN1D+JM6qcvVvGKTo7CEOtekfomzCEZ9i1Yb99/0PjqSUSsWNSEkCrk5rdF ewCdSfcdl+anTuFR2/oYGXbFws+qzzqcnL89ADpXT5d7pkk8dvPcCAwMT1QpOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfVlQ6qw8zkqX; Thu, 31 Oct 2024 17:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VH6gmg092093; Thu, 31 Oct 2024 17:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH6gLI092090; Thu, 31 Oct 2024 17:06:42 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:06:42 GMT Message-Id: <202410311706.49VH6gLI092090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: eac97072d19b - stable/13 - sctp: another cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eac97072d19b44d131025359e26e15c501d94f8c Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eac97072d19b44d131025359e26e15c501d94f8c commit eac97072d19b44d131025359e26e15c501d94f8c Author: Michael Tuexen AuthorDate: 2024-10-27 14:01:45 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:06:20 +0000 sctp: another cleanup No functional change intended. (cherry picked from commit d08713dcdb158b2f55a885e7cfbbe410272c55a2) --- sys/netinet/sctp_pcb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 2423aef5a89d..39b7d58c8892 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -543,7 +543,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, } else { /* * The last IFN gets the address, remove the - * old one + * old one. */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", @@ -691,13 +691,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, uint32_t ifn_index, const char *if_name) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_WLOCK(); vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); - goto out_now; + SCTP_IPI_ADDR_WUNLOCK(); + return; } #ifdef SCTP_DEBUG @@ -705,10 +706,10 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, SCTPDBG_ADDR(SCTP_DEBUG_PCB4, addr); #endif sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap) { + if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - int valid = 0; + bool valid = false; /*- * The name has priority over the ifn_index @@ -717,13 +718,13 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (if_name) { if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { /* They match its a correct delete */ - valid = 1; + valid = true; } } if (!valid) { /* last ditch check ifn_index */ if (ifn_index == sctp_ifap->ifn_p->ifn_index) { - valid = 1; + valid = true; } } if (!valid) { @@ -757,9 +758,8 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, } #endif -out_now: SCTP_IPI_ADDR_WUNLOCK(); - if (sctp_ifap) { + if (sctp_ifap != NULL) { struct sctp_laddr *wi; wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr); From nobody Thu Oct 31 17:45:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfWcm0Rfgz5c5cY; Thu, 31 Oct 2024 17:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfWcl3Vzkz4tNg; Thu, 31 Oct 2024 17:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730396759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iyl2n8PqFkonNHLPIhnGNRxA21QGTb7cCjIYa48jaZg=; b=B7qaxggEDOacMX/09HpNlb5t5/PMgEsHLQdnTsD38W3Qj1bCaRMhcbFKYts8oADaZ86lFN jyl50SJKbDPVxvsKVa9As1ytqBAh0QzeQZ7MenpfzFTfyC1kWRzwsBYUCB9ayHb8Zcbw3j 3XoLqqPiMOzp+iOm1ukRZlWE6Ahdv96VVyvb8iA95pRoBgrT2ukW9pFhcgBY4jkuO8UKMY pkmCanFC8Kyegz7k+ihh1A5lngmCW8WPI6MbTji1wqn7wJl8v7QOM0MEB0k9hNA/IknKyR wJn+vFxveEw0eXJnxKYS6ahoWwHPPoX1rxHUV3YYFiKE82Z37jXrmTgMKSs/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730396759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iyl2n8PqFkonNHLPIhnGNRxA21QGTb7cCjIYa48jaZg=; b=r7FwEKIBAO3eqAM86XcCOJ4TFZUfxB9RxsiJ29uzk/jiVud4IE74LuBSq6BN8KXL2hr0UN Zpv+gsKpTs7tB6L7QaEg//G4ih/qGLXfCad9NF51qIJxhzn4MTM2flhvzCVIINKLfY4IsA hJyXR5ay4x6N2/2RcbLtS5mfFuiqYbF0wJ1eRUxxkQXJNkKxfhDandVBlwWJIijx9s2Cpw 0dzOcwLk5QRpvqRktIbULEpcOMq9hccr3h0ozkoO27YSi/Uw1vnmlHavTRVPeC9fQks0kW 6IZ1PfFBpp9NFFz+cy3x5NSA8g+58mC4Ybm7DF8wRwI+HkUqikaxuxTOBnSl9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730396759; a=rsa-sha256; cv=none; b=YPsnzacoBYmiC9IltP9V2/ElosBtOqfYtuoeLvcYZ2MFUrFOoXufFG9DzUzG7AW+iDxDoe tHfh2QXcY17mWvNP2jLRxu2d6gZK74GBS+3nmfYltyXBDLrqCoMQMKhWIvpcJSMv44NAdx WMmaNe7VbK1x9lzLbvNMuxhfYBQQjUZ6kjDh+X5T88GMGBio+mQjyDA6/XVboRX2/rdfeQ JLLGShkAwSWVhVnLGOpAPMq4NmDUmgCl0LaaIZXlUbmGqMCcNdbAS8yZF2PJ2ZPwsOFHFB 5xV5d7LdGmhOVOpIIBp20tdF6BTDscQM3KHnJ0pkNgBd2fGUu/ZyIF4Tr4dQFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfWcl36pszmBp; Thu, 31 Oct 2024 17:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VHjx7V065545; Thu, 31 Oct 2024 17:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VHjx98065542; Thu, 31 Oct 2024 17:45:59 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:45:59 GMT Message-Id: <202410311745.49VHjx98065542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 68e013783780 - main - tests: Switch bin/hostname/hostname_test to execenv=jail List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68e01378378089a9b8543a53a4e80b231133c92d Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=68e01378378089a9b8543a53a4e80b231133c92d commit 68e01378378089a9b8543a53a4e80b231133c92d Author: Igor Ostapenko AuthorDate: 2024-10-31 17:44:49 +0000 Commit: Igor Ostapenko CommitDate: 2024-10-31 17:44:49 +0000 tests: Switch bin/hostname/hostname_test to execenv=jail Kyua skips tests based on the jail execution environment if a system is built WITHOUT_JAIL. Thus, the test case does not need to handle it. Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D47334 --- bin/hostname/tests/hostname_test.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/hostname/tests/hostname_test.sh b/bin/hostname/tests/hostname_test.sh index a4d4d54bb052..a032fd91229b 100644 --- a/bin/hostname/tests/hostname_test.sh +++ b/bin/hostname/tests/hostname_test.sh @@ -42,9 +42,6 @@ test_jail_conf='%%test_jail_name%% { init() { - if ! which -s jail; then - atf_skip "This test requires jail" - fi echo "${test_jail_conf}" | \ sed -e "s/%%test_jail_name%%/${test_jail_name}/" > "./jail.conf" jail -f "./jail.conf" -c ${test_jail_name} @@ -61,6 +58,7 @@ basic_head() { atf_set require.user root atf_set "descr" "basic test for getting hostname" + atf_set execenv jail } basic_body() { @@ -81,9 +79,6 @@ basic_body() } basic_cleanup() { - if ! which -s jail; then - atf_skip "This test requires jail" - fi recycle } From nobody Thu Oct 31 18:35:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfXkS1J26z5c9YR; Thu, 31 Oct 2024 18:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfXkS0ZGwz478F; Thu, 31 Oct 2024 18:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730399760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDEv2wjB59X7DsTOoEAdnDM9zKTICOGWEi4wPpvvx84=; b=HQDpUo+CuN/5oN41AjemFozLNhL7J9XWSbPm0pqGaWm028DDbZKDa7VBf9DuPUpxCbkd/x Zp/rq0/UEcksKkfUupA9OUPXttAbT39OpeUb2JC2Og0x2yNumj10yclkYeK/8+hMMS1gEO g95xg/JmRlqPlsHpxA+hs67oxOt8+SjjsW/GhS3gYEaeGVQfeetAN4dfaXCCjzxAMoAa/0 dvfxR++33ek+jfeDND9S2R3gacODlLxsrV0t2BEVj20953TPWJZ6AllUxxiJCOh64y+UMK s+C9jydYV9ynOpMTlf5GRlDdeZVD1RKgTPgNOp+mN1zY9lc2U6sM0YTLG7+h5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730399760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDEv2wjB59X7DsTOoEAdnDM9zKTICOGWEi4wPpvvx84=; b=m6tjad1jCFy0TpKxh5KY8PQx43ORFJAQJNdnSEn73lCIIVKyFz/rHWXxXs+h5oPtfLO3Zr O7sHh12XBZwidAx5m7M8kA7hzZXYuW3M5598/y6LBl9EqgkKPqSkGSmQyfZBwF4gUuee7p /fWoZ/sjpOx9WcUus6fY2tepgmVsDC5ZvAlBHGv7pDVXvjmqz7SMfhGVBZrIJPB/QrdvBD aiKA1h+YMjD2aJgCr49N7sjzx7nRyMzfw1Nsj7ofgoru4s2Lh/AKeiSmBi/1liEJevaZMz pwegkOdzAxD/PLPlhfOJbEYmJ3o/lYubF13f1VuoJ0ghyi2GIw9XK7o0WdQCoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730399760; a=rsa-sha256; cv=none; b=Th8ifGptji6bEYrk2vebAW34WeUwMr7TuXTYqipkDvCUnGdPRfG2urGck6YaQBsUyauNoe nS6eXblhtQq+1OAc4imST8LLTTH/3hPCrOo+lHzAFOG8/W9U1pgTYdATUE23n/lKKf4q7m soG1prw9JvXHHg46reOsEuyeMD/DO5xTCzPwpHlIerf7wGwrxyZlbe2RdvBTYuL7mivB07 M3L/z63xXKAUrOX576kdMKhBs8MWfqJyfOI/GlOFmGmp7/Mu+admL2Z2RMuITm55Zrwxxa +dIjTlKqAT3PhRd3NQuR1s5HcoBQ7Db40PjJwdeNYBlXTvw3sljZI8ioFYcNTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfXkS00rRznQ6; Thu, 31 Oct 2024 18:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VIZxq3058484; Thu, 31 Oct 2024 18:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VIZxH6058481; Thu, 31 Oct 2024 18:35:59 GMT (envelope-from git) Date: Thu, 31 Oct 2024 18:35:59 GMT Message-Id: <202410311835.49VIZxH6058481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: cf1aba2857c1 - main - freebsd-update: refuse to operate on a pkgbase system List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf1aba2857c1ec59c9a34d363cb18a61ffa34a10 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1aba2857c1ec59c9a34d363cb18a61ffa34a10 commit cf1aba2857c1ec59c9a34d363cb18a61ffa34a10 Author: Ed Maste AuthorDate: 2024-10-30 19:15:13 +0000 Commit: Ed Maste CommitDate: 2024-10-31 18:35:44 +0000 freebsd-update: refuse to operate on a pkgbase system FreeBSD-update is not compatible with packaged base. PR: 282252 Reviewed by: bapt, markj (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47341 --- usr.sbin/freebsd-update/freebsd-update.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 459d54db0c57..80a8bf288251 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1099,6 +1099,25 @@ IDS_check_params () { fetch_setup_verboselevel } +# Packaged base and freebsd-update are incompatible. Exit with an error if +# packaged base is in use. +check_pkgbase() +{ + # Packaged base requires that pkg is bootstrapped. + if ! pkg -c ${BASEDIR} -N >/dev/null 2>/dev/null; then + return + fi + # Presence of FreeBSD-* package(s) indicates packaged base. + if ! pkg -c ${BASEDIR} info -q -x '^FreeBSD' 2>/dev/null; then + return + fi + cat < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dave Cottlehuber Subject: git: 77b296a2582b - stable/14 - release: move OCI to ORACLE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 77b296a2582b4ea5e4398398e22bd5b4d3323107 Auto-Submitted: auto-generated The branch stable/14 has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=77b296a2582b4ea5e4398398e22bd5b4d3323107 commit 77b296a2582b4ea5e4398398e22bd5b4d3323107 Author: Dave Cottlehuber AuthorDate: 2024-10-15 09:28:12 +0000 Commit: Dave Cottlehuber CommitDate: 2024-10-31 19:18:44 +0000 release: move OCI to ORACLE This allows future releng tooling to use OCI for the industry standard Open Container Initiative tooling, reducing potential for confusion. Approved by: cperciva Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46975 MFC after: 3 days Sponsored by: SkunkWerks, GmbH (cherry picked from commit 1be84d745bcc11b766ac1fa03afd2c8ea8771737) --- release/Makefile.vm | 8 ++++---- release/release.conf.sample | 2 +- release/tools/{oci.conf => oracle.conf} | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 3bfe2d8bfee0..ba57601c1f6c 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -22,7 +22,7 @@ CLOUDWARE_TYPES?= AZURE \ BASIC-CLOUDINIT \ EC2 \ GCE \ - OCI \ + ORACLE \ VAGRANT AZURE_FORMAT= vhdf AZURE_FSLIST?= ufs zfs @@ -42,9 +42,9 @@ EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image -OCI_FORMAT= qcow2 -OCI_FSLIST?= ufs -OCI_DESC= Oracle Cloud Infrastructure image +ORACLE_FORMAT= qcow2 +ORACLE_FSLIST?= ufs +ORACLE_DESC= Oracle Cloud Infrastructure image OPENSTACK_FORMAT=qcow2 OPENSTACK_FSLIST?= ufs OPENSTACK_DESC= OpenStack platform image diff --git a/release/release.conf.sample b/release/release.conf.sample index ac9c1aaa254e..351496dcf6a4 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -113,4 +113,4 @@ PORTBRANCH="main" ## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers ## to create disk images. -#CLOUDWARE="EC2 GCE OCI VAGRANT-VIRTUALBOX VAGRANT-VMWARE" +#CLOUDWARE="EC2 GCE ORACLE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" diff --git a/release/tools/oci.conf b/release/tools/oracle.conf similarity index 94% rename from release/tools/oci.conf rename to release/tools/oracle.conf index a4fe54ad3031..d3b4eb351107 100644 --- a/release/tools/oci.conf +++ b/release/tools/oracle.conf @@ -68,15 +68,15 @@ EOF # S14 Root user login must be disabled on serial-over-ssh console pw -R ${DESTDIR} usermod root -w no - # OCI requirements override the default FreeBSD cloud-init settings - cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oci.cfg + # Oracle requirements override the default FreeBSD cloud-init settings + cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg disable_root: true system_info: distro: freebsd default_user: name: freebsd lock_passwd: True - gecos: "OCI Default User" + gecos: "Oracle Cloud Default User" groups: [wheel] sudo: ["ALL=(ALL) NOPASSWD:ALL"] shell: /bin/sh From nobody Thu Oct 31 19:19:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfYhq1KK8z5cDg1; Thu, 31 Oct 2024 19:19:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfYhp6rW5z4HfY; Thu, 31 Oct 2024 19:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730402379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQ7pZW+j7IUO5vSqa7hTNp9XGVmdImYFr1RyoOOqt60=; b=trUhr6+jL3CJG6U8pOu2Ni2HfRNhByYM6Z2e0oUdmQXTe/l+iKwHfPgLjX5HrBAFjd5DRp qIsmgUnTqorxSorFPyC9x94Ly+7KUzrVw5oQx+2QOoR22YmYEFLu8nGOK1Tk6ZEaQzgQW4 cxcI6XV8dtx+w4gShUVx7O40pYvajYaMa5Hyqy/HL5h+dwEDgxqwL4BjXlq/HTg2f1gqLT MLD7/dhtUEyuoCaKWfq6X+iOCiVRe7Hjt9fuOKBaoVvr31d+7TZS3sjBEJVoBB1Ef5MB3M o2Uob1r3guTSbcFw1f5lScZA4n06eFIFxWgTCdxoCWNmy3GCGgq+4+Ibh8Y54Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730402379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQ7pZW+j7IUO5vSqa7hTNp9XGVmdImYFr1RyoOOqt60=; b=ejpbD4yYZ8/cCu0hnOBwL4T2WMldcH/KH1dH09oHwKiLl98hh1lo7N0VLmSf1njOIi9jSc hMVWvGo6/Wyrk9r1iuDqq9ay6uREvuMBxGwUJ/1ZLYzPPhE/sK1iAzFMqWtcziR2/fwxoj TpUUQVvt89XlsulDdaJvmjfCNHVQGHTyF7DVvdP3WgdmxjgyMgvtPTGkGvXhRFGYy/tbEW 0AjZDJj3QSjkOyZSVM2rDdJg2VdqBujmDxr/DBN503ueU5lgQ7bUAMonWh813r+e5BuDrE OadFvqGFDQXFMJ1p22smoWoXCESfyVtt25Jbc1tjm/lr0ns45u0267LHh3qafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730402379; a=rsa-sha256; cv=none; b=bEMzuCRZ4P6dW/9aqs/K++v7RsD6AIgYYgXf+HqJErO5wR6dlpgROUwUOdvkyE0dK+s5pV 1uOpPGAGtgIjnAJuhDcLnSTQqAoni660R1opZ+k3b8IUvi5JRqQhcf6Wa622DSQmXyQv9Q ztpCgdWCRH4dU4WmXgM/mSIpioVWRFpTe1J/mtgjfgu2d03QS90qU1U6I4BttR3QITV7+r tVxkMlI5xpCokUKPcn9mLkpShuoxdJA981dU3Ag/YNd/0Lv4qX+2P0TVfMFElcs1U0vHwA ZxwV1H4qK6NCDUvzvQelaFl178GrOFfRqOmm+y9t+Q+dONU1S1xuu5Wda+rCsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfYhp6D17zp0y; Thu, 31 Oct 2024 19:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VJJcpC033875; Thu, 31 Oct 2024 19:19:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VJJcU6033872; Thu, 31 Oct 2024 19:19:38 GMT (envelope-from git) Date: Thu, 31 Oct 2024 19:19:38 GMT Message-Id: <202410311919.49VJJcU6033872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dave Cottlehuber Subject: git: 786ebfa46d22 - stable/14 - release: tweak Oracle Cloud settings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 786ebfa46d2211822e4d28d03451cfa4dbfe3cf5 Auto-Submitted: auto-generated The branch stable/14 has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=786ebfa46d2211822e4d28d03451cfa4dbfe3cf5 commit 786ebfa46d2211822e4d28d03451cfa4dbfe3cf5 Author: Dave Cottlehuber AuthorDate: 2024-10-25 15:11:24 +0000 Commit: Dave Cottlehuber CommitDate: 2024-10-31 19:18:44 +0000 release: tweak Oracle Cloud settings - use raw image disk type and enable zfs, this yields smaller images for upload after using native qcow2 + zstd compression Reviewed by: lwhsu, emaste Differential Revision: https://reviews.freebsd.org/D47055 MFC after: 3 days Approved by: emaste (cherry picked from commit c611041660845e8ee8bf3009b32327d1f783a47b) --- release/Makefile.vm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index ba57601c1f6c..07fd8ec94f87 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -42,8 +42,8 @@ EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image -ORACLE_FORMAT= qcow2 -ORACLE_FSLIST?= ufs +ORACLE_FORMAT= raw +ORACLE_FSLIST?= ufs zfs ORACLE_DESC= Oracle Cloud Infrastructure image OPENSTACK_FORMAT=qcow2 OPENSTACK_FSLIST?= ufs From nobody Thu Oct 31 19:52:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfZRD1tBPz5cHFT; Thu, 31 Oct 2024 19:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfZRD1LTXz4Pyg; Thu, 31 Oct 2024 19:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0vE1OJClCZjxb2TDR+wAK0yWy6zH//DJ354kmudg6Y=; b=vFmGRZBWvSkg6mbA0JgAq7gpYRZZ17xS4zYKS7YY2PqB+PYdvgz9XAKJ4lJkeEJkI+Fu1o EIkQBBLhXwAREXobvF6wEf7uh/4JTaRkfPOK65elt6trAp31awaklC4WxQ/+BMTyK7kjwr hIubmF1bDjCFlaTYQHkhlnnzhQVQQg5veXxzdzlw41Is1+a0rX/yWWMpBh0Nvsg7RQ87Wi vFAVTyz8l7dpCBRB8+upS3oRNHNh0o9JxnLrkMsJPUx1l2w7vliX6Z0t8Y+2fmm/A3BfvR oHcBdxGl+wSzAZy5CXc1citXZKfinHwXShRWtU8Cfx1ghg6qolcgcgdO7Ex5/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J0vE1OJClCZjxb2TDR+wAK0yWy6zH//DJ354kmudg6Y=; b=iTEPaTkHqkJx50CIP8FtGSHUrp7WOtLgqxBrd/T4kRnHa+3hTnoeYeOEaO2L9/udDj/9Ed ZzFLnXrPKrIr5NiMgEcePjGm5HjePvjGtBXmr+Lie88/xkyMCtJSPLkq7nhj0CqP87NdxP DLNUAsHQSZnvEMjzJvrFCE8PvT/bgAJ1aiq1brg2udIhz5E8YskfblNFNu7Q9N+V51ZCuw SXqADxvNfnl/C/lJX47CofJFS/kBX0SZIA33IWE2Vg+ZnZ78m5X2DbsO/oX2We5VlsHP00 lTsyWLlnZ2EZzJXQAv06n/doq1Czz0X3vY4fvlT/yGjND3KOtuWCfMGnQGCNEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730404376; a=rsa-sha256; cv=none; b=qMm5bMlViE6HbodAgrG5oMYtATuPoF1x5GZ5kStqRmix2NOyd6S2ReAw0iFY6ys/8aSV4z +D2uWjeNhLzSlLDbOdMmLFBcQ1ow5em7ciR/SBhT+R3BU265eaq8xSi7E1BmXOM+G8Xt+g 1e8HPRuG/AY5L4aq0UAZTIUm5XOm2bEOSrdyCypRWn/TeFiuHBc5HYF0kjzdtmqMyMMELG 8v00qs9tFR4eeOM7bcxiWz4l3LeU8tcY60sP2UOjpLFYEgfe2MmHAMJxYEv32J8PHukIso 3xLPK/KEpNMK6bNlGJ7F1ZCZCm8iadm4vLsUMX4Amzci25Q/CDHy0mD+REqLMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfZRD0xy1zqNT; Thu, 31 Oct 2024 19:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VJqudX005917; Thu, 31 Oct 2024 19:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VJquaA005914; Thu, 31 Oct 2024 19:52:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 19:52:56 GMT Message-Id: <202410311952.49VJquaA005914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1cddce89ce30 - main - fixup_pci: Remove unused attach DEVMETHOD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cddce89ce30570d554120af864d23c554cd5d18 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1cddce89ce30570d554120af864d23c554cd5d18 commit 1cddce89ce30570d554120af864d23c554cd5d18 Author: John Baldwin AuthorDate: 2024-10-31 19:49:05 +0000 Commit: John Baldwin CommitDate: 2024-10-31 19:49:05 +0000 fixup_pci: Remove unused attach DEVMETHOD The probe routine always fails, so the attach routine is unused. However, this weird driver is really a quirk system for PCI and should be turned into PCI quirks instead. The Natoma quirk is also broken as it should be doing a runtime check either on mp_ncpus (or more likely to see if it is using APIC) instead of #ifdef. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47219 --- sys/dev/pci/fixup_pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/pci/fixup_pci.c b/sys/dev/pci/fixup_pci.c index 4bccda90a040..cad175f301a3 100644 --- a/sys/dev/pci/fixup_pci.c +++ b/sys/dev/pci/fixup_pci.c @@ -55,7 +55,6 @@ static void fixc1_nforce2(device_t dev); static device_method_t fixup_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, fixup_pci_probe), - DEVMETHOD(device_attach, bus_generic_attach), { 0, 0 } }; From nobody Thu Oct 31 19:52:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfZRF34xZz5cGyB; Thu, 31 Oct 2024 19:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfZRF2PYWz4Phx; Thu, 31 Oct 2024 19:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hIYu7lFPqiNa74wBirEIVCn3O2C8g31iVGWlvEHz+vQ=; b=ElqvfCgL1pnSMMrXaTntjfQvhZAKkGthFmEoN7jtgF2pCtQtX9Nt57nVM5Ea5cxp2AwL10 Vuk9XvTCRUI8ZV5Lw8/rjdAOfFKH+ocD5H+Xi2skE0E+FJeoa+RlFZCF0mkYZcBn6/H//v bO4OdvNll4pyFeWWWA0xqdoiMtDRx9LIosE1fO7nM94zEmeSlIH+nLDVR/qbJjvyo7DVI/ OIMTjaC5IWLh0kXVBT7OgATsJQ/siu15HViKMfT1XT2Y6urt1c+veH97g32y1I7emi6gas G+lVBq/2ikn/zgk7BB0FZH6wz27Gsyl3Oc20jFPqNaiFSpTlPy+k6HiVyZbhLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hIYu7lFPqiNa74wBirEIVCn3O2C8g31iVGWlvEHz+vQ=; b=EY9Rz8p/pzNbhbhVvWy0n7vr/FQ5WBHiMocBtXrQDaDfBBXgIuDlBI3dJMMbLlBZ/1iJxb DcN0lpNEYMQFWECJekZhUc261KnE6ftOtGYR4xGKKmd/uMHguyggbWFVOvt/2rAUZtOe5y KhT0t2rNWiChGTB+2NyXOfei6m0YyLkc+f87UXLQJ8C7K4ryaaqzhCM+uF4Y+HMbDRq7iX 0J2LXXp+eq0j+BG0h1nf051WVFHw00vgmAf+nZIO6GWFBNXYlvfv1CXMeoaqshqFpuAzLR g/9zjghDwSTqAWSFDuLDhUYKHBthkwSDDzThrhY6kfUq8t15SMuvRzGbKnbDWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730404377; a=rsa-sha256; cv=none; b=LkgTgsuzS9qtIjxIZixBZ/VnZCI6Mgdmkcz0ClNOPEIJfLHp/VQNXvRnay6l3GO3fnj9y9 sbgazLOCE/qYoYTWWg8vJRkERcMMu46hwaWm6VxOsUrrNBgspZLYyzVO3EC3BrQUAd4dz5 UZp79dDf8fTEtlgTIZQ9mAIGrRl8HP0UbWJJ7HAAGEdBCkeO7+vrnUYdAjxET72W80ODa/ WlKiSJJvixeUWPNJsGnwP0vI62gmw7w+v92Za/eZKxh5+5VD9st3mZroXpDGdSkArb5P7W aopASqwVBJzc+wldfvEJJ6Mr9K+TOEFdHHd4+gPK72TSA9EJFFNSegq42JXrAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfZRF20ypzqBw; Thu, 31 Oct 2024 19:52:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VJqvfM005980; Thu, 31 Oct 2024 19:52:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VJqvhh005977; Thu, 31 Oct 2024 19:52:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 19:52:57 GMT Message-Id: <202410311952.49VJqvhh005977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f2e50ce0a37a - main - ignore_pci: Add a proper stub attach routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2e50ce0a37a40363b7ec6a165aa0b0a2e81ffc4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f2e50ce0a37a40363b7ec6a165aa0b0a2e81ffc4 commit f2e50ce0a37a40363b7ec6a165aa0b0a2e81ffc4 Author: John Baldwin AuthorDate: 2024-10-31 19:49:27 +0000 Commit: John Baldwin CommitDate: 2024-10-31 19:49:27 +0000 ignore_pci: Add a proper stub attach routine This isn't a bus driver, so an empty attach routine is more appropriate. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47220 --- sys/dev/pci/ignore_pci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/ignore_pci.c b/sys/dev/pci/ignore_pci.c index 22964e55b81d..8a12e43bcae3 100644 --- a/sys/dev/pci/ignore_pci.c +++ b/sys/dev/pci/ignore_pci.c @@ -41,11 +41,12 @@ #include static int ignore_pci_probe(device_t dev); +static int ignore_pci_attach(device_t dev); static device_method_t ignore_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ignore_pci_probe), - DEVMETHOD(device_attach, bus_generic_attach), + DEVMETHOD(device_attach, ignore_pci_attach), { 0, 0 } }; @@ -68,3 +69,9 @@ ignore_pci_probe(device_t dev) } return(ENXIO); } + +static int +ignore_pci_attach(device_t dev) +{ + return (0); +} From nobody Thu Oct 31 19:52:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfZRG56Hvz5cHQk; Thu, 31 Oct 2024 19:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfZRG3P53z4PpN; Thu, 31 Oct 2024 19:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wQ6qH77a+WKL+SG14Er/fpsApgXe6Nx1zWp03fpKtk0=; b=faTK9dLIN39lfeUx8PQwC5vcONM+lrHeNpPRvf9gmH/FyJI55324fBCJ2P5YX3U4jtED8Y MDL3RtQz7RhsDe6Q+ikmF2WjmLJ7qqV/3RZhualz3Tyo2Q26vyZf8+kOGVIGUZJSpjS+cw GDe3FIXqmKs3lDeHY8OQKvcTMsSUxCUoCU2hJYcgRcLR5nRIbiZVjHpCpGUZuCCXZguvYK ywsrcWuIjE8SzbkdwOSNB5CUh8swnI73L6i26NsMWITXvUwSD2JfDQy7DMOwjOHBf2CBxR zZvyS2mRiJMbyaWHylywZQ5mxN1PEwtVmMUAgQcCnYH7oivlT/BMUIClDSjaOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730404378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wQ6qH77a+WKL+SG14Er/fpsApgXe6Nx1zWp03fpKtk0=; b=FJrAuY8b4lSxGN2lFL6qLS0LsEbPds5JUm24WL9fwIWcR2LKXRbLtmgB4wE6hhRVRUA1CB 8o80xE/+Hfiba1p6ABYJu3XSO/pAHeXNLdoD/fQspwzvSt62jFay7eQTGTo5NcXwrHPvYH G/I+6hBWdEsOJgBajd0rxueUbeiQKoBC0fB6D0Hbm8Rp6mUqTnFHASCej3QrZOXoaaqX09 JNzM6doIxrTIUmb4EensHiyIzHOrYfJ6MRV5mbRKg/OWcYnkZgWrWqQFYQxv/1Q9GmajUq ehpPvOeHHE5B9voAjzOUWsmzvvg9Ltsrm5rPT/dk3ovd1vNiBBOfnxaVyws4tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730404378; a=rsa-sha256; cv=none; b=SH1h6pAjNZZtwb6HIPcHUgFC4/z1RX42jMCpSrcKR1wqDiIF0I7jXn13iUw+XIkPNBoEwU 4fxkMDOf36Y6daG3gjeyAxS+nAMOK6P8kgOkCltwNC2Hvo4c5Q+bBGZIKEqR2EO5X1tJCi sappG7vAK+qJhXp/Ns9QVr9GtINYzgTKNET966xwvrVMqoVPipxJpgEkF37uNE7MWA1/w8 IHavDLIwthl/BeQW3EuW38uW1EcwFyFY9y8m4hELpYzUWNYA43cbnafyIjap9lRc3J4J7H i9OryC1LtPi8IC2tmZs9IedTo5vA+pYFSCSwt3O7WP1Q+F3N3OoVMKDcLSwHHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfZRG2kPZzqNV; Thu, 31 Oct 2024 19:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VJqwj7006033; Thu, 31 Oct 2024 19:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VJqwhD006030; Thu, 31 Oct 2024 19:52:58 GMT (envelope-from git) Date: Thu, 31 Oct 2024 19:52:58 GMT Message-Id: <202410311952.49VJqwhD006030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 13a1dbfed57b - main - vf_i2c: Don't hold a mutex across bus_generic_detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13a1dbfed57b167a6dc4d68b60115eb0e070b9b6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=13a1dbfed57b167a6dc4d68b60115eb0e070b9b6 commit 13a1dbfed57b167a6dc4d68b60115eb0e070b9b6 Author: John Baldwin AuthorDate: 2024-10-31 19:49:41 +0000 Commit: John Baldwin CommitDate: 2024-10-31 19:49:41 +0000 vf_i2c: Don't hold a mutex across bus_generic_detach This was also leaking the lock if bus_generic_detach failed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47221 --- sys/dev/iicbus/controller/vybrid/vf_i2c.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c index 0a0b9d0cb35a..ea0e1eeac7fb 100644 --- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c @@ -207,13 +207,6 @@ i2c_detach(device_t dev) sc = device_get_softc(dev); vf_i2c_dbg(sc, "i2c detach\n"); - mtx_lock(&sc->mutex); - - if (sc->freq == 0) { - vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n"); - WRITE1(sc, I2C_IBFD, 0x00); - } - error = bus_generic_detach(dev); if (error != 0) { device_printf(dev, "cannot detach child devices.\n"); @@ -226,6 +219,13 @@ i2c_detach(device_t dev) return (error); } + mtx_lock(&sc->mutex); + + if (sc->freq == 0) { + vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n"); + WRITE1(sc, I2C_IBFD, 0x00); + } + bus_release_resources(dev, i2c_spec, sc->res); mtx_unlock(&sc->mutex); From nobody Thu Oct 31 20:25:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfb8s50NNz5cKSZ; Thu, 31 Oct 2024 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfb8s32cYz4V0d; Thu, 31 Oct 2024 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLei2u1P6jLXJ3z3tfFZ1vscFHAtTktT9tAFWSJt6M4=; b=kEukST+eFb2ra0XIoZrky6lsQnWgvTsBI2NGRkTFSfdxBKbdbJPYHZraNrSD1HMnktQL06 CdaT7LY100YA+Vp+YrQ33zToHki3W7m0+ztnN8iCHrxd2k8BfNSmMP/KnMordgTbEP0EfP ROHptbyEJ8yIcOfsKcNLMi9QuODAHpDxuBo0eRfqwhwbeOB4JTO/n5CcWBZZ0tN8rV8eAu N0OBrwR17tpS4rwHGsiX7rDiS4ChVUNGBVuHZ4vLFBKCQ7ITm2LEXsDd9pWKIn1kJk42DS 3RehvgAhKUu7zMLMIQjaLcP9w2HSArMmrs6QoMoK7T3TOyTSZkP9Y+n66kblMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLei2u1P6jLXJ3z3tfFZ1vscFHAtTktT9tAFWSJt6M4=; b=NwJTVsQnFY031Zz7xIjF4ykJ/xgddS4cQa0P42ZBYxc4hLWTE9UOCWcBgxQErkBprkHMPD HEtXGVzfp/wGbphv6Xn64g16YWlgZIc5N4gaS/oR5gATN6LOefEzHgeQB3gzkNRcpffZKm f5XyE26fF7uFbb6cUeJCkcRAyGhmt2aqW9qmBuYYUUipB0U03mV1kIcna/5Q8xJfM0d7YW l/JKjijyq6TAZm2BKiUGDqVKBbDCerUrsEN5fuqMacaO8OTFkUyDUIQo5gi85NlcYUb3z5 Q1Hg1C6FDJuiADMfDqGMbcb1Jh/E6U/ULFEFA/uToOkuSz9ygHWjRNu2iM8Arw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730406333; a=rsa-sha256; cv=none; b=u2nazcElPAdXHtAUX0e7/JoWFGSqZvnZT77puVbxAr5RB0IaVRkJSNR6Y5wh6p8tiygwio /JRj3CdJ+O24zAlQhc4gSzc8LFQzcE8vlgXDqbF0SVluwS+YA4CUWcGwhM03NcRFD/CQSS 4eaNgAc1QHEVR3DwbyrbLTp3GcMUTnqoYqTrY7Lp+S3W1vzGkUCyEd2uSn5nanMQA0agev 2AiJzd3ZYFP6wry8a0gRDfESoX2i4UeHJWOzeJsikfRNBTRXVDINvFYS8UkZIgwjgwaQ8C EiuvizT41S+jQy4gzCFAjg7ItP21lt9Pxj0c1McRPg3lGg8rsIy1nVB0ytX14A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfb8s2WZHzqd4; Thu, 31 Oct 2024 20:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKPX8k063746; Thu, 31 Oct 2024 20:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKPXrY063743; Thu, 31 Oct 2024 20:25:33 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:25:33 GMT Message-Id: <202410312025.49VKPXrY063743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: d3916eace506 - main - riscv/vmm: Initial import. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3916eace506b8ab23537223f5c92924636a1c41 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=d3916eace506b8ab23537223f5c92924636a1c41 commit d3916eace506b8ab23537223f5c92924636a1c41 Author: Ruslan Bukin AuthorDate: 2024-10-31 15:33:07 +0000 Commit: Ruslan Bukin CommitDate: 2024-10-31 20:24:12 +0000 riscv/vmm: Initial import. Add kernel code for 'H' — Hypervisor Extension[1] to support virtualization on RISC-V ISA. This comes with a separate userspace patch allowing us to boot unmodified freebsd/riscv guest. Other operating systems are untested. This also comes with a U-Boot port that is configured to run in bhyve guest environment — in RISC-V virtual supervisor mode. The vmm SBI code emulates RISC-V machine-mode for the guest, handling SBI calls partly in vmm kernel and partly in bhyve userspace. Developed in Spike simulator during short period of time, the support is considered experimental. The first real hardware with hypervisor spec included should have just reached the market, so this was tested in Spike and QEMU only. Note that this depends on Sstc extension presence in the hardware (both Spike and QEMU have it). Note that booting multiple guests at the same time is not tested and may require additional work. Some TODOs are indicated within the code, and some listed in the project's home page[2]. Many thanks to Jessica Clarke, Mitchell Horne and Mark Johnston for help with parts, test and review. 1. https://riscv.org/technical/specifications/ 2. https://wiki.freebsd.org/riscv/bhyve Sponsored by: UK Research and Innovation Differential Revision: https://reviews.freebsd.org/D45553 --- sys/conf/files.riscv | 10 + sys/conf/kern.mk | 2 +- sys/riscv/include/cpu.h | 4 +- sys/riscv/include/elf.h | 1 + sys/riscv/include/md_var.h | 1 + sys/riscv/include/riscvreg.h | 38 + sys/riscv/include/vmm.h | 328 ++++++ sys/riscv/include/vmm_dev.h | 258 +++++ sys/riscv/include/vmm_instruction_emul.h | 85 ++ sys/riscv/include/vmm_snapshot.h | 1 + sys/riscv/riscv/genassym.c | 34 + sys/riscv/riscv/identcpu.c | 4 + sys/riscv/vmm/riscv.h | 132 +++ sys/riscv/vmm/vmm.c | 1606 ++++++++++++++++++++++++++++++ sys/riscv/vmm/vmm_aplic.c | 528 ++++++++++ sys/riscv/vmm/vmm_aplic.h | 54 + sys/riscv/vmm/vmm_dev_machdep.c | 126 +++ sys/riscv/vmm/vmm_instruction_emul.c | 109 ++ sys/riscv/vmm/vmm_riscv.c | 922 +++++++++++++++++ sys/riscv/vmm/vmm_sbi.c | 179 ++++ sys/riscv/vmm/vmm_stat.h | 43 + sys/riscv/vmm/vmm_switch.S | 220 ++++ 22 files changed, 4682 insertions(+), 3 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 89fb6f3cbe5a..f75fee72fde2 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -12,6 +12,8 @@ dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_fdt.c optional pci fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_lowrisc.c optional uart_lowrisc +dev/vmm/vmm_dev.c optional vmm +dev/vmm/vmm_stat.c optional vmm dev/xilinx/axi_quad_spi.c optional xilinx_spi dev/xilinx/axidma.c optional axidma xdma dev/xilinx/if_xae.c optional xae @@ -44,6 +46,7 @@ riscv/riscv/dump_machdep.c standard riscv/riscv/elf_machdep.c standard riscv/riscv/exception.S standard riscv/riscv/exec_machdep.c standard +riscv/riscv/fpe.c optional vmm riscv/riscv/gdb_machdep.c optional gdb riscv/riscv/intc.c standard riscv/riscv/identcpu.c standard @@ -72,6 +75,13 @@ riscv/riscv/timer.c standard riscv/riscv/uio_machdep.c standard riscv/riscv/unwind.c optional ddb | kdtrace_hooks | stack riscv/riscv/vm_machdep.c standard +riscv/vmm/vmm.c optional vmm +riscv/vmm/vmm_aplic.c optional vmm +riscv/vmm/vmm_dev_machdep.c optional vmm +riscv/vmm/vmm_instruction_emul.c optional vmm +riscv/vmm/vmm_riscv.c optional vmm +riscv/vmm/vmm_sbi.c optional vmm +riscv/vmm/vmm_switch.S optional vmm # Zstd contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 4c3014f2abb6..2f451f9286a6 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -163,7 +163,7 @@ INLINE_LIMIT?= 8000 # code model as "medium" and "medany" respectively. # .if ${MACHINE_CPUARCH} == "riscv" -CFLAGS+= -march=rv64imafdc +CFLAGS+= -march=rv64imafdch CFLAGS+= -mabi=lp64 CFLAGS.clang+= -mcmodel=medium CFLAGS.gcc+= -mcmodel=medany diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index cbf660dcda0c..0c33adb2abcd 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -47,8 +47,6 @@ #define cpu_spinwait() /* nothing */ #define cpu_lock_delay() DELAY(1) -#ifdef _KERNEL - /* * Core manufacturer IDs, as reported by the mvendorid CSR. */ @@ -89,6 +87,8 @@ #define MMU_SV48 0x2 /* 4-level paging */ #define MMU_SV57 0x4 /* 5-level paging */ +#ifdef _KERNEL + extern char btext[]; extern char etext[]; diff --git a/sys/riscv/include/elf.h b/sys/riscv/include/elf.h index a14d6859902b..78788abe1e57 100644 --- a/sys/riscv/include/elf.h +++ b/sys/riscv/include/elf.h @@ -80,6 +80,7 @@ __ElfType(Auxinfo); #define HWCAP_ISA_F HWCAP_ISA_BIT('f') #define HWCAP_ISA_D HWCAP_ISA_BIT('d') #define HWCAP_ISA_C HWCAP_ISA_BIT('c') +#define HWCAP_ISA_H HWCAP_ISA_BIT('h') #define HWCAP_ISA_G \ (HWCAP_ISA_I | HWCAP_ISA_M | HWCAP_ISA_A | HWCAP_ISA_F | HWCAP_ISA_D) #define HWCAP_ISA_B HWCAP_ISA_BIT('b') diff --git a/sys/riscv/include/md_var.h b/sys/riscv/include/md_var.h index d9404db914a2..85a51e30b4a7 100644 --- a/sys/riscv/include/md_var.h +++ b/sys/riscv/include/md_var.h @@ -42,6 +42,7 @@ extern register_t mimpid; extern u_int mmu_caps; /* Supervisor-mode extension support */ +extern bool has_hyp; extern bool has_sstc; extern bool has_sscofpmf; extern bool has_svpbmt; diff --git a/sys/riscv/include/riscvreg.h b/sys/riscv/include/riscvreg.h index e1ad09acedc8..23feb419d04c 100644 --- a/sys/riscv/include/riscvreg.h +++ b/sys/riscv/include/riscvreg.h @@ -47,9 +47,15 @@ #define SCAUSE_STORE_ACCESS_FAULT 7 #define SCAUSE_ECALL_USER 8 #define SCAUSE_ECALL_SUPERVISOR 9 +#define SCAUSE_VIRTUAL_SUPERVISOR_ECALL 10 +#define SCAUSE_MACHINE_ECALL 11 #define SCAUSE_INST_PAGE_FAULT 12 #define SCAUSE_LOAD_PAGE_FAULT 13 #define SCAUSE_STORE_PAGE_FAULT 15 +#define SCAUSE_FETCH_GUEST_PAGE_FAULT 20 +#define SCAUSE_LOAD_GUEST_PAGE_FAULT 21 +#define SCAUSE_VIRTUAL_INSTRUCTION 22 +#define SCAUSE_STORE_GUEST_PAGE_FAULT 23 #define SSTATUS_UIE (1 << 0) #define SSTATUS_SIE (1 << 1) @@ -116,6 +122,17 @@ #define MSTATUS_PRV_H 2 /* hypervisor */ #define MSTATUS_PRV_M 3 /* machine */ +#define HSTATUS_VSBE (1 << 5) +#define HSTATUS_GVA (1 << 6) +#define HSTATUS_SPV (1 << 7) +#define HSTATUS_SPVP (1 << 8) +#define HSTATUS_HU (1 << 9) +#define HSTATUS_VGEIN_S 12 +#define HSTATUS_VGEIN_M (0xf << HSTATUS_VGEIN_S) +#define HSTATUS_VTVM (1 << 20) +#define HSTATUS_VTW (1 << 21) +#define HSTATUS_VTSR (1 << 22) + #define MIE_USIE (1 << 0) #define MIE_SSIE (1 << 1) #define MIE_HSIE (1 << 2) @@ -143,10 +160,31 @@ #define MIP_SEIP (1 << 9) +#define HVIP_VSSIP (1 << 2) +#define HVIP_VSTIP (1 << 6) +#define HVIP_VSEIP (1 << 10) + +#define HIE_VSSIE (1 << 2) +#define HIE_VSTIE (1 << 6) +#define HIE_VSEIE (1 << 10) +#define HIE_SGEIE (1 << 12) + /* Note: sip register has no SIP_STIP bit in Spike simulator */ #define SIP_SSIP (1 << 1) #define SIP_STIP (1 << 5) +#define HENVCFG_STCE (1UL << 63) +#define HENVCFG_PBMTE (1UL << 62) +#define HENVCFG_CBZE (1UL << 7) +#define HENVCFG_CBCFE (1UL << 6) +#define HENVCFG_CBIE_S 4 +#define HENVCFG_CBIE_M (0x3 << HENVCFG_CBIE_S) +#define HENVCFG_FIOM (1UL << 0) + +#define HCOUNTEREN_CY (1UL << 0) /* Cycle */ +#define HCOUNTEREN_TM (1UL << 1) /* Time */ +#define HCOUNTEREN_IR (1UL << 2) /* Instret */ + #define SATP_PPN_S 0 #define SATP_PPN_M (0xfffffffffffUL << SATP_PPN_S) #define SATP_ASID_S 44 diff --git a/sys/riscv/include/vmm.h b/sys/riscv/include/vmm.h new file mode 100644 index 000000000000..e148cd95b522 --- /dev/null +++ b/sys/riscv/include/vmm.h @@ -0,0 +1,328 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2015 Mihai Carabas + * Copyright (c) 2024 Ruslan Bukin + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _VMM_H_ +#define _VMM_H_ + +#include +#include +#include +#include + +#include "pte.h" +#include "pmap.h" + +struct vcpu; + +enum vm_suspend_how { + VM_SUSPEND_NONE, + VM_SUSPEND_RESET, + VM_SUSPEND_POWEROFF, + VM_SUSPEND_HALT, + VM_SUSPEND_LAST +}; + +/* + * Identifiers for architecturally defined registers. + */ +enum vm_reg_name { + VM_REG_GUEST_ZERO = 0, + VM_REG_GUEST_RA, + VM_REG_GUEST_SP, + VM_REG_GUEST_GP, + VM_REG_GUEST_TP, + VM_REG_GUEST_T0, + VM_REG_GUEST_T1, + VM_REG_GUEST_T2, + VM_REG_GUEST_S0, + VM_REG_GUEST_S1, + VM_REG_GUEST_A0, + VM_REG_GUEST_A1, + VM_REG_GUEST_A2, + VM_REG_GUEST_A3, + VM_REG_GUEST_A4, + VM_REG_GUEST_A5, + VM_REG_GUEST_A6, + VM_REG_GUEST_A7, + VM_REG_GUEST_S2, + VM_REG_GUEST_S3, + VM_REG_GUEST_S4, + VM_REG_GUEST_S5, + VM_REG_GUEST_S6, + VM_REG_GUEST_S7, + VM_REG_GUEST_S8, + VM_REG_GUEST_S9, + VM_REG_GUEST_S10, + VM_REG_GUEST_S11, + VM_REG_GUEST_T3, + VM_REG_GUEST_T4, + VM_REG_GUEST_T5, + VM_REG_GUEST_T6, + VM_REG_GUEST_SEPC, + VM_REG_LAST +}; + +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) +#define VM_INTINFO_DEL_ERRCODE 0x800 +#define VM_INTINFO_RSVD 0x7ffff000 +#define VM_INTINFO_VALID 0x80000000 +#define VM_INTINFO_TYPE 0x700 +#define VM_INTINFO_HWINTR (0 << 8) +#define VM_INTINFO_NMI (2 << 8) +#define VM_INTINFO_HWEXCEPTION (3 << 8) +#define VM_INTINFO_SWINTR (4 << 8) + +#define VM_MAX_SUFFIXLEN 15 + +#ifdef _KERNEL + +#define VM_MAX_NAMELEN 32 + +struct vm; +struct vm_exception; +struct vm_exit; +struct vm_run; +struct vm_object; +struct vm_guest_paging; +struct vm_aplic_descr; +struct pmap; + +struct vm_eventinfo { + void *rptr; /* rendezvous cookie */ + int *sptr; /* suspend cookie */ + int *iptr; /* reqidle cookie */ +}; + +int vm_create(const char *name, struct vm **retvm); +struct vcpu *vm_alloc_vcpu(struct vm *vm, int vcpuid); +void vm_disable_vcpu_creation(struct vm *vm); +void vm_slock_vcpus(struct vm *vm); +void vm_unlock_vcpus(struct vm *vm); +void vm_destroy(struct vm *vm); +int vm_reinit(struct vm *vm); +const char *vm_name(struct vm *vm); + +/* + * APIs that modify the guest memory map require all vcpus to be frozen. + */ +void vm_slock_memsegs(struct vm *vm); +void vm_xlock_memsegs(struct vm *vm); +void vm_unlock_memsegs(struct vm *vm); +int vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t off, + size_t len, int prot, int flags); +int vm_munmap_memseg(struct vm *vm, vm_paddr_t gpa, size_t len); +int vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem); +void vm_free_memseg(struct vm *vm, int ident); + +/* + * APIs that inspect the guest memory map require only a *single* vcpu to + * be frozen. This acts like a read lock on the guest memory map since any + * modification requires *all* vcpus to be frozen. + */ +int vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, int *segid, + vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); +int vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, + struct vm_object **objptr); +vm_paddr_t vmm_sysmem_maxaddr(struct vm *vm); +void *vm_gpa_hold(struct vcpu *vcpu, vm_paddr_t gpa, size_t len, + int prot, void **cookie); +void *vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, + int prot, void **cookie); +void vm_gpa_release(void *cookie); +bool vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa); + +int vm_gla2gpa_nofault(struct vcpu *vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *is_fault); + +uint16_t vm_get_maxcpus(struct vm *vm); +void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus); +int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus); +int vm_get_register(struct vcpu *vcpu, int reg, uint64_t *retval); +int vm_set_register(struct vcpu *vcpu, int reg, uint64_t val); +int vm_run(struct vcpu *vcpu); +int vm_suspend(struct vm *vm, enum vm_suspend_how how); +void* vm_get_cookie(struct vm *vm); +int vcpu_vcpuid(struct vcpu *vcpu); +void *vcpu_get_cookie(struct vcpu *vcpu); +struct vm *vcpu_vm(struct vcpu *vcpu); +struct vcpu *vm_vcpu(struct vm *vm, int cpu); +int vm_get_capability(struct vcpu *vcpu, int type, int *val); +int vm_set_capability(struct vcpu *vcpu, int type, int val); +int vm_activate_cpu(struct vcpu *vcpu); +int vm_suspend_cpu(struct vm *vm, struct vcpu *vcpu); +int vm_resume_cpu(struct vm *vm, struct vcpu *vcpu); +int vm_inject_exception(struct vcpu *vcpu, uint64_t scause); +int vm_attach_aplic(struct vm *vm, struct vm_aplic_descr *descr); +int vm_assert_irq(struct vm *vm, uint32_t irq); +int vm_deassert_irq(struct vm *vm, uint32_t irq); +int vm_raise_msi(struct vm *vm, uint64_t msg, uint64_t addr, int bus, int slot, + int func); +struct vm_exit *vm_exitinfo(struct vcpu *vcpu); +void vm_exit_suspended(struct vcpu *vcpu, uint64_t pc); +void vm_exit_debug(struct vcpu *vcpu, uint64_t pc); +void vm_exit_rendezvous(struct vcpu *vcpu, uint64_t pc); +void vm_exit_astpending(struct vcpu *vcpu, uint64_t pc); + +cpuset_t vm_active_cpus(struct vm *vm); +cpuset_t vm_debug_cpus(struct vm *vm); +cpuset_t vm_suspended_cpus(struct vm *vm); + +static __inline int +vcpu_rendezvous_pending(struct vm_eventinfo *info) +{ + + return (*((uintptr_t *)(info->rptr)) != 0); +} + +static __inline int +vcpu_suspended(struct vm_eventinfo *info) +{ + + return (*info->sptr); +} + +int vcpu_debugged(struct vcpu *vcpu); + +enum vcpu_state { + VCPU_IDLE, + VCPU_FROZEN, + VCPU_RUNNING, + VCPU_SLEEPING, +}; + +int vcpu_set_state(struct vcpu *vcpu, enum vcpu_state state, bool from_idle); +enum vcpu_state vcpu_get_state(struct vcpu *vcpu, int *hostcpu); + +static int __inline +vcpu_is_running(struct vcpu *vcpu, int *hostcpu) +{ + return (vcpu_get_state(vcpu, hostcpu) == VCPU_RUNNING); +} + +#ifdef _SYS_PROC_H_ +static int __inline +vcpu_should_yield(struct vcpu *vcpu) +{ + struct thread *td; + + td = curthread; + return (td->td_ast != 0 || td->td_owepreempt != 0); +} +#endif + +void *vcpu_stats(struct vcpu *vcpu); +void vcpu_notify_event(struct vcpu *vcpu); + +enum vm_reg_name vm_segment_name(int seg_encoding); + +#endif /* _KERNEL */ + +#define VM_DIR_READ 0 +#define VM_DIR_WRITE 1 + +#define VM_GP_M_MASK 0x1f +#define VM_GP_MMU_ENABLED (1 << 5) + +struct vm_guest_paging { + int flags; + int padding; +}; + +struct vie { + uint8_t access_size:4, sign_extend:1, dir:1, unused:2; + enum vm_reg_name reg; +}; + +struct vre { + uint32_t inst_syndrome; + uint8_t dir:1, unused:7; + enum vm_reg_name reg; +}; + +/* + * Identifiers for optional vmm capabilities + */ +enum vm_cap_type { + VM_CAP_UNRESTRICTED_GUEST, + VM_CAP_MAX +}; + +enum vm_exitcode { + VM_EXITCODE_BOGUS, + VM_EXITCODE_ECALL, + VM_EXITCODE_HYP, + VM_EXITCODE_PAGING, + VM_EXITCODE_SUSPENDED, + VM_EXITCODE_DEBUG, + VM_EXITCODE_INST_EMUL, + VM_EXITCODE_WFI, + VM_EXITCODE_MAX +}; + +struct vm_exit { + uint64_t scause; + uint64_t sepc; + uint64_t stval; + uint64_t htval; + uint64_t htinst; + enum vm_exitcode exitcode; + int inst_length; + uint64_t pc; + union { + struct { + uint64_t gpa; + } paging; + + struct { + uint64_t gpa; + struct vm_guest_paging paging; + struct vie vie; + } inst_emul; + + struct { + uint64_t args[8]; + } ecall; + + struct { + enum vm_suspend_how how; + } suspended; + + struct { + uint64_t scause; + } hyp; + } u; +}; + +#endif /* _VMM_H_ */ diff --git a/sys/riscv/include/vmm_dev.h b/sys/riscv/include/vmm_dev.h new file mode 100644 index 000000000000..a21528a8dc68 --- /dev/null +++ b/sys/riscv/include/vmm_dev.h @@ -0,0 +1,258 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2015 Mihai Carabas + * Copyright (c) 2024 Ruslan Bukin + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _VMM_DEV_H_ +#define _VMM_DEV_H_ + +struct vm_memmap { + vm_paddr_t gpa; + int segid; /* memory segment */ + vm_ooffset_t segoff; /* offset into memory segment */ + size_t len; /* mmap length */ + int prot; /* RWX */ + int flags; +}; +#define VM_MEMMAP_F_WIRED 0x01 + +struct vm_munmap { + vm_paddr_t gpa; + size_t len; +}; + +#define VM_MEMSEG_NAME(m) ((m)->name[0] != '\0' ? (m)->name : NULL) +struct vm_memseg { + int segid; + size_t len; + char name[VM_MAX_SUFFIXLEN + 1]; +}; + +struct vm_register { + int cpuid; + int regnum; /* enum vm_reg_name */ + uint64_t regval; +}; + +struct vm_register_set { + int cpuid; + unsigned int count; + const int *regnums; /* enum vm_reg_name */ + uint64_t *regvals; +}; + +struct vm_run { + int cpuid; + cpuset_t *cpuset; /* CPU set storage */ + size_t cpusetsize; + struct vm_exit *vm_exit; +}; + +struct vm_exception { + int cpuid; + uint64_t scause; +}; + +struct vm_msi { + uint64_t msg; + uint64_t addr; + int bus; + int slot; + int func; +}; + +struct vm_capability { + int cpuid; + enum vm_cap_type captype; + int capval; + int allcpus; +}; + +#define MAX_VM_STATS 64 +struct vm_stats { + int cpuid; /* in */ + int index; /* in */ + int num_entries; /* out */ + struct timeval tv; + uint64_t statbuf[MAX_VM_STATS]; +}; +struct vm_stat_desc { + int index; /* in */ + char desc[128]; /* out */ +}; + +struct vm_suspend { + enum vm_suspend_how how; +}; + +struct vm_gla2gpa { + int vcpuid; /* inputs */ + int prot; /* PROT_READ or PROT_WRITE */ + uint64_t gla; + struct vm_guest_paging paging; + int fault; /* outputs */ + uint64_t gpa; +}; + +struct vm_activate_cpu { + int vcpuid; +}; + +struct vm_cpuset { + int which; + int cpusetsize; + cpuset_t *cpus; +}; +#define VM_ACTIVE_CPUS 0 +#define VM_SUSPENDED_CPUS 1 +#define VM_DEBUG_CPUS 2 + +struct vm_aplic_descr { + uint64_t mem_start; + uint64_t mem_size; +}; + +struct vm_irq { + uint32_t irq; +}; + +struct vm_cpu_topology { + uint16_t sockets; + uint16_t cores; + uint16_t threads; + uint16_t maxcpus; +}; + +enum { + /* general routines */ + IOCNUM_ABIVERS = 0, + IOCNUM_RUN = 1, + IOCNUM_SET_CAPABILITY = 2, + IOCNUM_GET_CAPABILITY = 3, + IOCNUM_SUSPEND = 4, + IOCNUM_REINIT = 5, + + /* memory apis */ + IOCNUM_GET_GPA_PMAP = 12, + IOCNUM_GLA2GPA_NOFAULT = 13, + IOCNUM_ALLOC_MEMSEG = 14, + IOCNUM_GET_MEMSEG = 15, + IOCNUM_MMAP_MEMSEG = 16, + IOCNUM_MMAP_GETNEXT = 17, + IOCNUM_MUNMAP_MEMSEG = 18, + + /* register/state accessors */ + IOCNUM_SET_REGISTER = 20, + IOCNUM_GET_REGISTER = 21, + IOCNUM_SET_REGISTER_SET = 24, + IOCNUM_GET_REGISTER_SET = 25, + + /* statistics */ + IOCNUM_VM_STATS = 50, + IOCNUM_VM_STAT_DESC = 51, + + /* CPU Topology */ + IOCNUM_SET_TOPOLOGY = 63, + IOCNUM_GET_TOPOLOGY = 64, + + /* interrupt injection */ + IOCNUM_ASSERT_IRQ = 80, + IOCNUM_DEASSERT_IRQ = 81, + IOCNUM_RAISE_MSI = 82, + IOCNUM_INJECT_EXCEPTION = 83, + + /* vm_cpuset */ + IOCNUM_ACTIVATE_CPU = 90, + IOCNUM_GET_CPUSET = 91, + IOCNUM_SUSPEND_CPU = 92, + IOCNUM_RESUME_CPU = 93, + + /* vm_attach_aplic */ + IOCNUM_ATTACH_APLIC = 110, +}; + +#define VM_RUN \ + _IOWR('v', IOCNUM_RUN, struct vm_run) +#define VM_SUSPEND \ + _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) +#define VM_REINIT \ + _IO('v', IOCNUM_REINIT) +#define VM_ALLOC_MEMSEG \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg) +#define VM_GET_MEMSEG \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg) +#define VM_MMAP_MEMSEG \ + _IOW('v', IOCNUM_MMAP_MEMSEG, struct vm_memmap) +#define VM_MMAP_GETNEXT \ + _IOWR('v', IOCNUM_MMAP_GETNEXT, struct vm_memmap) +#define VM_MUNMAP_MEMSEG \ + _IOW('v', IOCNUM_MUNMAP_MEMSEG, struct vm_munmap) +#define VM_SET_REGISTER \ + _IOW('v', IOCNUM_SET_REGISTER, struct vm_register) +#define VM_GET_REGISTER \ + _IOWR('v', IOCNUM_GET_REGISTER, struct vm_register) +#define VM_SET_REGISTER_SET \ + _IOW('v', IOCNUM_SET_REGISTER_SET, struct vm_register_set) +#define VM_GET_REGISTER_SET \ + _IOWR('v', IOCNUM_GET_REGISTER_SET, struct vm_register_set) +#define VM_SET_CAPABILITY \ + _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) +#define VM_GET_CAPABILITY \ + _IOWR('v', IOCNUM_GET_CAPABILITY, struct vm_capability) +#define VM_STATS \ + _IOWR('v', IOCNUM_VM_STATS, struct vm_stats) +#define VM_STAT_DESC \ + _IOWR('v', IOCNUM_VM_STAT_DESC, struct vm_stat_desc) +#define VM_ASSERT_IRQ \ + _IOW('v', IOCNUM_ASSERT_IRQ, struct vm_irq) +#define VM_DEASSERT_IRQ \ + _IOW('v', IOCNUM_DEASSERT_IRQ, struct vm_irq) +#define VM_RAISE_MSI \ + _IOW('v', IOCNUM_RAISE_MSI, struct vm_msi) +#define VM_INJECT_EXCEPTION \ + _IOW('v', IOCNUM_INJECT_EXCEPTION, struct vm_exception) +#define VM_SET_TOPOLOGY \ + _IOW('v', IOCNUM_SET_TOPOLOGY, struct vm_cpu_topology) +#define VM_GET_TOPOLOGY \ + _IOR('v', IOCNUM_GET_TOPOLOGY, struct vm_cpu_topology) +#define VM_GLA2GPA_NOFAULT \ + _IOWR('v', IOCNUM_GLA2GPA_NOFAULT, struct vm_gla2gpa) +#define VM_ACTIVATE_CPU \ + _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) +#define VM_GET_CPUS \ + _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) +#define VM_SUSPEND_CPU \ + _IOW('v', IOCNUM_SUSPEND_CPU, struct vm_activate_cpu) +#define VM_RESUME_CPU \ + _IOW('v', IOCNUM_RESUME_CPU, struct vm_activate_cpu) +#define VM_ATTACH_APLIC \ + _IOW('v', IOCNUM_ATTACH_APLIC, struct vm_aplic_descr) +#endif diff --git a/sys/riscv/include/vmm_instruction_emul.h b/sys/riscv/include/vmm_instruction_emul.h new file mode 100644 index 000000000000..bee63d2f86ba --- /dev/null +++ b/sys/riscv/include/vmm_instruction_emul.h @@ -0,0 +1,85 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2015 Mihai Carabas + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _VMM_INSTRUCTION_EMUL_H_ +#define _VMM_INSTRUCTION_EMUL_H_ + +/* + * Callback functions to read and write memory regions. + */ +typedef int (*mem_region_read_t)(struct vcpu *vcpu, uint64_t gpa, + uint64_t *rval, int rsize, void *arg); +typedef int (*mem_region_write_t)(struct vcpu *vcpu, uint64_t gpa, + uint64_t wval, int wsize, void *arg); + +/* + * Callback functions to read and write registers. + */ +typedef int (*reg_read_t)(struct vcpu *vcpu, uint64_t *rval, void *arg); +typedef int (*reg_write_t)(struct vcpu *vcpu, uint64_t wval, void *arg); + +/* + * Emulate the decoded 'vie' instruction when it contains a memory operation. + * + * The callbacks 'mrr' and 'mrw' emulate reads and writes to the memory region + * containing 'gpa'. 'mrarg' is an opaque argument that is passed into the + * callback functions. + * + * 'void *vm' should be 'struct vm *' when called from kernel context and + * 'struct vmctx *' when called from user context. + * + */ +int vmm_emulate_instruction(struct vcpu *vcpu, uint64_t gpa, struct vie *vie, + struct vm_guest_paging *paging, mem_region_read_t mrr, + mem_region_write_t mrw, void *mrarg); + +/* + * Emulate the decoded 'vre' instruction when it contains a register access. + * + * The callbacks 'regread' and 'regwrite' emulate reads and writes to the + * register from 'vie'. 'regarg' is an opaque argument that is passed into the + * callback functions. + * + * 'void *vm' should be 'struct vm *' when called from kernel context and + * 'struct vmctx *' when called from user context. + * + */ +int vmm_emulate_register(struct vcpu *vcpu, struct vre *vre, reg_read_t regread, + reg_write_t regwrite, void *regarg); + +#ifdef _KERNEL +void vm_register_reg_handler(struct vm *vm, uint64_t iss, uint64_t mask, + reg_read_t reg_read, reg_write_t reg_write, void *arg); +void vm_deregister_reg_handler(struct vm *vm, uint64_t iss, uint64_t mask); + +void vm_register_inst_handler(struct vm *vm, uint64_t start, uint64_t size, + mem_region_read_t mmio_read, mem_region_write_t mmio_write); +void vm_deregister_inst_handler(struct vm *vm, uint64_t start, uint64_t size); +#endif + +#endif /* _VMM_INSTRUCTION_EMUL_H_ */ diff --git a/sys/riscv/include/vmm_snapshot.h b/sys/riscv/include/vmm_snapshot.h new file mode 100644 index 000000000000..da23dbe43a4f --- /dev/null +++ b/sys/riscv/include/vmm_snapshot.h @@ -0,0 +1 @@ +/* $FreeBSD$ */ diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index 637510db242e..74b70858edab 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -55,6 +55,8 @@ #include #include +#include + ASSYM(KERNBASE, KERNBASE); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); @@ -98,6 +100,38 @@ ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); +ASSYM(HYP_H_RA, offsetof(struct hypctx, host_regs.hyp_ra)); +ASSYM(HYP_H_SP, offsetof(struct hypctx, host_regs.hyp_sp)); +ASSYM(HYP_H_GP, offsetof(struct hypctx, host_regs.hyp_gp)); +ASSYM(HYP_H_TP, offsetof(struct hypctx, host_regs.hyp_tp)); +ASSYM(HYP_H_T, offsetof(struct hypctx, host_regs.hyp_t)); +ASSYM(HYP_H_S, offsetof(struct hypctx, host_regs.hyp_s)); +ASSYM(HYP_H_A, offsetof(struct hypctx, host_regs.hyp_a)); +ASSYM(HYP_H_SEPC, offsetof(struct hypctx, host_regs.hyp_sepc)); +ASSYM(HYP_H_SSTATUS, offsetof(struct hypctx, host_regs.hyp_sstatus)); +ASSYM(HYP_H_HSTATUS, offsetof(struct hypctx, host_regs.hyp_hstatus)); +ASSYM(HYP_H_SSCRATCH, offsetof(struct hypctx, host_sscratch)); +ASSYM(HYP_H_STVEC, offsetof(struct hypctx, host_stvec)); +ASSYM(HYP_H_SCOUNTEREN, offsetof(struct hypctx, host_scounteren)); + +ASSYM(HYP_G_RA, offsetof(struct hypctx, guest_regs.hyp_ra)); +ASSYM(HYP_G_SP, offsetof(struct hypctx, guest_regs.hyp_sp)); +ASSYM(HYP_G_GP, offsetof(struct hypctx, guest_regs.hyp_gp)); +ASSYM(HYP_G_TP, offsetof(struct hypctx, guest_regs.hyp_tp)); +ASSYM(HYP_G_T, offsetof(struct hypctx, guest_regs.hyp_t)); +ASSYM(HYP_G_S, offsetof(struct hypctx, guest_regs.hyp_s)); +ASSYM(HYP_G_A, offsetof(struct hypctx, guest_regs.hyp_a)); +ASSYM(HYP_G_SEPC, offsetof(struct hypctx, guest_regs.hyp_sepc)); +ASSYM(HYP_G_SSTATUS, offsetof(struct hypctx, guest_regs.hyp_sstatus)); +ASSYM(HYP_G_HSTATUS, offsetof(struct hypctx, guest_regs.hyp_hstatus)); +ASSYM(HYP_G_SCOUNTEREN, offsetof(struct hypctx, guest_scounteren)); + +ASSYM(HYP_TRAP_SEPC, offsetof(struct hyptrap, sepc)); +ASSYM(HYP_TRAP_SCAUSE, offsetof(struct hyptrap, scause)); +ASSYM(HYP_TRAP_STVAL, offsetof(struct hyptrap, stval)); +ASSYM(HYP_TRAP_HTVAL, offsetof(struct hyptrap, htval)); +ASSYM(HYP_TRAP_HTINST, offsetof(struct hyptrap, htinst)); + ASSYM(RISCV_BOOTPARAMS_SIZE, sizeof(struct riscv_bootparams)); ASSYM(RISCV_BOOTPARAMS_KERN_PHYS, offsetof(struct riscv_bootparams, kern_phys)); ASSYM(RISCV_BOOTPARAMS_KERN_STACK, offsetof(struct riscv_bootparams, diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 54eb302982f1..7823830c3136 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -72,6 +72,7 @@ register_t mimpid; /* The implementation ID */ u_int mmu_caps; /* Supervisor-mode extension support. */ +bool has_hyp; *** 4006 LINES SKIPPED *** From nobody Thu Oct 31 20:25:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfb8t4GZSz5cKPb; Thu, 31 Oct 2024 20:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfb8t3WB9z4VGc; Thu, 31 Oct 2024 20:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XP1+lIMW0gSec8TSA2QJkiCKPagTjxmFepARBBe4ssU=; b=DXMKkc6jFQOEd6qTrWAwEfkLuse7OpAzKJ3sHYSNi6SYFHmfz/3La1RxO08kq8HIlg3MHF ASHNfTq1cIRdN1TEDJsseMHCH/6GTR7+VXDLuFAJbfYhgxMsqx7EN013mZB9Wc686zz09u sZ7S0YnPLebQ3j3xUA0jnIYldFhDhFyHz+XhkF/P5VV+R7M8sOTTW9EqSSxAkp/IUOXeUv iOrKnietTuEOvxPQPNez8fdSByjSgJrwqov7FxLYEL9vNvaUunHX6Q9cq61MSuh2kVUHg5 8hxZ1X2rxQh+/QvKl2JrXvFRzRQLrGB4gRg/AqU5zSHA4GQU0UXpGsIOoe177A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XP1+lIMW0gSec8TSA2QJkiCKPagTjxmFepARBBe4ssU=; b=b9QDaxNatHjj4COej83yrgwpyvJulP6FJ9Uk5NRMs7KNyw6yPHcreUIRrszm5l9dNTWvIg R2JyPEpKlJw47bGoylWE4Z4sYDKVxwJLYKErerEQdyZi4N0jGtJYqWa2XzHs+3+xDbEswK YGaJ2+tbCOMN5IdFTHs1jCEacBPyvCGy9qtZQKA1d11rZj5B22Eyg2uTD1HBuZZ6C+jrtS 99lkve5pENsRY53wVITqeLj/aHvOXyB34x6gje1qLETD+Mw2e6mQeYL3s8RaHlqt6vTymC tpQ0kSDKk2klbfG4evcATv1G/VGHZx91fmJyXTpTNdhRw2VRzLOKWD1oEWx2WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730406334; a=rsa-sha256; cv=none; b=EOSdC8pWMq5QABnuZ2PueR2TkMx34I3flFo4TQBh5TB3h8nWWEHWTgS1snrOdziVn0Yht8 +9AmG2FM+8SsYg45E1BXie7lbK8Gqf7Bx6YFGMs+pbcGRrhRLskt/0y3nw5cZdHi3J2AUI aXNcvManagtU8HUuQh0NTJgQ5tTfR+AncfAOO9yVasXk5Nl37KMZQSvB3BTrmIJiWS6Y1Y khNRPgOBzYQEpTw3CrkDJ23xXly8pkRM/OgZgO/cZYsYBhg0iTCTq0giJSwZ8hE2NY5CBf Prhjl8tQKGzAQ4KGV5qQK0pAdBIM9IPp9djJMx52Z0iZ+JL1UNxDGhp5rRsPvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfb8t35sRzqd5; Thu, 31 Oct 2024 20:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKPYsI063797; Thu, 31 Oct 2024 20:25:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKPYbK063789; Thu, 31 Oct 2024 20:25:34 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:25:34 GMT Message-Id: <202410312025.49VKPYbK063789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 7ab1a32cd43c - main - bhyve/riscv: Initial import. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ab1a32cd43cbae61ad4dd435d6a482bbf61cb52 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=7ab1a32cd43cbae61ad4dd435d6a482bbf61cb52 commit 7ab1a32cd43cbae61ad4dd435d6a482bbf61cb52 Author: Ruslan Bukin AuthorDate: 2024-10-31 16:14:32 +0000 Commit: Ruslan Bukin CommitDate: 2024-10-31 20:24:12 +0000 bhyve/riscv: Initial import. Add machine-dependent parts for bhyve hypervisor to support virtualization on RISC-V ISA. No objection: markj Sponsored by: UK Research and Innovation Differential Revision: https://reviews.freebsd.org/D45512 --- lib/Makefile | 3 +- lib/libvmmapi/riscv/Makefile.inc | 1 + lib/libvmmapi/riscv/vmmapi_machdep.c | 117 +++++++++ lib/libvmmapi/vmmapi.h | 9 +- usr.sbin/Makefile.riscv | 2 + usr.sbin/bhyve/pci_emul.c | 2 +- usr.sbin/bhyve/pci_irq.h | 2 + usr.sbin/bhyve/riscv/Makefile.inc | 7 + usr.sbin/bhyve/riscv/bhyverun_machdep.c | 357 ++++++++++++++++++++++++++++ usr.sbin/bhyve/riscv/fdt.c | 326 +++++++++++++++++++++++++ usr.sbin/bhyve/riscv/fdt.h | 45 ++++ usr.sbin/bhyve/riscv/pci_irq.c | 66 ++++++ usr.sbin/bhyve/riscv/pci_irq_machdep.h | 49 ++++ usr.sbin/bhyve/riscv/riscv.h | 41 ++++ usr.sbin/bhyve/riscv/vmexit.c | 366 +++++++++++++++++++++++++++++ usr.sbin/bhyvectl/riscv/Makefile.inc | 1 + usr.sbin/bhyvectl/riscv/bhyvectl_machdep.c | 82 +++++++ 17 files changed, 1472 insertions(+), 4 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index fdfe198bea10..af0079978075 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -202,7 +202,8 @@ SUBDIR.${MK_PMC}+= libopencsd SUBDIR.${MK_PMC}+= libipt .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "riscv" SUBDIR.${MK_BHYVE}+= libvmmapi .endif diff --git a/lib/libvmmapi/riscv/Makefile.inc b/lib/libvmmapi/riscv/Makefile.inc new file mode 100644 index 000000000000..663ea0ab90a3 --- /dev/null +++ b/lib/libvmmapi/riscv/Makefile.inc @@ -0,0 +1 @@ +SRCS+= vmmapi_machdep.c diff --git a/lib/libvmmapi/riscv/vmmapi_machdep.c b/lib/libvmmapi/riscv/vmmapi_machdep.c new file mode 100644 index 000000000000..9c70185942c9 --- /dev/null +++ b/lib/libvmmapi/riscv/vmmapi_machdep.c @@ -0,0 +1,117 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include +#include +#include + +#include +#include + +#include "vmmapi.h" +#include "internal.h" + +const char *vm_capstrmap[] = { + [VM_CAP_MAX] = NULL, +}; + +#define VM_MD_IOCTLS \ + VM_ATTACH_APLIC, \ + VM_ASSERT_IRQ, \ + VM_DEASSERT_IRQ, \ + VM_RAISE_MSI + +const cap_ioctl_t vm_ioctl_cmds[] = { + VM_COMMON_IOCTLS, + VM_MD_IOCTLS, +}; +size_t vm_ioctl_ncmds = nitems(vm_ioctl_cmds); + +int +vm_attach_aplic(struct vmctx *ctx, uint64_t mem_start, size_t mem_size) +{ + struct vm_aplic_descr aplic; + + bzero(&aplic, sizeof(aplic)); + aplic.mem_start = mem_start; + aplic.mem_size = mem_size; + + return (ioctl(ctx->fd, VM_ATTACH_APLIC, &aplic)); +} + +int +vm_assert_irq(struct vmctx *ctx, uint32_t irq) +{ + struct vm_irq vi; + + bzero(&vi, sizeof(vi)); + vi.irq = irq; + + return (ioctl(ctx->fd, VM_ASSERT_IRQ, &vi)); +} + +int +vm_deassert_irq(struct vmctx *ctx, uint32_t irq) +{ + struct vm_irq vi; + + bzero(&vi, sizeof(vi)); + vi.irq = irq; + + return (ioctl(ctx->fd, VM_DEASSERT_IRQ, &vi)); +} + +int +vm_raise_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg, + int bus, int slot, int func) +{ + struct vm_msi vmsi; + + bzero(&vmsi, sizeof(vmsi)); + vmsi.addr = addr; + vmsi.msg = msg; + vmsi.bus = bus; + vmsi.slot = slot; + vmsi.func = func; + + return (ioctl(ctx->fd, VM_RAISE_MSI, &vmsi)); +} + +int +vm_inject_exception(struct vcpu *vcpu, uint64_t scause) +{ + struct vm_exception vmexc; + + bzero(&vmexc, sizeof(vmexc)); + vmexc.scause = scause; + + return (vcpu_ioctl(vcpu, VM_INJECT_EXCEPTION, &vmexc)); +} diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index d2a217c4d2e9..0ea1d5824271 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -161,12 +161,17 @@ int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); int vm_reinit(struct vmctx *ctx); int vm_raise_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg, int bus, int slot, int func); -#ifdef __aarch64__ +#if defined(__aarch64__) int vm_attach_vgic(struct vmctx *ctx, uint64_t dist_start, size_t dist_size, uint64_t redist_start, size_t redist_size); +int vm_inject_exception(struct vcpu *vcpu, uint64_t esr, uint64_t far); +#elif defined(__riscv) +int vm_attach_aplic(struct vmctx *ctx, uint64_t mem_start, size_t mem_size); +int vm_inject_exception(struct vcpu *vcpu, uint64_t scause); +#endif +#if defined(__aarch64__) || defined(__riscv) int vm_assert_irq(struct vmctx *ctx, uint32_t irq); int vm_deassert_irq(struct vmctx *ctx, uint32_t irq); -int vm_inject_exception(struct vcpu *vcpu, uint64_t esr, uint64_t far); #endif #ifdef __amd64__ int vm_apicid2vcpu(struct vmctx *ctx, int apicid); diff --git a/usr.sbin/Makefile.riscv b/usr.sbin/Makefile.riscv new file mode 100644 index 000000000000..a8897983059c --- /dev/null +++ b/usr.sbin/Makefile.riscv @@ -0,0 +1,2 @@ +SUBDIR+= bhyve +SUBDIR+= bhyvectl diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index b61f29aa6830..2f04a488d9c1 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -136,7 +136,7 @@ static TAILQ_HEAD(boot_list, boot_device) boot_devices = TAILQ_HEAD_INITIALIZER( * change this address without changing it in OVMF. */ #define PCI_EMUL_MEMBASE32 0xc0000000 -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv) #define PCI_EMUL_IOBASE 0xdf000000UL #define PCI_EMUL_IOLIMIT 0xe0000000UL #define PCI_EMUL_MEMBASE32 0xa0000000UL diff --git a/usr.sbin/bhyve/pci_irq.h b/usr.sbin/bhyve/pci_irq.h index 8b556ddc91a2..8078583add52 100644 --- a/usr.sbin/bhyve/pci_irq.h +++ b/usr.sbin/bhyve/pci_irq.h @@ -36,6 +36,8 @@ struct pci_devinst; #include "amd64/pci_irq_machdep.h" #elif defined(__aarch64__) #include "aarch64/pci_irq_machdep.h" +#elif defined(__riscv) +#include "riscv/pci_irq_machdep.h" #else #error Unsupported platform #endif diff --git a/usr.sbin/bhyve/riscv/Makefile.inc b/usr.sbin/bhyve/riscv/Makefile.inc new file mode 100644 index 000000000000..2b57201c6259 --- /dev/null +++ b/usr.sbin/bhyve/riscv/Makefile.inc @@ -0,0 +1,7 @@ +SRCS+= \ + fdt.c + +.PATH: ${BHYVE_SYSDIR}/sys/riscv/vmm +SRCS+= vmm_instruction_emul.c + +BHYVE_FDT_SUPPORT= diff --git a/usr.sbin/bhyve/riscv/bhyverun_machdep.c b/usr.sbin/bhyve/riscv/bhyverun_machdep.c new file mode 100644 index 000000000000..39d6a7cdf231 --- /dev/null +++ b/usr.sbin/bhyve/riscv/bhyverun_machdep.c @@ -0,0 +1,357 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * Copyright (c) 2024 Ruslan Bukin + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "bhyverun.h" +#include "config.h" +#include "debug.h" +#include "fdt.h" +#include "mem.h" +#include "pci_emul.h" +#include "pci_irq.h" +#include "uart_emul.h" +#include "riscv.h" + +#define FDT_SIZE (64 * 1024) +#define FDT_DTB_ALIGN 8 + +/* Start of lowmem + 64K */ +#define UART_MMIO_BASE 0x10000 +#define UART_MMIO_SIZE 0x1000 +#define UART_INTR 1 + +#define APLIC_MEM_BASE 0x2f000000 +#define APLIC_MEM_SIZE 0x10000 + +#define PCIE_INTA 2 +#define PCIE_INTB 3 +#define PCIE_INTC 4 +#define PCIE_INTD 5 + +void +bhyve_init_config(void) +{ + init_config(); + + /* Set default values prior to option parsing. */ + set_config_bool("acpi_tables", false); + set_config_bool("acpi_tables_in_memory", false); + set_config_value("memory.size", "256M"); +} + +void +bhyve_usage(int code) +{ + const char *progname; + + progname = getprogname(); + + fprintf(stderr, + "Usage: %s [-CDHhSW]\n" + " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" + " %*s [-k config_file] [-m mem] [-o var=value]\n" + " %*s [-p vcpu:hostcpu] [-r file] [-s pci] [-U uuid] vmname\n" + " -C: include guest memory in core file\n" + " -c: number of CPUs and/or topology specification\n" + " -D: destroy on power-off\n" + " -h: help\n" + " -k: key=value flat config file\n" + " -m: memory size\n" + " -o: set config 'var' to 'value'\n" + " -p: pin 'vcpu' to 'hostcpu'\n" + " -S: guest memory cannot be swapped\n" + " -s: PCI slot config\n" + " -U: UUID\n" + " -W: force virtio to use single-vector MSI\n", + progname, (int)strlen(progname), "", (int)strlen(progname), "", + (int)strlen(progname), ""); + exit(code); +} + +void +bhyve_optparse(int argc, char **argv) +{ + const char *optstr; + int c; + + optstr = "hCDSWk:f:o:p:c:s:m:U:"; + while ((c = getopt(argc, argv, optstr)) != -1) { + switch (c) { + case 'c': + if (bhyve_topology_parse(optarg) != 0) { + errx(EX_USAGE, "invalid cpu topology '%s'", + optarg); + } + break; + case 'C': + set_config_bool("memory.guest_in_core", true); + break; + case 'D': + set_config_bool("destroy_on_poweroff", true); + break; + case 'k': + bhyve_parse_simple_config_file(optarg); + break; + case 'm': + set_config_value("memory.size", optarg); + break; + case 'o': + if (!bhyve_parse_config_option(optarg)) { + errx(EX_USAGE, + "invalid configuration option '%s'", + optarg); + } + break; + case 'p': + if (bhyve_pincpu_parse(optarg) != 0) { + errx(EX_USAGE, + "invalid vcpu pinning configuration '%s'", + optarg); + } + break; + case 's': + if (strncmp(optarg, "help", strlen(optarg)) == 0) { + pci_print_supported_devices(); + exit(0); + } else if (pci_parse_slot(optarg) != 0) + exit(4); + else + break; + case 'S': + set_config_bool("memory.wired", true); + break; + case 'U': + set_config_value("uuid", optarg); + break; + case 'W': + set_config_bool("virtio_msix", false); + break; + case 'h': + bhyve_usage(0); + default: + bhyve_usage(1); + } + } +} + +void +bhyve_init_vcpu(struct vcpu *vcpu __unused) +{ +} + +void +bhyve_start_vcpu(struct vcpu *vcpu, bool bsp __unused) +{ + int error; + + /* Set hart ID. */ + error = vm_set_register(vcpu, VM_REG_GUEST_A0, vcpu_id(vcpu)); + assert(error == 0); + + fbsdrun_addcpu(vcpu_id(vcpu)); +} + +/* + * Load the specified boot code at the beginning of high memory. + */ +static void +load_bootrom(struct vmctx *ctx, const char *path, uint64_t *elrp, + uint64_t *lenp) +{ + struct stat sb; + void *data, *gptr; + vm_paddr_t loadaddr; + off_t size; + int fd; + + fd = open(path, O_RDONLY); + if (fd < 0) + err(1, "open(%s)", path); + if (fstat(fd, &sb) != 0) + err(1, "fstat(%s)", path); + + size = sb.st_size; + + loadaddr = vm_get_highmem_base(ctx); + gptr = vm_map_gpa(ctx, loadaddr, round_page(size)); + + data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); + if (data == MAP_FAILED) + err(1, "mmap(%s)", path); + (void)close(fd); + memcpy(gptr, data, size); + + if (munmap(data, size) != 0) + err(1, "munmap(%s)", path); + + *elrp = loadaddr; + *lenp = size; +} + +static void +mmio_uart_intr_assert(void *arg) +{ + struct vmctx *ctx = arg; + + vm_assert_irq(ctx, UART_INTR); +} + +static void +mmio_uart_intr_deassert(void *arg) +{ + struct vmctx *ctx = arg; + + vm_deassert_irq(ctx, UART_INTR); +} + +static int +mmio_uart_mem_handler(struct vcpu *vcpu __unused, int dir, uint64_t addr, + int size __unused, uint64_t *val, void *arg1, long arg2) +{ + struct uart_ns16550_softc *sc = arg1; + long reg; + + reg = addr - arg2; + if (dir == MEM_F_WRITE) + uart_ns16550_write(sc, reg, *val); + else + *val = uart_ns16550_read(sc, reg); + + return (0); +} + +static bool +init_mmio_uart(struct vmctx *ctx) +{ + struct uart_ns16550_softc *sc; + struct mem_range mr; + const char *path; + int error; + + path = get_config_value("console"); + if (path == NULL) + return (false); + + sc = uart_ns16550_init(mmio_uart_intr_assert, mmio_uart_intr_deassert, + ctx); + if (uart_ns16550_tty_open(sc, path) != 0) { + EPRINTLN("Unable to initialize backend '%s' for mmio uart", + path); + assert(0); + } + + bzero(&mr, sizeof(struct mem_range)); + mr.name = "uart"; + mr.base = UART_MMIO_BASE; + mr.size = UART_MMIO_SIZE; + mr.flags = MEM_F_RW; + mr.handler = mmio_uart_mem_handler; + mr.arg1 = sc; + mr.arg2 = mr.base; + error = register_mem(&mr); + assert(error == 0); + + return (true); +} + +int +bhyve_init_platform(struct vmctx *ctx, struct vcpu *bsp) +{ + const char *bootrom; + uint64_t elr; + uint64_t len; + int error; + int pcie_intrs[4] = {PCIE_INTA, PCIE_INTB, PCIE_INTC, PCIE_INTD}; + vm_paddr_t fdt_gpa; + + bootrom = get_config_value("bootrom"); + if (bootrom == NULL) { + warnx("no bootrom specified"); + return (ENOENT); + } + load_bootrom(ctx, bootrom, &elr, &len); + error = vm_set_register(bsp, VM_REG_GUEST_SEPC, elr); + if (error != 0) { + warn("vm_set_register(GUEST_SEPC)"); + return (error); + } + + fdt_gpa = vm_get_highmem_base(ctx) + roundup2(len, FDT_DTB_ALIGN); + error = fdt_init(ctx, guest_ncpus, fdt_gpa, FDT_SIZE); + if (error != 0) + return (error); + + /* Set FDT base address to the bootable hart. */ + error = vm_set_register(bsp, VM_REG_GUEST_A1, fdt_gpa); + assert(error == 0); + + fdt_add_aplic(APLIC_MEM_BASE, APLIC_MEM_SIZE); + error = vm_attach_aplic(ctx, APLIC_MEM_BASE, APLIC_MEM_SIZE); + if (error != 0) { + warn("vm_attach_aplic()"); + return (error); + } + + if (init_mmio_uart(ctx)) + fdt_add_uart(UART_MMIO_BASE, UART_MMIO_SIZE, UART_INTR); + + pci_irq_init(pcie_intrs); + fdt_add_pcie(pcie_intrs); + vmexit_set_bsp(vcpu_id(bsp)); + + return (0); +} + +int +bhyve_init_platform_late(struct vmctx *ctx __unused, struct vcpu *bsp __unused) +{ + + fdt_finalize(); + + return (0); +} diff --git a/usr.sbin/bhyve/riscv/fdt.c b/usr.sbin/bhyve/riscv/fdt.c new file mode 100644 index 000000000000..54b75c68ea76 --- /dev/null +++ b/usr.sbin/bhyve/riscv/fdt.c @@ -0,0 +1,326 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 The FreeBSD Foundation + * Copyright (c) 2024 Ruslan Bukin + * + * This software was developed by Andrew Turner under sponsorship from + * the FreeBSD Foundation. + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "config.h" +#include "bhyverun.h" +#include "fdt.h" + +#define SET_PROP_U32(prop, idx, val) \ + ((uint32_t *)(prop))[(idx)] = cpu_to_fdt32(val) +#define SET_PROP_U64(prop, idx, val) \ + ((uint64_t *)(prop))[(idx)] = cpu_to_fdt64(val) + +#define IRQ_TYPE_LEVEL_HIGH 4 +#define IRQ_TYPE_LEVEL_LOW 8 + +static void *fdtroot; +static uint32_t aplic_phandle = 0; +static uint32_t intc0_phandle = 0; + +static uint32_t +assign_phandle(void *fdt) +{ + static uint32_t next_phandle = 1; + uint32_t phandle; + + phandle = next_phandle; + next_phandle++; + fdt_property_u32(fdt, "phandle", phandle); + + return (phandle); +} + +static void +set_single_reg(void *fdt, uint64_t start, uint64_t len) +{ + void *reg; + + fdt_property_placeholder(fdt, "reg", 2 * sizeof(uint64_t), ®); + SET_PROP_U64(reg, 0, start); + SET_PROP_U64(reg, 1, len); +} + +static void +add_cpu(void *fdt, int cpuid) +{ + char node_name[16]; + + snprintf(node_name, sizeof(node_name), "cpu@%d", cpuid); + + fdt_begin_node(fdt, node_name); + fdt_property_string(fdt, "device_type", "cpu"); + fdt_property_string(fdt, "compatible", "riscv"); + fdt_property_u32(fdt, "reg", cpuid); + fdt_property_string(fdt, "riscv,isa", "rv64imafdc_sstc"); + fdt_property_string(fdt, "mmu-type", "riscv,sv39"); + fdt_property_string(fdt, "clock-frequency", "1000000000"); + + fdt_begin_node(fdt, "interrupt-controller"); + intc0_phandle = assign_phandle(fdt); + fdt_property_u32(fdt, "#address-cells", 2); + fdt_property_u32(fdt, "#interrupt-cells", 1); + fdt_property(fdt, "interrupt-controller", NULL, 0); + fdt_property_string(fdt, "compatible", "riscv,cpu-intc"); + fdt_end_node(fdt); + + fdt_end_node(fdt); +} + +static void +add_cpus(void *fdt, int ncpu) +{ + int cpuid; + + fdt_begin_node(fdt, "cpus"); + /* XXX: Needed given the root #address-cells? */ + fdt_property_u32(fdt, "#address-cells", 1); + fdt_property_u32(fdt, "#size-cells", 0); + fdt_property_u32(fdt, "timebase-frequency", 10000000); + + for (cpuid = 0; cpuid < ncpu; cpuid++) { + add_cpu(fdt, cpuid); + } + fdt_end_node(fdt); +} + +int +fdt_init(struct vmctx *ctx, int ncpu, vm_paddr_t fdtaddr, vm_size_t fdtsize) +{ + void *fdt; + const char *bootargs; + + fdt = paddr_guest2host(ctx, fdtaddr, fdtsize); + if (fdt == NULL) + return (EFAULT); + + fdt_create(fdt, (int)fdtsize); + + /* Add the memory reserve map (needed even if none is reserved) */ + fdt_finish_reservemap(fdt); + + /* Create the root node */ + fdt_begin_node(fdt, ""); + + fdt_property_string(fdt, "compatible", "freebsd,bhyve"); + fdt_property_u32(fdt, "#address-cells", 2); + fdt_property_u32(fdt, "#size-cells", 2); + + fdt_begin_node(fdt, "chosen"); + fdt_property_string(fdt, "stdout-path", "serial0:115200n8"); + bootargs = get_config_value("fdt.bootargs"); + if (bootargs != NULL) + fdt_property_string(fdt, "bootargs", bootargs); + fdt_end_node(fdt); + + fdt_begin_node(fdt, "memory"); + fdt_property_string(fdt, "device_type", "memory"); + /* There is no lowmem on riscv. */ + assert(vm_get_lowmem_size(ctx) == 0); + set_single_reg(fdt, vm_get_highmem_base(ctx), vm_get_highmem_size(ctx)); + fdt_end_node(fdt); + + add_cpus(fdt, ncpu); + + /* Finalized by fdt_finalized(). */ + fdtroot = fdt; + + return (0); +} + +void +fdt_add_aplic(uint64_t mem_base, uint64_t mem_size) +{ + char node_name[32]; + void *fdt, *prop; + + fdt = fdtroot; + + snprintf(node_name, sizeof(node_name), "interrupt-controller@%lx", + (unsigned long)mem_base); + fdt_begin_node(fdt, node_name); + + aplic_phandle = assign_phandle(fdt); + fdt_property_string(fdt, "compatible", "riscv,aplic"); + fdt_property(fdt, "interrupt-controller", NULL, 0); +#if notyet + fdt_property(fdt, "msi-controller", NULL, 0); +#endif + /* XXX: Needed given the root #address-cells? */ + fdt_property_u32(fdt, "#address-cells", 2); + fdt_property_u32(fdt, "#interrupt-cells", 2); + fdt_property_placeholder(fdt, "reg", 2 * sizeof(uint64_t), &prop); + SET_PROP_U64(prop, 0, mem_base); + SET_PROP_U64(prop, 1, mem_size); + + fdt_property_placeholder(fdt, "interrupts-extended", + 2 * sizeof(uint32_t), &prop); + SET_PROP_U32(prop, 0, intc0_phandle); + SET_PROP_U32(prop, 1, 9); + fdt_property_u32(fdt, "riscv,num-sources", 63); + + fdt_end_node(fdt); + + fdt_property_u32(fdt, "interrupt-parent", aplic_phandle); +} + +void +fdt_add_uart(uint64_t uart_base, uint64_t uart_size, int intr) +{ + void *fdt, *interrupts; + char node_name[32]; + + assert(aplic_phandle != 0); + + fdt = fdtroot; + + snprintf(node_name, sizeof(node_name), "serial@%lx", uart_base); + fdt_begin_node(fdt, node_name); + fdt_property_string(fdt, "compatible", "ns16550"); + set_single_reg(fdt, uart_base, uart_size); + fdt_property_u32(fdt, "interrupt-parent", aplic_phandle); + fdt_property_placeholder(fdt, "interrupts", 2 * sizeof(uint32_t), + &interrupts); + SET_PROP_U32(interrupts, 0, intr); + SET_PROP_U32(interrupts, 1, IRQ_TYPE_LEVEL_HIGH); + + fdt_end_node(fdt); + + snprintf(node_name, sizeof(node_name), "/serial@%lx", uart_base); + fdt_begin_node(fdt, "aliases"); + fdt_property_string(fdt, "serial0", node_name); + fdt_end_node(fdt); +} + +void +fdt_add_pcie(int intrs[static 4]) +{ + void *fdt, *prop; + int slot, pin, intr, i; + + assert(aplic_phandle != 0); + + fdt = fdtroot; + + fdt_begin_node(fdt, "pcie@1f0000000"); + fdt_property_string(fdt, "compatible", "pci-host-ecam-generic"); + fdt_property_u32(fdt, "#address-cells", 3); + fdt_property_u32(fdt, "#size-cells", 2); + fdt_property_string(fdt, "device_type", "pci"); + fdt_property_u64(fdt, "bus-range", (0ul << 32) | 1); + set_single_reg(fdt, 0xe0000000, 0x10000000); + fdt_property_placeholder(fdt, "ranges", + 2 * 7 * sizeof(uint32_t), &prop); + SET_PROP_U32(prop, 0, 0x01000000); + + SET_PROP_U32(prop, 1, 0); + SET_PROP_U32(prop, 2, 0xdf000000); + + SET_PROP_U32(prop, 3, 0); + SET_PROP_U32(prop, 4, 0xdf000000); + + SET_PROP_U32(prop, 5, 0); + SET_PROP_U32(prop, 6, 0x01000000); + + SET_PROP_U32(prop, 7, 0x02000000); + + SET_PROP_U32(prop, 8, 0); + SET_PROP_U32(prop, 9, 0xa0000000); + + SET_PROP_U32(prop, 10, 0); + SET_PROP_U32(prop, 11, 0xa0000000); + + SET_PROP_U32(prop, 12, 0); + SET_PROP_U32(prop, 13, 0x3f000000); + +#if notyet + fdt_property_placeholder(fdt, "msi-map", 4 * sizeof(uint32_t), &prop); + SET_PROP_U32(prop, 0, 0); /* RID base */ + SET_PROP_U32(prop, 1, aplic_phandle); /* MSI parent */ + SET_PROP_U32(prop, 2, 0); /* MSI base */ + SET_PROP_U32(prop, 3, 0x10000); /* RID length */ + fdt_property_u32(fdt, "msi-parent", aplic_phandle); +#endif + + fdt_property_u32(fdt, "#interrupt-cells", 1); + fdt_property_u32(fdt, "interrupt-parent", aplic_phandle); + + /* + * Describe standard swizzled interrupts routing (pins rotated by one + * for each consecutive slot). Must match pci_irq_route(). + */ + fdt_property_placeholder(fdt, "interrupt-map-mask", + 4 * sizeof(uint32_t), &prop); + SET_PROP_U32(prop, 0, 3 << 11); + SET_PROP_U32(prop, 1, 0); + SET_PROP_U32(prop, 2, 0); + SET_PROP_U32(prop, 3, 7); + fdt_property_placeholder(fdt, "interrupt-map", + 16 * 9 * sizeof(uint32_t), &prop); + for (i = 0; i < 16; ++i) { + pin = i % 4; + slot = i / 4; + intr = intrs[(pin + slot) % 4]; + SET_PROP_U32(prop, 10 * i + 0, slot << 11); + SET_PROP_U32(prop, 10 * i + 1, 0); + SET_PROP_U32(prop, 10 * i + 2, 0); + SET_PROP_U32(prop, 10 * i + 3, pin + 1); + SET_PROP_U32(prop, 10 * i + 4, aplic_phandle); + SET_PROP_U32(prop, 10 * i + 5, 0); + SET_PROP_U32(prop, 10 * i + 6, 0); + SET_PROP_U32(prop, 10 * i + 7, intr); + SET_PROP_U32(prop, 10 * i + 8, IRQ_TYPE_LEVEL_HIGH); + } + + fdt_end_node(fdt); +} + +void +fdt_finalize(void) +{ + fdt_end_node(fdtroot); + + fdt_finish(fdtroot); +} diff --git a/usr.sbin/bhyve/riscv/fdt.h b/usr.sbin/bhyve/riscv/fdt.h new file mode 100644 index 000000000000..9bebe6ffa29d --- /dev/null +++ b/usr.sbin/bhyve/riscv/fdt.h @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 The FreeBSD Foundation + * + * This software was developed by Andrew Turner under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _FDT_H_ +#define _FDT_H_ + *** 653 LINES SKIPPED *** From nobody Thu Oct 31 20:33:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfbKp4ktjz5cKmN; Thu, 31 Oct 2024 20:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfbKp4BcNz4Wh0; Thu, 31 Oct 2024 20:33:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZMq+OsHee+iU4R4gsz9tuU4P1s4kRqveCDA2Yq6IpP4=; b=SkjpFhyd+ecVxmmUR41DqqRNDNtDpr145E2cKAs1c5riFc5GIf0rhkcbai8lSRnoev7i0A 6xp4JuhO+a+WHuMWx2K9boAHS1/daCsUXfSbHweqyg56FYNCwbhA/Py2b75kRCfigWe3Ok HQXRzpj12N0G+bT6UqJ6STabVETs2PPSdabnCmSKoEhLGwUgRwagA3GxuQI4lwCOSPXGEH du3lC6hF3NtY9VVbGjsGhiCG0A96uzvfT5IrkM+FBj5ZgQnq5ypor67uETnr/uahSeK+PU nvrb45LIxHCE9cpdeotkBBC4vLeIzJQ8JAcZi7rUFMotr5nfo6JQOZd0Ok5YCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZMq+OsHee+iU4R4gsz9tuU4P1s4kRqveCDA2Yq6IpP4=; b=whCg5aTWov0v41BJyZPHHCEpfirEvNjQpBXQFCaRCOhk6K7NzCQ4NmM+9Qp8sL/wfOZ/k7 GLbw42A1axWsOLu3rfIFnoKQ3xfSGvryTBaihbcOaaGBNHERGEfkSpR5XZye+vwlKI4/aQ OkzAg/D3Zx//JBzRjxETyopr8HtAVd6mIoF/iq9wMKNvinfuHQFunEI3d+gURslopVuspl wAB/nCLO81GV2nlUuWzebUP7jVvyzpSr264RLw8wu1O670LR5Cuh9SYRoYC5J4TjMTtIxk rOPEYrDenkPVXehM0NXdV75mXDsJzISSiHxQBx0Wee1DfqBNE8wrgprAvEl2hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730406798; a=rsa-sha256; cv=none; b=XVgtvomnZwrmiuadMLXyKvIBYyAfL8nnyki3hlY8HChbnSN453e0aw35fckFxPXCorSfRt L8bJpjAaKsnwF12zIi9dDE0y08ZNq0/en1ouXw7z7pZ6hq/PktEaBu77KFodCEGRB49/46 eFYY9EHr6fkN4XywgkpCiwKL28C5QP+hLOosMmAINnFjEB3GFSY0onLkTLHgM7spG+Pz14 n4rAy879PcP1eGBgMnL6NOhbdxxOoUV73fgh7HZp3kMyfNVgGUUf/+o1cTYAr2MoUh9HQH ZqRXy8ugDsRlShaBnvx3JWCsrS0sw24QSG5Bvd1Jc28l7wRlO8uQt+SWqIFICg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfbKp3nvTzrBj; Thu, 31 Oct 2024 20:33:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKXIDH081790; Thu, 31 Oct 2024 20:33:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKXInx081787; Thu, 31 Oct 2024 20:33:18 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:33:18 GMT Message-Id: <202410312033.49VKXInx081787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 314cb279959b - main - mbuf: Don't force all M_EXTPG mbufs to be read-only List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 314cb279959b08811543612a715e47266f685c7b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=314cb279959b08811543612a715e47266f685c7b commit 314cb279959b08811543612a715e47266f685c7b Author: John Baldwin AuthorDate: 2024-10-31 20:32:31 +0000 Commit: John Baldwin CommitDate: 2024-10-31 20:32:31 +0000 mbuf: Don't force all M_EXTPG mbufs to be read-only Some M_EXTPG mbufs are read-only (e.g. those backing sendfile requests), but others are not. Add a flags argument to mb_alloc_ext_pgs that can be used to set M_RDONLY when needed rather than setting it unconditionally. Update mb_unmapped_to_ext to preserve M_RDONLY from the unmapped mbuf. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D46783 --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 2 +- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 +- sys/dev/iscsi/icl_soft.c | 2 +- sys/dev/nvmf/nvmf_tcp.c | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- sys/kern/kern_mbuf.c | 9 +++++---- sys/kern/kern_sendfile.c | 2 +- sys/kern/uipc_mbuf.c | 4 ++-- sys/sys/mbuf.h | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index ab1428c06d87..c8592807f843 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -651,7 +651,7 @@ icl_cxgbei_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *ip, while (len > 0) { if (m == NULL) { m = mb_alloc_ext_pgs(flags & ~ICL_NOCOPY, - cxgbei_free_mext_pg); + cxgbei_free_mext_pg, 0); if (__predict_false(m == NULL)) return (ENOMEM); atomic_add_int(&icp->ref_cnt, 1); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 0a40bbda3f3f..8cafac61fa8b 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2126,7 +2126,7 @@ alloc_aiotx_mbuf(struct kaiocb *job, int len) if (npages < 0) break; - m = mb_alloc_ext_pgs(M_WAITOK, aiotx_free_pgs); + m = mb_alloc_ext_pgs(M_WAITOK, aiotx_free_pgs, M_RDONLY); m->m_epg_1st_off = pgoff; m->m_epg_npgs = npages; if (npages == 1) { diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 832ff8135ec5..812793a9fba3 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -1139,7 +1139,7 @@ icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request, while (len > 0) { if (m == NULL) { m = mb_alloc_ext_pgs(flags & ~ICL_NOCOPY, - icl_soft_free_mext_pg); + icl_soft_free_mext_pg, 0); if (__predict_false(m == NULL)) return (ENOMEM); atomic_add_int(&isp->ref_cnt, 1); diff --git a/sys/dev/nvmf/nvmf_tcp.c b/sys/dev/nvmf/nvmf_tcp.c index 22275aaa835b..2e33334b92ee 100644 --- a/sys/dev/nvmf/nvmf_tcp.c +++ b/sys/dev/nvmf/nvmf_tcp.c @@ -884,7 +884,7 @@ nvmf_tcp_mext_pg(void *arg, int how) struct nvmf_tcp_command_buffer *cb = arg; struct mbuf *m; - m = mb_alloc_ext_pgs(how, nvmf_tcp_free_mext_pg); + m = mb_alloc_ext_pgs(how, nvmf_tcp_free_mext_pg, M_RDONLY); m->m_ext.ext_arg1 = cb; tcp_hold_command_buffer(cb); return (m); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 7540893ce63c..e1c02a71939b 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -9402,7 +9402,7 @@ nfsm_split(struct mbuf *mp, uint64_t xfer) if (pgno == m->m_epg_npgs) panic("nfsm_split: eroneous ext_pgs mbuf"); - m2 = mb_alloc_ext_pgs(M_WAITOK, mb_free_mext_pgs); + m2 = mb_alloc_ext_pgs(M_WAITOK, mb_free_mext_pgs, 0); m2->m_epg_flags |= EPG_FLAG_ANON; /* diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 5c1c5b095449..73c98209474a 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -1014,7 +1014,8 @@ _mb_unmapped_to_ext(struct mbuf *m) ref_inc++; m_extadd(m_new, (char *)sf_buf_kva(sf), PAGE_SIZE, - mb_unmapped_free_mext, sf, mref, M_RDONLY, EXT_SFBUF); + mb_unmapped_free_mext, sf, mref, m->m_flags & M_RDONLY, + EXT_SFBUF); m_new->m_data += segoff; m_new->m_len = seglen; @@ -1119,7 +1120,7 @@ mb_unmapped_to_ext(struct mbuf *top) * freed. */ struct mbuf * -mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) +mb_alloc_ext_pgs(int how, m_ext_free_t ext_free, int flags) { struct mbuf *m; @@ -1137,7 +1138,7 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) m->m_epg_tls = NULL; m->m_epg_so = NULL; m->m_data = NULL; - m->m_flags |= (M_EXT | M_RDONLY | M_EXTPG); + m->m_flags |= M_EXT | M_EXTPG | flags; m->m_ext.ext_flags = EXT_FLAG_EMBREF; m->m_ext.ext_count = 1; m->m_ext.ext_size = 0; @@ -1709,7 +1710,7 @@ mb_alloc_ext_plus_pages(int len, int how) vm_page_t pg; int i, npgs; - m = mb_alloc_ext_pgs(how, mb_free_mext_pgs); + m = mb_alloc_ext_pgs(how, mb_free_mext_pgs, 0); if (m == NULL) return (NULL); m->m_epg_flags |= EPG_FLAG_ANON; diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 323e7fcde07b..05a820fe5ac1 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -1003,7 +1003,7 @@ retry_space: ext_pgs_idx++; if (ext_pgs_idx == max_pgs) { m0 = mb_alloc_ext_pgs(M_WAITOK, - sendfile_free_mext_pg); + sendfile_free_mext_pg, M_RDONLY); if (flags & SF_NOCACHE) { m0->m_ext.ext_flags |= diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index f6ce9b5cc74b..f3e2f13e89ec 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1887,7 +1887,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) * ciphersuites. */ if (__predict_false(total == 0)) { - mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs); + mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs, 0); if (mb == NULL) return (NULL); mb->m_epg_flags = EPG_FLAG_ANON; @@ -1899,7 +1899,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) */ m = NULL; while (total > 0) { - mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs); + mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs, 0); if (mb == NULL) goto failed; if (m == NULL) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index ab494a76833e..434f29feddcf 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -808,7 +808,7 @@ void mb_dupcl(struct mbuf *, struct mbuf *); void mb_free_ext(struct mbuf *); void mb_free_extpg(struct mbuf *); void mb_free_mext_pgs(struct mbuf *); -struct mbuf *mb_alloc_ext_pgs(int, m_ext_free_t); +struct mbuf *mb_alloc_ext_pgs(int, m_ext_free_t, int); struct mbuf *mb_alloc_ext_plus_pages(int, int); struct mbuf *mb_mapped_to_unmapped(struct mbuf *, int, int, int, struct mbuf **); From nobody Thu Oct 31 20:33:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfbKr0j9gz5cLDB; Thu, 31 Oct 2024 20:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfbKq5BTpz4Wpv; Thu, 31 Oct 2024 20:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2rqh3r/4/+/PiyPu75Gqu7aq8u19XtApb+W/qpup3U=; b=LNA50uaSOwZGs+LgKiIVKOk3pKlkBfc2JLz5/Kmh188fLud/54nMAXn+R9jqDwpb1XhYvI lKSKD8RXNM6qiJTP54xRi6NWcgli2QTyT9AEjIyCnd0mhG0tOf8lgfDhuMG10P9VEvzQVL 2nqnIGKro0pjIQKzz6M63x5kynOuyqfIwUv5SerM6k1rl0NaHPK6gnkP9r0OJLm6tPjJbp zAi4XzS8SL8CnMKQeRrgSXru8rvhDhtKxAyk0MdcbbKJ9KVniawqPZ37R32a0NUxNATS7+ sePDirAkV9dDv8YebFQAeqSvaOYySlPtz8LH5M1KEj20inbE+KhAEzSg2BYUzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2rqh3r/4/+/PiyPu75Gqu7aq8u19XtApb+W/qpup3U=; b=E/UzYY+EHFBDkpZQmzbHO1EyQhFj34Zx3dzSuHDMNr6RpuCgPEryg1V2Hn8UTm5pG4QRcP ugMjKOl8mqvEyGDQ9tJxHJvF56HZ6rZtW9jB3FY9YFZjCKbL2sn8UrB+wFW8zotkAlpUvH pt2zIeQ50ZsLxtKvB5sauagjwF/hJuJZy32REp8FOL+XfKTxR+Km4Os1hJGQclezRbItoV Yas0ukRIjSXphW2XMfh2G43jyeSUBoVYnFPp7gkPMGVR1c/22S5igUBr0FljRnkifZNXFn Tl8spZ/ps9IgpLhTpAsev/rPG0flqv402+NVfXnWmRPZnaeeVRNnjd2cN7v28Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730406799; a=rsa-sha256; cv=none; b=HBQUwQAF/L1z2K2ao8UTjzLOIXNxXUFobpitbhTZCGR2D4zes4Lg0OQm3OZN/PYO6nMzYR /lWaEamhlJsJUv4dgfKEf5SuNoQQQT5vRbOfzGowejnZYiZvM7tHWbs/Updzbie5gjOJRp DImsXDU8BODgp2aUq2orOAiccEDg6uygjZ02ycycLl9gY8axHK9998yEqm7MYFTK566GPn GHxoa/ifwFiaVvy/4vfLhJb+tMkw/6/9WpBZ80DkSO34hv7fZTIlkarnBME6JCbYcMEXed 2jbIqxeRvPydSE9EeXK+eJAnfuiPDi5CSbV+ScthRNZzSeG/gL9TJySfHfnl6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfbKq4pdczqyF; Thu, 31 Oct 2024 20:33:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKXJd2081844; Thu, 31 Oct 2024 20:33:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKXJJl081841; Thu, 31 Oct 2024 20:33:19 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:33:19 GMT Message-Id: <202410312033.49VKXJJl081841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f02d9edfb5d6 - main - ktls: Mark mbufs containing outbound encrypted TLS records read-only List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f02d9edfb5d695734b8866c81d2da0c7700c8779 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f02d9edfb5d695734b8866c81d2da0c7700c8779 commit f02d9edfb5d695734b8866c81d2da0c7700c8779 Author: John Baldwin AuthorDate: 2024-10-31 20:32:32 +0000 Commit: John Baldwin CommitDate: 2024-10-31 20:32:32 +0000 ktls: Mark mbufs containing outbound encrypted TLS records read-only Reviewed by: gallatin, kp Differential Revision: https://reviews.freebsd.org/D46784 --- sys/kern/uipc_ktls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 1e4a933d4e4f..bf2ff37e3c3a 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -3072,6 +3072,7 @@ ktls_encrypt(struct ktls_wq *wq, struct mbuf *top) if ((m->m_epg_flags & EPG_FLAG_ANON) == 0) ktls_finish_nonanon(m, &state); + m->m_flags |= M_RDONLY; npages += m->m_epg_nrdy; @@ -3110,6 +3111,7 @@ ktls_encrypt_cb(struct ktls_ocf_encrypt_state *state, int error) if ((m->m_epg_flags & EPG_FLAG_ANON) == 0) ktls_finish_nonanon(m, state); + m->m_flags |= M_RDONLY; so = state->so; free(state, M_KTLS); From nobody Thu Oct 31 20:33:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfbKs232Cz5cL6S; Thu, 31 Oct 2024 20:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfbKr6fx7z4WQ1; Thu, 31 Oct 2024 20:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1YD9Znzlos0wIidboZih5o07ji6UIjP1fwWMqmCFg64=; b=o2oUXcJ1ny1qzayKRIuaVdIAS5b2VT246l+BVM8yL4UMw0WHhovEIeIzX0c8cJpSRB4Az0 QKXx7VsvXHSSx/aDp2XCYt7/3kLk3DF9pY/cSTQ0o1P2d0zMw98OvkF1Kjfq3P1FME3uiw eVhZq+NClLEWiy+nStPK8ItU7GcLVFvKJFRYjgTP+IvR16h0xk38uBhqD2+BVM0qTctDhi jHS5MHE6h+FZFcWMNcgcYM1IYJRqm9BaZnKHRvLD5t2mrS827yILZyd4J76X8ouvWKdB9T kTfCdoOytMofk7N4DZMB9E2V8kXch4g/67aH+2Jbf8Kzux3k8qMJ/aexQYwHTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730406800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1YD9Znzlos0wIidboZih5o07ji6UIjP1fwWMqmCFg64=; b=kUrLefcShM+m10iP69CDZM1bRoMxfQ1Gz0OzJPt/qW+TugkaLgPp4tvUY2tRXekC1nn2qJ sFToOppnIXo1mh8L4fJ+B/Ep+ixapFx7ws0iJ+/wCVRILGR43xN6+JZybcxasNfZfoqDvp hj+JyPp4v4q//7IAMgMx4CkmfTsYWkm/JJh1rC0idLa/v2T8e52CjwIFaOboO9/Wr8s2Dl 8/CCurAKTVMWqRLbioRyk7s8mYiM10AgONd4mvxis9WRZqGLZ2j/DUIkDbmFUnn3PdhmMz i2IGE49APLiq9Keuw9TpCeiRzTrdJl+Ys7Nok0MIJXYHEFHx3+S7y6DkVev3gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730406800; a=rsa-sha256; cv=none; b=mEwB2Fj3I4MwuH2SmHJj3xHG7cPkraP6xlpcHQMq2T0v8qAMt54WFZ2dW1ittSzP1CbGRF pkBPm7b5xnPXmN5VQ0cwRrh3gXUHKmPv05WYqNgZcR7z4IIm45hMhfR6xOhfcSBOxNZL5c vvuIcC1SYu3s5wUpVBvpiBakQ5U2cC2lx26bciB3Z7kQtr7M7P/QYpRt3d9FqdYvI/WBb5 0ZD5FsIZmv2zIzuCrVtuKfO7G3owF7lObU45cRWd/Y/Gl2+U8FqS//qhMrYs9Cp1lk8cJW yanPwHNyuhtyYhqXrwvKJBRnkXmk6ovdltN+an7iaUkal/xIOUymZmjW3PZmQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfbKr6DhczrQQ; Thu, 31 Oct 2024 20:33:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKXKnp081905; Thu, 31 Oct 2024 20:33:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKXK29081902; Thu, 31 Oct 2024 20:33:20 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:33:20 GMT Message-Id: <202410312033.49VKXK29081902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 28aafeb83c08 - main - netinet*: Add assertions for some places that don't support M_EXTPG mbufs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28aafeb83c085b83d03c8f2f2fe0a785f640c026 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=28aafeb83c085b83d03c8f2f2fe0a785f640c026 commit 28aafeb83c085b83d03c8f2f2fe0a785f640c026 Author: John Baldwin AuthorDate: 2024-10-31 20:32:32 +0000 Commit: John Baldwin CommitDate: 2024-10-31 20:32:32 +0000 netinet*: Add assertions for some places that don't support M_EXTPG mbufs Found while auditing calls to M_WRITABLE to see if M_EXTPG could be removed from its checks. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D46785 --- sys/netinet/igmp.c | 1 + sys/netinet/ip_mroute.c | 4 ++++ sys/netinet/ip_options.c | 2 ++ sys/netinet6/ip6_mroute.c | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 454668c2aadc..5082b6294ebb 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1471,6 +1471,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto) m = *mp; ifp = m->m_pkthdr.rcvif; *mp = NULL; + M_ASSERTMAPPED(m); IGMPSTAT_INC(igps_rcv_total); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index afa199ce0691..501b3e0d9a43 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1311,6 +1311,8 @@ X_ip_mforward(struct ip *ip, struct ifnet *ifp, struct mbuf *m, u_long hash; int hlen; + M_ASSERTMAPPED(m); + CTR3(KTR_IPMF, "ip_mforward: delete mfc orig 0x%08x group %lx ifp %p", ntohl(ip->ip_src.s_addr), (u_long)ntohl(ip->ip_dst.s_addr), ifp); @@ -1562,6 +1564,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt, vifi_t xmt_vif) vifi_t vifi; int plen = ntohs(ip->ip_len); + M_ASSERTMAPPED(m); MRW_LOCK_ASSERT(); NET_EPOCH_ASSERT(); @@ -1745,6 +1748,7 @@ phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m) int hlen = ip->ip_hl << 2; MRW_LOCK_ASSERT(); + M_ASSERTMAPPED(m); /* * Make a new reference to the packet; make sure that diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index 41f77a7491f2..a9d6836d9e97 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -514,6 +514,8 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen) *phlen = 0; return (m); /* XXX should fail */ } + KASSERT((m->m_flags & M_EXTPG) == 0, ("%s: mbuf %p is unmapped", + __func__, m)); if (p->ipopt_dst.s_addr) ip->ip_dst = p->ipopt_dst; if (!M_WRITABLE(m) || M_LEADINGSPACE(m) < optlen) { diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 3e849e5b36dd..f3c68d61f245 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1073,6 +1073,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) GET_TIME(tp); #endif /* UPCALL_TIMING */ + M_ASSERTMAPPED(m); MRT6_DLOG(DEBUG_FORWARD, "src %s, dst %s, ifindex %d", ip6_sprintf(ip6bufs, &ip6->ip6_src), ip6_sprintf(ip6bufd, &ip6->ip6_dst), ifp->if_index); @@ -1364,6 +1365,8 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) u_int32_t iszone, idzone, oszone, odzone; int error = 0; + M_ASSERTMAPPED(m); + /* * Don't forward if it didn't arrive from the parent mif * for its origin. @@ -1527,6 +1530,8 @@ phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) int error __unused = 0; u_long linkmtu; + M_ASSERTMAPPED(m); + /* * Make a new reference to the packet; make sure that * the IPv6 header is actually copied, not just referenced, From nobody Thu Oct 31 20:48:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfbgD4qkyz5cMBx; Thu, 31 Oct 2024 20:48: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfbgD4Kj1z4gRy; Thu, 31 Oct 2024 20:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vN+fhMBVVzQzhQzC15F7qp704UeC1HhRsnRrPlZTtu4=; b=gAkAIe5AA59sLWGWaGuvlyQ1tl7gly4K8buBnrnXIenjFs5pHy8Sg7OwYyhEGr2kuVKAqJ n9x4SlmbnvOx5bOrLzY1sdWqgJ/jmuh6wJlpOzsIrEr8JU9wsdnWusp6G61n3ATIpZb7ss 9BVPPG12As2RcaHPpStKifV7FIlqz4p6e1DtKO5/Z6lpnQZ0Oalo/JWyC4X09nRBxeNjnV 3vdvGVcSo5bwSTIJGl7huOHQTrQUe2cfq49ot2XfAbLl/xY5wlKZz+YxI/a1bfLbK03Eay IQFhTsrA/oQxrGluJGbribifl+qqlh4592HvDZTz5q2QpAjIiB4zEzD52+X93g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vN+fhMBVVzQzhQzC15F7qp704UeC1HhRsnRrPlZTtu4=; b=f0HuO8+c6I+aGhBZhyCMChvfwu7cMkOxJEDPCV0zh4mnM0bqh0Sng2aximEwuaV9RykGa/ XlnkEtxOhUTMxMn/uIjMEWZ+ipRiyI1I6hm3C55ECXP4Z5623pghFxUnd7wKnb2HIlpYYU Ou6cANJadzYQhs9GVuFd4e/b1jZPjpWscjeRlIE4+n/pEtfPaBsRpdFN9xYKKDaU4vTae9 iaIqV3bQCV4wly2TzI9FhyTt9UeJFbOVTSeI249boXxvTiIt4oL5IRVBABQ7FbmxmZShuF W6dtaXIvCQwrMYSDFV/vi2A78hQ609+HTxAcsFEUF5Q0pf2FCMLGkjJ6Y8RetQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730407704; a=rsa-sha256; cv=none; b=pgCdKP4pfilrIy+rvEl1B9MWIbcqsZh55N0CzaFZsXIrIHvqUsJWqfP4gB2+3MZtJrz5sQ nUq+LFelN4ro6XcTCXXfSOPgoxdKL8FwHdoU6Vv6u48f/qt195b8zuitBvqrGHxXGktA8o 1U+6JqCrPCQIVL681iUXQtgEgq5IgoI8HEbGsPBn2hw3bQflvG5bYN/qb3nU6a3xr6f0m/ lcWIBLD+dfA/PKsb5Koe2lIJF45f+krk24iInjpVxn7O/ucSu8/czLS+swzXg6eEVQ5S/b tCtLyXpSRMRvG9oHudK8plMEiJEVXhmqpk61oV4GvQwD6xl35a8EJE2WyA78wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfbgD3qPvzrcr; Thu, 31 Oct 2024 20:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKmO5u005569; Thu, 31 Oct 2024 20:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKmOuK005566; Thu, 31 Oct 2024 20:48:24 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:48:24 GMT Message-Id: <202410312048.49VKmOuK005566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 89311e6f987e - main - release: increase VMSIZE for Oracle images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89311e6f987ebb1a968eee6fe594b11bfb91977a Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=89311e6f987ebb1a968eee6fe594b11bfb91977a commit 89311e6f987ebb1a968eee6fe594b11bfb91977a Author: Dave Cottlehuber AuthorDate: 2024-10-31 20:47:09 +0000 Commit: Dave Cottlehuber CommitDate: 2024-10-31 20:47:15 +0000 release: increase VMSIZE for Oracle images While OK for 14.x, both 13.x and 15.0 are failing in snapshot builds. Reported by: cperciva Sponsored by: SkunkWerks, GmbH Reviewed by: emaste Approved by: cperciva Differential Revision: https://reviews.freebsd.org/D47285 --- release/tools/oracle.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index d3b4eb351107..08a9a3a372b0 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -27,7 +27,7 @@ export VM_EXTRA_PACKAGES=" " # Should be enough for base image, image can be resized in needed -export VMSIZE=6g +export VMSIZE=8g # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST=" From nobody Thu Oct 31 20:48:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfbgq5qqRz5cMC3; Thu, 31 Oct 2024 20:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfbgq5L6Zz4gjG; Thu, 31 Oct 2024 20:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ypj1BMnsGpjqnEI08MC4DoXQshlD7H9icZfrhacvoJY=; b=ICdxQQyzJteRrJtfmZO4zrPHXP5jBdKoHFIy18bRs5F9dBASqXfcSVUi348+ANFsxYZKkU IBcdebe0hqmJJbwnmqo2jLk4L8lgeJ272Q6tpqWAZvcR/5mtrNspxNFO7VIyiuedR0MC/w M3ITqaYqzgTJ3aMJV1N4DzQP5+fxWc/n/89KKLRlEWmLH6Xye1mNwT8Xv4m2xCHni1mddz U35MENcOmJYmXy5DiHOzYJH1gQaaDaYZXglGd0lXWgjqpwWcpUJnjhvcbBNdCwtlZvaoUC lHNZiOK16Of6L08XN6reCQXjQ0o7eDFYqEuHe18ndgFMA871cejH6T51WWv2nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ypj1BMnsGpjqnEI08MC4DoXQshlD7H9icZfrhacvoJY=; b=FNP7SuaT6O82CtpKg7VDAmSiOYW+wgTNT86OTQx59lXDevffadw1W9+Q5IltfiHLgA4iA3 uRcRa0aBL9w/fWoG7IoqdpB0uk1+osLx8qHWXgCQo+gE06lu49BSAWPjsxSRqI0avL4uS8 f48hnXsRti895BwHWZisGeCbbxGeWvrNVpgEWO0lmh0C9PO5THcSonVcGbdMckmvu60xnH /V4f2TCuHRd0lqsEyUfWy/tbGDTakLNkIJpmdsIiSYN0vJE7VqP+G5mXq2dvFX8N2wPy2n 6W1CchOGyoEHdyEuklo8Cobnu/dO7IzKG2p1MTLr8xeIKj2Ou0nzTHQUAGl54g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730407735; a=rsa-sha256; cv=none; b=FeevadgDMdLmIwpQcFRFYOHFlRMx9foycvEciJtB9mTZXzICQROYSlbPS7MYuojNr4d/8x X5B8/Kg/6fIoihY6gggn0NMzDR3dxKAeTR1Oj1sg4CuHeVgDuua2yGhGqdlfbeJA0axj2p 8dOmMl8XASCqaI/nD5+FEiWJQUuS5Y0nufM6GM+JDxxbuYWZCS0KgPBJfguFalIhUkNz1n fQA64P2e9E6/U1Px2o8cUHzWqvlDLvL2MqJmrsDDF8ficXFX5noGxmOQdSjWp3Y1JBkiKS Yf7q+uvSd8BTrFuQJGKAW+F4Qa6jgEiKPNHh31AH2wR7DWmbm0HIIy+ZD+KquQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfbgq4xQMzqjr; Thu, 31 Oct 2024 20:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKmt9d005858; Thu, 31 Oct 2024 20:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKmt0L005855; Thu, 31 Oct 2024 20:48:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:48:55 GMT Message-Id: <202410312048.49VKmt0L005855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dave Cottlehuber Subject: git: 44ef88398e57 - stable/14 - release: increase VMSIZE for Oracle images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 44ef88398e57b7c0b7893dfefb26f9c71ae0bd05 Auto-Submitted: auto-generated The branch stable/14 has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=44ef88398e57b7c0b7893dfefb26f9c71ae0bd05 commit 44ef88398e57b7c0b7893dfefb26f9c71ae0bd05 Author: Dave Cottlehuber AuthorDate: 2024-10-31 20:47:09 +0000 Commit: Dave Cottlehuber CommitDate: 2024-10-31 20:48:39 +0000 release: increase VMSIZE for Oracle images While OK for 14.x, both 13.x and 15.0 are failing in snapshot builds. Reported by: cperciva Sponsored by: SkunkWerks, GmbH Reviewed by: emaste Approved by: cperciva Differential Revision: https://reviews.freebsd.org/D47285 (cherry picked from commit 89311e6f987ebb1a968eee6fe594b11bfb91977a) --- release/tools/oracle.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index d3b4eb351107..08a9a3a372b0 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -27,7 +27,7 @@ export VM_EXTRA_PACKAGES=" " # Should be enough for base image, image can be resized in needed -export VMSIZE=6g +export VMSIZE=8g # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST=" From nobody Thu Oct 31 20:52:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfbm55Sngz5cMcw; Thu, 31 Oct 2024 20:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfbm54Hgwz4hXx; Thu, 31 Oct 2024 20:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aro9NKJBxJJnF9WJNRG4u+o7VNDCGuQqQJm0aqzWWKE=; b=upeeWQhwQPf7cFqsbXxbZR/QMjqfSN+7Em0qHu5VsOWFtKL8ofdZqy13FlgwzfMnRCfy7d qKgXPHehlxjLBhVTewIj7MV0wwJ+L9fRBmwGx6ksSebh1WWSYuhPd7ST/afCczYitmj++b O2+gWE3OFKHdcNo5kvOnytpumOYavsKRXwnwFgEApPABAOHCSl4gl3LftwExPawnaMNikU +ad9fuAgXUWrcAGhKsrQa0qR83sJkgqpeHx3JE/qqt2RitxdWnhyP3hUOfNF/i55iCA7M4 EOKxcq5OUYF6MWApaPwLXyvyw+QdSb6P6zWpEryTJT33w1MlQYzvBiVkZreL4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aro9NKJBxJJnF9WJNRG4u+o7VNDCGuQqQJm0aqzWWKE=; b=VmYuVFnVJhy/CNNF6TVWf3+wDyaHqp97MsHnFGJUDZb5iw7ARPmTb3Rr0gSY+s6JAgyLkT ClDs2CTf+YSnhx+7jJwbcuFEBPTSgGwf3/G5MwW9oGe9YqVlKTb1aChVdIbZLajsQjs0+4 g+9uptnDUWO8JpRX7wumP5DMZcfR2mBewSfqjjy5PNnRergcAIptdC1QoYpObGgFHJQl2U khawx01JVRQ5HARgVBoOFnjYm99NEfxw5F1oDYLrWvlrZ/Gfp5qP8JtIa6fwQdWygTpUkv qVU/myOBCql6qP0n2LU0pmD7oT0oNm1CwdO4ui/7EJnQM+GZXvDdQzcMjLrRpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730407957; a=rsa-sha256; cv=none; b=o/EBwjBYpTiXcrzhCpNaYMK7TQ3vqF71olFuGEohDywy6rgJ5lQBYPaP8xSXRegiRvEvQ2 kcaMRaHBsybnxg/4PizrLbSo6C+KEDG1Uw1lPpnzKQru6hVCV00388rk+WD06JIQopCuI6 lOosibKbJJ++VkG5TlFKaBEQwie3Rbqpgak/w4cRGmUyqVSO2ixRExbUjA/Ih8PnWDD0oW ddjNMPfqFc+cynwBYzBvtoNql8uGxvl+up4dadDmE1HyVimIwxn9EpRI6k4ghusHLL+dGC 3UukA9Ftg+tFp10ylcJhNegkXTHzROHTmXjH4ekguLvPIrXC7rKUxq0ACPiNSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfbm53vQrzrhY; Thu, 31 Oct 2024 20:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKqb1d022439; Thu, 31 Oct 2024 20:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKqb1d022436; Thu, 31 Oct 2024 20:52:37 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:52:37 GMT Message-Id: <202410312052.49VKqb1d022436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 86bc7259d3d5 - main - LinuxKPI: 802.11: hookup net80211 callbacks dependent on (*ampdu_action)() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86bc7259d3d558495511a0a23d137b4a6cd030f3 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=86bc7259d3d558495511a0a23d137b4a6cd030f3 commit 86bc7259d3d558495511a0a23d137b4a6cd030f3 Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 13:24:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 20:52:27 +0000 LinuxKPI: 802.11: hookup net80211 callbacks dependent on (*ampdu_action)() If a LinuxkPI base wireless driver does not support the (*ampdu_action)() ieee80211_ops function for offloading parts to firmware there is no reason for us to hook into the net80211 callbacks either but simply to let software (net80211) handle this. Sponsored by: The FreeBSD Foundation (commit) MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 56 +++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 6de5c42fe59d..3417c7776567 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2024 The FreeBSD Foundation - * Copyright (c) 2020-2022 Bjoern A. Zeeb + * Copyright (c) 2020-2024 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -4675,30 +4675,36 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) ic->ic_node_free = lkpi_ic_node_free; #ifdef LKPI_80211_HT - lhw->ic_recv_action = ic->ic_recv_action; - ic->ic_recv_action = lkpi_ic_recv_action; - lhw->ic_send_action = ic->ic_send_action; - ic->ic_send_action = lkpi_ic_send_action; - - lhw->ic_ampdu_enable = ic->ic_ampdu_enable; - ic->ic_ampdu_enable = lkpi_ic_ampdu_enable; - - lhw->ic_addba_request = ic->ic_addba_request; - ic->ic_addba_request = lkpi_ic_addba_request; - lhw->ic_addba_response = ic->ic_addba_response; - ic->ic_addba_response = lkpi_ic_addba_response; - lhw->ic_addba_stop = ic->ic_addba_stop; - ic->ic_addba_stop = lkpi_ic_addba_stop; - lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout; - ic->ic_addba_response_timeout = lkpi_ic_addba_response_timeout; - - lhw->ic_bar_response = ic->ic_bar_response; - ic->ic_bar_response = lkpi_ic_bar_response; - - lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start; - ic->ic_ampdu_rx_start = lkpi_ic_ampdu_rx_start; - lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop; - ic->ic_ampdu_rx_stop = lkpi_ic_ampdu_rx_stop; + /* + * Only attach if the driver/firmware supports (*ampdu_action)(). + * Otherwise it is in the hands of net80211. + */ + if (lhw->ops->ampdu_action != NULL) { + lhw->ic_recv_action = ic->ic_recv_action; + ic->ic_recv_action = lkpi_ic_recv_action; + lhw->ic_send_action = ic->ic_send_action; + ic->ic_send_action = lkpi_ic_send_action; + + lhw->ic_ampdu_enable = ic->ic_ampdu_enable; + ic->ic_ampdu_enable = lkpi_ic_ampdu_enable; + + lhw->ic_addba_request = ic->ic_addba_request; + ic->ic_addba_request = lkpi_ic_addba_request; + lhw->ic_addba_response = ic->ic_addba_response; + ic->ic_addba_response = lkpi_ic_addba_response; + lhw->ic_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = lkpi_ic_addba_stop; + lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout; + ic->ic_addba_response_timeout = lkpi_ic_addba_response_timeout; + + lhw->ic_bar_response = ic->ic_bar_response; + ic->ic_bar_response = lkpi_ic_bar_response; + + lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start; + ic->ic_ampdu_rx_start = lkpi_ic_ampdu_rx_start; + lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop; + ic->ic_ampdu_rx_stop = lkpi_ic_ampdu_rx_stop; + } #endif lkpi_radiotap_attach(lhw); From nobody Thu Oct 31 20:52:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfbm66Qz7z5cMXN; Thu, 31 Oct 2024 20:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfbm65LPlz4hbd; Thu, 31 Oct 2024 20:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JA/zMARWMDC8apBzT6mQJgUiZJ8hqbCNdOjv1o01+wE=; b=YaVWGgdjhQh3kBXF0vgqes91KqItb9jv6pbGqMdK1kthFP/oAHu91eRxvCtJ4Y+zUQh4uN TaihXjFgAdIuSVqHgKEUDpnueyBmgmDCP684X1mxwWx4l4hdenY0X+lt+2lY5LCCDbxm3K q5tm3GU3gf+ENENBcYwVvKCDMS6fp5fMgNHquAUm4IbOKuiLhdS9WBv7X7DfdvQZlQTxJD xqjqTBXW9EjOt/4aR07VfA3tLrGTpinuMRnwOT18Kqt2ZE/8oqPdLFpegr5C+iENQTkvCq +mruIZ8Da3VB8cjBtOMS5rlGgS4bnzude1PS94e7eEbPM4HI5xWlwfj3UayszA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730407958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JA/zMARWMDC8apBzT6mQJgUiZJ8hqbCNdOjv1o01+wE=; b=LD8qUrKl0pSZ+lvMNWkRDsnN+vMqQFBOLFOIG4vTWQhYF0iXNMAer/j/SmCAVH3GXCoNE8 Jf/BoS5ui0o9yE759qDpU8Z201e6lI/yiFTXs84P6RGmimTcOCmareNPVJtKoSehXX/Iqf hRfbwwpaflGXr0vfhlj+M/+D9UbCjkC9/1y33bXq66vB+EMggHGqZwelzIVwhuoVD3n2zW 3mbvMfSxYkQ75U2yWGuTRRrJnWO44llorM4+q3/hSuU+G9hr+kYTU3de4mWrPi1Doi8B2I QwneoYzNnjlzrnduzImGDos+HDGkrvMPguhAW2UtPxU4DMbbflytpJpUR9XrtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730407958; a=rsa-sha256; cv=none; b=TR/FGi3HmE0vQU0ODjNGzGwAuIy4C3Eu8dk8pSx2VYbmgjPagrysvTSWLg2M35Wt0t7kSr AAEiBRq06TW8VIez6wfQVqltZ/lqdnrDQesm8pl4p2cPDtQCykp+OLh+G7mZQmC+aEl+mw z+0Yf8wHqiZn9KkREkizhbCth/7Oasd5Ar5A34o89IE17gLGHqn8ZQ6dzsMvQvA6IMlEmJ KxNKzuZ5sbGhJbjO1n5NCFAm22/wNQn443TYdlOKRJOZWB0rRUEO73BRiSq5PdzOs7cvDM nBzVSVz5WpP/gqtbfKNRVTMR6M+C85w0iUv/9t8asUCF/d1vcISzGcSgx7RGZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfbm64xkjzrhZ; Thu, 31 Oct 2024 20:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VKqcZ0022510; Thu, 31 Oct 2024 20:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VKqclu022507; Thu, 31 Oct 2024 20:52:38 GMT (envelope-from git) Date: Thu, 31 Oct 2024 20:52:38 GMT Message-Id: <202410312052.49VKqclu022507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 310743c4ccc5 - main - LinuxKPI: 802.11: improvements to (*ampdu_action)() callers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 310743c4ccc545d58401cb9fb7761432e12a9fb5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=310743c4ccc545d58401cb9fb7761432e12a9fb5 commit 310743c4ccc545d58401cb9fb7761432e12a9fb5 Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 13:24:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-10-31 20:52:28 +0000 LinuxKPI: 802.11: improvements to (*ampdu_action)() callers Annotate lkpi_ic_recv_action(), lkpi_ic_send_action(), and lkpi_ic_ampdu_enable() with HT specifc debug logging as we only hook them up currently for debug tracing but later should not need them anymore. Start the implementation for lkpi_ic_addba_request(), lkpi_ic_addba_response(), and lkpi_ic_addba_stop(). Improve the implementation of lkpi_ic_ampdu_rx_start() and lkpi_ic_ampdu_rx_stop(). Sponsored by: The FreeBSD Foundation (commit) MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 206 +++++++++++++++++++++++++-- 1 file changed, 192 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 3417c7776567..ec471db21efd 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3986,7 +3986,7 @@ lkpi_ic_recv_action(struct ieee80211_node *ni, const struct ieee80211_frame *wh, ic = ni->ni_ic; lhw = ic->ic_softc; - IMPROVE_HT(); + IMPROVE_HT("recv_action called; nothing to do in lkpi; make debugging"); return (lhw->ic_recv_action(ni, wh, frm, efrm)); } @@ -4000,7 +4000,7 @@ lkpi_ic_send_action(struct ieee80211_node *ni, int category, int action, void *s ic = ni->ni_ic; lhw = ic->ic_softc; - IMPROVE_HT(); + IMPROVE_HT("send_action called; nothing to do in lkpi; make debugging"); return (lhw->ic_send_action(ni, category, action, sa)); } @@ -4015,52 +4015,207 @@ lkpi_ic_ampdu_enable(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) ic = ni->ni_ic; lhw = ic->ic_softc; - IMPROVE_HT(); + IMPROVE_HT("ieee80211_ampdu_enable called; nothing to do in lkpi for now; make debugging"); return (lhw->ic_ampdu_enable(ni, tap)); } +/* + * (*ic_addba_request)() is called by ieee80211_ampdu_request() before + * calling send_action(CAT_BA, BA_ADDBA_REQUEST). + * + * NB: returns 0 on ERROR! + */ static int lkpi_ic_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int dialogtoken, int baparamset, int batimeout) { struct ieee80211com *ic; struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params = { }; + int error; ic = ni->ni_ic; lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + vap = ni->ni_vap; + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); - IMPROVE_HT(); + if (!lsta->added_to_drv) { + ic_printf(ic, "%s: lsta %p ni %p, sta %p not added to firmware\n", + __func__, lsta, ni, sta); + return (0); + } + + params.sta = sta; + params.action = IEEE80211_AMPDU_TX_START; + /* Keep 0 here! */ + params.buf_size = 0; + params.timeout = 0; + params.ssn = tap->txa_start & (IEEE80211_SEQ_RANGE-1); + params.tid = tap->txa_tid; + params.amsdu = false; + + IEEE80211_UNLOCK(ic); + LKPI_80211_LHW_LOCK(lhw); + error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + LKPI_80211_LHW_UNLOCK(lhw); + IEEE80211_LOCK(ic); + if (error != 0) { + ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n", + __func__, error, ni, tap); + return (0); + } return (lhw->ic_addba_request(ni, tap, dialogtoken, baparamset, batimeout)); } +/* + * (*ic_addba_response)() is called from ht_recv_action_ba_addba_response() + * and calls the default ieee80211_addba_response() which always returns 1. + * + * NB: No error checking in net80211! + * Staying with 0 is an error. + */ static int lkpi_ic_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status, int baparamset, int batimeout) { struct ieee80211com *ic; struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params = { }; + int error; ic = ni->ni_ic; lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + vap = ni->ni_vap; + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); - IMPROVE_HT(); + if (!lsta->added_to_drv) { + ic_printf(ic, "%s: lsta %p ni %p, sta %p not added to firmware\n", + __func__, lsta, ni, sta); + return (0); + } + + if (status == IEEE80211_STATUS_SUCCESS) { + params.sta = sta; + params.action = IEEE80211_AMPDU_TX_OPERATIONAL; + params.buf_size = tap->txa_wnd; + params.timeout = 0; + params.ssn = 0; + params.tid = tap->txa_tid; + if ((tap->txa_flags & IEEE80211_AGGR_AMSDU) != 0) + params.amsdu = true; + else + params.amsdu = false; + } else { + /* We need to free the allocated resources. */ + params.sta = sta; + switch (status) { + /* params.action = FLUSH, FLUSH_CONT */ + default: + params.action = IEEE80211_AMPDU_TX_STOP_CONT; + break; + } + params.buf_size = 0; + params.timeout = 0; + params.ssn = 0; + params.tid = tap->txa_tid; + params.amsdu = false; + } + + IEEE80211_UNLOCK(ic); + LKPI_80211_LHW_LOCK(lhw); + error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + LKPI_80211_LHW_UNLOCK(lhw); + IEEE80211_LOCK(ic); + if (error != 0) { + ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n", + __func__, error, ni, tap); + return (0); + } + + IMPROVE_HT("who unleashes the TXQ? and when?, do we need to ni->ni_txseqs[tid] = tap->txa_start & 0xfff;"); return (lhw->ic_addba_response(ni, tap, status, baparamset, batimeout)); } +/* + * (*ic_addba_stop)() is called from ampdu_tx_stop(), ht_recv_action_ba_delba(), + * and ieee80211_ampdu_stop() and calls the default ieee80211_addba_stop(). + */ static void lkpi_ic_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { struct ieee80211com *ic; struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params = { }; + int error; ic = ni->ni_ic; lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + vap = ni->ni_vap; + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); - IMPROVE_HT(); + if (!lsta->added_to_drv) { + ic_printf(ic, "%s: lsta %p ni %p, sta %p not added to firmware\n", + __func__, lsta, ni, sta); + goto n80211; + } + /* We need to free the allocated resources. */ + params.sta = sta; + IMPROVE("net80211 does not provide a reason to us"); + params.action = IEEE80211_AMPDU_TX_STOP_CONT; /* params.action = FLUSH, FLUSH_CONT */ + params.buf_size = 0; + params.timeout = 0; + params.ssn = 0; + params.tid = tap->txa_tid; + params.amsdu = false; + + IEEE80211_UNLOCK(ic); + LKPI_80211_LHW_LOCK(lhw); + error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + LKPI_80211_LHW_UNLOCK(lhw); + IEEE80211_LOCK(ic); + if (error != 0) { + ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p tap %p\n", + __func__, error, ni, tap); + goto n80211; + } + + IMPROVE_HT("anyting else?"); + +n80211: lhw->ic_addba_stop(ni, tap); } @@ -4104,8 +4259,8 @@ lkpi_ic_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap struct lkpi_vif *lvif; struct ieee80211_vif *vif; struct lkpi_sta *lsta; - struct ieee80211_sta *sta; - struct ieee80211_ampdu_params params; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params = { }; int error; ic = ni->ni_ic; @@ -4117,6 +4272,14 @@ lkpi_ic_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap lsta = ni->ni_drv_data; sta = LSTA_TO_STA(lsta); + IEEE80211_UNLOCK_ASSERT(ic); + + if (!lsta->added_to_drv) { + ic_printf(ic, "%s: lsta %p ni %p vap %p, sta %p not added to firmware\n", + __func__, lsta, ni, vap, sta); + return (-ENXIO); + } + params.sta = sta; params.action = IEEE80211_AMPDU_RX_START; params.buf_size = _IEEE80211_MASKSHIFT(le16toh(baparamset), IEEE80211_BAPS_BUFSIZ); @@ -4124,22 +4287,33 @@ lkpi_ic_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap params.buf_size = IEEE80211_MAX_AMPDU_BUF_HT; else params.buf_size = min(params.buf_size, IEEE80211_MAX_AMPDU_BUF_HT); - if (params.buf_size > hw->max_rx_aggregation_subframes) + if (hw->max_rx_aggregation_subframes > 0 && + params.buf_size > hw->max_rx_aggregation_subframes) params.buf_size = hw->max_rx_aggregation_subframes; params.timeout = le16toh(batimeout); params.ssn = _IEEE80211_MASKSHIFT(le16toh(baseqctl), IEEE80211_BASEQ_START); params.tid = _IEEE80211_MASKSHIFT(le16toh(baparamset), IEEE80211_BAPS_TID); - params.amsdu = false; - IMPROVE_HT("Do we need to distinguish based on SUPPORTS_REORDERING_BUFFER?"); + /* Based on net80211::ampdu_rx_start(). */ + if ((vap->iv_htcaps & IEEE80211_HTC_RX_AMSDU_AMPDU) && + (_IEEE80211_MASKSHIFT(baparamset, IEEE80211_BAPS_AMSDU))) + params.amsdu = true; + else + params.amsdu = false; - /* This may call kalloc. Make sure we can sleep. */ + LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + LKPI_80211_LHW_UNLOCK(lhw); if (error != 0) { ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap); return (error); } + + if (!ieee80211_hw_check(hw, SUPPORTS_REORDERING_BUFFER)) { + IMPROVE("%s: TODO: SUPPORTS_REORDERING_BUFFER not set; check net80211\n", __func__); + } + IMPROVE_HT("net80211 is missing the error check on return and assumes success"); error = lhw->ic_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); @@ -4156,8 +4330,8 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct lkpi_vif *lvif; struct ieee80211_vif *vif; struct lkpi_sta *lsta; - struct ieee80211_sta *sta; - struct ieee80211_ampdu_params params; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params = { }; int error; uint8_t tid; @@ -4197,7 +4371,11 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) params.tid = tid; params.amsdu = false; + // IEEE80211_UNLOCK(ic); + LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + LKPI_80211_LHW_UNLOCK(lhw); + // IEEE80211_LOCK(ic); if (error != 0) ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap); From nobody Thu Oct 31 21:26:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfcWj5jBfz5cPtM; Thu, 31 Oct 2024 21:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfcWj48fNz4lSs; Thu, 31 Oct 2024 21:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730410017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCli1gjBGcq8HIst5Qql25p5o36o4GKtIcpnHbdoN+4=; b=DkVU7x1TZ7gOn6uheG2QhKuzCqxisFtHaFLuAqknWEZdwQKfLVkHYbnbqgPmhlPnQXzAgb Zr2JhN8fhJCy/gb3f9XoL72YkYMO6LjFQZm4pbSqrxM/nsVSbIEwohIqQ8Bsm3fSQHXnBc MtPOdw2utvlnoE9CHfOLDbhRDtRHMpWgu0GKTz1aHGmvcvYNFs2SOdSnz3n0a3sI3V/PCe iz8pIpcBQdcz3JeQeFbD9sFJwUFRE+sUE0g7SaRRWOLtt76claa/i9p3oGqQ/4YPPMlwk6 8Va5izTLlnTd6Tb/Szx5WAwnTpk8Qvm79AyM4sExVJr3ldkuKzV+ETkF9WjVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730410017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCli1gjBGcq8HIst5Qql25p5o36o4GKtIcpnHbdoN+4=; b=czffbbttvLyDv4ZU6qebeSNIevS0gY8SnqhH5z7tRIoRjTO9IB91gmqTRIGX6Qkifer1CQ GK3pMOZ5m6AvUzNbxfsOx7LAIG+97mFNfiue78oAaTVCmd+t7iHtLWEIIjmQeg32DGqCR7 8CDqGXpMKgTPGKO0NQ/f0vvCjACw4AAxagOhLWGtssQVgjAALKUuaPntfwXvRpwYoyptWC pnBy4bZQooRdzBoB6+mgT8l8R54sBfJPBiYi8cSJe3f6oIrMs+HuGEs/Z+BJbRqzvN+K2k ch1XO/xAZhR800OqpuHzAtfS1EjQZ7BF5qMIUJpves3myYsN3yPLVZWwleJrbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730410017; a=rsa-sha256; cv=none; b=TX3iVVmrHbbTU6owXa8ioeek48hLPflbVwLe9Yqh79k+dBlJxUwJtrCBAkhOq2fkIM9YCi 7aTIW/SW1VqV1Z8i3ifxSlOsv2ucN3XTAn7TckHB8uJ4TPR/k73rlWcuLRWXBQyj4H1zRu BXEzdGy86wKIrN4Pa6REaKdmFQKVtRsoFS9aUjI2sHFio5l/N6nW1XO9BF+zMxNhf7JzYG qRfX+FeXjS9m4HwFgwn4B9G9tXLDh3j1IUJHd0zvBacy3kdo7CJcRpFvs4A95DOp6xhoWs ek8T2mNGwEQh6y7hQK3k7PkgomgCIyvTilTVdPRrG8d2SGEV+fdOKNclTL7yxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfcWj3mFmzs2c; Thu, 31 Oct 2024 21:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VLQv6Q080584; Thu, 31 Oct 2024 21:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VLQvTY080581; Thu, 31 Oct 2024 21:26:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 21:26:57 GMT Message-Id: <202410312126.49VLQvTY080581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 9709bda03cd0 - main - GPIO: Add ACPI _AEI support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9709bda03cd0f20eba0ba4276fc3c2e06354a54f Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9709bda03cd0f20eba0ba4276fc3c2e06354a54f commit 9709bda03cd0f20eba0ba4276fc3c2e06354a54f Author: Colin Percival AuthorDate: 2024-10-22 18:53:55 +0000 Commit: Colin Percival CommitDate: 2024-10-31 21:26:34 +0000 GPIO: Add ACPI _AEI support Changes to acpi_gpiobus.c handle discovering and parsing the _AEI objects and storing necessary data in device ivars. A new gpioaei.c file implements the device, which simply requests an interrupt when the pin is triggered and invokes the appropriate _Exx or _Lxx ACPI method. This makes the GPIO "power button" work on arm64 Graviton systems, allowing EC2 "Stop"/"Reboot" instance calls to be handled cleanly. (Prior to this change, those requests would time out after 4 minutes and the instance would be forcibly killed.) Reviwed by: imp, andrew, Ahmad Khalifa MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47253 Co-authored-by: Andrew Turner --- sys/conf/files | 1 + sys/dev/gpio/acpi_gpiobus.c | 121 +++++++++++++++++++++++++++++++++++ sys/dev/gpio/acpi_gpiobusvar.h | 49 ++++++++++++++ sys/dev/gpio/gpioaei.c | 131 ++++++++++++++++++++++++++++++++++++++ sys/modules/gpio/Makefile | 2 +- sys/modules/gpio/gpioaei/Makefile | 14 ++++ 6 files changed, 317 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 7c3392fc7320..d04e75be3793 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1740,6 +1740,7 @@ dev/gpio/acpi_gpiobus.c optional acpi gpio dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt +dev/gpio/gpioaei.c optional acpi gpio dev/gpio/gpiobacklight.c optional gpiobacklight fdt dev/gpio/gpiokeys.c optional gpiokeys fdt dev/gpio/gpiokeys_codes.c optional gpiokeys fdt diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index c01d825fabf5..e766c25e5336 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -35,6 +35,9 @@ #include #include +#include + +#include "gpiobus_if.h" struct acpi_gpiobus_softc { struct gpiobus_softc super_sc; @@ -46,6 +49,13 @@ struct acpi_gpiobus_ctx { ACPI_HANDLE dev_handle; }; +struct acpi_gpiobus_ivar +{ + struct gpiobus_ivar gpiobus; /* Must come first */ + ACPI_HANDLE dev_handle; /* ACPI handle for bus */ + uint32_t flags; +}; + static uint32_t acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) { @@ -138,6 +148,74 @@ acpi_gpiobus_enumerate_res(ACPI_RESOURCE *res, void *context) return (AE_OK); } +static struct acpi_gpiobus_ivar * +acpi_gpiobus_setup_devinfo(device_t bus, device_t child, + ACPI_RESOURCE_GPIO *gpio_res) +{ + struct acpi_gpiobus_ivar *devi; + + devi = malloc(sizeof(*devi), M_DEVBUF, M_NOWAIT | M_ZERO); + if (devi == NULL) + return (NULL); + resource_list_init(&devi->gpiobus.rl); + + devi->flags = acpi_gpiobus_convflags(gpio_res); + if (acpi_quirks & ACPI_Q_AEI_NOPULL) + devi->flags &= ~GPIO_PIN_PULLUP; + + devi->gpiobus.npins = 1; + if (gpiobus_alloc_ivars(&devi->gpiobus) != 0) { + free(devi, M_DEVBUF); + return (NULL); + } + + for (int i = 0; i < devi->gpiobus.npins; i++) + devi->gpiobus.pins[i] = gpio_res->PinTable[i]; + + return (devi); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context) +{ + ACPI_RESOURCE_GPIO *gpio_res = &res->Data.Gpio; + struct acpi_gpiobus_ctx *ctx = context; + device_t bus = ctx->sc->sc_busdev; + device_t child; + struct acpi_gpiobus_ivar *devi; + + /* Check that we have a GpioInt object. */ + if (res->Type != ACPI_RESOURCE_TYPE_GPIO) + return (AE_OK); + if (gpio_res->ConnectionType != ACPI_RESOURCE_GPIO_TYPE_INT) + return (AE_OK); + + /* Add a child. */ + child = device_add_child_ordered(bus, 0, "gpio_aei", DEVICE_UNIT_ANY); + if (child == NULL) + return (AE_OK); + devi = acpi_gpiobus_setup_devinfo(bus, child, gpio_res); + if (devi == NULL) { + device_delete_child(bus, child); + return (AE_OK); + } + device_set_ivars(child, devi); + + for (int i = 0; i < devi->gpiobus.npins; i++) { + if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) { + gpiobus_free_ivars(&devi->gpiobus); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return (AE_OK); + } + } + + /* Pass ACPI information to children. */ + devi->dev_handle = ctx->dev_handle; + + return (AE_OK); +} + static ACPI_STATUS acpi_gpiobus_enumerate(ACPI_HANDLE handle, UINT32 depth, void *context, void **result) @@ -274,6 +352,13 @@ acpi_gpiobus_attach(device_t dev) if (ACPI_FAILURE(status)) device_printf(dev, "Failed to enumerate GPIO resources\n"); + /* Look for AEI children */ + status = AcpiWalkResources(handle, "_AEI", acpi_gpiobus_enumerate_aei, + &ctx); + + if (ACPI_FAILURE(status)) + device_printf(dev, "Failed to enumerate GPIO resources\n"); + return (0); } @@ -296,12 +381,48 @@ acpi_gpiobus_detach(device_t dev) return (gpiobus_detach(dev)); } +int +gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin) +{ + struct acpi_gpiobus_ivar *devi; + int rv; + + rv = gpio_pin_get_by_child_index(consumer, idx, out_pin); + if (rv != 0) + return (rv); + + devi = device_get_ivars(consumer); + (*out_pin)->flags = devi->flags; + + return (0); +} + +static int +acpi_gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct acpi_gpiobus_ivar *devi = device_get_ivars(child); + + switch (which) { + case ACPI_GPIOBUS_IVAR_HANDLE: + *result = (uintptr_t)devi->dev_handle; + break; + default: + return (gpiobus_read_ivar(dev, child, which, result)); + } + + return (0); +} + static device_method_t acpi_gpiobus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_gpiobus_probe), DEVMETHOD(device_attach, acpi_gpiobus_attach), DEVMETHOD(device_detach, acpi_gpiobus_detach), + /* Bus interface */ + DEVMETHOD(bus_read_ivar, acpi_gpiobus_read_ivar), + DEVMETHOD_END }; diff --git a/sys/dev/gpio/acpi_gpiobusvar.h b/sys/dev/gpio/acpi_gpiobusvar.h new file mode 100644 index 000000000000..77cb91110cb5 --- /dev/null +++ b/sys/dev/gpio/acpi_gpiobusvar.h @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __ACPI_GPIOBUS_H__ +#define __ACPI_GPIOBUS_H__ + +#include + +#include + +enum acpi_gpiobus_ivars { + ACPI_GPIOBUS_IVAR_HANDLE = 10600, +}; + +#define ACPI_GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(acpi_gpiobus, var, ACPI_GPIOBUS, ivar, type) + +ACPI_GPIOBUS_ACCESSOR(handle, HANDLE, ACPI_HANDLE) + +#undef ACPI_GPIOBUS_ACCESSOR + +int gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin); + +#endif /* __ACPI_GPIOBUS_H__ */ diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c new file mode 100644 index 000000000000..050f259a2127 --- /dev/null +++ b/sys/dev/gpio/gpioaei.c @@ -0,0 +1,131 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "gpiobus_if.h" + +#include +#include + +#include +#include + +struct gpio_aei_softc { + ACPI_HANDLE handle; + char objname[5]; /* "_EXX" or "_LXX" */ + struct resource * intr_res; + int intr_rid; + void * intr_cookie; +}; + +static int +gpio_aei_probe(device_t dev) +{ + + /* We only match when gpiobus explicitly requested gpio_aei. */ + return (BUS_PROBE_NOWILDCARD); +} + +static void +gpio_aei_intr(void * arg) +{ + struct gpio_aei_softc * sc = arg; + + /* Ask ACPI to run the appropriate _Exx or _Lxx method. */ + AcpiEvaluateObject(sc->handle, sc->objname, NULL, NULL); +} + +static int +gpio_aei_attach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + gpio_pin_t pin; + int err; + + /* This is us. */ + device_set_desc(dev, "ACPI Event Information Device"); + + /* Store parameters needed by gpio_aei_intr. */ + sc->handle = acpi_gpiobus_get_handle(dev); + if (gpio_pin_get_by_acpi_index(dev, 0, &pin) != 0) { + device_printf(dev, "Unable to get the input pin\n"); + return (ENXIO); + } + sprintf(sc->objname, "_%c%02X", + (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); + + /* Support for GPIO pins > 255 is not implemented. */ + if (pin->pin > 255) { + device_printf(dev, "ACPI Event Information Device does not support pins > 255"); + return (ENOTSUP); + } + + /* Set up the interrupt. */ + if ((sc->intr_res = gpio_alloc_intr_resource(dev, &sc->intr_rid, + RF_ACTIVE, pin, pin->flags & GPIO_INTR_MASK)) == NULL) { + device_printf(dev, "Cannot allocate an IRQ\n"); + return (ENOTSUP); + } + err = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, gpio_aei_intr, sc, &sc->intr_cookie); + if (err != 0) { + device_printf(dev, "Cannot set up IRQ\n"); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, + sc->intr_res); + return (err); + } + + return (0); +} + +static int +gpio_aei_detach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->intr_res, sc->intr_cookie); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, sc->intr_res); + return (0); +} + +static device_method_t gpio_aei_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, gpio_aei_probe), + DEVMETHOD(device_attach, gpio_aei_attach), + DEVMETHOD(device_detach, gpio_aei_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(gpio_aei, gpio_aei_driver, gpio_aei_methods, sizeof(struct gpio_aei_softc)); +DRIVER_MODULE(gpio_aei, gpiobus, gpio_aei_driver, NULL, NULL); +MODULE_DEPEND(gpio_aei, acpi_gpiobus, 1, 1, 1); diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index ffb3581d1f01..1d7f69f1836d 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,7 +24,7 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile new file mode 100644 index 000000000000..514dcd80a35e --- /dev/null +++ b/sys/modules/gpio/gpioaei/Makefile @@ -0,0 +1,14 @@ +.PATH: ${SRCTOP}/sys/dev/gpio/ + +KMOD= gpioaei +SRCS= gpioaei.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + gpio_if.h \ + gpiobus_if.h + +CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ + +.include From nobody Thu Oct 31 22:47:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XffJC14f6z5b3YS; Thu, 31 Oct 2024 22:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XffJC06QDz42JJ; Thu, 31 Oct 2024 22:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730414827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Grgpsqut66piy3MGmCUrQPsqm95As63sionGrJmiRO8=; b=lbGPMlOBj5kQXHz+JO7tzgjUrNML8gfNu1iJ1S0d6IrtUZCAGjMc4L408wlbT/rBqaiA7A jSlMKcgHEsZRzbwIeHQO6+iyqOiNdqY2pfFLzoECdUQKWHHoa+SiXaNeSZZ2RW0pU5vXkr 4s9zG5/ln/dtkX+CpLmHOvE4kmGcVbq3lemKRvOiaKoZiRPCuz0gu2uuVCXs6aAdnhpK+D LfBjs0ZA++gnRFCNT2ZiZUqWarWxcuQuIpsLdXZYEca5MXDVvF08U5z/K8Y/Pp8wCkSrMH dMV8Xbe3S0hRqNuutbRLxvaYXkhMRCFv2Yusw9zROx7r8eHRhzuMfIt01Wy1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730414827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Grgpsqut66piy3MGmCUrQPsqm95As63sionGrJmiRO8=; b=pICRgoD9tOYfvf4o8wuaY3R8zbpf528pFQASauWtZPnFDgM+KTWuP4M4OtoDe7kw/LM13p 7zAl0pyDK4xGMUMBCFrcXckm54aK2y+5U1KFev2xQ+PQ45atWGvmU5VvyyviedRdVaI4qi 7UeHInZInqy6+nbq+TiJMfgidh2BHn8BiFBSKcRRJux5B7SqgvoPeKR7lf3VBx7DCnuKfn Hyxlri2D3KJ8QVSD2EIfy+CxL8mrpgC9hvyHTE+FJfe3Jy/OZVGfPiF4AdNSnUy277ZkhH ysy7YciHuduSJgzbB70Zn0MzjYfogLCaZfAIx2UsJdXNXyS/BkKcQQzNvzEZog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730414827; a=rsa-sha256; cv=none; b=uDMT89qqAgylXyEmx038cU8Ym+JmGRXPLeCWh/pXkSINE8pws2QyyuxNha9t6JXyvu63f8 mXTIg8vKtyvzE5FcHC+zFCfqnvcMkdeXFJfGGMPEUJ2dPaRcjfZvN5rRg5GTp5V/Y0zxQL RzhBMi8gCQ/Xb2xwdWukd37dj+jckNs5rxJ1tMJr+aR9slUdnpozK/NkOermFQ2NZ8Yi9t PYh/e/s3ueY8NIXInB2zEr1idn9fcOKbk4+rMfgISOKAd5RnoF5jREwPoSlBJMtlAwx1dc nH5TJLnOxuiKgq6ge7fPV3pMxtjdDSR6DF3oNEXA+zSYHMywHSOSOa2n5YV6XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XffJB6qWfzvd0; Thu, 31 Oct 2024 22:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VMl64K031345; Thu, 31 Oct 2024 22:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VMl6TW031342; Thu, 31 Oct 2024 22:47:06 GMT (envelope-from git) Date: Thu, 31 Oct 2024 22:47:06 GMT Message-Id: <202410312247.49VMl6TW031342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6540ac118473dde29cb02f786c79c64f73834ca1 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6540ac118473dde29cb02f786c79c64f73834ca1 commit 6540ac118473dde29cb02f786c79c64f73834ca1 Author: Colin Percival AuthorDate: 2024-10-31 22:45:03 +0000 Commit: Colin Percival CommitDate: 2024-10-31 22:45:03 +0000 modules: gpioaei only on ACPI-supporting archs Fixes: 9709bda03cd0 ("GPIO: Add ACPI _AEI support") Pointy-hat to: cperciva Sponsored by: Amazon --- sys/modules/gpio/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index 1d7f69f1836d..66090b1393bf 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,10 +24,14 @@ # SUCH DAMAGE. # -SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps .endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SUBDIR += gpioaei +.endif + .include From nobody Fri Nov 1 00:03:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfh0S2GmGz5bBKd; Fri, 01 Nov 2024 00:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfh0S1nQBz48j9; Fri, 1 Nov 2024 00:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730419416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=txB0YRloaPv85f1uvQ0hLdofxTG1vmMiDdu6JHSVOuM=; b=f1OLuXPwJGleCMQqIMC0tQ4IvcxFvs3MS8TVzlCFLWz1mnqnQJetxkPBhNMtYuHWHRqQq3 llh/r5w5Tpe9pO4EhGpgAX3OW7g6lDwyo8VEJCokgh/3hpU2Tztq51YdKAO4tjy4e5pDcI G5jUXN7TfWilcf+0kiW8TDy1+V9URxfAn9mxUvx2aThAvHL+MMupGztRA7Mfv4mxQfiL0U ty/DVJurobOrfUqOTFc4jdAD4/ZtBQyIVF9JcT/k4rNwxlpLJGW8CPY0+YRQiO7bSl3+2T w9kIePNMltbQpH5KkzXiq3MyfU0muN6KRPR3iIgxcbu19LMgqghEXrfik7AiHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730419416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=txB0YRloaPv85f1uvQ0hLdofxTG1vmMiDdu6JHSVOuM=; b=qL5y/x0JCfXHFFyfJg+Ti4QfjnhX03rvjnnK0XFLal/jlGBQEm4zPkaOQv+187OtOayWU2 fwg7llp1flocZ5R2PC+xVBWYVcXPqx37JNPcnn6/NKF48rf0TcGWD2uFz6wiuR7HLCR0jl lZOnpOzyxeFX13oYGFYYeiq2ZfNjDUuGF7962rtXSHRKxmx515nj+d2aNuGEFP7wd5tHIs EWo8IUmghAaRrBAf3FWSFnb+Kpx+AHD1reX8GIW9Mn1yB6qp96impAjYZ5QhwIjtSWzFDQ egiVCZjpEB6Cr0UI4pY7ponnoKlXJsJ+bIpKWG+LSfaRdUOb4gMOWKL8NfcfUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730419416; a=rsa-sha256; cv=none; b=MfFhSI1GMKhpFGOfx77Y/dk3I6vPr8QnZkvSlZascevHy9dAWhghuF1pWBLYHad7rJB1wu sLZzpKCR86woHJSptu3WZcQjVESCVr1xNYyN991sEMLfb3DRnNSckgJBeNSwr2Ap6WnecO 9uIUkqT2no15V9phsrKS+UPu0Lsv5nKD53kxjUW0HsdikTPZ7jj8617ImMlZPe6pB4JwUt Yc959FJ24hvSMIPp7eFZt7cGC0Hm0He0/kpHwz3jaH+NOlAx0GKOrqaxOKaNV30jRcw3/o ia/qqUTEWXAgXyPqXBWmBw0DjBfLwFaY6qNQbjhZvatRdLMdwQ6XAG2YPo4fKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfh0S1PNBzwtZ; Fri, 1 Nov 2024 00:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A103aDO079084; Fri, 1 Nov 2024 00:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A103aVr079081; Fri, 1 Nov 2024 00:03:36 GMT (envelope-from git) Date: Fri, 1 Nov 2024 00:03:36 GMT Message-Id: <202411010003.4A103aVr079081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4e8444d5750a - stable/14 - Post-14.2-branch updates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4e8444d5750a5d9da9c812e8f6caf6d62862be0a Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4e8444d5750a5d9da9c812e8f6caf6d62862be0a commit 4e8444d5750a5d9da9c812e8f6caf6d62862be0a Author: Colin Percival AuthorDate: 2024-11-01 00:03:16 +0000 Commit: Colin Percival CommitDate: 2024-11-01 00:03:16 +0000 Post-14.2-branch updates Rename stable/14 to -STABLE Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9176ee00e9e3..c77c3818c566 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.2" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index a900131fe8ec..926485f34572 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1401503 +#define __FreeBSD_version 1402500 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Nov 1 00:03:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xfh0T3NTNz5b9vg; Fri, 01 Nov 2024 00:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfh0T2wjbz48gR; Fri, 1 Nov 2024 00:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730419417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tuQIMSBPgJ9ZCv70KgnXLqoQt9ZEvrCHgSpGOIFm9qg=; b=THqwA+oEbBr342+89cjpupS9u5avf3DGB3CqySB6WTHzKW5/jowjo5LiWmLNk4RhY2CeXT Hk/h6KX+5OUnBwqGbxwI9cUkxe6rtRqFrXZk1e5sXOacpftIH9VVqaVNvW8AVTPOycx1XY bZ9Lb8OFWVx7f9RZH+uqbcHiMUOQXX62Mf5MJ+ChGy99rS2pOM7+pUaoJdemanTrtfAtFF ZBfcViyKeI5grS5xShEhOYBnmh6NA+g4vEDVveauN2Oe4rSe5p027RQG0TILHtfS946URA 6blxRtzhDoZcFRxzlj2ak6xdIgkue7rfGzXtYGqODfdHAUfxnZOiWB9duKtXFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730419417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tuQIMSBPgJ9ZCv70KgnXLqoQt9ZEvrCHgSpGOIFm9qg=; b=p8wBuLPYKbIFdd6mJ9mQ4VtGhkG37Bv3miPoCq2Mg34qhBAmpZHD0mtM2VCU/i7ZB5fxqj cSEu/I7oIc8xtOLvu7ZhGcQRwQqR9TU3njwb8wngXsVGT1OVPSlP6IvV1g8+WG0FVgR4rj rwq4i+dVz0yxIboKp9GDiQ8vsNsT1HdLt+3s14s8OEzGbFVHYB3jZ8wV3TAV2+RnhWvrjx 4pYSI2oqqrOY9arXOYtDQyyqKrRo5vH+oBHmZu/IjJFEbMzhvlhuFOoKPwazpwu0ddXADN 97SYKBhb5BiF+htSrPg2je3MId7+ewnSlPtsujeX8FLfFPoj7W9WGV7TCLLlXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730419417; a=rsa-sha256; cv=none; b=ApXCJidUv+m6v+33uOPBw0VZ5JxikIbLSa4rniR8lUWTVC4Dk3+TjyC/lISZLxLqSf5yHp sDwWOPctz/lWjZiQfyNvQhwPnbYiKe/bnAqA5SzrpebCuVCsVOvZ24CqOK2br43rbvGKnV t98O8lQv0FwOllX47SRbr3uwKmkeGRGSuLf0MaUnYu8V2i4c7lzPXCVCaQE0rsb/M7A6qf u2VfEJ3LbzcLKmKiBvF1qJqZJFwL70IWjCuhtbrAAM/kuQDLQFDC4lDEi3VxdyQdJEPtAH 7n+Sw3vsjiC8uwiCuv8/TG2M35waBN32oxqetaNXSX2Qb0lp4IwGao4EPqoasA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xfh0T2WPfzxgt; Fri, 1 Nov 2024 00:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A103btl079138; Fri, 1 Nov 2024 00:03:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A103bCI079135; Fri, 1 Nov 2024 00:03:37 GMT (envelope-from git) Date: Fri, 1 Nov 2024 00:03:37 GMT Message-Id: <202411010003.4A103bCI079135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 603608e520f0 - releng/14.2 - 14.2: create releng/14.2 branch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 603608e520f01b4626b63d98a6926cef5b297887 Auto-Submitted: auto-generated The branch releng/14.2 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=603608e520f01b4626b63d98a6926cef5b297887 commit 603608e520f01b4626b63d98a6926cef5b297887 Author: Colin Percival AuthorDate: 2024-11-01 00:02:35 +0000 Commit: Colin Percival CommitDate: 2024-11-01 00:02:35 +0000 14.2: create releng/14.2 branch Update from PRERELEASE to BETA1 Switch pkg(8) configuration to use the quarterly repository Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index c2e64c43a56f..600c309d5979 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9176ee00e9e3..385b47891a43 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.2" -BRANCH="PRERELEASE" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index a900131fe8ec..5d9c19974d6b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1401503 +#define __FreeBSD_version 1402000 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Nov 1 13:38:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg25P6K8dz5bGxV; Fri, 01 Nov 2024 13:39:05 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg25P5ngKz4W3C; Fri, 1 Nov 2024 13:39:05 +0000 (UTC) (envelope-from garga@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730468345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ZjOj0FkCb6WSgG/isTeDq504AE0OZGdKjFcKa8O6kTU=; b=AJcyS0hSaa3mLtmlUI5jCk1s6u0IkxoSnH73fx0vh1lnakxNIp20sD9XUJxE5+ZZMtPb+y i+LKfMUUIZss9FhCWpv1qQIDMXolDQK1PgM4xpu40KgEjMin1ejomDBGoB8mJdzRMMG6/d Do7au1I3ZPjohNCFgq6OZajrRQgARLMfn0iqnmqCOCijrxIZKdIyXRlEQxsVERlRTc1Th9 tffWVVHKkp6MmR+tSPWzF91u3n5JJ8jfXhHDczDXT5LYSxZoqTrn+G7KRomr5APfx2V8o/ I7ors8KEbmbzqtvYQszmDUEvhp6tod6kyaEy0Cad3MYSw8uWNSsKJfNy987eqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730468345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=ZjOj0FkCb6WSgG/isTeDq504AE0OZGdKjFcKa8O6kTU=; b=j1aDjxQtaxqCf2wH8GVzFwLhSzb41dvgYBW7KSDCHvWZefNL2oFYXmY64CsEmtkd6p/k09 BsCtu4vqrkRuKzTF45SNTalW8xZ45wyS6pYKKzQdrlfEacHC2TXcjPhG9hi5PWz7R8pffd GMgAk3ie7zvJhnqIvXL2Vb1ZApZvf+vQIg8evWtLlDLy2Wopxthb91EE4p+XQzFzREM+jX a5pZzKaZHvLvn+RM3ltLNvBK2uJfIxoYCRg749QnGYWuVf0S5T0Sl4mlZo9e8YRoMmhW8O BS1ad1nCRuDZKWBHcewfGirSf/WhXWvs9IIvyIodp/zTabPU4KleQ+9O2ET1pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730468345; a=rsa-sha256; cv=none; b=F8k/IHkJLi3nYLJ/EYHXMEaDvIYmJJ3s3oMCcTWrZtIYnz8h+REpIUf4eDkl3Nof7Tzf2Z 5QEgDcCPXpJophb9lj87amjAagtYtPVPwfknf4/KEvGpCeZejh9TSLVqbiORhub1U+Na8a +qXokk9HWJlH56mOiakvHQGCrMO0htHvQJRqWEwc+80ByYYXdmIyvIGv44PQHNz4WKbrjx THvMZECtLxr0gH3imHObrbgPvEscE19ezOPcMUH5dJLgeMQk5bqMzgvAWWWMUzyAnzwb5W TlGwUYAwOewwcQjU0XEpqToISTyJLYnz7umpz3tLk8WTNop6E791heMBofV5og== Received: from [IPV6:2804:f1c:8c9:8000:11c4:a398:9579:36f0] (unknown [IPv6:2804:f1c:8c9:8000:11c4:a398:9579:36f0]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: garga) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xg25N70kCz1XmV; Fri, 1 Nov 2024 13:39:04 +0000 (UTC) (envelope-from garga@FreeBSD.org) Message-ID: Date: Fri, 1 Nov 2024 10:38:59 -0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: git: f3dbef108212 - main - Bump __FreeBSD_version for llvm 19.1.2 merge To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202410231832.49NIWkas078103__1245.09599279321$1729708469$gmane$org@gitrepo.freebsd.org> Content-Language: en-US From: Renato Botelho Autocrypt: addr=garga@FreeBSD.org; keydata= xsBNBGStavwBCACjNlp/9+Y+VFe9ieR2h/WWbdvjz4Mb2z/f22bGoaskzCfvVNbo/v3i34I9 H6OdgZkGqheQEAD2jNfRbmPr4z40xDMUpYGLds+1Mvg7G3Hms3j5Ef8KaLSWUNWIfwKdfSVR Qs35ccSJxAdRW5YdI6J3xZgika+3Bc4eJ05YE/nWW+PNTYevt5rqD50N3zybVYIcLoqVPpBi AZE/sf5SLiLACIJb1t/s4x+pi8vgWevxVVT9u8V1f8zYErmHSLSqjxii0B3eRZphX9NCJOv9 +tfFZhnENInhn9gT7H4e2YumUltEy3jacONHJF3CC1pvvWEa6lEyypclMOkHQwNON7DLABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4FAheAFiEERL7Dxegbnh7xTiQ5Ob6P xxJcZXoFAmSta78CGQEACgkQOb6PxxJcZXrYlggAgaZmr6c1yIWzN8VksHrHpwt/uxONEP+h ljy3yfrMsgfS5wx5Uzgfih1xYZUFC6jiI63CetqBqJpp3g1klRS1UWYKx2NeXphDMYZEdPm/ a6sXh4bKZbk6IE8Yn0/YiRT57d9DtbvswC7Gn7Igj/MSbhl49TvTGyvuB6juaffVoYZViomx 5zMoee8Ml2o2qj3MrCJ+/K8GU54RlpOGqGRsqdwVdr9XEWub6fF2YFwR46cjmbiU3P5urFHH nkJlBGPIwKxHimTW0lZsdx9aCKRDd/D80/WOEzXmk3k8B9lv/GsvOluHmveLhJG1R1tIJ31I f2q8dfTvqsQXnu8CcWRcgc7ATQRkrWr8AQgA1DufoxScA+CWQbUR6zExIu8wXQKrhuRt4DG2 BgynT7EMUvEBadcbQRZXsBpemNfncc9Axyut/+rWiyKJf9BLQuo/9QYmSRvW1U6+0LJUYmdg kMyBeYaPk+vnssv/u9jLuvV7FVgyE0yk1iaWIKOVDD+XrQCOvGw9uSceBrQyCyo3A/eRM/+p vnDCaywR63PKE+3axk6lfNdGK3TnaWmS30/ZDCZlNsXuqprqR4JdT5wXids5o36dsuJ5EZ20 s5hNMD34s4Yr1Y1R9elH6qBsFCpozs0+jwrArxq+UJJCR6hH5W8ZEwJtRC8tzR8mRE1WywzX BXYj0YhfGztQIxZckQARAQABwsB8BBgBCgAmFiEERL7Dxegbnh7xTiQ5Ob6PxxJcZXoFAmSt avwCGwwFCQWjmoAACgkQOb6PxxJcZXr1vgf/SKXhoZcUU5I7TqcbHg0lJz9tICTupCGHWr/s SQgjh9oEM5j1wqW7FlCGP90Tl9K0g3ow9YdbhU7VK470o6pymX9V9eLHzGgkZO/KMEtGBeK1 u+5ePjCJ/MK5B21KODLSU7WrIL1VN5ceXfQPLYt02LMLtPri+oduHD6RNBeA7US1DUzleq5F 9NHGbvV2U7BdDUezpiO8NaFjFZVB11I5d99FxUM5XGVstI3VhsRKZxjY0KnqJzaQgTFsPGmv AUfZVIN1pXgXiedhPXpr8+Y64jP+pHVwpVmh1zYWL6+q3kqFOUVP6c5iiMeoEXZvgJz7x/AC ek3X5gvu8Hpcv+MZIg== In-Reply-To: <202410231832.49NIWkas078103__1245.09599279321$1729708469$gmane$org@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 23/10/24 15:32, Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f3dbef108212460489ae68b4c47e20b73984f433 > > commit f3dbef108212460489ae68b4c47e20b73984f433 > Author: Dimitry Andric > AuthorDate: 2024-10-23 16:49:02 +0000 > Commit: Dimitry Andric > CommitDate: 2024-10-23 18:27:43 +0000 > > Bump __FreeBSD_version for llvm 19.1.2 merge > > PR: 280562 > MFC after: 1 month > --- > sys/sys/param.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/sys/param.h b/sys/sys/param.h > index 8af2f9594bc1..7647c0d6e518 100644 > --- a/sys/sys/param.h > +++ b/sys/sys/param.h > @@ -73,7 +73,7 @@ > * cannot include sys/param.h and should only be updated here. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1500025 > +#define __FreeBSD_version 1500026 > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > > open-vm-tools build fails after llvm19 import. I will have time to look at it next week but maybe it's something trivial so I will leave log here just in case https://idaho.arrakis.com.br/data/main-amd64-default/2024-11-01_09h39m06s/logs/errors/open-vm-tools-12.5.0,2.log -- Renato Botelho From nobody Fri Nov 1 14:07:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2kF1CLDz5bpQj; Fri, 01 Nov 2024 14:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2kF0fp8z4YWr; Fri, 1 Nov 2024 14:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4bBsuCsZO40MGudRzjQMyOtUso8XTfNEHvnvqfkwcA=; b=Ma9w7JKjkZUj7Oxck72jA6LI339wxF2Dm9uM5BWzu6DRqvIjDjERap6BSnD5bAdUu6fTnU 9J1Q/8otdvPIVDvu2nLujs1kTk1xdP9quqUzvNistwq6K4EbIyJpD16hb/nTK4+1/pqJNx Nyotod8uB4FvlVDAMvEvly5xDNqN5GaAL71rqb77+JfuNG1ff8XwzMnbmh+yQt+NFe0cJC I2NvwvRa91w1UqaZxCdhyVoHfajad69kSTV6Wvl9h/xnNTrg9L+b9coq0Tv5SXe5QPJhT7 mhFPpMdrXwWKAtmJ+m9B/0SC9fT7HVX2B+efVYXeI+/NCGhnXuTmAiKrLfPniQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4bBsuCsZO40MGudRzjQMyOtUso8XTfNEHvnvqfkwcA=; b=sH7K/xar8ud1adu2DURmooLtRHja73gySnClUXsb+lRqvWnK5BZoUEfdjS61UQSOAYKIIc z50vG4wV/ovijPlc4mCSAYYjEr96wyIRhydHZ1ayPtAstJoWpB0FboqsBAOJAEakDOqhd2 2Am3ovXRQNpgKHkz4y/N7w+UM3dc8AdujPwwgAVqNE9lLgiuNA3AxqC27ufoOwe2z/rMNO 6AsXgb9y75wrtteEXAjRIvmycR8uWMjIbaOcBEJvBBAj4M8H5wI4/RhDhWDuCbuxDJE/ZX DMz9G7g13jHSZbLoak+mBAEXKHcqprgKL3ikNsaCqTM2JOzDlfXo3il2HLjHsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470053; a=rsa-sha256; cv=none; b=LbuxMWJuu4H1p9c019tRrxOJ36VxVQlvg8zfAt2VcLYBP69Wn4GQFbP4zCxXhOLo2JUKc7 R6DnsZeuKihX+He/i41U6cRAbGF9mK6HCyg653V6ZdUkKGV60KdlaHwQLWHHZbiSoWmXoX Y6TnORgEMELSbw7LxkIh2GPHkTMKWTy8lxahDwt5qP2ldJDgKCoH7Q7IbdZES7mOPSYvhR 137V+dtCUvXeF/9Eyrbir6aczQGaxFwr1GOpKLzvPmbT4NdaxpPbADO1MOIRCXEHw+cxsx gWiK7n8tLNoKAoHndw4tjw2z1xQ5rdBo4LVNLdeRtH/IxxihJcVSGdUFfRpWPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2kF0F3yzNCG; Fri, 1 Nov 2024 14:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1E7WkR041352; Fri, 1 Nov 2024 14:07:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1E7Wst041349; Fri, 1 Nov 2024 14:07:32 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:07:32 GMT Message-Id: <202411011407.4A1E7Wst041349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a0069f16fe23 - main - tools: Add a couple of utilities which were useful for testing SO_SPLICE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0069f16fe235068fac8fac8d11aee4c5dac6e8c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a0069f16fe235068fac8fac8d11aee4c5dac6e8c commit a0069f16fe235068fac8fac8d11aee4c5dac6e8c Author: Mark Johnston AuthorDate: 2024-11-01 14:02:40 +0000 Commit: Mark Johnston CommitDate: 2024-11-01 14:02:40 +0000 tools: Add a couple of utilities which were useful for testing SO_SPLICE Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47308 --- tools/tools/README | 1 + tools/tools/so_splice/Makefile | 12 ++ tools/tools/so_splice/pingpong.c | 197 +++++++++++++++++ tools/tools/so_splice/proxy.c | 451 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 661 insertions(+) diff --git a/tools/tools/README b/tools/tools/README index 45f1d09f2d21..c5b42d08ff0d 100644 --- a/tools/tools/README +++ b/tools/tools/README @@ -52,6 +52,7 @@ pciid Generate src/share/misc/pci_vendors. pciroms A tool for dumping PCI ROM images. WARNING: alpha quality. pirtool A tool for dumping the $PIR table on i386 machines at runtime. scsi-defects Get at the primary or grown defect list of a SCSI disk. +so_splice Utilities relating to the SO_SPLICE socket option. sysdoc Build a manual page with available sysctls for a specific kernel configuration. track Track the progress of a world / kernel build diff --git a/tools/tools/so_splice/Makefile b/tools/tools/so_splice/Makefile new file mode 100644 index 000000000000..57ced2fc7b47 --- /dev/null +++ b/tools/tools/so_splice/Makefile @@ -0,0 +1,12 @@ +PROGS= pingpong proxy + +MAN= + +WARNS?= 6 + +.if defined(SRCDIR) +CFLAGS+= -I${SRCDIR}/include \ + -I${SRCDIR}/sys +.endif + +.include diff --git a/tools/tools/so_splice/pingpong.c b/tools/tools/so_splice/pingpong.c new file mode 100644 index 000000000000..bfcd7f4e0736 --- /dev/null +++ b/tools/tools/so_splice/pingpong.c @@ -0,0 +1,197 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Klara, Inc. + */ + +/* + * A utility which implements a simple ping-pong over TCP, and prints the amount + * of time elapsed for each round trip. + */ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static void +usage(void) +{ + fprintf(stderr, +"usage: pingpong [-c [-l ] [-n ]\n"); + exit(1); +} + +static void +addrinfo(struct sockaddr_storage *ss, const char *addr) +{ + struct addrinfo hints, *res, *res1; + char *host, *port; + int error; + + host = strdup(addr); + if (host == NULL) + err(1, "strdup"); + port = strchr(host, ':'); + if (port == NULL) + errx(1, "invalid address '%s', should be :", host); + *port++ = '\0'; + + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(host, port, &hints, &res); + if (error != 0) + errx(1, "%s", gai_strerror(error)); + for (res1 = res; res != NULL; res = res->ai_next) { + if (res->ai_protocol == IPPROTO_TCP) { + memcpy(ss, res->ai_addr, res->ai_addrlen); + break; + } + } + if (res == NULL) + errx(1, "no TCP address found for '%s'", host); + free(host); + freeaddrinfo(res1); +} + +int +main(int argc, char **argv) +{ + char buf[1024]; + struct sockaddr_storage ss; + char *addr; + size_t len; + int ch, count, s; + enum { NONE, CLIENT, SERVER } mode; + + count = 0; + len = 0; + mode = NONE; + while ((ch = getopt(argc, argv, "c:l:n:s:")) != -1) { + switch (ch) { + case 'c': + addr = optarg; + mode = CLIENT; + break; + case 'l': + len = strtol(optarg, NULL, 10); + if (len > sizeof(buf)) + errx(1, "message size too large"); + if (len == 0) + errx(1, "message size must be non-zero"); + break; + case 'n': + count = strtol(optarg, NULL, 10); + if (count <= 0) + errx(1, "count must be positive"); + break; + case 's': + addr = optarg; + mode = SERVER; + break; + default: + usage(); + break; + } + } + + if (mode == NONE) + usage(); + if (mode == SERVER && len != 0) + usage(); + + if (mode == CLIENT) { + if (len == 0) + len = 1; + if (count == 0) + count = 1; + } + + addrinfo(&ss, addr); + + s = socket(ss.ss_family, SOCK_STREAM, 0); + if (s == -1) + err(1, "socket"); + if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &(int){1}, sizeof(int)) == + -1) + err(1, "setsockopt"); + + if (mode == CLIENT) { + struct timespec ts1, ts2; + ssize_t n; + + memset(buf, 'a', len); + if (connect(s, (struct sockaddr *)&ss, ss.ss_len) == -1) + err(1, "connect"); + + for (int i = 0; i < count; i++) { + int64_t ns; + + clock_gettime(CLOCK_MONOTONIC, &ts1); + n = write(s, buf, len); + if (n < 0) + err(1, "write"); + n = read(s, buf, len); + if (n < 0) + err(1, "read"); + if ((size_t)n < len) + errx(1, "unexpected short read"); + clock_gettime(CLOCK_MONOTONIC, &ts2); + + ns = (ts2.tv_sec - ts1.tv_sec) * 1000000000 + + (ts2.tv_nsec - ts1.tv_nsec); + printf("round trip time: %ld.%02ld us\n", ns / 1000, + (ns % 1000) / 10); + for (size_t j = 0; j < len; j++) { + if (buf[j] != 'b') + errx(1, "unexpected data"); + } + } + } else /* if (mode == SERVER) */ { + int cs; + + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &(int){1}, + sizeof(int)) == -1) + err(1, "setsockopt"); + if (bind(s, (struct sockaddr *)&ss, ss.ss_len) == -1) + err(1, "bind"); + if (listen(s, 1) == -1) + err(1, "listen"); + + for (;;) { + ssize_t n; + + cs = accept(s, NULL, NULL); + if (cs == -1) + err(1, "accept"); + + for (;;) { + n = read(cs, buf, sizeof(buf)); + if (n < 0) { + if (errno == ECONNRESET) + break; + err(1, "read"); + } + if (n == 0) + break; + memset(buf, 'b', n); + n = write(cs, buf, n); + if (n < 0) + err(1, "write"); + } + (void)close(cs); + } + } + + return (0); +} diff --git a/tools/tools/so_splice/proxy.c b/tools/tools/so_splice/proxy.c new file mode 100644 index 000000000000..409a47225522 --- /dev/null +++ b/tools/tools/so_splice/proxy.c @@ -0,0 +1,451 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Klara, Inc. + */ + +/* + * A simple TCP proxy. Listens on a local address until a connection appears, + * then opens a TCP connection to the target address and shuttles data between + * the two until one side closes its connection. + * + * For example: + * + * $ proxy -l 127.0.0.1:8080 www.example.com:80 + * + * The -m flag selects the mode of the transfer. Specify "-m copy" to enable + * copying through userspace, and "-m splice" to use SO_SPLICE. + * + * The -L flag enables a loopback mode, wherein all data is additionally proxied + * through a loopback TCP connection. This exists mostly to help test a + * specific use-case in custom proxy software where we would like to use + * SO_SPLICE. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct proxy_softc { + struct sockaddr_storage lss; + struct sockaddr_storage tss; + size_t bufsz; + enum proxy_mode { PROXY_MODE_COPY, PROXY_MODE_SPLICE } mode; + bool loopback; +}; + +static void +usage(void) +{ + fprintf(stderr, +"usage: proxy [-m copy|splice] [-s ] [-L] -l \n"); + exit(1); +} + +static void +proxy_copy(struct proxy_softc *sc, int cs, int ts) +{ + struct kevent kev[2]; + uint8_t *buf; + int kq; + + kq = kqueue(); + if (kq == -1) + err(1, "kqueue"); + + EV_SET(&kev[0], cs, EVFILT_READ, EV_ADD, 0, 0, (void *)(uintptr_t)ts); + EV_SET(&kev[1], ts, EVFILT_READ, EV_ADD, 0, 0, (void *)(uintptr_t)cs); + if (kevent(kq, kev, 2, NULL, 0, NULL) == -1) + err(1, "kevent"); + + buf = malloc(sc->bufsz); + if (buf == NULL) + err(1, "malloc"); + + for (;;) { + uint8_t *data; + ssize_t n, resid; + int rs, ws; + + if (kevent(kq, NULL, 0, kev, 2, NULL) == -1) { + if (errno == EINTR) + continue; + err(1, "kevent"); + } + + rs = (int)kev[0].ident; + ws = (int)(uintptr_t)kev[0].udata; + + n = read(rs, buf, sc->bufsz); + if (n == -1) { + if (errno == ECONNRESET) + break; + err(1, "read"); + } + if (n == 0) + break; + + data = buf; + resid = n; + do { + n = write(ws, data, resid); + if (n == -1) { + if (errno == EINTR) + continue; + if (errno == ECONNRESET || errno == EPIPE) + break; + err(1, "write"); + } + assert(n > 0); + data += n; + resid -= n; + } while (resid > 0); + } + + free(buf); + close(kq); +} + +static void +splice(int s1, int s2) +{ + struct splice sp; + + memset(&sp, 0, sizeof(sp)); + sp.sp_fd = s2; + if (setsockopt(s1, SOL_SOCKET, SO_SPLICE, &sp, sizeof(sp)) == -1) + err(1, "setsockopt"); +} + +static void +proxy_splice(struct proxy_softc *sc __unused, int cs, int ts) +{ + struct kevent kev[2]; + int error, kq; + + /* Set up our splices. */ + splice(cs, ts); + splice(ts, cs); + + /* Block until the connection is terminated. */ + kq = kqueue(); + if (kq == -1) + err(1, "kqueue"); + EV_SET(&kev[0], cs, EVFILT_READ, EV_ADD, 0, 0, NULL); + EV_SET(&kev[1], ts, EVFILT_READ, EV_ADD, 0, 0, NULL); + do { + error = kevent(kq, kev, 2, kev, 2, NULL); + if (error == -1 && errno != EINTR) + err(1, "kevent"); + } while (error <= 0); + + close(kq); +} + +static void +nodelay(int s) +{ + if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &(int){1}, sizeof(int)) == + -1) + err(1, "setsockopt"); +} + +/* + * Like socketpair(2), but for TCP sockets on the loopback address. + */ +static void +tcp_socketpair(int out[2], int af) +{ + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + struct sockaddr *sa; + int sd[2]; + + sd[0] = socket(af, SOCK_STREAM, 0); + if (sd[0] == -1) + err(1, "socket"); + sd[1] = socket(af, SOCK_STREAM, 0); + if (sd[1] == -1) + err(1, "socket"); + + nodelay(sd[0]); + nodelay(sd[1]); + + if (af == AF_INET) { + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sin.sin_port = 0; + sin.sin_len = sizeof(sin); + sa = (struct sockaddr *)&sin; + } else if (af == AF_INET6) { + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_addr = in6addr_loopback; + sin6.sin6_port = 0; + sin6.sin6_len = sizeof(sin6); + sa = (struct sockaddr *)&sin6; + } else { + errx(1, "unsupported address family %d", af); + } + + if (bind(sd[0], sa, sa->sa_len) == -1) + err(1, "bind"); + if (listen(sd[0], 1) == -1) + err(1, "listen"); + + if (getsockname(sd[0], sa, &(socklen_t){sa->sa_len}) == -1) + err(1, "getsockname"); + if (connect(sd[1], sa, sa->sa_len) == -1) + err(1, "connect"); + + out[0] = sd[1]; + out[1] = accept(sd[0], NULL, NULL); + if (out[1] == -1) + err(1, "accept"); + close(sd[0]); +} + +/* + * Proxy data between two connected TCP sockets. Returns the PID of the process + * forked off to handle the data transfer. + */ +static pid_t +proxy(struct proxy_softc *sc, int s1, int s2) +{ + pid_t child; + + child = fork(); + if (child == -1) + err(1, "fork"); + if (child != 0) { + close(s1); + close(s2); + return (child); + } + + if (sc->mode == PROXY_MODE_COPY) + proxy_copy(sc, s1, s2); + else + proxy_splice(sc, s1, s2); + _exit(0); +} + +/* + * The proxy event loop accepts connections and forks off child processes to + * handle them. We also handle events generated when child processes exit + * (triggered by one side closing its connection). + */ +static void +eventloop(struct proxy_softc *sc) +{ + struct kevent kev; + int kq, lsd; + pid_t child; + + lsd = socket(sc->lss.ss_family, SOCK_STREAM, 0); + if (lsd == -1) + err(1, "socket"); + if (setsockopt(lsd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)) == + -1) + err(1, "setsockopt"); + if (bind(lsd, (struct sockaddr *)&sc->lss, sc->lss.ss_len) == -1) + err(1, "bind"); + if (listen(lsd, 5) == -1) + err(1, "listen"); + + kq = kqueue(); + if (kq == -1) + err(1, "kqueue"); + EV_SET(&kev, lsd, EVFILT_READ, EV_ADD, 0, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) + err(1, "kevent"); + + for (;;) { + if (kevent(kq, NULL, 0, &kev, 1, NULL) == -1) { + if (errno == EINTR) + continue; + err(1, "kevent"); + } + + switch (kev.filter) { + case EVFILT_READ: { + int s, ts; + + if ((int)kev.ident != lsd) + errx(1, "unexpected event ident %d", + (int)kev.ident); + + s = accept(lsd, NULL, NULL); + if (s == -1) + err(1, "accept"); + nodelay(s); + + ts = socket(sc->tss.ss_family, SOCK_STREAM, 0); + if (ts == -1) + err(1, "socket"); + nodelay(ts); + if (connect(ts, (struct sockaddr *)&sc->tss, + sc->tss.ss_len) == -1) + err(1, "connect"); + + if (sc->loopback) { + int ls[2]; + + tcp_socketpair(ls, sc->tss.ss_family); + child = proxy(sc, ls[0], ts); + EV_SET(&kev, child, EVFILT_PROC, EV_ADD, + NOTE_EXIT, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) + err(1, "kevent"); + child = proxy(sc, s, ls[1]); + EV_SET(&kev, child, EVFILT_PROC, EV_ADD, + NOTE_EXIT, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) + err(1, "kevent"); + } else { + child = proxy(sc, s, ts); + EV_SET(&kev, child, EVFILT_PROC, EV_ADD, + NOTE_EXIT, 0, NULL); + if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) + err(1, "kevent"); + } + + break; + } + case EVFILT_PROC: { + int status; + + child = kev.ident; + status = (int)kev.data; + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0) { + errx(1, "child exited with status %d", + WEXITSTATUS(status)); + } + } else if (WIFSIGNALED(status)) { + warnx("child %d terminated by signal %d", + (pid_t)kev.ident, WTERMSIG(status)); + } + if (waitpid(child, NULL, 0) == -1) + err(1, "waitpid"); + break; + } + } + } +} + +static void +addrinfo(struct sockaddr_storage *ss, const char *addr) +{ + struct addrinfo hints, *res, *res1; + char *host, *port; + int error; + + host = strdup(addr); + if (host == NULL) + err(1, "strdup"); + port = strchr(host, ':'); + if (port == NULL) + errx(1, "invalid address '%s', should be :", host); + *port++ = '\0'; + + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(host, port, &hints, &res); + if (error != 0) + errx(1, "%s", gai_strerror(error)); + for (res1 = res; res != NULL; res = res->ai_next) { + if (res->ai_protocol == IPPROTO_TCP) { + memcpy(ss, res->ai_addr, res->ai_addrlen); + break; + } + } + if (res == NULL) + errx(1, "no TCP address found for '%s'", host); + free(host); + freeaddrinfo(res1); +} + +static void +proxy_init(struct proxy_softc *sc, const char *laddr, const char *taddr, + size_t bufsz, enum proxy_mode mode, bool loopback) +{ + addrinfo(&sc->lss, laddr); + addrinfo(&sc->tss, taddr); + + sc->bufsz = bufsz; + sc->mode = mode; + sc->loopback = loopback; +} + +int +main(int argc, char **argv) +{ + struct proxy_softc sc; + char *laddr, *taddr; + size_t bufsz; + enum proxy_mode mode; + int ch; + bool loopback; + + (void)signal(SIGPIPE, SIG_IGN); + + loopback = false; + mode = PROXY_MODE_COPY; + bufsz = 2 * 1024 * 1024ul; + laddr = taddr = NULL; + while ((ch = getopt(argc, argv, "Ll:m:s:")) != -1) { + switch (ch) { + case 'l': + laddr = optarg; + break; + case 'L': + loopback = true; + break; + case 'm': + if (strcmp(optarg, "copy") == 0) + mode = PROXY_MODE_COPY; + else if (strcmp(optarg, "splice") == 0) + mode = PROXY_MODE_SPLICE; + else + usage(); + break; + case 's': + bufsz = atoi(optarg); + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (laddr == NULL || argc != 1) + usage(); + taddr = argv[0]; + + /* Marshal command-line parameters into a neat structure. */ + proxy_init(&sc, laddr, taddr, bufsz, mode, loopback); + + /* Start handling connections. */ + eventloop(&sc); + + return (0); +} From nobody Fri Nov 1 14:13:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rY19sYz5bpbB; Fri, 01 Nov 2024 14:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rX73Nfz4bNW; Fri, 1 Nov 2024 14:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqhcruNsZhhexxHG4T05JXWmf94qcAPbBPtrd8WLrec=; b=yez/9t3OJoZlt+DdcxKB0wl3/3eLwv4GvlNDr0cuGTA+V6cdTt1XeyjE2j9cTuvx3Kooey 7UlfPje75N5IX7KSTtYBn5ACul819Q3yocLxNDj9MW/HKIyzMzGJwZGNm/NzNh92GqnIkC ER4CMgX2tWRiXUsYM2oRAklGV82/wJayGceW2O6rHSshoNx3ZOc3QVFZ5DlNnKHWdjgDp9 PuWoW0AkWw4n6SgWxlihGqYmjhhtlRq+cDEuo+5OZsWlLXgdx1L+Ipc/kRtViySJmzM/c0 5JZ3vW5zYBAfUYvqwM9ep/wLa6LhKvrquOWpqHLFitgCW0uzsn9rC9GcqrT7Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqhcruNsZhhexxHG4T05JXWmf94qcAPbBPtrd8WLrec=; b=VTfXhcSN8bjXbJzvRGztt4QedGrAoUZf/BQW/89i/gniQ91SkTfN5gZqoXJToNBRw5TAC/ /l2ShXI000eFonljklZwXkTIF0oKfA/WYfFAJ58c3chCs7n7wbsbIlEc90EYkeKs28haHf ORi9RZ1AKGy3JRNw7Yta2cjjMvZYozAcyLXBewP1c7C3XOFjv6VemExGVL78IJCqmQ2U53 sUfay5nemKEJhXP52p4ACA89HXmNpqUZ2WtTAoRpODv3b+6yY/M9de5S4jxpW4KiFetVIq hkZwvRN5weJ8wuBAIsbMXIjzf72wIixOWyb6POic9tozexOoVlxiUYaknfdyCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470381; a=rsa-sha256; cv=none; b=W9oBJshFptBAkVStNV43K8Xn3xVi01HliA1y1TtFtxDzAYYekAzcnxCEzbo775iiiikr4F T7IATySPkFq6NUNjSCm9hn+iqjO6H+0BtbaAHLikpN5NKSCESlB/qpmkLPvtTVuIafMhhf 0Js2mkpi9TTN6xN9SgaRpT7gAPYosldpfPFlv9OpXDVujFctD7b4O8SXOVaedtedIsHgjF I4I7vKSY/0izsvw2/OMq8izPaow2gEaCkDyxoRdDTkUzdwY7MY8ZYJ9XCAdhEU1pE2O5oY fSfQDYXLhScPFy8phdHsfGsmcUXYsukd1YB/oBsR89Nxz36GyMlMWl5i+2g9yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rX6gRLzNpB; Fri, 1 Nov 2024 14:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED0l5059253; Fri, 1 Nov 2024 14:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED0wu059250; Fri, 1 Nov 2024 14:13:00 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:00 GMT Message-Id: <202411011413.4A1ED0wu059250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5c7af84925aa - main - nvdimm: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c7af84925aa0916983551b0d470b461a70c0f1f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5c7af84925aa0916983551b0d470b461a70c0f1f commit 5c7af84925aa0916983551b0d470b461a70c0f1f Author: John Baldwin AuthorDate: 2024-11-01 14:08:44 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:08:44 +0000 nvdimm: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47363 --- sys/dev/nvdimm/nvdimm_acpi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c index a8e5db0542f2..f6a7ebe6e2b9 100644 --- a/sys/dev/nvdimm/nvdimm_acpi.c +++ b/sys/dev/nvdimm/nvdimm_acpi.c @@ -197,13 +197,18 @@ nvdimm_root_attach(device_t dev) return (error); } +static void +nvdimm_root_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_NVDIMM_ACPI); +} + static int nvdimm_root_detach(device_t dev) { struct nvdimm_root_dev *root; struct SPA_mapping *spa, *next; - device_t *children; - int i, error, num_children; + int error; root = device_get_softc(dev); SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { @@ -215,12 +220,6 @@ nvdimm_root_detach(device_t dev) error = bus_generic_detach(dev); if (error != 0) return (error); - error = device_get_children(dev, &children, &num_children); - if (error != 0) - return (error); - for (i = 0; i < num_children; i++) - free(device_get_ivars(children[i]), M_NVDIMM_ACPI); - free(children, M_TEMP); error = device_delete_children(dev); return (error); } @@ -264,6 +263,7 @@ static device_method_t nvdimm_acpi_methods[] = { DEVMETHOD(device_attach, nvdimm_root_attach), DEVMETHOD(device_detach, nvdimm_root_detach), DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_child_deleted, nvdimm_root_child_deleted), DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), DEVMETHOD(bus_child_location, nvdimm_root_child_location), From nobody Fri Nov 1 14:13:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rZ36pXz5bpgF; Fri, 01 Nov 2024 14:13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rZ12F9z4bWN; Fri, 1 Nov 2024 14:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgB/h6R//DUnwCymozdId8VDwYccAUOSB6WEq3lWioI=; b=e6AY1lBXB7gY7LLh/Mg1WQF+iZLz4LFBM4YpHB/N5NnVxJdlXSf/fjCrrwWLQOL1z/ahcP dGpeo8RL9KUCGpZHUWfstsy1uKe1+VN0Mp1mEDeZLw/XiB7wbsd0CIto963ALsdw4qGdF4 Gtn4Nk+8MAUak/lYkY5eBFRsnR4NOPQQo9tZQ/Vb6L0D46XjVmQa7N/dWmTY6wMhrDPgwc hcf/p++TY8KhVIwaTkwddn69XbGiT17C0XXukegai2O4K3vHyPPbt4M7JN9p+PpjQDUWil bRVGpwtAEyB+azvzLZJVzGriSGNvVxOjqlAq6HHCgyEdgvHhRE9VVTTeoiMZxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgB/h6R//DUnwCymozdId8VDwYccAUOSB6WEq3lWioI=; b=bP9gbjfFdc+4rB5ufU/wNSgtESfbIhGyiQ1FwdrIewjAE84jZUIo5eElEK+DqE58HJmxoC O3Xx+sF8dW/LQCXMMcTSldiGsDYkJ4njOl9f5w/pZ95V5Ip3sgct0cG9QTN6btzt6EJ5Mn VKstfYleTK4SOk+Ie9fALpahDG/AuGEB6BTk4MqkwlatEUNVl6MislNiF/dCIsX9fBCc8r tZ71PZxzkY9WzeeO+suxRYjMltNV3MlWHmovQYd3j+W9l9n6+N6jHng4NkUTS/NGcbLWJK 5zMXSEBKVedObZUtVm1phzPBJjxUAqGCIe9N3BIfypnQLlwiX3M8tSjVNIcNWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470382; a=rsa-sha256; cv=none; b=mcNx1jYBCOtHDh5xZ/Xv3SOYIYYJbJR4DpXjJK9RjRLQjQvlUSPRRFRub/gOTtFofhnmeg NAdxdZO89yVmKaVC1XPCSVBrpZ9bB1G+RGCAxHcHXL4ORdqHvDnQnh+JtW1AnD4inB1Ts4 CckdRcdoPIXfbqrXJKlrTCrpcCKTVRv+AoUtpnBjJH4mZJuBqZXaJ7Br+uy2P8hO0I+Frm xwrHJx2BYdyTDe1kcNwv9Z9Rc7koqHKDlx0WAe2sDLhU/aiNt3jRHe/uv1WXxjq8Vqo6gn /sSrofSXgi6bQfABtSWMwhLaqfcaNrpwWG4Cjx8Tv6iA8yjhm0jlX/684tq/tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rZ0dWRzNX6; Fri, 1 Nov 2024 14:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED1X7059313; Fri, 1 Nov 2024 14:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED14c059310; Fri, 1 Nov 2024 14:13:01 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:01 GMT Message-Id: <202411011413.4A1ED14c059310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 79dfe2b76189 - main - ow: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79dfe2b761891eb3ab1b6a769d4f6adc97335350 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=79dfe2b761891eb3ab1b6a769d4f6adc97335350 commit 79dfe2b761891eb3ab1b6a769d4f6adc97335350 Author: John Baldwin AuthorDate: 2024-11-01 14:08:52 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:08:52 +0000 ow: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47364 --- sys/dev/ow/ow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/ow/ow.c b/sys/dev/ow/ow.c index 9901e51c289d..6157c9df2939 100644 --- a/sys/dev/ow/ow.c +++ b/sys/dev/ow/ow.c @@ -330,6 +330,12 @@ ow_add_child(device_t dev, romid_t romid) return (0); } +static void +ow_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_OW); +} + static device_t ow_child_by_romid(device_t dev, romid_t romid) { @@ -560,7 +566,6 @@ ow_detach(device_t ndev) { device_t *children, child; int nkid, i; - struct ow_devinfo *di; struct ow_softc *sc; sc = device_get_softc(ndev); @@ -577,8 +582,6 @@ ow_detach(device_t ndev) return ENOMEM; for (i = 0; i < nkid; i++) { child = children[i]; - di = device_get_ivars(child); - free(di, M_OW); device_delete_child(ndev, child); } free(children, M_TEMP); @@ -703,6 +706,7 @@ static device_method_t ow_methods[] = { DEVMETHOD(device_detach, ow_detach), /* Bus interface */ + DEVMETHOD(bus_child_deleted, ow_child_deleted), DEVMETHOD(bus_child_pnpinfo, ow_child_pnpinfo), DEVMETHOD(bus_read_ivar, ow_read_ivar), DEVMETHOD(bus_write_ivar, ow_write_ivar), From nobody Fri Nov 1 14:13:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rb2yCYz5bq87; Fri, 01 Nov 2024 14:13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rb1MtXz4bWQ; Fri, 1 Nov 2024 14:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3G1mwN5L2m6mt/ID/hZVZ5gfpGyNGHSCU8j8JmIyk4=; b=eqbnZL/+GSZuI1he90YtQ7MemWq5cW4VVsQIHFJfD3hTYWlIMewPaUDcOHqBh34nBLlHDX ozY0gU5n8xJNgXl3mzwBKbyZe4lk1zNFui51ZgOZu/mOPE5AcrCov8+OmEUtSY7UD6IEUT zeJin3pG9kAbTCNKRkvo5aaGaoUc6L4dihNXR+NkmKBrsLfZS81/f05CelEGTvIWcSg7rN jfrFFz6+Fw1OB2NX52ewwrvoy5BVrhddCweWHqs1DE/hg2au5VtYItwRDd/kSvxJIVYRoW XN7fJg8y1YF3oIxtlrNWn+oqRllensTuACbzmoqhN2Yr19XytV60rZPFEzUsUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3G1mwN5L2m6mt/ID/hZVZ5gfpGyNGHSCU8j8JmIyk4=; b=KWa9+LdwINeI5X8yPyHh+J5wTvvshUYtaU1HVDigyQFPPA26RuSiwf1HwklMZAfNaIcR1Z XFoZkG8IDc5wG2cWx92tKDS+fWrR3kh1c44V12fdfnBxtsBk2m0FNuBjfTxx6SvAdhCcFq KAnJSj0dOQFQYFmhPhZbYW/7mWhZQwEPojSgvf8se4af+mUbr/QoBLUDYO5RnNYXJx9E5q Do38sdMfEHK8zouRi6ElJfOJhHQT62fhRn0bFOY8Jd91hsAEkjpalXLGiQLkYdG6fpTBqs vXGdHjMFZDQQOAjyyZEM31WTaceTr28fz4ymjiYkC9lDZ871AdrhPnNs9EG6Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470383; a=rsa-sha256; cv=none; b=s7/8s56vM9TuF93GkYGdUmo+DR0YXNkaSTvdtZWorVBhc74+8Bkk2/1X8O/Fu2KivHpLJF YCUIbQ6f6zMWMrtVPXORKPBlqP3GZ5SzhM87xGxpxLKr9+VQqG3qt80sGKZg1urSZsHSUj Dmid/2HaR0Q2wrS18x3MPboM4aqAKEQfq1UZooZLGuIAbDyjW84qxhn/trGoLQdW5/H+rk b4HXa1ZsiwNQQyVvgZ2NOhEilK+q0wuI9msvXWZGLIu+ES5d6+XP0RwaJow/r4MGLJl4jj V860ApeZxTsyiQecnKStW0UuqJpd0sBrGDtJKhq6jY5Z21td/x/W1HSWDJ8ZUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rb0zG3zNjJ; Fri, 1 Nov 2024 14:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED36K059381; Fri, 1 Nov 2024 14:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED30c059378; Fri, 1 Nov 2024 14:13:03 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:03 GMT Message-Id: <202411011413.4A1ED30c059378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2ff5c8502735 - main - msk/sk: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ff5c85027356038969d03c2beb55b98db389b41 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2ff5c85027356038969d03c2beb55b98db389b41 commit 2ff5c85027356038969d03c2beb55b98db389b41 Author: John Baldwin AuthorDate: 2024-11-01 14:09:01 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:01 +0000 msk/sk: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47365 --- sys/dev/msk/if_msk.c | 12 ++++++++---- sys/dev/sk/if_sk.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 0f41565c6b02..31c80b87511d 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -252,6 +252,7 @@ static const char *model_name[] = { static int mskc_probe(device_t); static int mskc_attach(device_t); +static void mskc_child_deleted(device_t, device_t); static int mskc_detach(device_t); static int mskc_shutdown(device_t); static int mskc_setup_rambuffer(struct msk_softc *); @@ -335,6 +336,7 @@ static device_method_t mskc_methods[] = { DEVMETHOD(device_resume, mskc_resume), DEVMETHOD(device_shutdown, mskc_shutdown), + DEVMETHOD(bus_child_deleted, mskc_child_deleted), DEVMETHOD(bus_get_dma_tag, mskc_get_dma_tag), DEVMETHOD_END @@ -2046,6 +2048,12 @@ msk_detach(device_t dev) return (0); } +static void +mskc_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static int mskc_detach(device_t dev) { @@ -2056,13 +2064,9 @@ mskc_detach(device_t dev) if (device_is_alive(dev)) { if (sc->msk_devs[MSK_PORT_A] != NULL) { - free(device_get_ivars(sc->msk_devs[MSK_PORT_A]), - M_DEVBUF); device_delete_child(dev, sc->msk_devs[MSK_PORT_A]); } if (sc->msk_devs[MSK_PORT_B] != NULL) { - free(device_get_ivars(sc->msk_devs[MSK_PORT_B]), - M_DEVBUF); device_delete_child(dev, sc->msk_devs[MSK_PORT_B]); } bus_generic_detach(dev); diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 4ed6fb1ad001..423c2eeff945 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -185,6 +185,7 @@ static const struct sk_type sk_devs[] = { static int skc_probe(device_t); static int skc_attach(device_t); +static void skc_child_deleted(device_t, device_t); static int skc_detach(device_t); static int skc_shutdown(device_t); static int skc_suspend(device_t); @@ -291,6 +292,7 @@ static device_method_t skc_methods[] = { DEVMETHOD(device_resume, skc_resume), DEVMETHOD(device_shutdown, skc_shutdown), + DEVMETHOD(bus_child_deleted, skc_child_deleted), DEVMETHOD(bus_get_dma_tag, skc_get_dma_tag), DEVMETHOD_END @@ -1738,6 +1740,12 @@ fail: return(error); } +static void +skc_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + /* * Shutdown hardware and free up resources. This can be called any * time after the mutex has been initialized. It is called in both @@ -1796,11 +1804,9 @@ skc_detach(device_t dev) if (device_is_alive(dev)) { if (sc->sk_devs[SK_PORT_A] != NULL) { - free(device_get_ivars(sc->sk_devs[SK_PORT_A]), M_DEVBUF); device_delete_child(dev, sc->sk_devs[SK_PORT_A]); } if (sc->sk_devs[SK_PORT_B] != NULL) { - free(device_get_ivars(sc->sk_devs[SK_PORT_B]), M_DEVBUF); device_delete_child(dev, sc->sk_devs[SK_PORT_B]); } bus_generic_detach(dev); From nobody Fri Nov 1 14:13:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rc3dfPz5bq88; Fri, 01 Nov 2024 14:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rc2Qn1z4bNZ; Fri, 1 Nov 2024 14:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aPXgftUHS/9dJVdRMY8XOGUPh+yeWN9yc3v5f6R9ss=; b=Htr3jNQ4NFJkbz23Pk7e4TX4C5g+erH+TfIu4i3QtnfAEvKHCcp63u5bN+ZOIbe4T6eP2p jORpwOK8lk48Ahf3/q5f0zOzJbZWp1LX8Wln9PlTmnw/E1NA3E52fO2WCfwMKYe6Gy9kcA pFmuNwqzowHGNQe1W/8w50aAXr5Vj6iv3h3Byp1Gi8qfrQscDTGdRM7EFpdWqxoA1aqlaZ 9iy6NZkWJcmkd3xIMu7U79OcvhXrB47D7qrzgfQfAtM8EgVXT+X69twfIvR2ly4CMmZMLL l3OJ1zZWRVRRrqzWT3w1NOcDAwgWRW7zRc//Q6oWGa5Qzg85EuEnu9kkailMfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aPXgftUHS/9dJVdRMY8XOGUPh+yeWN9yc3v5f6R9ss=; b=JJza8RnFUEcLBAqzW5IIDZx27c8F/gOE+9jC49gMn3I1GC7q0FTaIV/ojZAQeac37U6YoH GyrbGgFhcjPJjiUJfz7s8gHuLT9pgvVlzZ7VhDM6XXF+tYqiEG44glTRgiNnDbz73a6c7m SiB0X6q3ZeSU2X/ZuHQ9xoGscBw1E93RQsAOHczPrXclhiU2DmkjV2kTXp+D8GxtGCwCf2 7eUiZ9ziXgmqM5kriykel0OjsxTpTGcgmul6giwTuOe+JjVYZa3KFjVQLus+6KFg+Wi6cK +LTguq2zjBjomhZYB1qEXEZYMwCy07afITk0AGHM6ak/XSQz0oQgHxoBiqqd/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470384; a=rsa-sha256; cv=none; b=TnBs/0Mq1xflQcWPockARrO71b5ChdA2hjGkbxK+Ftia0K7DzxrQfdj2UZWYMypQsTVAbu QD8V6QALYCO3TmtYJCpk9tObTqnswR5liyXEhk6g4/cNBL3oYEFyzHxId5/U5TS1mMGF1R 3u3OnKQbZmYwqOL30hh49r7cJNdnzdD1NyD7xIt+ZxxrkmI4jnCFvWAwbatLhdDVIF7oah kcy0T/oI9KQwvCRfu9BDRFpZcTY4ww7+vCDS6HJegvEiDvcoiyswoGLLn4AOL7L1sI07bF wOefW3enH9AaDJdFhYH0KsYh6/wJ/uDncCJUzrspf6sJOZg2q6Ohti3r0/iRew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rc22DyzNll; Fri, 1 Nov 2024 14:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED42R059435; Fri, 1 Nov 2024 14:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED4iB059432; Fri, 1 Nov 2024 14:13:04 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:04 GMT Message-Id: <202411011413.4A1ED4iB059432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a17a41ffde0d - main - sound: Use bus_child_deleted methods to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a17a41ffde0d1c579dcd7cef7900c3b44be0ec81 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a17a41ffde0d1c579dcd7cef7900c3b44be0ec81 commit a17a41ffde0d1c579dcd7cef7900c3b44be0ec81 Author: John Baldwin AuthorDate: 2024-11-01 14:09:11 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:11 +0000 sound: Use bus_child_deleted methods to free ivars for children Note that hdsp and hdspe were just leaking the ivars on detach previously. While here, use M_WAITOK to allocate ivars since attach routines are sleepable. hdsp and hdspe were using M_NOWAIT without checking the return value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47366 --- sys/dev/sound/pci/csa.c | 26 +++------ sys/dev/sound/pci/emu10kx.c | 134 ++++++++++---------------------------------- sys/dev/sound/pci/hdsp.c | 9 ++- sys/dev/sound/pci/hdspe.c | 9 ++- 4 files changed, 54 insertions(+), 124 deletions(-) diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index 6440b73f6341..d62759e22dcb 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -273,22 +273,14 @@ csa_attach(device_t dev) /* Attach the children. */ /* PCM Audio */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_PCM; scp->pcm = device_add_child(dev, "pcm", DEVICE_UNIT_ANY); device_set_ivars(scp->pcm, func); /* Midi Interface */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto err_teardown; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); func->varinfo = &scp->binfo; func->func = SCF_MIDI; scp->midi = device_add_child(dev, "midi", DEVICE_UNIT_ANY); @@ -309,34 +301,33 @@ err_io: return (error); } +static void +csa_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static int csa_detach(device_t dev) { csa_res *resp; sc_p scp; - struct sndcard_func *func; int err; scp = device_get_softc(dev); resp = &scp->res; if (scp->midi != NULL) { - func = device_get_ivars(scp->midi); err = device_delete_child(dev, scp->midi); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->midi = NULL; } if (scp->pcm != NULL) { - func = device_get_ivars(scp->pcm); err = device_delete_child(dev, scp->pcm); if (err != 0) return err; - if (func != NULL) - free(func, M_DEVBUF); scp->pcm = NULL; } @@ -1060,6 +1051,7 @@ static device_method_t csa_methods[] = { DEVMETHOD(device_resume, csa_resume), /* Bus interface */ + DEVMETHOD(bus_child_deleted, csa_child_deleted), DEVMETHOD(bus_alloc_resource, csa_alloc_resource), DEVMETHOD(bus_release_resource, csa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index e642d334f9e8..b35a5e3139cb 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -3211,16 +3211,8 @@ emu_pci_attach(device_t dev) sc->pcm[i] = NULL; /* FRONT */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_FRONT; @@ -3231,16 +3223,8 @@ emu_pci_attach(device_t dev) if (!(sc->mch_disabled)) { /* REAR */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_REAR; @@ -3250,16 +3234,8 @@ emu_pci_attach(device_t dev) device_set_ivars(sc->pcm[RT_REAR], func); if (sc->has_51) { /* CENTER */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_CENTER; @@ -3268,16 +3244,8 @@ emu_pci_attach(device_t dev) sc->pcm[RT_CENTER] = device_add_child(dev, "pcm", DEVICE_UNIT_ANY); device_set_ivars(sc->pcm[RT_CENTER], func); /* SUB */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SUB; @@ -3288,16 +3256,8 @@ emu_pci_attach(device_t dev) } if (sc->has_71) { /* SIDE */ - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_SIDE; @@ -3309,16 +3269,8 @@ emu_pci_attach(device_t dev) } /* mch_disabled */ if (sc->mch_rec) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pcminfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + pcminfo = malloc(sizeof(struct emu_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); pcminfo->card = sc; pcminfo->route = RT_MCHRECORD; @@ -3335,16 +3287,8 @@ emu_pci_attach(device_t dev) #if 0 /* Midi Interface 1: Live!, Audigy, Audigy 2 */ if ((sc->is_emu10k1) || (sc->is_emu10k2) || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; if (sc->is_emu10k2 || (sc->is_ca0102)) { midiinfo->port = EMU_A_MUDATA1; @@ -3361,16 +3305,8 @@ emu_pci_attach(device_t dev) } /* Midi Interface 2: Audigy, Audigy 2 (on AudigyDrive) */ if (sc->is_emu10k2 || (sc->is_ca0102)) { - func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO); - if (func == NULL) { - error = ENOMEM; - goto bad; - } - midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_NOWAIT | M_ZERO); - if (midiinfo == NULL) { - error = ENOMEM; - goto bad; - } + func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_WAITOK | M_ZERO); + midiinfo = malloc(sizeof(struct emu_midiinfo), M_DEVBUF, M_WAITOK | M_ZERO); midiinfo->card = sc; midiinfo->port = EMU_A_MUDATA2; @@ -3401,11 +3337,22 @@ bad: return (error); } +static void +emu_pci_child_deleted(device_t dev, device_t child) +{ + struct sndcard_func *func; + + func = device_get_ivars(child); + if (func != NULL) { + free(func->varinfo, M_DEVBUF); + free(func, M_DEVBUF); + } +} + static int emu_pci_detach(device_t dev) { struct emu_sc_info *sc; - struct sndcard_func *func; int devcount, i; device_t *childlist; int r = 0; @@ -3414,35 +3361,17 @@ emu_pci_detach(device_t dev) for (i = 0; i < RT_COUNT; i++) { if (sc->pcm[i] != NULL) { - func = device_get_ivars(sc->pcm[i]); - if (func != NULL && func->func == SCF_PCM) { - device_set_ivars(sc->pcm[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->pcm[i]); if (r) return (r); } } if (sc->midi[0] != NULL) { - func = device_get_ivars(sc->midi[0]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[0], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[0]); if (r) return (r); } if (sc->midi[1] != NULL) { - func = device_get_ivars(sc->midi[1]); - if (func != NULL && func->func == SCF_MIDI) { - device_set_ivars(sc->midi[1], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } r = device_delete_child(dev, sc->midi[1]); if (r) return (r); } @@ -3450,12 +3379,6 @@ emu_pci_detach(device_t dev) if (device_get_children(dev, &childlist, &devcount) == 0) for (i = 0; i < devcount - 1; i++) { device_printf(dev, "removing stale child %d (unit %d)\n", i, device_get_unit(childlist[i])); - func = device_get_ivars(childlist[i]); - if (func != NULL && (func->func == SCF_MIDI || func->func == SCF_PCM)) { - device_set_ivars(childlist[i], NULL); - free(func->varinfo, M_DEVBUF); - free(func, M_DEVBUF); - } device_delete_child(dev, childlist[i]); } if (childlist != NULL) @@ -3488,6 +3411,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(device_attach, emu_pci_attach), DEVMETHOD(device_detach, emu_pci_detach), /* Bus methods */ + DEVMETHOD(bus_child_deleted, emu_pci_child_deleted), DEVMETHOD(bus_read_ivar, emu_read_ivar), DEVMETHOD(bus_write_ivar, emu_write_ivar), diff --git a/sys/dev/sound/pci/hdsp.c b/sys/dev/sound/pci/hdsp.c index 03e885df63aa..d678fed527dd 100644 --- a/sys/dev/sound/pci/hdsp.c +++ b/sys/dev/sound/pci/hdsp.c @@ -887,7 +887,7 @@ hdsp_attach(device_t dev) return (ENXIO); for (i = 0; i < HDSP_MAX_CHANS && chan_map[i].descr != NULL; i++) { - scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); + scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); scp->hc = &chan_map[i]; scp->sc = sc; scp->dev = device_add_child(dev, "pcm", -1); @@ -955,6 +955,12 @@ hdsp_attach(device_t dev) return (bus_generic_attach(dev)); } +static void +hdsp_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void hdsp_dmafree(struct sc_info *sc) { @@ -1002,6 +1008,7 @@ static device_method_t hdsp_methods[] = { DEVMETHOD(device_probe, hdsp_probe), DEVMETHOD(device_attach, hdsp_attach), DEVMETHOD(device_detach, hdsp_detach), + DEVMETHOD(bus_child_deleted, hdsp_child_deleted), { 0, 0 } }; diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 0e25e9599328..2561fcdebb1c 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -578,7 +578,7 @@ hdspe_attach(device_t dev) return (ENXIO); for (i = 0; i < HDSPE_MAX_CHANS && chan_map[i].descr != NULL; i++) { - scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); + scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_WAITOK | M_ZERO); scp->hc = &chan_map[i]; scp->sc = sc; scp->dev = device_add_child(dev, "pcm", DEVICE_UNIT_ANY); @@ -626,6 +626,12 @@ hdspe_attach(device_t dev) return (bus_generic_attach(dev)); } +static void +hdspe_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void hdspe_dmafree(struct sc_info *sc) { @@ -673,6 +679,7 @@ static device_method_t hdspe_methods[] = { DEVMETHOD(device_probe, hdspe_probe), DEVMETHOD(device_attach, hdspe_attach), DEVMETHOD(device_detach, hdspe_detach), + DEVMETHOD(bus_child_deleted, hdspe_child_deleted), { 0, 0 } }; From nobody Fri Nov 1 14:13:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rd6dlgz5bpmC; Fri, 01 Nov 2024 14:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rd4jLjz4bJm; Fri, 1 Nov 2024 14:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Vul49BE7505hvh6a4RY4cuUz5/wrESlCpNikI22zXs=; b=kiQJgafcimiR/5ocz93mlkAyi2C6a50np6DKevoNAVyPjEuN7q9eZCrfTx9LCPdKgH91c7 TYa5vhzR8vOCkrpic0V5MeQEe4yQT6EUvc7oKEUsWe7rdvteDJOV2HUgcv/GiY9rBU4uy7 YPxrst0Q9e/uvK0p6FDOglrjJUd0c+SW/PKVAQnf2704IvodCisPjJ90K6z2aBBxmWQmwn wS8KsR+PjUW0jxwpET7INF32ISOfjeBrniNsvGJsJSOiCAZRr6517ffIyLCliH31WT79SN My4GQUJXjzdJWACwwpY8QfsV8v9Nss1+DitQQfJJ7djsFR25PSHuVcgBWK+Jiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Vul49BE7505hvh6a4RY4cuUz5/wrESlCpNikI22zXs=; b=fi9pyB7ryxjMz+gnYMP16pGXzFpuMknaXVywwaYZyqSAtFEVkmagvEfkFyXtIKXViecg71 wg+yuJBzlrJSRzy3hgXyGlFCbPngfJtpHwjESNb3zd7MAj9UmtekbgbVPQyxhYAac93bbN OS1o1T4to7j8GHWiOtf+nnlJ2oC55yb+26rFfqBLAq4k9bUBk4vDTCinaPb4ktAwXA0g4G kiGrT396MXqirWiiCfyiA7F+IHxJRPOPI/bQj7e7WTtWG3Kwjf2T6Pc4+I44CSMD4FlQeD 011kDsu4Hp1muIzmd7n3WTqbUfhhny3325BFOwrOSDrHMGHsM2gcZqUOmZ9E9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470385; a=rsa-sha256; cv=none; b=Kqf+0zKub5KrGQ2rXEFx7rLjF2S9k+wF6RQ6iLKHg2Hq2TXWB7xO3UG9T2sslHH3rchZpZ Hztq+mu/R+PuD5JPqw6/Pz2QIiQh+hyhPmC11X1J492AN/f0hVcq7VqlfiRlpUwO7qgzsr 9qV2Ys7QUz6+pm2e4sIyjvf5jW/I+azRLiZLQQkl8hUeaJ16HzuSqwGAyAt9DgNFOb7tp7 EMTtX5gXUYuTsMrflMi1WHMRE89q4meexBGBpaWRLX9GJtkQDtpcO25GZowCrL4bT1SQDO vP1dBvnqBpT2AE4qJna1qwa+vfYeW5A1vY3skU2hbfw7HO4I32w0zDgEYwwj0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rd3P2bzNpC; Fri, 1 Nov 2024 14:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED52O059492; Fri, 1 Nov 2024 14:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED5QB059489; Fri, 1 Nov 2024 14:13:05 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:05 GMT Message-Id: <202411011413.4A1ED5QB059489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2520675d3f0e - main - superio: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2520675d3f0ef9039049fd67481f013b36f250ee Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2520675d3f0ef9039049fd67481f013b36f250ee commit 2520675d3f0ef9039049fd67481f013b36f250ee Author: John Baldwin AuthorDate: 2024-11-01 14:09:21 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:21 +0000 superio: Use a bus_child_deleted method to free ivars for children Previously these ivars were leaked. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47367 --- sys/dev/superio/superio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index 960b89c0cdc0..7dbd7d30907a 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -768,6 +768,18 @@ superio_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +superio_child_deleted(device_t dev, device_t child) +{ + struct superio_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo == NULL) + return; + resource_list_free(&dinfo->resources); + free(dinfo, M_DEVBUF); +} + static int superio_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { @@ -1078,6 +1090,7 @@ static device_method_t superio_methods[] = { DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(bus_add_child, superio_add_child), + DEVMETHOD(bus_child_deleted, superio_child_deleted), DEVMETHOD(bus_child_detached, superio_child_detached), DEVMETHOD(bus_child_location, superio_child_location), DEVMETHOD(bus_child_pnpinfo, superio_child_pnp), From nobody Fri Nov 1 14:13:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rg3K0vz5bpsC; Fri, 01 Nov 2024 14:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rf53Tfz4bT5; Fri, 1 Nov 2024 14:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MpE3H70D71Ap0/DkjLy8ARiiHoq5RSnjEWTASew8DI=; b=pYBN3aLxaLfUdBUv1vJqmWtn0cTLFy5rrFpXShJmfQoC2W2+jB6awKeJk2nDB4Zewee7cU LtghsuTwRWyekMGKzh26IRwRxtdy34lj4qZQUNyWk1+NCzJd+mN6G7nQBqYkuWv5GBwqlR yKUfAg+i54V7ykhieRXaw5Yl2S7j6i53NBZM9j2RShzR7nsbxUptO6cSqGyReusn9eJdNF xpye6eje/jTLO/uEal7TBCY+mlI/FhWmdN2IbaN9bSCbHsqM650nEJ+jKjqnkfxrl9o5Rp CrTjS3YXkTsrCB5g0XrIF8OwQ9ticdIvWgbkUBR5FhDREc3YWwb3c+3lffWpXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6MpE3H70D71Ap0/DkjLy8ARiiHoq5RSnjEWTASew8DI=; b=WMNURpn6EhM4gHhQo22riqHz9HHzejAvKuyb1QcsdFnaeX7sRTbst1VhiUT0ex2U0AFRQ2 3iIlNCMtkyvqxhCJ4CfG/pTIABsNAX99IUk/5g1XL9POibENkSU15j7sKL79PX574XDNK9 z0ZC5EsAWagCv9dyhTmB/q6qpHjEK8OIXTVgLXM/ZXAv0RDgY0O5hRAhLj+Y4lc81myiHE H6tmqfIwCd2A9Kcw1LC9BOuI+eaIEGrRw1wA46hA+Fck1kOorG7MG3dq38WFOF/rIHvjmj g1jPP1UadASqV4zBKwI4GzVKzJFlGnYqS96b56Zumk9P8SV4dZRUX1W0jRaEIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470386; a=rsa-sha256; cv=none; b=qDj3nliJDL8Z5csYqnHYTeBbIuTgtKD5M7r5T18M1UyGWvrsc/FwS+kl5Lx/OKLZMlDnjC tCeYUX4ig/g9N9zldnqqXJsD1niKe0el1lJLjEo0VLd8GQlkpARSqEAJqaMBmdwQ9l+z8t /4UYIxrwGVz+SzxEJFga7AP2hfCUuYDJcwsSkD1Bu1cr3zOuTOIDAC+/otv5Doss+jnhir m8CcjXdpxC3/VS0sHOQLQDC7BaUQIYlAxfcuQLmbIbncvbkG252B5bsNt06/VfrOCdJAZM gdtjQni9X+1GN65zB7thTYDM8RqylrCefazLiVNYtE9a9Zz+GPf6xiSYPpQE1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rf4XVqzNlm; Fri, 1 Nov 2024 14:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED6x5059549; Fri, 1 Nov 2024 14:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED6a6059546; Fri, 1 Nov 2024 14:13:06 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:06 GMT Message-Id: <202411011413.4A1ED6a6059546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c8fa54882226 - main - isa: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8fa54882226d89e987fb26b94979aed85a3bd9a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c8fa54882226d89e987fb26b94979aed85a3bd9a commit c8fa54882226d89e987fb26b94979aed85a3bd9a Author: John Baldwin AuthorDate: 2024-11-01 14:09:31 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:31 +0000 isa: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47368 --- sys/isa/isa_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index 22c473108e2f..519f9353b794 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -622,6 +622,12 @@ isa_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +isa_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_ISADEV); +} + static int isa_print_all_resources(device_t dev) { @@ -1058,6 +1064,7 @@ static device_method_t isa_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, isa_add_child), + DEVMETHOD(bus_child_deleted, isa_child_deleted), DEVMETHOD(bus_print_child, isa_print_child), DEVMETHOD(bus_probe_nomatch, isa_probe_nomatch), DEVMETHOD(bus_read_ivar, isa_read_ivar), From nobody Fri Nov 1 14:13:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rh1nDnz5bpgR; Fri, 01 Nov 2024 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rg5n6nz4bZD; Fri, 1 Nov 2024 14:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Z9PvxyaZckmLN+zCEQ4ueMC5RVAcbnFhfX0zRzFArg=; b=Cb5d8XSCpQQhri38dHCe9JOxKeJQK3fGQZrHRgOTehEDnxP4HfahMfZK9CQP5SM0yVWFPN QDONgrnrGHbs8XovOekf4QGXceRMVRFiyhJhYU2cSetAxY3DzQorrBAnbOY77EH5EjeWs8 tSjvAC2o2BevpFiAuRAxyJ80o8KEb/mOO2o1/PUr0riE32eABf0jO83Fne697URtm58zZS CH7bw/oxjyoA6hsiHfzLKwqHOXBMR+cSRGTSKp7p50ajyaMskwrSmfzXeQzjMVQcY4knZg uOsQYukyPHFmnjbfr/TjOPj3TxR7CoHeKX0EccD8HblrGZ4Mgeu2ksBJv/T3mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Z9PvxyaZckmLN+zCEQ4ueMC5RVAcbnFhfX0zRzFArg=; b=ePpGcJCmJGyQPh8iBcu0DcVyFHkC7Yqj0FkXtuxDDPISFADBFgI/AtinP1pQmBhZR1G16+ wO9mZHDii1rfx+GnJI9TlVY/L0Sv9RLtMlIlOg+X89wDikUhzTBFJ1/nqICnivE/THLbj+ v9ZMmUF+kTIcz8bomufEFz3oKExszQnYyoSU4SNXtQMc+8aJVJxVoPzTZx7aD7GH8uPKXc CAVUasodOkjJb3AqKp60Tyih0DVssbFmqGavpsfPrxSNkFxjbWQ6ol/zlJodgYYBt+dB7O VqcJZRSKlEH3DfXO/+izj8FFuKYp3YUdvMR93OiTxjy1s7WlKB145b2yciygqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470387; a=rsa-sha256; cv=none; b=WiX0O1jk7rzQvXRYeqcPQRDqGJnnh1HKhQrHDuPx7vkwSELDSxsF9ZlnbNWaDo0yA5mgiA PyMl6+SBlkYrH/3jb+JworrZw404hoCG8JrNokULpZsByZAXjDmwg93bdsKduHKbqicBRk wEXTqhJuCVI4hdP/Ddblh32DUoUAcl+sx/+ZeiXScLRRieecLSQ5S2lg+HtIIlU/gRZEYP qj3GpYJSg6E3tlZVeNj7g98ds2cDIzSvDitlnxdh7wq8KyM4BIM/SmJhk5JefetLPECQEq 0zczU2rNTpzDK2AkDQabzXR9R7UyELjrfU+rpkM6vVjS1YkaqFsChGZVRwnWaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rg5DgTzNpD; Fri, 1 Nov 2024 14:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED7RD059609; Fri, 1 Nov 2024 14:13:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED76Q059606; Fri, 1 Nov 2024 14:13:07 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:07 GMT Message-Id: <202411011413.4A1ED76Q059606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c9e880c0ceef - main - gpiobus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9e880c0ceef9541625c18add3f5a8499137e016 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e880c0ceef9541625c18add3f5a8499137e016 commit c9e880c0ceef9541625c18add3f5a8499137e016 Author: John Baldwin AuthorDate: 2024-11-01 14:09:39 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:39 +0000 gpiobus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47369 --- sys/dev/gpio/gpiobus.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 02c02bcd645d..6b0f8e5ed3ff 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -574,9 +574,7 @@ int gpiobus_detach(device_t dev) { struct gpiobus_softc *sc; - struct gpiobus_ivar *devi; - device_t *devlist; - int i, err, ndevs; + int i, err; sc = GPIOBUS_SOFTC(dev); KASSERT(mtx_initialized(&sc->sc_mtx), @@ -585,17 +583,9 @@ gpiobus_detach(device_t dev) if ((err = bus_generic_detach(dev)) != 0) return (err); - - if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) + if ((err = device_delete_children(dev)) != 0) return (err); - for (i = 0; i < ndevs; i++) { - devi = GPIOBUS_IVAR(devlist[i]); - gpiobus_free_ivars(devi); - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); - device_delete_child(dev, devlist[i]); - } - free(devlist, M_TEMP); + rman_fini(&sc->sc_intr_rman); if (sc->sc_pins) { for (i = 0; i < sc->sc_npins; i++) { @@ -699,6 +689,19 @@ gpiobus_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +gpiobus_child_deleted(device_t dev, device_t child) +{ + struct gpiobus_ivar *devi; + + devi = GPIOBUS_IVAR(child); + if (devi == NULL) + return; + gpiobus_free_ivars(devi); + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); +} + static int gpiobus_rescan(device_t dev) { @@ -718,7 +721,6 @@ static void gpiobus_hinted_child(device_t bus, const char *dname, int dunit) { struct gpiobus_softc *sc = GPIOBUS_SOFTC(bus); - struct gpiobus_ivar *devi; device_t child; const char *pins; int irq, pinmask; @@ -728,19 +730,14 @@ gpiobus_hinted_child(device_t bus, const char *dname, int dunit) } child = BUS_ADD_CHILD(bus, 0, dname, dunit); - devi = GPIOBUS_IVAR(child); if (resource_int_value(dname, dunit, "pins", &pinmask) == 0) { if (gpiobus_parse_pins(sc, child, pinmask)) { - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); device_delete_child(bus, child); return; } } else if (resource_string_value(dname, dunit, "pin_list", &pins) == 0) { if (gpiobus_parse_pin_list(sc, child, pins)) { - resource_list_free(&devi->rl); - free(devi, M_DEVBUF); device_delete_child(bus, child); return; } @@ -1045,6 +1042,7 @@ static device_method_t gpiobus_methods[] = { DEVMETHOD(bus_get_resource_list, gpiobus_get_resource_list), DEVMETHOD(bus_get_rman, gpiobus_get_rman), DEVMETHOD(bus_add_child, gpiobus_add_child), + DEVMETHOD(bus_child_deleted, gpiobus_child_deleted), DEVMETHOD(bus_rescan, gpiobus_rescan), DEVMETHOD(bus_probe_nomatch, gpiobus_probe_nomatch), DEVMETHOD(bus_print_child, gpiobus_print_child), From nobody Fri Nov 1 14:13:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rj1Zzzz5bpgS; Fri, 01 Nov 2024 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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rh71k4z4bR6; Fri, 1 Nov 2024 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lLUeDu36gNDclfET/xUyDdiQBz9bUxjG3TfCM4CmT8=; b=CxeikFdFGwWk6PNcgelfxo4+vETkLQ+7VAyx/ZpheyaPu3GC4JS/17HOzsDeKZHbAWLD1O RB0eNEZbiNuvv+HPiIdMmQuNfX8CFe7B7EOGm6Pu3SPtOtnbo9yjo2T6NAarLZkMH9aBhH n25M8GKCm1f1j76HFNqH6d6W4lIXgGHzaGkCaDyyMfMJCprkhZ7KkS5vn12L0vdQQ/AcnV QOjJ0hrHJKfisB5Y5BerX52jNvPYUDNUPM8paBR4qU6QmL4vQA8n/dmIyKaiLVsgiyu2vy tDEynfDbrFFrdmT0zKZhuFUsT06L73F6shjBUJP7MCGY3ZJi6IdojxrxhldOPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lLUeDu36gNDclfET/xUyDdiQBz9bUxjG3TfCM4CmT8=; b=tODf5B2nELwepMEU8r3AYYMeRBRt6KKRphAIqM33WvUSTWdpX56QDauTfgEqq1sEHTFNKY TWE3IN5xl1n8/muM5kJawaknKVbt32w9vglkh0TPHgnQPY30oLQo8QVfVCMn8QAsb47vs8 oChkkmGemq3Q/XNtz4l5lVQ94iGs3kzwfvMilTJY0iBfi4+jwGXBgYEboD/Nnh7OKWVsE4 chiL/CsqO9yc80TfsbaGCEvRAYxcgKDFC80uB1WFjJJYJ0iAUWFC89uOj90M85fyBtjgBi SwoW+rpPAm39/A1KGvd5jr+umS70w3G+BLgT24UJcywpSqtvfGdgJcMepRJ5Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470389; a=rsa-sha256; cv=none; b=o8UgwxD1dXichdkoOr9e9K1H1b5k2NO8kLNpzEnTgsRwcoK9Pe/QT0OCj/Ql32DZC5AOTC LXoLyiqtwH6vc2fx3Dyhc0MLLDrmc+ZZUYc4Vb8IRkn4524BK5/Lp+Jafw7xh1cuNsO4qR y1lMLYa78b/soUfx28nGETEeM0jC71eGTBW3y6sldwTEQbZCvXb/iYEHO85u/dfo05pheM pe7ISllg8HCz/WjFVVLthZY/0sZLPI1cOkADhbYYRd2iL6JOMeG9rvSNfGcp8aOB0a8uLt Mlf3rDxLEgCYQaFjL3hbBAkNpZSHGJOoFNtJgwHdqCVxlPYGBgK5GrGw0mfEYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rh6drqzP0v; Fri, 1 Nov 2024 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED807059683; Fri, 1 Nov 2024 14:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED86A059678; Fri, 1 Nov 2024 14:13:08 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:08 GMT Message-Id: <202411011413.4A1ED86A059678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9c99ba9a0677 - main - iicbus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 commit 9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 Author: John Baldwin AuthorDate: 2024-11-01 14:09:50 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:50 +0000 iicbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47370 --- sys/dev/iicbus/iicbus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c index 33fb5c875c50..f48338865e0a 100644 --- a/sys/dev/iicbus/iicbus.c +++ b/sys/dev/iicbus/iicbus.c @@ -248,6 +248,18 @@ iicbus_add_child(device_t dev, u_int order, const char *name, int unit) dev, order, name, unit, sizeof(struct iicbus_ivar))); } +static void +iicbus_child_deleted(device_t dev, device_t child) +{ + struct iicbus_ivar *devi; + + devi = device_get_ivars(child); + if (devi == NULL) + return; + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); +} + static void iicbus_hinted_child(device_t bus, const char *dname, int dunit) { @@ -360,6 +372,7 @@ static device_method_t iicbus_methods[] = { DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource_list, iicbus_get_resource_list), DEVMETHOD(bus_add_child, iicbus_add_child), + DEVMETHOD(bus_child_deleted, iicbus_child_deleted), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar), From nobody Fri Nov 1 14:13:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rk2sVfz5bpqT; Fri, 01 Nov 2024 14:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rk0zZTz4bjB; Fri, 1 Nov 2024 14:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zSp13p7o3KUxWODNYvOrL75goxH5Fy8LcKIDlIQc3vA=; b=wY9gN9Xy+oc0FPrLjWUYP7nIpfD/uhbogLhZBlWE86b3JKUudXo8zKKIyhCwrokkmquycw nojMZ9x8/P+/3aD+N08aOLvIYL7yfJtlQyjKiwNBSCgAdHrfLppPBDHx0e5EEKo7Q/KQGr 4ARSxIeTzX/E2BmeUocLoNW2vKtb5TxkohpyGSYmV3pConYtdYGgCrX8w5pq1x03LguJnc o4TY2zc5oCyIW5WxFOUD0m+WdGmdh1TbdW9RV+GeEqRtoyEs714Rti+xlzAlNA0H60xFSr LNvquSbIAFicrVtVxLCkgihRDjSjGR3OZ345IHjNUM1s1sDtL4taXJ1aVcCxYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zSp13p7o3KUxWODNYvOrL75goxH5Fy8LcKIDlIQc3vA=; b=DxrnYVNBtvDoisAV7UVBvmAsPTdqxVmTehTPqLaQ7ipbL261Y1TZwGyavcSGudioAMNww7 ZJZzrEHkwEc91temSXRH4SnYpT7ihL7dLjEWuHvx0RbHmX39bZ/1ChUhvUjkfPr8An5vVD bLD0NvzEE3ZM39jiNxpPAsuzo6d5/mE9RXn0yyc373vDgLCTsr2H8o0bAsnk4QCEKVj31y lBWoE8rMM1lhtBngxznCcNzweonYOEBV/Qdx9amVukhy/ppAFWm/hfYjZerLr1gpkAotwD s1hUN7/egw4pdP8uezZ/80ksiyNDV4niZFsjv0rQ5c9tmOcKD6l/MsZotu6mfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470390; a=rsa-sha256; cv=none; b=qqWLmLsmFd1W9r2+943VGbaP4vNi0uOW9pNF9fwrfEiFp6nQEcb5vPHc7ce4zOIKneHdOT X2amp0lxG8JwEDPnrQcjvT93Uunsuwln1yJYFHefC8Nlq0uKztXI99KVy7jilcR3TeuW1J bI4qSr5U0bdAJo0sAdpwt3neFikSRgK6e/lgzQPgyzSkO6ALwy6Eq0geSZbWZl4SaTvc0e /PqThWc4MePLo7cyzrsY64j2rGwznIRfHWS1Vte/P/9jW6JVei5AfzxFwd9KpATM5EDtzU 7gDfPGq7MVmOMPpyXFn2l85urYn4jrR2kR3pBNPF7RUqnC+z2NFFrkSSCPftSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rk0ZpPzNjK; Fri, 1 Nov 2024 14:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED9Ad059753; Fri, 1 Nov 2024 14:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED9Zk059748; Fri, 1 Nov 2024 14:13:09 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:09 GMT Message-Id: <202411011413.4A1ED9Zk059748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: dc569c894207 - main - miibus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc569c894207a524b0cb542040b35b0edd57d1c8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dc569c894207a524b0cb542040b35b0edd57d1c8 commit dc569c894207a524b0cb542040b35b0edd57d1c8 Author: John Baldwin AuthorDate: 2024-11-01 14:10:01 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:10:01 +0000 miibus: Use a bus_child_deleted method to free ivars for children If a device was detached (e.g. via devctl) and then re-attached, the ivars would be freed by the previous bus_child_detached method during detach, but device_get_ivars during the subsequent attach would return a stale pointer resulting in a use after free. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47371 --- sys/dev/mii/mii.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 48bbf0d506ce..dde79c189322 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -58,7 +58,7 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" -static bus_child_detached_t miibus_child_detached; +static bus_child_deleted_t miibus_child_deleted; static bus_child_location_t miibus_child_location; static bus_child_pnpinfo_t miibus_child_pnpinfo; static device_detach_t miibus_detach; @@ -84,7 +84,7 @@ static device_method_t miibus_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, miibus_print_child), DEVMETHOD(bus_read_ivar, miibus_read_ivar), - DEVMETHOD(bus_child_detached, miibus_child_detached), + DEVMETHOD(bus_child_deleted, miibus_child_deleted), DEVMETHOD(bus_child_pnpinfo, miibus_child_pnpinfo), DEVMETHOD(bus_child_location, miibus_child_location), DEVMETHOD(bus_hinted_child, miibus_hinted_child), @@ -167,7 +167,7 @@ miibus_detach(device_t dev) } static void -miibus_child_detached(device_t dev, device_t child) +miibus_child_deleted(device_t dev, device_t child) { struct mii_attach_args *args; From nobody Fri Nov 1 14:13:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rl4Rfjz5bpgZ; Fri, 01 Nov 2024 14:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rl1jJfz4bg9; Fri, 1 Nov 2024 14:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+4bGpnd7USUgscf/tx6COdth6RsO6t3M+LOKDsrv5lw=; b=M7Yp7tg1zgun3Vx6c8AK7lKsBFvz8CSLFntJn2eH4pswjx4pivoW8PjO34CLNb67YdLGhM 3G/583jxEv8ec8RLXVMZcE74RLFDYMzyl+3aFygm/ySls/bmed8yRIZ5WDfY48dW7YZ2rR o+vGOxENUV+sGCfp5D6FmMW8CzdyH4U6FGKw1er3YFw12Ofs1QwCiqb3mgn4C3+L1THER8 Qf/1WbjD89IV6rjSKyEhMznH3AKUvEP6UTBq7pQTEJQkIgG/Rp+std+mdzJvRAgj8Rbpxz V8FKJ3Nf/wsSTUqSQO615YKyy93q0lRtxQP8/ALjJn8qkBakejWqq4Mgw+AKjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+4bGpnd7USUgscf/tx6COdth6RsO6t3M+LOKDsrv5lw=; b=ZToHCdZm/m5qcy3CXT4mFagC0naW4kLRCKPejnSEzmwVWXqu2ESDUZbd4r9+YDWED5x4xk YlDRFJIxKDRDouRPDFtG9rEsUJ8q9F9+yajg4uXV12QQqwUv/8D1DGxDu4a3gWu2C0lwsq YnnVYnsE6Xll0awnfX/a6hlDdZ/kQbEyRmEte9TQ9rrkkAd7wLD00tpUesw80OM1ZcV0op CVcaSsUs6fCxudmmbjbmdqwyUc0UTLQr3XQwpk182auwTWvGksvLmTofGAEPLWLVNdDLkD vKCwGIuQ4MX3UAm4Kl7I7Wf6TfUumdpUWpITB/XFYoeU+Kufo08QLYkfSpNFrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470391; a=rsa-sha256; cv=none; b=vy/hbZFhPh8mj3f7lG7z8f2S+I16CatfYyqLkoYJLN8gY4QnuT5GlMrpoFULUghnY5lwSk ZYQfxxInBq8dmWgc9/UfeXj79MLSgn1tDTInJU0JgPbi0/iPRT290gJN66Aky79mbbtkcL ngFUrcAOGIJAeFF9REkOPzk3pX34oRcMKZqF3TbTwW+gqswwDVjTqEaqnd98fb9yYuynub ZFjTqjihP6DdlL2yURqu2zkL3EWoI5lYUClfv5b4WHf+dYk64PpRIAuZkbx+yP+bTaB+jp IY1EKc6jf/06POwVsRsnMhV0ax1WJMR2DCNiADf4XL/UhuRn+m21gonUH3/jXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rl19V9zP0w; Fri, 1 Nov 2024 14:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1EDBWa059821; Fri, 1 Nov 2024 14:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1EDBmo059818; Fri, 1 Nov 2024 14:13:11 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:11 GMT Message-Id: <202411011413.4A1EDBmo059818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 03f641f9b1d8 - main - smbus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03f641f9b1d82b7369c8988afbd75a32d9913aaf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=03f641f9b1d82b7369c8988afbd75a32d9913aaf commit 03f641f9b1d82b7369c8988afbd75a32d9913aaf Author: John Baldwin AuthorDate: 2024-11-01 14:10:10 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:10:10 +0000 smbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47372 --- sys/dev/smbus/smbus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c index eed1aa6efce0..b0983fa32c30 100644 --- a/sys/dev/smbus/smbus.c +++ b/sys/dev/smbus/smbus.c @@ -112,6 +112,12 @@ smbus_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +smbus_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void smbus_hinted_child(device_t bus, const char *dname, int dunit) { @@ -222,6 +228,7 @@ static device_method_t smbus_methods[] = { /* bus interface */ DEVMETHOD(bus_add_child, smbus_add_child), + DEVMETHOD(bus_child_deleted, smbus_child_deleted), DEVMETHOD(bus_hinted_child, smbus_hinted_child), DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch), DEVMETHOD(bus_child_location, smbus_child_location), From nobody Fri Nov 1 14:13:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rm58jcz5bpsl; Fri, 01 Nov 2024 14:13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rm2y7Lz4bVJ; Fri, 1 Nov 2024 14:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vtHx0bW4nkPtVoyzJPrliudfHm+g39K5AZIxA/+clk=; b=mQOrkBL720ViAV4pEf5A8IzYyJsWDjMYllOWvQaVzLEN6Tn7xWfGUoBYHzV8MPID2+cD3X PnhpOaJtH+xG6+YOF45/w8X6db7Cli7Sa3bP17GXMv/WUyAqx0Cc2ynOlDcGo31OmWakeJ OZaGkMDqFCr9ftjFbA0Ex6HvngGUv8TinilyFPeP74/uunUyJElvbKuSzNOrOwzbZ56MSH r8e4iTKx/knnYM5K6jYMxWNFDHtbbdewtFwd/HJ3wc0EqBFb859qzx7cwmkp2Yr0Y7Op78 cPwKw5Vw7xKSLy08o+hzA7bZvzZOrNHQcgXwM5chdU5DTUnTh/36iRdbbxC7sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vtHx0bW4nkPtVoyzJPrliudfHm+g39K5AZIxA/+clk=; b=GBvbCbOTHRLPz+fwsaYantRS3p6esh2w8cP4//oCJVh4YPz18GM66DT+wnbXQzzUP6APdb yJFjQX3sjAKXDRgBVdkZjlZ36WTBswhxrAtmg3jFOgraNjJ5uibT9xIF8qO9ML9Lcyy7Kx FGw0Skqa7bdEa7f5PJAnDoygDjLv6ZEDm64EWFCpcfV9NLFKUWw/8yHdQG62iaCsrWXxYT 4TvNdfQBDDaCIQdJDI7Yy9Ai3zA8Z1oVR9t6YeqJf65zu9gHFOMD7PRZ/kB+Cxld8rcO33 YCgUmGJYLM+iWVyzjeB2gJ5bZ7INPXOtbjO4HrxxHwp1M6aBez3kCjyb8+RQ9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470392; a=rsa-sha256; cv=none; b=KcPMXQvHpD8bUqea21iba7PHp3dFjh7ZjogA2TI7+ym63ufBNiZWImiLKfcTE/JlJuQpO1 O8RDrwApKOLP2BFyNYha5XIsp90Fbq6V1HNCuUrj76Rff6BD2DXDc3e+YKrymRX9nhFce1 8l8rMZEOE9qjKaDc1Lt5d0TCQ2/BaBxGLuzwt6+GR/rNrFu/rO77AE07kutUybStjuorW/ CVzslRx/qTSFJEpdin8X2zcqNc0TT6ALuncFu9+7sHqin8GH8c9v/iieOElmWvhQqvIGfM x0VGSZ+IYeN/84amXTaiFh9/xFx/j+oMUJdE+cV5WKW+4XD+rB9bbWdp2cC7Bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rm2XpZzNjL; Fri, 1 Nov 2024 14:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1EDCtP059878; Fri, 1 Nov 2024 14:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1EDCI3059875; Fri, 1 Nov 2024 14:13:12 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:12 GMT Message-Id: <202411011413.4A1EDCI3059875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 84553ccd0c8b - main - spibus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84553ccd0c8b1fa5b3f0b5b70a42a244f26cea75 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=84553ccd0c8b1fa5b3f0b5b70a42a244f26cea75 commit 84553ccd0c8b1fa5b3f0b5b70a42a244f26cea75 Author: John Baldwin AuthorDate: 2024-11-01 14:10:19 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:10:19 +0000 spibus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47373 --- sys/dev/spibus/acpi_spibus.c | 1 + sys/dev/spibus/ofw_spibus.c | 7 +++++++ sys/dev/spibus/spibus.c | 13 +++++++++++++ sys/dev/spibus/spibusvar.h | 1 + 4 files changed, 22 insertions(+) diff --git a/sys/dev/spibus/acpi_spibus.c b/sys/dev/spibus/acpi_spibus.c index 7241ad15bdab..9bce45b93dba 100644 --- a/sys/dev/spibus/acpi_spibus.c +++ b/sys/dev/spibus/acpi_spibus.c @@ -561,6 +561,7 @@ static device_method_t acpi_spibus_methods[] = { DEVMETHOD(bus_alloc_resource, acpi_spibus_alloc_resource), #endif DEVMETHOD(bus_add_child, acpi_spibus_add_child), + DEVMETHOD(bus_child_deleted, spibus_child_deleted), DEVMETHOD(bus_probe_nomatch, acpi_spibus_probe_nomatch), DEVMETHOD(bus_driver_added, acpi_spibus_driver_added), DEVMETHOD(bus_child_deleted, acpi_spibus_child_deleted), diff --git a/sys/dev/spibus/ofw_spibus.c b/sys/dev/spibus/ofw_spibus.c index 7fbff2f0c567..57a5f562c9b3 100644 --- a/sys/dev/spibus/ofw_spibus.c +++ b/sys/dev/spibus/ofw_spibus.c @@ -190,6 +190,12 @@ ofw_spibus_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +ofw_spibus_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static const struct ofw_bus_devinfo * ofw_spibus_get_devinfo(device_t bus, device_t dev) { @@ -216,6 +222,7 @@ static device_method_t ofw_spibus_methods[] = { /* Bus interface */ DEVMETHOD(bus_child_pnpinfo, ofw_bus_gen_child_pnpinfo), DEVMETHOD(bus_add_child, ofw_spibus_add_child), + DEVMETHOD(bus_child_deleted, ofw_spibus_child_deleted), DEVMETHOD(bus_get_resource_list, ofw_spibus_get_resource_list), /* ofw_bus interface */ diff --git a/sys/dev/spibus/spibus.c b/sys/dev/spibus/spibus.c index 3db3c58b4ef1..03083cfafc04 100644 --- a/sys/dev/spibus/spibus.c +++ b/sys/dev/spibus/spibus.c @@ -198,6 +198,18 @@ spibus_add_child_common(device_t dev, u_int order, const char *name, int unit, return (child); } +void +spibus_child_deleted(device_t dev, device_t child) +{ + struct spibus_ivar *devi; + + devi = device_get_ivars(child); + if (devi == NULL) + return; + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); +} + static device_t spibus_add_child(device_t dev, u_int order, const char *name, int unit) { @@ -262,6 +274,7 @@ static device_method_t spibus_methods[] = { DEVMETHOD(bus_get_resource_list, spibus_get_resource_list), DEVMETHOD(bus_add_child, spibus_add_child), + DEVMETHOD(bus_child_deleted, spibus_child_deleted), DEVMETHOD(bus_print_child, spibus_print_child), DEVMETHOD(bus_probe_nomatch, spibus_probe_nomatch), DEVMETHOD(bus_read_ivar, spibus_read_ivar), diff --git a/sys/dev/spibus/spibusvar.h b/sys/dev/spibus/spibusvar.h index 338bacd82dcf..6a74f9b1053d 100644 --- a/sys/dev/spibus/spibusvar.h +++ b/sys/dev/spibus/spibusvar.h @@ -79,6 +79,7 @@ extern driver_t ofw_spibus_driver; int spibus_attach(device_t); int spibus_detach(device_t); device_t spibus_add_child_common(device_t, u_int, const char *, int, size_t); +void spibus_child_deleted(device_t, device_t); void spibus_probe_nomatch(device_t, device_t); int spibus_child_location(device_t, device_t, struct sbuf *); int spibus_read_ivar(device_t, device_t, int, uintptr_t *); From nobody Fri Nov 1 14:13:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rn5x38z5bpgg; Fri, 01 Nov 2024 14:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rn4255z4bbM; Fri, 1 Nov 2024 14:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470393; h=from:from:reply-to:subject:subject: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/ZlKWKpftG+szYY9JYTExT8exw0pD7wlUJ0sSx28iw=; b=cGAeKeeJrUOIug6e/k5avxDOq5C74ic5SttyAbYURX6QRLePsbPMXLfa7FYtDERKr8nZMi js9UNvP6et7zJLF22FYTTQtnlvT5npZJJSFqobFAFUhLAV6+/qQKJywZr7lura/NsCSorm tj4l/YiKGjG8tlcsvAsSt32Yuo4HKd9r2j88sPj1qCtlaL644wvCPkNPDfa+eMM8uTc7rT DwMwzp4z/8x14mYTANDKcsG9mn3Y7tooLudIIKARqNAkDHQAahkN9CxqFXi6a7rF3Kh5+W I39PckqfyqjV4tDEglaW4+oSOhyVtMBCsn+nEpDnt2teXveL6Yoj26hLcTNzMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470393; h=from:from:reply-to:subject:subject: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/ZlKWKpftG+szYY9JYTExT8exw0pD7wlUJ0sSx28iw=; b=oLwX3rrclA5oJFtBGrw4zDcyZrBXhZD/NzcIJHX+7ccPCGj75gI7aOk5ABcPUUwmQjJP8d Zn1izTbSk/SLQWV7DIO89Z3aHqXA4ifdgFPKx/u+BorJnXC94tARMnnTvfruOCp/fNbMJN AM71d3Ihw0tgrpUnEIlJMvg0nj0h5zxXI5yW6g5VWeBm4K4oOKxzPo5ediFE0hqtDTKgBE KYKNx5Ycp/W/9PfbOrkBn8iZtaI2wN3yrBZmk1n/MRx6qTtscdU5puwUgIKMe/ssfUMPgo i0JMD2np/DkhsFOZV7pVW/N0wki91akbujFt7aLrIIg3yafGT1YpCLhdj0Zamg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470393; a=rsa-sha256; cv=none; b=Ps/Mw/n+rEcoruiV8ZIadhszoa7HxJ1pOZPnGR+eEd3GeeQkSXwZ/gOuuXNywNchyxoRLr 9hZEzlM0HkR/Yzss7ONHfUU0VRTwbUxq26fHN/kq3u8yLInEIG1kzvOjjzGeV2kKq/hXfH uADa4YVaCmGgQGTkFrhPw4EJwS8uKUrSzccez/lziQ7Rp9+1yIJDQ7QKaS4m5bIMddrcW4 tLFNzjK8mLBhkJgzOFkQXmeSOr3olPWjUw2Ps8f0RC8sDSgz37UJ8h1imdmZOpdjo3iWQf Pt3p6GklHo7SIBbDkHQz8GEHdrKi2TB2UIvJfUnhUnQs89i387ol409TzpzvsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rn3ckzzNjM; Fri, 1 Nov 2024 14:13:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1EDDef059929; Fri, 1 Nov 2024 14:13:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1EDDoR059926; Fri, 1 Nov 2024 14:13:13 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:13 GMT Message-Id: <202411011413.4A1EDDoR059926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: df6157359603 - main - x86: Remove invalid DEVMETHOD methods for leaf devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df615735960370255d3acc4ac2a6f4fd297b7461 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df615735960370255d3acc4ac2a6f4fd297b7461 commit df615735960370255d3acc4ac2a6f4fd297b7461 Author: John Baldwin AuthorDate: 2024-11-01 14:10:30 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:10:30 +0000 x86: Remove invalid DEVMETHOD methods for leaf devices None of these drivers are for bus devices, so bus_generic_* is not appropriate. Most of these were nops except that detach would actually "succeed" (but not do any cleanup). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47374 --- sys/amd64/amd64/fpu.c | 4 ---- sys/i386/i386/npx.c | 4 ---- sys/x86/isa/atpic.c | 4 ---- sys/x86/isa/atrtc.c | 3 --- sys/x86/isa/clock.c | 3 --- sys/x86/isa/isa_dma.c | 4 ---- sys/x86/pci/pci_bus.c | 4 ---- sys/x86/x86/nexus.c | 4 ---- 8 files changed, 30 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 1c38949f7375..58a135e827a8 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -1066,10 +1066,6 @@ static device_method_t fpupnp_methods[] = { /* Device interface */ DEVMETHOD(device_probe, fpupnp_probe), DEVMETHOD(device_attach, fpupnp_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index 0334aedd740b..a81413c291b3 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -1339,10 +1339,6 @@ static device_method_t npxisa_methods[] = { /* Device interface */ DEVMETHOD(device_probe, npxisa_probe), DEVMETHOD(device_attach, npxisa_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; diff --git a/sys/x86/isa/atpic.c b/sys/x86/isa/atpic.c index 556951d1b886..4ea80cfff7f9 100644 --- a/sys/x86/isa/atpic.c +++ b/sys/x86/isa/atpic.c @@ -599,10 +599,6 @@ static device_method_t atpic_methods[] = { /* Device interface */ DEVMETHOD(device_probe, atpic_probe), DEVMETHOD(device_attach, atpic_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c index df0acdd499be..63f41d866679 100644 --- a/sys/x86/isa/atrtc.c +++ b/sys/x86/isa/atrtc.c @@ -639,9 +639,6 @@ static device_method_t atrtc_isa_methods[] = { /* Device interface */ DEVMETHOD(device_probe, atrtc_probe), DEVMETHOD(device_attach, atrtc_isa_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX stop statclock? */ DEVMETHOD(device_resume, atrtc_resume), diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c index 0b5d2e614d67..68d6085d5891 100644 --- a/sys/x86/isa/clock.c +++ b/sys/x86/isa/clock.c @@ -635,9 +635,6 @@ static device_method_t attimer_methods[] = { /* Device interface */ DEVMETHOD(device_probe, attimer_probe), DEVMETHOD(device_attach, attimer_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, attimer_resume), { 0, 0 } }; diff --git a/sys/x86/isa/isa_dma.c b/sys/x86/isa/isa_dma.c index cf2f2ea417e6..6196d5a6a8e6 100644 --- a/sys/x86/isa/isa_dma.c +++ b/sys/x86/isa/isa_dma.c @@ -581,10 +581,6 @@ static device_method_t atdma_methods[] = { /* Device interface */ DEVMETHOD(device_probe, atdma_probe), DEVMETHOD(device_attach, atdma_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index 8aafbfb9d664..ca4773ecff9e 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -712,10 +712,6 @@ static device_method_t pcibus_pnp_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pcibus_pnp_probe), DEVMETHOD(device_attach, pcibus_pnp_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c index aa62c920bcd8..d7bb0292157e 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -761,10 +761,6 @@ static device_method_t sysresource_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sysresource_probe), DEVMETHOD(device_attach, sysresource_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD_END }; From nobody Fri Nov 1 15:45:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg4vM0ygkz5c056; Fri, 01 Nov 2024 15:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg4vL5ZfSz4rhD; Fri, 1 Nov 2024 15:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYuH0JwAzzXgcu2K96A4JnBS/TlM2Lht6T0xZqMgoMQ=; b=BWHbom1es2IgUek5bJqDpqjJlADQgyGN9nfN2yYY0rkCnL3C7Nw8k4T/FY+sOkupb4sP8c A6YEXwxFHoRMRQF8DHwYkGmQpIXYucpTIRwjItaHBYYc15AHJeFGdfwSmqNx7Ooeg1XQrO 8FBhopv0GxpnRlwbR+6cfZsb4rpegKVTF8BtuuhdlduLF/hgRPR8Mlv0gPEWLpimjRPhqu 9bbAbIiQWLBhVSDDK1EV84E+LFBe24TqG7zpxp5dyPJTOIR1l9ILCwkcsg7OKCwX/ycEcU rgGb/s5YRrS6tnmbPg3WYAmqpLHKr4b00ir1Lpr8eC+2nTz0g6hsmE+6/K+clA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GYuH0JwAzzXgcu2K96A4JnBS/TlM2Lht6T0xZqMgoMQ=; b=uEODH4OpwANfTWCZRh+Wph8ttyCGCb+Um95AgCLfAmQz0B/okfF0NdnHTlMssUcmbr/2G/ yrn5obawrv/TvUWbmIXpsnd9gJUJoIhVKmiK5/aABJQwTEDpMt39Sp8vpBH0/Pb5Jv8Zh2 E4TGINND3sGMmQzq8t7RnfzFYSliik/dRM/HhNtW0AsCrCv6vLvZgLg1lpu2cwAgZkFuVz xUg/OU8qt5BwshmYLc/nBp4Ts1fS+1YFg9UTv81ANaq4vC3OpAwRlA4UIT+DBBIsYkTbmG hZFqtKhYlyRYT46og+SpFDzme2fdSmteWTfNRVBM29BAjCaNXyUyi2+TCp6GUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730475934; a=rsa-sha256; cv=none; b=KYvF+5Ex1IiS1+QLZdRuWxfmn+ucZW1LBO91FqO1FfBZZafu+Oe/QMT8uMuLLiL/GtQNc6 RTxP68aJErcA5zlWQ/VXF96+6lNLBi7ocCD6y4D+9f33dr7EPtrElirj3qU2FJY4AHj7JM jmqnnSDPJS2Kv/0ie5Dk8cc1Dylc1OBpUGfBPIChJd/4k/gQwh0u43CXw1q13D4xcfZucm c7CJkTaZjRwxIklg1VpwX3OA4rjyswsA+wy2YQgN7mkpH5N63OXGT64MrRelkcXAQ4liIO lMh0mry6Up519ge28AiqlKJeEJ8wdvD6OOKXQDEKl+4XJBsqbcrTIMW5qihueQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg4vL4rSWzRMB; Fri, 1 Nov 2024 15:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FjYrt029006; Fri, 1 Nov 2024 15:45:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FjYZb029003; Fri, 1 Nov 2024 15:45:34 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:45:34 GMT Message-Id: <202411011545.4A1FjYZb029003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2ea829e3abfb - main - sysent: sort modifier flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ea829e3abfba1d6b5e81e0b5f06f3dcc0f3f72c Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2ea829e3abfba1d6b5e81e0b5f06f3dcc0f3f72c commit 2ea829e3abfba1d6b5e81e0b5f06f3dcc0f3f72c Author: Brooks Davis AuthorDate: 2024-10-30 22:47:28 +0000 Commit: Brooks Davis CommitDate: 2024-11-01 15:44:34 +0000 sysent: sort modifier flags These flags are a mix of excusive types and modifer flags. Comment the modifer flags and sort them. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503 --- sys/tools/syscalls/core/syscall.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua index 402595b998da..ca96fc160211 100644 --- a/sys/tools/syscalls/core/syscall.lua +++ b/sys/tools/syscalls/core/syscall.lua @@ -24,8 +24,10 @@ syscall.known_flags = util.set { "NOARGS", "NOPROTO", "NOSTD", - "NOTSTATIC", + + -- flags beyond this point are modifiers "CAPENABLED", + "NOTSTATIC", "SYSMUX", } From nobody Fri Nov 1 15:45:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg4vN1VYbz5c0MC; Fri, 01 Nov 2024 15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg4vM6lSTz4rlv; Fri, 1 Nov 2024 15:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjqb0KgE1wJj5t3ivdzx+87dVvfNeAkipXMVkkyPjM4=; b=x2QGoGTxYX/S5kM9GA/09L6LxlJ7qIx7ZzO1BKMBkBwU5Hxld8vmbqix3TiUN6/0afNp5g HMm4GADqLCl7jiErJNicfXwi4wdraFFDk/p2D1doHHkwPPOQZA3yZod4wcWdVIszGd8Lo2 cPRHIYCfAM1d5kBd4zjDtQ5yhxvwTOMbHXYs7hV2ub9pE2ywYh1QHiVWRX3uKRrAJ0KofR FH3Yw/69gfCB0IkSpP56WN9lepvth/aCZIlFbXthnMZZgTyoVi9Ta/9jk4rLX24MxIzDBW KnIw5vOXHeovO05YPOQR/1dI/WlUoOsQY17xi+A1JJzey5VBWqDNNB1nkLQjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjqb0KgE1wJj5t3ivdzx+87dVvfNeAkipXMVkkyPjM4=; b=qbclQbUWDq7XcPJbdxSbdwxtuk9UbHCVLS767JTQ1AXJcUZC4DGlutbRyTk6aTB9cz/pIs 4Ag4kVg/Vy1z8FlqAN/wZIf9aeNmP4245D+RrJktqUdwig5Q1tgsb5NfCc/8537eGO9WLX kCGcR4U086Rck0WvjTQvwLbOppf8AZ2DbXhiXWv3uonDoaNAl/S9FQD3qzGQjq5K8Z1Gs4 9kw9LRfwF73/ap0Byepa7QJ3CFRHcSMiO5HVzTzq93MK+UECdvoz9Nt60D90zbiDSoz1CW ovH+Sx2aeq2inSOLi52JGNPzRdbW2J+755kZKe9SVodNCeC2/C2wnaWybuZgRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730475935; a=rsa-sha256; cv=none; b=LwKkijO4lhD8SmUUtjwM35o3g5npNN9v7VLhEKBdrtGKq3ra/pfaDhioI8M3gH3PEPyn53 oRI8RzoXbIGUL0qep/Pn1IkyS5SWUGD/lGBTxncZLULbrn8SSpGC9/Sm4juVD8ABhsPkoU vlEDJjXCeUg4J4M5/uhuUGxeuERfOpGcm2h6KI8WuJ4VWoYDN53U55GlJNBu5APM0h1ona 6O9rQ+C4ZSJbQf9ZcPUhPxfn++MALJ0GTxyaN1X9Lqz4QVkIAacR5NXO9DK7UjSTTx5Svh Vt8NEWVc9BqZ9Zv9wN051uY1rsbHaondpWZO6tdKvbbGRP9sE+VOgiHlGDuWMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg4vM5w0tzR1x; Fri, 1 Nov 2024 15:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FjZOR029064; Fri, 1 Nov 2024 15:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FjZma029061; Fri, 1 Nov 2024 15:45:35 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:45:35 GMT Message-Id: <202411011545.4A1FjZma029061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: bbc0f33b1317 - main - sysent: add a NOLIB modifer to prevent stub generation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbc0f33b1317bb922ff3d960216ce7b4af88b8af Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=bbc0f33b1317bb922ff3d960216ce7b4af88b8af commit bbc0f33b1317bb922ff3d960216ce7b4af88b8af Author: Brooks Davis AuthorDate: 2024-10-30 22:48:49 +0000 Commit: Brooks Davis CommitDate: 2024-11-01 15:44:47 +0000 sysent: add a NOLIB modifer to prevent stub generation The yield system call has long existed, but never had a stub. Replace the hardcoded checks for it in libsys_h.lua and syscalls_map.lua and stop inserting it into MIASM (requiring libsys/Makefile.sys to disable the stub). (This seems like overkill, but I've got another case in CheriBSD so this reduces my diff appreciably.) Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503 --- sys/kern/syscalls.master | 3 ++- sys/tools/syscalls/core/syscall.lua | 1 + sys/tools/syscalls/scripts/libsys_h.lua | 2 +- sys/tools/syscalls/scripts/syscall_mk.lua | 4 ++-- sys/tools/syscalls/scripts/syscalls_map.lua | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 7a7530697e59..2bbd20b5a5b0 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -46,6 +46,7 @@ ; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. +; NOLIB don't create stubs in libc or libsys ; NOTSTATIC syscall is loadable ; SYSMUX syscall multiplexer. No prototype, argument struct, or ; handler is declared or used. Handled in MD syscall code. @@ -1679,7 +1680,7 @@ _In_opt_ _Contains_ptr_ struct osigevent *sig ); } -321 AUE_NULL STD|CAPENABLED { +321 AUE_NULL STD|CAPENABLED|NOLIB { int yield(void); } 322 AUE_NULL OBSOL thr_sleep diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua index ca96fc160211..e7e3dc3aac33 100644 --- a/sys/tools/syscalls/core/syscall.lua +++ b/sys/tools/syscalls/core/syscall.lua @@ -27,6 +27,7 @@ syscall.known_flags = util.set { -- flags beyond this point are modifiers "CAPENABLED", + "NOLIB", "NOTSTATIC", "SYSMUX", } diff --git a/sys/tools/syscalls/scripts/libsys_h.lua b/sys/tools/syscalls/scripts/libsys_h.lua index 75627f08750f..91349d5dc870 100755 --- a/sys/tools/syscalls/scripts/libsys_h.lua +++ b/sys/tools/syscalls/scripts/libsys_h.lua @@ -31,7 +31,7 @@ function libsys_h.generate(tbl, config, fh) local print_decl = function (sc) return sc:native() and not sc.type.NODEF and - not sc.type.SYSMUX and sc.name ~= "yield" + not sc.type.NOLIB and not sc.type.SYSMUX end -- Bind the generator to the parameter file. diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index 68438ee8d90c..49d3f6f86c20 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -44,7 +44,7 @@ function syscall_mk.generate(tbl, config, fh) for _, v in pairs(s) do local c = v:compatLevel() idx = idx + 1 - if v:native() and not v.type.NODEF then + if v:native() and not v.type.NODEF and not v.type.NOLIB then if idx >= size then -- At last system call, no backslash. gen:write(string.format("\t%s.o\n", v:symbol())) @@ -53,7 +53,7 @@ function syscall_mk.generate(tbl, config, fh) gen:write(string.format("\t%s.o \\\n", v:symbol())) end -- Handle compat (everything >= FREEBSD3): - elseif c >= 7 and not v.type.NODEF then + elseif c >= 7 and not v.type.NODEF and not v.type.NOLIB then if idx >= size then -- At last system call, no backslash. gen:write(string.format("\t%s.o\n", v:symbol())) diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua index 57bb5e9da93b..023b43052921 100755 --- a/sys/tools/syscalls/scripts/syscalls_map.lua +++ b/sys/tools/syscalls/scripts/syscalls_map.lua @@ -38,7 +38,7 @@ function syscalls_map.generate(tbl, config, fh) for _, v in pairs(s) do --print("num " .. v.num .. " name " .. v.name) - if v:native() and not v.type.NODEF and v.name ~= "yield" then + if v:native() and not v.type.NODEF and not v.type.NOLIB then if v.name ~= "exit" and v.name ~= "vfork" then gen:write(string.format("\t_%s;\n", v.name)) end From nobody Fri Nov 1 15:45:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg4vP3KZ2z5c071; Fri, 01 Nov 2024 15:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg4vP089Fz4rRs; Fri, 1 Nov 2024 15:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m0GG4bOFQIxPabYf3kW3Qdbn7YSdVq3k2SwxSOyMTV8=; b=YT01GdacRIy1FsrNWf4LhH9o69qAEzSmpIBwWGBBc9l1l/PmAzhkS2xVvaLubHPIEAicpd JIqTWNNGwhylqkWKsu5tTAYwgGNOZwPm+dlaxEvblPE8hJwxTvvFz79KjWvHjU9XLyuM4j ViJpcJUL5N4YKKcRKYHPbtukRXUXtcfqKTN2onS9zIPiBhWf0E+9m9s2SMhrDER9D2BCLT m6Xb4Vu6PkXQVJVS9ctjGXpOI/pCk9rRSrvagcQ6mhLX0JOnSt/1TdlrDf5ncFA808Adc9 zDpLbNWFq7Uu9HyIlaVngiGmApYMamyhhmaqIY0r2f3C06XTwr9+bgWVw64T9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m0GG4bOFQIxPabYf3kW3Qdbn7YSdVq3k2SwxSOyMTV8=; b=ODr9X+0C9BGNzoEvvfYmLFySuaRvyqDKwTECZTTMO7LxMRVWEdXux9dp5cg+OCnfOS5E14 XWM92i+X0vdPZe2T2uF6WtdDTAYy2PkwglA4cpuKv7UhleyMV2e38Qhr60BahRyRR70iEu Ss2tCHnwz8l2/v5+NFO0J+y17f76tzCo/QftzkcMwbxQe+AzwkPmgSRtKkMalRbUwq6r2O gtCFFAGEU/t2/qsX+KRTzl3JzkFLn+Rbqc7x9Jz2JfOYlevWgdziyVrlIWp4EvseQgYAd7 4IACQRSLBLp9pQfaePAw/nUN1/mRjzGRhprMKC9AfOCVnXbM2shZZcTG8J8bVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730475937; a=rsa-sha256; cv=none; b=A+ckNE94MHNw+M+zo2qMpUun7pn2A4q1BEnnNepwvsjRI2944zCl9S6MJW9q9qrWDqTvG7 C6mButCXNDNZjVCIjlqRZGszl07cTkwajnf1h7dVWWrQrrrl59Nlt2pdCHxHVhum0Pt7cb DqOhkRK7+7cPhmmcjn5sCLVd4E15O78fiD6/q01jUBd8i8Ibf7kHhaf2TLW8l83vtnYyar iL+oXyrmBM1FubyzUveXLmXxjpPU5hHy9KPRqqSqVRpbfkBccG6lSwnktDpLZvNBOprLBY MgucP3IqZKcRDPPjMXaKTbPvmrk3+I68y8HRcB++vgRGQzHJ9vnlUShbmBAn5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg4vN6sj0zRJj; Fri, 1 Nov 2024 15:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FjaNS029116; Fri, 1 Nov 2024 15:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FjaJq029113; Fri, 1 Nov 2024 15:45:36 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:45:36 GMT Message-Id: <202411011545.4A1FjaJq029113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: bed4c839735f - main - sysent: regen with yield marked NOLIB List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bed4c839735f141d9d40c77ec23dfdf50180d902 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=bed4c839735f141d9d40c77ec23dfdf50180d902 commit bed4c839735f141d9d40c77ec23dfdf50180d902 Author: Brooks Davis AuthorDate: 2024-10-30 22:54:51 +0000 Commit: Brooks Davis CommitDate: 2024-11-01 15:44:57 +0000 sysent: regen with yield marked NOLIB Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503 --- sys/sys/syscall.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index 4aa282724ab5..692c7d621471 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -196,7 +196,6 @@ MIASM = \ aio_suspend.o \ aio_cancel.o \ aio_error.o \ - yield.o \ mlockall.o \ munlockall.o \ __getcwd.o \ From nobody Fri Nov 1 15:45:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg4vQ1hx8z5c0H0; Fri, 01 Nov 2024 15:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg4vQ17Mfz4rq2; Fri, 1 Nov 2024 15:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mzlpvVenSlAmoVp/6V6VzNEfVvcKN2ee9zZeynoN2CE=; b=nmpTueoxGKdFxUbzuA2KoOtpQNudfclWPwIRX6GKtl+fXDYaCe20hb2KFKCsxIv6xUYVKg hkqlQZ+2lPQjnn2boo6JDuR+PdIWACGHLqL/n/GQlZvtZOHpQ15Ocn0DKN7ajRMtN7wtN1 0lC7CLCZK4arIVr+YVd7w/mheUW4xxINHgHc8JEViZNkIl126jz/Xe3Cgps7zEz4dQywBD ZpB4kVGsCy+maI31pBwLzJDcn3nW1zBQ50s7eX3g6ia2nQVzH8nqIkSM7lsv7RF77F0iY8 vAmGR6wWSOOKrknAGrq5CQasHkIKKUvkCaMN8Q5sMV8+8t9R5IxTR7emDQGdqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730475938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mzlpvVenSlAmoVp/6V6VzNEfVvcKN2ee9zZeynoN2CE=; b=nyNgspRiIs8ERisBn/iA98sw3IGb4XHBPDY8PXeL1md7zs10KAMA4Fan01qSAO1sB5/XTm /0EHmPGoDozskwfBlnZ13CpUa1PnymcUe1qfVnCn5emf6IMFQBJKu/OGYWr5rF1TmVN97A mYTCFeRvapnvv4WRHaBOvFgqWl8eXTYaaadCX4dSQCitwB/rNDGRmDEmeEUQZ8su0Jg29t Erhk419mOKeDWoXTuYtMuYbLvB73yRjmWieNpWlMYaJ4uy52rbqE4Q3iASenysFcPUbbNf OSXSyo8TEYCk71txtzQGZHEgPhYSBU5ZMb3rXzHR/l83GETKe9dzG5p5sWUhyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730475938; a=rsa-sha256; cv=none; b=qHcJKW+WFLKGwGiEX5B/UYPUjg5ul6J9bV9MvzfEaDyUySdK+RIo88qM0qCOh48CLFMcbz 7WjjmnaQ0CUIhAW06ILZaYmBam2QN7abw1x3QrzeG9XZ7B5qgLXk+t+6AGrJUVDr+SiAfi UQvi0TooV8dMNyXIJ703xwf6pIMJBwySbXGVyaj+S6VopNlJTs1GM9+/AIIlL73q9kYNNR nw1caplP7+FguNTOpK0p2j5YNYOTgFW1W53L8mLiQSDzlvdCh4+y/rivweZ9QCf9dhez65 6y6xr1YOAm+Fk+bJfyrK4eIDvj3/GCp3HzqADa8o3t3oScfnMABHE6VVjvZ+fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg4vQ0kdgzRMC; Fri, 1 Nov 2024 15:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FjcQl029175; Fri, 1 Nov 2024 15:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1Fjcto029172; Fri, 1 Nov 2024 15:45:38 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:45:38 GMT Message-Id: <202411011545.4A1Fjcto029172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 59a8b439aca5 - main - libsys: remove yield special case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59a8b439aca5e6ef3c603f3f9814cdbd234d4947 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=59a8b439aca5e6ef3c603f3f9814cdbd234d4947 commit 59a8b439aca5e6ef3c603f3f9814cdbd234d4947 Author: Brooks Davis AuthorDate: 2024-10-30 22:55:36 +0000 Commit: Brooks Davis CommitDate: 2024-11-01 15:45:04 +0000 libsys: remove yield special case Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503 --- lib/libsys/Makefile.sys | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index 04795445a374..87290a17820a 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -49,8 +49,6 @@ STATICOBJS+= auxv.o STATICOBJS+= interposing_table.o .endif -NOASM= yield.o - PSEUDO= \ clock_gettime \ exit \ From nobody Fri Nov 1 15:53:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg54F5XjYz5c0xc; Fri, 01 Nov 2024 15:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg54F4q0Zz4tbJ; Fri, 1 Nov 2024 15:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730476397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3THY3S51sgMoCfgLSuBFkLtummp/yPis+KCEdQkZQFg=; b=onT35JYLJ1NZJSvfXw6vxl1Xt/MNTShCxiCxoOuDN4/kqOEDz+vXJ9Zr41v70mVHjppB8O RQr5NUhppgRAO06UQt0eKOq+V/qHezVC9pUSzqiBtK0V1eAuSSYNU8ERAXHp93EUWqSFc7 hk1PB9IBHMO6XI2Xm4jGbtiL75+U1eBYBHc6psDURSaI2o1UgXX2rtIf8RulWaDxOOcr1L vw2ekhPLHOX+0fFncjXOF1YQClsf8muNS8VWtRE9k/itF1/o8rVEOMs2/slm2lxQGrbfuR S1hbL7dGBWJveC/Uoinu5Q5tOsCR9FAR8jC/y58oUsDmKV8EamTWkIKUKLIo8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730476397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3THY3S51sgMoCfgLSuBFkLtummp/yPis+KCEdQkZQFg=; b=bmibcFGR/LFL3DTjVGOJI9KTqIkTCEgksIa/0UjGwuqWtm5Sk44+wb1uANc6LC5o1B9euf HOO3kVLT7+/HA5LAbpiNeaofBbp6qwgHgR5TLvfw01l6KD1RF/3JM1PZ0FXdwsbkR9Lcyf AxLNM3I4C+gJ2tT+leb7FQ+C3Y+NY5yTU/o+4LTplwa6dF33wt0WInq08KfLZvgEa7sgC5 q1COqwMVdqr1mnIgViWeurXr8jeDQ8Vk8rDubmXcd8VEDuI185srP0444Od7yj2RTOYhBF wVC0A+UztwIO3euqW9EA1achI/Jcv1ouEAschFKBmbg7XZSuGitb9ZMH0uRooA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730476397; a=rsa-sha256; cv=none; b=e9AIfa8zcxSrIfxz+7Tw5OvhhhYBRLQcOKN3WKaRQTslkxnjVc9wFOTtU5O1LuvPAPdKYe RXbvwb7OtLLuThp6M9afOGVw2paBwcBOV6Ay1ZGhFAqN77sGtM3EPl9FAsvLr0Abmt8qVr G/S7xijYTkZ4/u1+mylrBWOeTEqaCU5CINbZQR1S5/AxyNVz8HfmYtD3xNkdTWNRJb/TVU KDnUo3JhpIbZxyo6t9mYcXbWKOe+PQq5ONP+Y9oEugM5y/6xQwaj9rz8JrbEmydgCky5sc V3w5wQTHYelyqSDc4RcxeKJpSBAiM63khPJHpBGmFx08XXvcwbHXnodaFXs/4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg54F45yqzRQZ; Fri, 1 Nov 2024 15:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FrHnh047160; Fri, 1 Nov 2024 15:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FrH3e047157; Fri, 1 Nov 2024 15:53:17 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:53:17 GMT Message-Id: <202411011553.4A1FrH3e047157@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 79679a18eacb - main - fts: Simplify fts_alloc() and use calloc(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 79679a18eacbd0f34d24d749ee379e3089045c00 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=79679a18eacbd0f34d24d749ee379e3089045c00 commit 79679a18eacbd0f34d24d749ee379e3089045c00 Author: Dag-Erling Smørgrav AuthorDate: 2024-11-01 15:51:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-11-01 15:53:11 +0000 fts: Simplify fts_alloc() and use calloc(). Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47382 --- lib/libc/gen/fts.c | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 976edacc361e..770a7b2cc322 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -1026,44 +1027,32 @@ fts_alloc(FTS *sp, char *name, size_t namelen) FTSENT *p; size_t len; - struct ftsent_withstat { - FTSENT ent; - struct stat statbuf; - }; - /* * The file name is a variable length array and no stat structure is * necessary if the user has set the nostat bit. Allocate the FTSENT * structure, the file name and the stat structure in one chunk, but * be careful that the stat structure is reasonably aligned. */ - if (ISSET(FTS_NOSTAT)) - len = sizeof(FTSENT) + namelen + 1; - else - len = sizeof(struct ftsent_withstat) + namelen + 1; - - if ((p = malloc(len)) == NULL) - return (NULL); - - if (ISSET(FTS_NOSTAT)) { - p->fts_name = (char *)(p + 1); - p->fts_statp = NULL; + len = sizeof(FTSENT) + namelen + 1; + if (!ISSET(FTS_NOSTAT)) { + len = roundup(len, alignof(struct stat)); + p = calloc(1, len + sizeof(struct stat)); } else { - p->fts_name = (char *)((struct ftsent_withstat *)p + 1); - p->fts_statp = &((struct ftsent_withstat *)p)->statbuf; + p = calloc(1, len); } + if (p == NULL) + return (NULL); - /* Copy the name and guarantee NUL termination. */ - memcpy(p->fts_name, name, namelen); - p->fts_name[namelen] = '\0'; - p->fts_namelen = namelen; + p->fts_symfd = -1; p->fts_path = sp->fts_path; - p->fts_errno = 0; - p->fts_flags = 0; + p->fts_name = (char *)(p + 1); + p->fts_namelen = namelen; p->fts_instr = FTS_NOINSTR; - p->fts_number = 0; - p->fts_pointer = NULL; + if (!ISSET(FTS_NOSTAT)) + p->fts_statp = (struct stat *)((char *)p + len); p->fts_fts = sp; + memcpy(p->fts_name, name, namelen); + return (p); } From nobody Fri Nov 1 15:55:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg56p2pCQz5c14l; Fri, 01 Nov 2024 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg56p2DgYz4v7H; Fri, 1 Nov 2024 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730476530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FX+9XntlUaypG+FpjYG3jvr0qvjtMOUKiWM2DNUPGNA=; b=AEv45QR7s1bspge0hTwioEAAtdqmQDBZbvd9O5Q7SqKL/fTpAhXkKKTDR1yWDEV+AiMshb G0AusutLQ0V/bVPrWhRKFyxG9VZ8PRwYvRBisnAPYbvwtADz5EdYRRDO6yfMMUHi5npIxo OSyJ+1mIhnBDfJuF9w0OwT2uFTfJmqybJ6V8iKmyn4AkRsNbvOinpuxZ/hGYVmGGKPAvsW hX8sXS5FyGDrTAvQe1AuffxUFCIOpZnh3IidFRjGshiMVnBPw4+APCpUMe7BSaKZ3LFWyc E3uoJRhufeWGNZCLtnZQggfhMtW6SC5KZnCoB7gk4MQ/dZrFbMoBtdYzQskxCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730476530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FX+9XntlUaypG+FpjYG3jvr0qvjtMOUKiWM2DNUPGNA=; b=VKWuvh+SrluqsUy/NRUOl3hrpm5SABp0hI13JzxUOONsUkLk9BkE5CekNND2udQFv6QlTI ugBzyzqIVuuZINQ+zl5Jv0DIQuYqRSh1TEcGE+Lz7TDFnNchUbNB+ZI01U8gVIaKykClT+ JNqIc7mAX/EhRDGV5sZtLe1hQkkzvZRf1N277D8xdTRKx88ZNuX9+TEMPD6fi+tHoAYECg bUjqsixLrjHkZPA2gR8PJ3Pix07qNOgorUvNYz/PriHy/38C7gpTmT9eRT31efdr0d/FPC r7rQ1o1AweyaNt6/tBORSfLyD1azZ2KrP+1/GYeyJ5+tqUCUrQySJfvUmETs5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730476530; a=rsa-sha256; cv=none; b=vAyC0xc7yryUGkAk7BLI4cbY5IjsWyDQWop3eCcYO7PMP68gsV5EpkBOSm9NK8dVdhDNFK v1Fqnpgq0crLHNQF6fQIT24ghY+t1DiL9DmPDx+Sy65T+5gQhIcbyfNWlCAhou2dadLJju 2zS63pqxFPXqLvLQWqV5x81c4F8HGkqnqrDC1NoljGU8eIYECq85MjF699uOwalWwxAKhS BTsukirDfxa8WdolLBw2p13RXvzgCp4zB/Hc9EkdqDfSmaxkIf2apJLuAfRGUKyWHpGk8H Ruo5Gyqr+ZDnoHMLF6/LdyjAw8CIh9KShe5JN49uyJAkoBL3nGBEId7IDRDLuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg56p1jf4zRYC; Fri, 1 Nov 2024 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1FtUGd048011; Fri, 1 Nov 2024 15:55:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1FtUps048008; Fri, 1 Nov 2024 15:55:30 GMT (envelope-from git) Date: Fri, 1 Nov 2024 15:55:30 GMT Message-Id: <202411011555.4A1FtUps048008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f65c19a242de - main - kbdcontrol: correct bell frequency for vt(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f65c19a242de322930f6a1cd7d5e6bf3ce19ce42 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f65c19a242de322930f6a1cd7d5e6bf3ce19ce42 commit f65c19a242de322930f6a1cd7d5e6bf3ce19ce42 Author: Ed Maste AuthorDate: 2024-09-26 23:55:33 +0000 Commit: Ed Maste CommitDate: 2024-11-01 15:54:40 +0000 kbdcontrol: correct bell frequency for vt(4) Do the `1193182 / pitch` hack only for sc(4). PR: 281713 Reported by: Rudolf Polzer Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46803 --- usr.sbin/kbdcontrol/kbdcontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 4e27febe2164..349dcfcaff8a 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -1038,8 +1038,10 @@ badopt: warnx("argument to -b must be duration.pitch or [quiet.]visual|normal|off"); return; } - if (pitch != 0) - pitch = 1193182 / pitch; /* in Hz */ + if (!is_vt4()) { + if (pitch != 0) + pitch = 1193182 / pitch; /* in Hz */ + } duration /= 10; /* in 10 m sec */ } From nobody Fri Nov 1 16:11:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg5TM3Stzz5c2Jg; Fri, 01 Nov 2024 16:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg5TM30jQz3xKC; Fri, 1 Nov 2024 16:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jImiQCUBin9DROI9Z5KaDb8xKXCFJen00H4Sh3y8uM8=; b=D4+DHBRUrv3vTjyvGDpldt9lgeLrQD6V0Nl+ClWOIOzRB4DkmRvMVUFPE/OlXyfcQl8nYy 1h8aRGE0ubpd4HPR56AJC1TOKnfQXW7BIu2wkQoG/U/+wSdsCHwPDS+qC03Sr/6ZUW9CDR FhopOPzcwJx+VwdciNSfGtHq1Vs2R4AaBmT8wshhVFm9F1Pk6iZpWvNU4tJ4DPjIq1dG7T nmh5cWeBGkefiEDvTaZBm8Da2BnoRawSZTOwGMr776xg7AjuwSnMN7E7qsD+lKNGdJLA4r lKu5QBbsDyhGjMxhpfVX+Je9QycrtEjzEikaE2nWqa25Z91VNQe2M88YweLUEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jImiQCUBin9DROI9Z5KaDb8xKXCFJen00H4Sh3y8uM8=; b=P/NwHNbauacqCDGH5ukFDg/GdJzBqrlrw4H/V5zN/isfSdyh+TKBvLt7UrUflR+4Tye7ZG fF1cO019PsfIky5P9wIvmrHrXpZfjHWALhkj95ZTH2yho3EKw34m9p0AvHQS2pNDvZbSUD dBT6zQfVTxY2tyWy+pukvW5yFJ7+Ya7FsHat02mUeYx8E7iqzuRX13Xk5ShPTMgeYgCawd kbBe2mEr3Yiy0n1H39N4EsrdgD9ZO8+43buKVy2WePf9BnGK7sWWzZVMeQC1q1t0s2YUap 85ouuEZEJVbfaz40r7qoqCTaJDY8CHiYUXZ09Xpd4KVA8LDke9AiN3BRg7P3vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730477495; a=rsa-sha256; cv=none; b=Med+15Qf+xXT0o309jHKpyI1kr+lbXusnoky8RC7O9w+ah8EMjm64Q5zaepyA5Wgdq54Uc bUcht35WD9c9SqMx8ubjFii1lVAopRgfwJwPNVqfFGxnYScbnGnhrYgyL3GLzzm0cBBzuA K4XVuFnFOCbYx8+0rvzhGmKGv9C245W/RHjX/8lJDBrJngR7S+eX0QGVP7Ix8wllQRhLnN mfSi+y3eyQ97dvbblh818xRDKTxgiw8fCq9Q8GQPXmBWEitoT3f37EWvR0wS5xiy01V9vP vf5U0ZbUabr6dbVQmpDnRn8rj9ofLhVtOUrVophVKK0nqA81asyj27bMjCq4rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg5TM2cNYzS1B; Fri, 1 Nov 2024 16:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1GBZus080093; Fri, 1 Nov 2024 16:11:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1GBZWN080090; Fri, 1 Nov 2024 16:11:35 GMT (envelope-from git) Date: Fri, 1 Nov 2024 16:11:35 GMT Message-Id: <202411011611.4A1GBZWN080090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b2dbd3d3ae33 - main - pctrie: reduce code duplication in PCTRIE_REMOVE_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2dbd3d3ae33286baa3ce4a07bd697c50b450e7a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b2dbd3d3ae33286baa3ce4a07bd697c50b450e7a commit b2dbd3d3ae33286baa3ce4a07bd697c50b450e7a Author: Doug Moore AuthorDate: 2024-11-01 16:10:19 +0000 Commit: Doug Moore CommitDate: 2024-11-01 16:10:19 +0000 pctrie: reduce code duplication in PCTRIE_REMOVE_* There's a little bit of code that appears in each PCTRIE_REMOVE function in pctrie.h. Make a new function for it, and invoke it from those PCTRIE_REMOVE functions. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D47320 --- sys/sys/pctrie.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h index 54b7fb401202..8556f08561b9 100644 --- a/sys/sys/pctrie.h +++ b/sys/sys/pctrie.h @@ -311,6 +311,14 @@ name##_PCTRIE_ITER_STEP_LE(struct pctrie_iter *it) \ } \ \ static __inline __unused void \ +name##_PCTRIE_REMOVE_BASE(struct pctrie *ptree, \ + struct pctrie_node *freenode) \ +{ \ + if (freenode != NULL) \ + freefn(ptree, freenode); \ +} \ + \ +static __inline __unused void \ name##_PCTRIE_ITER_REMOVE(struct pctrie_iter *it) \ { \ uint64_t *val; \ @@ -319,8 +327,7 @@ name##_PCTRIE_ITER_REMOVE(struct pctrie_iter *it) \ val = pctrie_iter_remove(it, &freenode); \ if (val == NULL) \ panic("%s: key not found", __func__); \ - if (freenode != NULL) \ - freefn(it->ptree, freenode); \ + name##_PCTRIE_REMOVE_BASE(it->ptree, freenode); \ } \ \ static __inline __unused struct type * \ @@ -340,8 +347,7 @@ name##_PCTRIE_REMOVE(struct pctrie *ptree, uint64_t key) \ val = pctrie_remove_lookup(ptree, key, &freenode); \ if (val == NULL) \ panic("%s: key not found", __func__); \ - if (freenode != NULL) \ - freefn(ptree, freenode); \ + name##_PCTRIE_REMOVE_BASE(ptree, freenode); \ } \ \ static __inline __unused struct type * \ @@ -351,8 +357,7 @@ name##_PCTRIE_REMOVE_LOOKUP(struct pctrie *ptree, uint64_t key) \ struct pctrie_node *freenode; \ \ val = pctrie_remove_lookup(ptree, key, &freenode); \ - if (freenode != NULL) \ - freefn(ptree, freenode); \ + name##_PCTRIE_REMOVE_BASE(ptree, freenode); \ return name##_PCTRIE_VAL2PTR(val); \ } From nobody Fri Nov 1 16:18:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg5dS2fvgz5c2ss; Fri, 01 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg5dS1z0Lz3yfD; Fri, 1 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as79dt008Rz0ttQYTQBFflpFIjXfyEPnPXEHtxgd/oI=; b=wrP79q/w8yba4QvErL/nG4p8Wci2+17mty6GEDCRqNQPgl3LLXotbqylZZiNRehQ/C5Bta V0v1j+r0xvZPoVoma5y6XwxQj6M/B7yzpYmg7B4DhQ5UdsHHsKZF1GwCFHPbriJLwDnprS yU6p+zSWHvVGjFJeCxd6EXYvxrftF0ZbYLzVujf7YF7sUuVKIjQmZdtzPCCiFUEsQ5YeRv XMkdi8z2GU5yToUNUYp5+YMzMIGI9wVKTl+zxc7KTsCGKU5geWR3xgdhnepevgMnl1LEtG Hn8WALpvgJiTZEj/GPrE8pZgDeDeDYyNIsNeaXNdqFCfbX264NA3M1FbL6y+XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as79dt008Rz0ttQYTQBFflpFIjXfyEPnPXEHtxgd/oI=; b=jvdeyS3eTy2RrYYnWUAECTg5qBx3fH/YM+QW74ZSTsDC691wtVJ+y5Q/ueZ47lqtTBMHNw sBinfKVvrYLd1x5OsTOM4XenwHovKx9fsOpIe+MdKAW7yuJ8BPWtJC87zn8KWgkuS8ox48 VzF86KFkMKvONFymXc9WuJeDGetFinAGn+P1WXRPQ+Jj0X2aBk5MgymPPNikGqTvadR4sU vf8SWzudILqA0REmSkaMGNGqB7syk0W2sPPhOKPrbLoWj/5oNP/vvfH2z9XpZxQvdPtPaa FRFFMIbKqEN+l54JMgTgX9dTNm/Sz6cScNBmpBqyvPIsxWksyVzCnM+QaDK/Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730477916; a=rsa-sha256; cv=none; b=kVqUoXRjCSIesw5ruV0rgPAqvBBXSyQgTlLdZBuyZarPRR6bkEtMOnbzP8Vib/TrKwBvgn V11KCSYYmW6fO1aT36U9iITt4O0SpCOB7cTKbagC6CiTnjre+mM/IQvHqNa7a0EwfsCzf6 LSReJn9Vpi6yB+L6h7Jke4fDti7PRA1Ml5S3YVV/Yn4iXDZkGHoCgnxavWYXgTkoJootiS vujps/7ZJXolCgQtpc5qPCGAO0jl5zXlgFvMy5zhMkuVME0wIgtNYIp1TQJZ7rrzX72Rua 0gpFFVp/eQejko41sWIohkcQLZcvYAB0IMtxVSxPM3n+Ttsa8fWT/DxdbKNRUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg5dS1Rb6zRrD; Fri, 1 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1GIa5m087075; Fri, 1 Nov 2024 16:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1GIa5s087072; Fri, 1 Nov 2024 16:18:36 GMT (envelope-from git) Date: Fri, 1 Nov 2024 16:18:36 GMT Message-Id: <202411011618.4A1GIa5s087072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2416be588ea1 - main - vt: Fix frequency calcuation for bell List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2416be588ea113cc06b924ed85861ed3bc391fe0 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2416be588ea113cc06b924ed85861ed3bc391fe0 commit 2416be588ea113cc06b924ed85861ed3bc391fe0 Author: Warner Losh AuthorDate: 2021-11-03 21:55:55 +0000 Commit: Ed Maste CommitDate: 2024-11-01 16:17:36 +0000 vt: Fix frequency calcuation for bell 386BSD provided a MD function sysbeep. This took two arguments (pitch and period). Pitch was jammed into the PIT's divisor directly (which means the argument was expected to sound a tone at '1193182 / pitch' Hz). FreeBSD inherited this interface. In commit e46598588587 (svn 177642, Mar 26 2008), phk changed this function to take a tone to sound in hz. He converted all in-tree instances of 1193182 / hz to just hz (and kept the few misguided folks that passed hz directly unchanged -- this was part of what motivated the change). He converted the places where we pre-computed the 8254 divisor from being pitch to 1193182 / pitch (since that converts the divisor to the frequency and the interfaces that were exposed to userland exposed it in these units in places, continuing the tradition inherited from SCO System V/386 Unix in spots). In 2009, Ed Shouten was contracted by the FreeBSD Foundation to write / finish newcons. This work was done in perforce and was imported into subversion in user/ed/newcons in revision 199072 (https://svnweb.freebsd.org/base?view=revision&revision=199072) which was later imported into FreeBSD by ray@ (Aleksandr Rybalko). From that earliest import into svn import to this date, we ring the bell with: sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); where VT_BELLPITCH was defined to be 800. This results in a bell frequency of 1491Hz, more or less today. This is similar to the frequency that syscons and pcvt used (1493Hz and 1500Hz respectively). This in turn was inherited from 386BSD, it seems, which used the hard coded value 0x31b which is 795 -> 1500Hz. This '800' was intended to be the bell tone (eg 800Hz) and this interface was one that wasn't converted. The most common terminal prior to the rise of PCs was the VT100, which had an approximately 800Hz bell. Ed Shouten has confirmed that the original intent was 800Hz and changing this was overlooked after the change to -current was made. This restors that original intent and makes the bell less obnoxious in the process. Reviewed by: des, adrian Differential Revision: https://reviews.freebsd.org/D32594 Sponsored by: Netflix (cherry picked from commit ba48d52ca6c867559156dd916631f9ac47abe80f) This change was accidentally reverted in 80f21bb039ce. --- sys/dev/vt/vt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index a579183658fa..8f5e45306d61 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -119,7 +119,7 @@ static const struct terminal_class vt_termclass = { /* Bell pitch/duration. */ #define VT_BELLDURATION (SBT_1S / 20) -#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ +#define VT_BELLPITCH 800 #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) From nobody Fri Nov 1 16:52:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg6Ns281zz5c5y8; Fri, 01 Nov 2024 16:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg6Ns1Xwcz44BP; Fri, 1 Nov 2024 16:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730479965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVSl83RNvNLHzJ5XqPzPCZdr+W06Id6MDZYltJm1qF8=; b=Ku8RQUaE96rQhD5E8iVlFHcq14MtglNSJRqUMaSFv3COVD4uyQnQ4itJPd92jVoEia2eQT mexHa52+bpw3SR0IQNOYVoanRJLpWhahbAeQLx4REK7nBcQPm8Am00euCodXLN7bAzHfd9 1dmrXLvAkj3RM/GIBoYmDeLfK3ELB7onC3mhSR48ncIPDjMxjI7yjn4ygTuD6Lmi6RhcMC frX267RrZafhxxXudAYYotpNqRhNvCO4gueT79LoTNGdbY2EAqtgNWVYIiyoP8tSiFOmvS D/apUMpME9NqaxY0pL6PpDsn6mxiXm752WPWOu61k8ZmOUoLebDUyiimw7n53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730479965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVSl83RNvNLHzJ5XqPzPCZdr+W06Id6MDZYltJm1qF8=; b=cHJ4OkMtrq8Q11ch9bpGrTnpap7/FN/SWvi4fTnRUP1jfCpwl8ifMBjMQbtIxQB1C8NjpD ol3XUlNSlO8nPhp0O2wejHGLXan3wckLghUbQI55+4IGTaU4kR7RyKGMJ9Z08MrCmNDRmR Tp2DXkq371xe3mcGzK7xqF79MUzF135r9NMYQZp1461AwcmZJ4YG+qE6Dmtbn28+/cmgtq Qy3q/DMg9ZcGrcf16GU2rI3zpONWsjTlyiW1Uvh+1RaYTtisZuOA0NxaBpZeNORcEVXmc0 evnWXjNRYsCnuImv7hhU+LL+zK5MbKlCwQ8ROr/qS8nR1IM4wiYO3ST/TMyPcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730479965; a=rsa-sha256; cv=none; b=bFvM6lvUEC98ip2mSMO6iGCw5nSZYdivHhHnyKpLSa+QyWj1fO6A4VwzpM6alQ/e5ksM+E kHIbPkwqyBTxpJyL7Xr5UYOkmEeBrsYdamzHkMahT8JIC6EswpAoTo2Z77bi1LlBkDRNb7 zlH28iBKl1hfGDyOHglbLVc0y/x2trzlPmtUy3Iu18VSG7vs84xe7aylaF4QBn0jKlRmE2 WTF8RNd44Vbl6qQ3ACs/JS/BHfdSVv9I3IFxDkNKVU/8q+v7beSbF0oozdpaqSFZfeA4hP qB1g2Krsz9a3VWkceJu/2oj4B0FFa0wjLAYP9d8eHYaqqZq6P5ZW+pYwMby1UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg6Ns18fMzSWn; Fri, 1 Nov 2024 16:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1GqjQ1058949; Fri, 1 Nov 2024 16:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1GqjUJ058946; Fri, 1 Nov 2024 16:52:45 GMT (envelope-from git) Date: Fri, 1 Nov 2024 16:52:45 GMT Message-Id: <202411011652.4A1GqjUJ058946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 6baae68d7f31 - main - release: Remove binutils List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6baae68d7f311f4ee0e844782dbaf4f3c9b223ed Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6baae68d7f311f4ee0e844782dbaf4f3c9b223ed commit 6baae68d7f311f4ee0e844782dbaf4f3c9b223ed Author: Jose Luis Duran AuthorDate: 2024-10-18 03:17:57 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-01 16:49:51 +0000 release: Remove binutils Reviewed by: mhorne, emaste Approved by: emaste (mentor) Fixes: 74e8d41e0ac8 MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1485 --- release/packages/Makefile.package | 2 -- 1 file changed, 2 deletions(-) diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index 87585f7eac38..4a31406c7c53 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -17,8 +17,6 @@ autofs_COMMENT= Autofs Utilities autofs_DESC= Autofs Utilities bhyve_COMMENT= Bhyve Utilities bhyve_DESC= Bhyve Utilities -binutils_COMMENT= Binutils -binutils_DESC= Binutils blocklist_COMMENT= Blocklist Utilities blocklist_DESC= Blocklist Utilities bluetooth_COMMENT= Bluetooth Utilities From nobody Fri Nov 1 17:55:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg7nc58GNz5cC0M; Fri, 01 Nov 2024 17:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg7nc4Dyqz4FPM; Fri, 1 Nov 2024 17:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730483748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j74uT77FyMeg1waybl2o5e0gARio30Iv1V4qoj66Fog=; b=tYHngvhmfBh5xyWoHKu8UKbU8w/T2SoczdouqBz2t0bo2/RwJ+BnwG0LkUPleNtcbodpbo yNVTHFiMw4/3EL5jA/SVcHEdX4HscZBH59qqlAatoYzfAksT3IT5sWCUVScJw0d99g3Tdj 7/0IvJjzPT/zCVnYB88KIabkltByEK4pm8FkDLQDf+5GvHe2S4uwWXIDTuaJl8+BdSU1l1 h+oJXP4YWriN+7MJtgRFK5c2SYpE1MCrGvVJPEg4obw8Rxv2J7yI/loxoBnGq2YjKVcNOq yEOjsgKnlf4xtwfQxdJrWhKjLt00q9oWaKeF0kU+eVja2GhUVebdnvx2bbw5ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730483748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j74uT77FyMeg1waybl2o5e0gARio30Iv1V4qoj66Fog=; b=LTwXXje+h0sM8TJTPhvWbnLeELD/wwfjXidFt2mNGbSgLaC9tXszm38ABvw0e+BBzLdfei UUHUX1hGJEUPSi18TlNvvl6bFx8X5sxI2XIMxhTbq6Sirmm6/Evf4jjvuPLkRnKe6SdV9v Zh/XaEww4UtN3uN1nofQ+72yXoxwS/E0lXP2LbUuqSwjqhhhMpQvE8INbLNjUOGQoiBrEe IVPTrjiPXufm5M3ZT2QldClbGGs0Oo0KHPHfGOyklTfB/dqmWzhYZw6dC15qsesdc7W6Jw dbCSxohJ7uZ3EjS3SHZ/mOQY1FOvYptKC5ape2VOvQVHNGwJkOYxXvUdyV1YAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730483748; a=rsa-sha256; cv=none; b=qu0+4t4aheLZU3ANkJf0jwXi6rjvBcj1CZ7+izU1MWQO/aKoCyOeKPi35n9kYuF06bjg8C lOmT4qCr+j1QCCI8PDjeDYX+BdFPMpjYfm4gBV1tF6wGzafi1oaLmBaTBiaFPY5e+1MKMs zNrpz3gBCiHVwdTNhOJy/+Kp9gNACK0fpiK6A2OwNeVbR6/z329aze9k4RZqjB77a3w9zY nYq0Zl5U2UJb+oWYThMJ28JPQzt0JjhQ8FRwPmoynwzVkGkcKovVtt5aEWw/klAeuyn3qv JiT/tR5upcOYsqbo/4LFDWbxyN1PlUFm3VfO+fC+eItqNZVLIGYZxDMXrLjAFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg7nc3rVdzW09; Fri, 1 Nov 2024 17:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1HtmL5072483; Fri, 1 Nov 2024 17:55:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1HtmtH072479; Fri, 1 Nov 2024 17:55:48 GMT (envelope-from git) Date: Fri, 1 Nov 2024 17:55:48 GMT Message-Id: <202411011755.4A1HtmtH072479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f3d3c63442ff - main - newbus: Simplify reallocation of devices array List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3d3c63442fff813d4941e0c73b7260834642422 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f3d3c63442fff813d4941e0c73b7260834642422 commit f3d3c63442fff813d4941e0c73b7260834642422 Author: Warner Losh AuthorDate: 2024-10-31 22:50:42 +0000 Commit: Warner Losh CommitDate: 2024-11-01 17:56:20 +0000 newbus: Simplify reallocation of devices array Simplify the complex expression down to what it is on 64-bit systems. 32-bit kernels would allocate 2 at a time. Replace all that with reallocf which will eliminate a bunch of copies. This should be faster and simpler on both types of kernels. In addition, transition to M_WAITOK since this is a sleepable context. Suggested by: jhb Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47362 --- sys/kern/subr_bus.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 8fec2b3de139..cd5f97cc72fe 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1229,28 +1229,18 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) } /* - * We've selected a unit beyond the length of the table, so let's - * extend the table to make room for all units up to and including - * this one. + * We've selected a unit beyond the length of the table, so let's extend + * the table to make room for all units up to and including this one. */ if (unit >= dc->maxunit) { - device_t *newlist, *oldlist; int newsize; - oldlist = dc->devices; - newsize = roundup((unit + 1), - MAX(1, MINALLOCSIZE / sizeof(device_t))); - newlist = malloc(sizeof(device_t) * newsize, M_BUS, M_NOWAIT); - if (!newlist) - return (ENOMEM); - if (oldlist != NULL) - bcopy(oldlist, newlist, sizeof(device_t) * dc->maxunit); - bzero(newlist + dc->maxunit, + newsize = unit + 1; + dc->devices = reallocf(dc->devices, + newsize * sizeof(*dc->devices), M_BUS, M_WAITOK); + memset(dc->devices + dc->maxunit, 0, sizeof(device_t) * (newsize - dc->maxunit)); - dc->devices = newlist; dc->maxunit = newsize; - if (oldlist != NULL) - free(oldlist, M_BUS); } PDEBUG(("now: unit %d in devclass %s", unit, DEVCLANAME(dc))); From nobody Fri Nov 1 17:55:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg7nd5qC7z5cBmm; Fri, 01 Nov 2024 17:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg7nd5Byjz4FBL; Fri, 1 Nov 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730483749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCm0P6gW47h0/wQ2zX96z8OHSJXL8Xb88s/6LuJiBJI=; b=eC17FckG7GOqdPZRZxGFvu4lkbHFXk1JsQVYPgwkbIEvbJi+gM3r68nJk9s3TsKWs67IFW kOgtjeIyZpGS74H6TW1VsY11hWBTOf6pFyP8FKZ0VocASyL+NVRyD94J7tIVDfcVMfGTMk bqXoqiZ9rhrEhEW5xKbr+5iv7891OyNdtCiMuo2ly8E1EG0aKlZdeOjA4wvUshSheer4r6 P9F1ZMjrgNiBmYMEfnpY/ly6kOAS5DrtTdQm2Zf3mbMr1oGpxvB64PBY7YY3UXwPr9RiCR RhcicLBKVdScb0FWzcdBRrh8t+emcCyNiJ3GbzvdySeLiVjt50y+6/+KHpu55A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730483749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uCm0P6gW47h0/wQ2zX96z8OHSJXL8Xb88s/6LuJiBJI=; b=AWp9RGomwu8HllvZ2RsKuD9HRnedzbnUd0TZgqGrzOqVYiYtraEg5AVzM6vS7Kq40hBsjx 5Qeun56RbaJr5oUNmIK/AKEuA7bEvXeSd9UAqI107paRBgU4RpZSbqqp7xhnlP6GK7ZrUV AzZtatuQTYARtY7mwOCBhrMF1qAnFd77CTNsf7v+ScuuiRuMdRSMYW45e8MzfgWvkehrI5 cviONCHGlvb458bXKsTdcH0DKHisj495ETGrb9hVBCoTaV2EGv3KzSPuZRmC1d0pOX9nsg UVAHxgRsE/ZWDgJeLUqB4YQVAnfZK5g29U2v27Ma80cQq11IEHvh3ritQ8UoHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730483749; a=rsa-sha256; cv=none; b=YbF2icHwy3DCyFgAmNkPo2Qti1sFzxUXfglr5SrLozgmGbnAwpvmlj4W8rP+WI+ylkLEBp S+QXLsoT0268plxTwQyKEQ9wGytQVhgCMxXSJ4a2Rh5Fi5OQdp83OY44TR/Pm22VFFnszr k+yfcczSCH6x2V4woOcTLy9nMIDMtJf5JsIesmFpikNfW5N36VDoKVRf0tp27TsYbeVU1X +JwohwgS6U6ibDTk5jKYnKKmJwPTpBqfFcniQHSddmHYpKJhk9lu8ozral4XB2pMavgf+c Db0WJzK8CQyWBBBwsVe8DpIt+ZDIrSET0cgiiUQuSIognzC2iGHcoq/QwFwbag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg7nd4plxzWFn; Fri, 1 Nov 2024 17:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1HtnBm072548; Fri, 1 Nov 2024 17:55:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1Htn6t072545; Fri, 1 Nov 2024 17:55:49 GMT (envelope-from git) Date: Fri, 1 Nov 2024 17:55:49 GMT Message-Id: <202411011755.4A1Htn6t072545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 055b41056ef7 - main - newbus: Limit units to [0, INT_MAX) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 055b41056ef7a54d0a75ba5c9049fc0bd34a8b26 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=055b41056ef7a54d0a75ba5c9049fc0bd34a8b26 commit 055b41056ef7a54d0a75ba5c9049fc0bd34a8b26 Author: Warner Losh AuthorDate: 2024-10-31 22:50:54 +0000 Commit: Warner Losh CommitDate: 2024-11-01 17:56:20 +0000 newbus: Limit units to [0, INT_MAX) Limit the number of units a newbus device can have to be a positive number. Reserve and reject the unit INT_MAX so that we can set maxunit to INT_MAX without ill effect and so the normal signed int math works. Add sanity checks to make sure we don't get negative unit numbers from bus routines that can set the unit. Remove now-redundant check for unit >=0 since it must be after an earlier check. This should be largely a nop, since we'll likely run out of memory before we have 2^31 devices. Also, finding unit number is O(n^2) since we do linear searches for the next unit number, which even on very fast machines will grind to a halt well before we reach this limit... Add note to device_find_free_unit that says it can return INT_MAX when all the unit numbers are in use. The one user in the tree (ata_pci_attach) will then add a child with this unit and it will fail and that failure will be handled properly. Hardware limitations, though mean there will never be more than tens of units, let alone billions. Update docs to document that EINVAL can be returned for bogus unit numbers, or when we run out. Sponsored-by: Netflix Reviewed-by: jhb Differential-Revision: https://reviews.freebsd.org/D47359 Co-Authored-by: Elliott Mitchell --- sys/kern/subr_bus.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index cd5f97cc72fe..c1f75dd30126 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1121,7 +1121,8 @@ devclass_get_maxunit(devclass_t dc) * @brief Find a free unit number in a devclass * * This function searches for the first unused unit number greater - * that or equal to @p unit. + * that or equal to @p unit. Note: This can return INT_MAX which + * may be rejected elsewhere. * * @param dc the devclass to examine * @param unit the first unit number to check @@ -1188,6 +1189,7 @@ devclass_get_sysctl_tree(devclass_t dc) * @retval 0 success * @retval EEXIST the requested unit number is already allocated * @retval ENOMEM memory allocation failure + * @retval EINVAL unit is negative or we've run out of units */ static int devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) @@ -1202,10 +1204,13 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) BUS_HINT_DEVICE_UNIT(device_get_parent(dev), dev, dc->name, &unit); + /* Unit numbers are either DEVICE_UNIT_ANY or in [0,INT_MAX) */ + if ((unit < 0 && unit != DEVICE_UNIT_ANY) || unit == INT_MAX) + return (EINVAL); + /* If we were given a wired unit number, check for existing device */ if (unit != DEVICE_UNIT_ANY) { - if (unit >= 0 && unit < dc->maxunit && - dc->devices[unit] != NULL) { + if (unit < dc->maxunit && dc->devices[unit] != NULL) { if (bootverbose) printf("%s: %s%d already exists; skipping it\n", dc->name, dc->name, *unitp); @@ -1214,7 +1219,7 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) } else { /* Unwired device, find the next available slot for it */ unit = 0; - for (unit = 0;; unit++) { + for (unit = 0; unit < INT_MAX; unit++) { /* If this device slot is already in use, skip it. */ if (unit < dc->maxunit && dc->devices[unit] != NULL) continue; @@ -1228,6 +1233,15 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) } } + /* + * Unit numbers must be in the range [0, INT_MAX), so exclude INT_MAX as + * too large. We constrain maxunit below to be <= INT_MAX. This means we + * can treat unit and maxunit as normal integers with normal math + * everywhere and we only have to flag INT_MAX as invalid. + */ + if (unit == INT_MAX) + return (EINVAL); + /* * We've selected a unit beyond the length of the table, so let's extend * the table to make room for all units up to and including this one. @@ -1263,6 +1277,7 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) * @retval 0 success * @retval EEXIST the requested unit number is already allocated * @retval ENOMEM memory allocation failure + * @retval EINVAL Unit number invalid or too many units */ static int devclass_add_device(devclass_t dc, device_t dev) From nobody Fri Nov 1 18:08:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg84S4ng8z5cCyy; Fri, 01 Nov 2024 18:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg84S4Dz3z4GfK; Fri, 1 Nov 2024 18:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730484520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIIVKScCL6UFrOl/aBfC5//37k5zcMzY2NzFVbRW00g=; b=dQ78rnVBvSU9poz0Q9X4eLMkF/eqou9pgzoFruQVYRaiJBei+BuR91mAwGqwGer2j3gwX8 ofG5uI/kW/9I4+ngkAjCVoF8T6s7W54M4IBiATEEB/xkm97PPefF2nAf3hBS4Me5L9qjjU sszRb5zd9z4VVQ2bT56rePdT+gihJft4CB/v16Qz3tlO/sStZwWzMq8GwKGX6z5k5s4+iN 1gYQZv3fTNNbFKqS74jkTyHTJ8zOuYRgCIuRve6WZ9JJadvXHDlp6poWOwwMTNAnLXPQ9s CQe19kty1BhjXYnOwVouizOTrK8mf+jcp2RVdCqxYCSPk6PvNuVl2UF3qNUlKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730484520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIIVKScCL6UFrOl/aBfC5//37k5zcMzY2NzFVbRW00g=; b=e8TpgmIm6c/2ZWzPXPu+Ak8dZHW4ykfYnk0hmsRDngxJ5pFynm1Wd58vNRmdo74xYLKRSP 90sFrLt+eONygezxbknXNF9IcmjFuS+151UNp/CwJqYtw2JP7lUfcyBMQrNzK5ITlwg5bp bRLC4FHefh7gSXvj/nRa9uC6iHSTwWJ7oo091oLV1BZDjyMxIBZ4oKmofvPr52ZyCgUX2h b3VegMSaa8+qhvprdFYO10Yv4p71osmOwwseBNlFJ72ALUfuZQk1g+k3J9prJdUf/BvePa aYP4UxbQRpsW5ez0pM21fINQtwEKDcyS/voDDmS59s1Q2UowDjli0KLC765ZGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730484520; a=rsa-sha256; cv=none; b=MHa7eO/Z6f4TZ4VbsZO3fheQPkYiUdWZZB0x6kgwBZr1zbJaZ6iJ1/ne02b6php0TRyAv5 xMomzVtzbgPDbfYsx79HYHgL36acPCOL9bWWXHMelnD0driE2XEsJq1uHd7imisRjaeTSb OpNr8Bnrvg3k4MTLsMTlYB8s5yxtdMmUK2tEmDLG4Dbtj0kxBB2KKaMcd6iBezyF7Kluxw 8A6yBZ5eQvQBKL5Y/ddCz8NbvhWVV84V0EL1jcYUJcRAnwvGhxgdjCbA3i0xphjCPoLC1y y/tOf89N0YUySMoetl4cmaP6Gmf/TkG/u14jd//EkXQzP5w6BXQjvRZLtsRseg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg84S3gDdzWhm; Fri, 1 Nov 2024 18:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1I8eq2092850; Fri, 1 Nov 2024 18:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1I8euY092847; Fri, 1 Nov 2024 18:08:40 GMT (envelope-from git) Date: Fri, 1 Nov 2024 18:08:40 GMT Message-Id: <202411011808.4A1I8euY092847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 8d6feaaaa26f - main - ipfilter: Set ipf -T optionlist at boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d6feaaaa26f444abb209360e52b993e39cb81bb Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8d6feaaaa26f444abb209360e52b993e39cb81bb commit 8d6feaaaa26f444abb209360e52b993e39cb81bb Author: Cy Schubert AuthorDate: 2024-10-30 19:28:31 +0000 Commit: Cy Schubert CommitDate: 2024-11-01 18:08:14 +0000 ipfilter: Set ipf -T optionlist at boot There is no easy way to set ipfilter optionlist variables during boot. Add plumbing to the rc script to support this. PR: 130555 Reviewed by: jlduran MFC 1 week Differential Revision: https://reviews.freebsd.org/D47346 --- libexec/rc/rc.conf | 1 + libexec/rc/rc.d/ipfilter | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 8f585bc02856..a21c587dcc07 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -214,6 +214,7 @@ ipfilter_program="/sbin/ipf" # where the ipfilter program lives ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see # /usr/src/contrib/ipfilter/rules for examples ipfilter_flags="" # additional flags for ipfilter +ipfilter_optionlist="" # optionlist for ipf(8) -T ippool_enable="NO" # Set to YES to enable ip filter pools ippool_program="/sbin/ippool" # where the ippool program lives ippool_rules="/etc/ippool.tables" # rules definition file for ippool diff --git a/libexec/rc/rc.d/ipfilter b/libexec/rc/rc.d/ipfilter index d0cb09ab527c..9b64fcff0c7a 100755 --- a/libexec/rc/rc.d/ipfilter +++ b/libexec/rc/rc.d/ipfilter @@ -33,7 +33,13 @@ required_modules="ipl:ipfilter" ipfilter_start() { echo "Enabling ipfilter." - if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes'; then + if [ -n "${ifilter_optionlist}" ]; then + if ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes'; then + ${ipfilter_program:-/sbin/ipf} -D + fi + ${ipfilter_program:-/sbin/ipf} -T "${ipfilter_optionlist}" + ${ipfilter_program:-/sbin/ipf} -E + elif ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes'; then ${ipfilter_program:-/sbin/ipf} -E fi ${ipfilter_program:-/sbin/ipf} -Fa From nobody Fri Nov 1 22:17:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgFc52lfpz5cZJh; Fri, 01 Nov 2024 22:17:57 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgFc52Bb1z4jYg; Fri, 1 Nov 2024 22:17:57 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730499477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=8XGjozjlJFDvAOLKvMWdDDtyhyJkQGd23uaBOENsL5c=; b=J1UQeMMZgaQxS5i+0TugmY65RU36UFdydXO1FCK+Jo6OzZmuY/MBZmfMxiOcHb22gLogQP bRWA4vC++dnbzp3X4mj59kSGW/OI6WSmBoEHHzO33zxYnq5VNf0MWTzoBl8oxQPXqjMn29 Ly4lyXlnFL88avRpGZd+WS0FtqyuYYFt248evMsBbSC50qu5zIPOEWQav7qu6Kp4xZ3bZ4 RpsSpUJVsWdiVFvflyRsHIEQWbjRTRGmB7b++TXPpZFv8kJq8IPacII7xNGUvcPXwGnw26 v9pynIsD2Syo1ENnYFhOLN+71/hRgdpIr63Vdopgpp5ZGjQypbq1eWM7fnTcrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730499477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=8XGjozjlJFDvAOLKvMWdDDtyhyJkQGd23uaBOENsL5c=; b=bKen/cS3KvrNdc8lI7sXpooXd7Xc4DcWWBhU+rTWXrSbas4+c3cFMQXf8FcEAuA8HUFc6f QSr1v2TD4QFhaH55tgz9yCf43HJ5C20InIJ0oqo1k5x9NjJbcsD4t6CM5j+AAt8WXu9MA/ HmGcCwGrWZJdpoWvQyALepsYlCzmNd3pEgnqmsdLwtR6/2OdFPm2g62qvq7lRDMdVPk9MM R+nSiNzj36qwlx/DlI7r25+9VbZb2gKrz178Yocf/mxtuOKb1LzpchYfL6DW+3cFjdtKKT ZhIrBvyYRBD7tWC62s2ZIzOdXiRIsTFg1MPcC9uMQ29Bf1T8TKnSGtcuQrW5ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730499477; a=rsa-sha256; cv=none; b=JgR1vR5vShmmyOzyg1mi6ItGY3bQHTCCMYF97jtEsBXccxDq/kh9FutWHCdzfG5ueEy+6b AlFkoBAO536Wa/o9oxkXpjZIPAwGI5nsYEDrJhEYf+wvyO1qIvHf/YZA2IrjXoWv/Qac/O Zpzu2XU6lOWoftXT29piJ4NFQYMTL/Ef4TbP2ohEpR03Eg0w1B1mD2LNbLMkHUxtmaW+69 CnOvLR6J1hoTm44tnEtE01u9Ld0qPLd4EICKvdlzZXXOWdCjx3wx/fUebNT5dRPyrQrokp fyHSkZZcSbrpSHCTbcecq9WpqdLLgs7pREc5zgnPafPrdfYwE07BvefBrzgwiw== Received: from [10.216.0.111] (unknown [188.243.165.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XgFc44S16zFNs; Fri, 1 Nov 2024 22:17:56 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> Date: Sat, 2 Nov 2024 01:17:53 +0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> Content-Language: ru, en-GB, en-US From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------Kh0QJAAboK996jzGV0o7kFPF" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------Kh0QJAAboK996jzGV0o7kFPF Content-Type: multipart/mixed; boundary="------------mYj6JX2v0c3KVpcpRM0qmajy"; protected-headers="v1" From: Dima Panov To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> In-Reply-To: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> --------------mYj6JX2v0c3KVpcpRM0qmajy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDIzLjEwLjIwMjQgMjE6MzIsIERpbWl0cnkgQW5kcmljIHdyb3RlOg0K PiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRlZCBieSBkaW06DQo+IA0KPiBVUkw6 IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMvY29tbWl0Lz9pZD01ZGVlZWJkOGM2Y2E5 OTEyNjllNzI5MDJhN2E2MmNhZGE1Nzk0N2Y2DQo+IA0KPiBjb21taXQgNWRlZWViZDhjNmNh OTkxMjY5ZTcyOTAyYTdhNjJjYWRhNTc5NDdmNg0KPiBNZXJnZTogNmU1MTZjODdiNmQ3IGU2 YjczMjc5MjgxMw0KPiBBdXRob3I6ICAgICBEaW1pdHJ5IEFuZHJpYyA8ZGltQEZyZWVCU0Qu b3JnPg0KPiBBdXRob3JEYXRlOiAyMDI0LTEwLTIxIDEyOjU5OjI2ICswMDAwDQo+IENvbW1p dDogICAgIERpbWl0cnkgQW5kcmljIDxkaW1ARnJlZUJTRC5vcmc+DQo+IENvbW1pdERhdGU6 IDIwMjQtMTAtMjMgMTg6Mjc6MzggKzAwMDANCj4gDQo+ICAgICAgTWVyZ2UgbGx2bS1wcm9q ZWN0IHJlbGVhc2UvMTkueCBsbHZtb3JnLTE5LjEuMi0wLWc3YmE3ZDhlMmY3YjYNCj4gICAg ICANCj4gICAgICBUaGlzIHVwZGF0ZXMgbGx2bSwgY2xhbmcsIGNvbXBpbGVyLXJ0LCBsaWJj KyssIGxpYnVud2luZCwgbGxkLCBsbGRiIGFuZA0KPiAgICAgIG9wZW5tcCB0byBsbHZtLXBy b2plY3QgcmVsZWFzZS8xOS54IGxsdm1vcmctMTkuMS4yLTAtZzdiYTdkOGUyZjdiNiwNCj4g ICAgICBhLmsuYS4gMTkuMS4yIHJlbGVhc2UuDQo+ICAgICAgDQo+ICAgICAgUFI6ICAgICAg ICAgICAgIDI4MDU2Mg0KPiAgICAgIE1GQyBhZnRlcjogICAgICAxIG1vbnRoDQo+IA0KDQoN CkFmdGVyIHRoaXMgdXBkYXRlIGFueSBsYW5nL2djYyogZmFpbHMgdG8gYnVpbGQgb24gYWFy Y2g2NCBtYWNoaW5lIDooDQoNCm1rZGlyIGFhcmNoNjQtcG9ydGJsZC1mcmVlYnNkMTUuMC9s aWJnb21wDQpDaGVja2luZyBtdWx0aWxpYiBjb25maWd1cmF0aW9uIGZvciBsaWJnb21wLi4u DQpDb25maWd1cmluZyBzdGFnZSAxIGluIGFhcmNoNjQtcG9ydGJsZC1mcmVlYnNkMTUuMC9s aWJnb21wDQpjb25maWd1cmU6IGNyZWF0aW5nIGNhY2hlIC4vY29uZmlnLmNhY2hlDQpjaGVj a2luZyBmb3IgLS1lbmFibGUtdmVyc2lvbi1zcGVjaWZpYy1ydW50aW1lLWxpYnMuLi4gbm8N CmNoZWNraW5nIGZvciAtLWVuYWJsZS1nZW5lcmF0ZWQtZmlsZXMtaW4tc3JjZGlyLi4uIG5v DQpjaGVja2luZyBidWlsZCBzeXN0ZW0gdHlwZS4uLiBhYXJjaDY0LXBvcnRibGQtZnJlZWJz ZDE1LjANCmNoZWNraW5nIGhvc3Qgc3lzdGVtIHR5cGUuLi4gYWFyY2g2NC1wb3J0YmxkLWZy ZWVic2QxNS4wDQpjaGVja2luZyB0YXJnZXQgc3lzdGVtIHR5cGUuLi4gYWFyY2g2NC1wb3J0 YmxkLWZyZWVic2QxNS4wDQpjaGVja2luZyBmb3IgYSBCU0QtY29tcGF0aWJsZSBpbnN0YWxs Li4uIC91c3IvYmluL2luc3RhbGwgLWMNCmNoZWNraW5nIHdoZXRoZXIgYnVpbGQgZW52aXJv bm1lbnQgaXMgc2FuZS4uLiB5ZXMNCmNoZWNraW5nIGZvciBhIHRocmVhZC1zYWZlIG1rZGly IC1wLi4uIC93cmtkaXJzL3Vzci9wb3J0cy9sYW5nL2djYzEzL3dvcmsvZ2NjLTEzLjMuMC9s aWJnb21wLy4uL2luc3RhbGwtc2ggLWMgLWQNCmNoZWNraW5nIGZvciBnYXdrLi4uIC91c3Iv YmluL2F3aw0KY2hlY2tpbmcgd2hldGhlciBnbWFrZSBzZXRzICQoTUFLRSkuLi4geWVzDQpj aGVja2luZyB3aGV0aGVyIGdtYWtlIHN1cHBvcnRzIG5lc3RlZCB2YXJpYWJsZXMuLi4geWVz DQpsZC1lbGYuc28uMTogL3dya2RpcnMvdXNyL3BvcnRzL2xhbmcvZ2NjMTMvd29yay8uYnVp bGQvLi9nY2MvbGliZ2NjX3Muc28uMTogdmVyc2lvbiBHQ0NfMy4zIHJlcXVpcmVkIGJ5IC93 cmtkaXJzL3Vzci9wb3J0cy9sYW5nL2djYzEzL3dvcmsvLmJ1aWxkLy4vZ2NjL3hnY2Mgbm90 IGRlZmluZWQNCmNoZWNraW5nIGZvciBhYXJjaDY0LXBvcnRibGQtZnJlZWJzZDE1LjAtZ2Nj Li4uIC93cmtkaXJzL3Vzci9wb3J0cy9sYW5nL2djYzEzL3dvcmsvLmJ1aWxkLy4vZ2NjL3hn Y2MgLUIvd3JrZGlycy91c3IvcG9ydHMvbGFuZy9nY2MxMy93b3JrLy5idWlsZC8uL2djYy8g LUIvdXNyL2xvY2FsL2FhcmNoNjQtcG9ydGJsZC1mcmVlYnNkMTUuMC9iaW4vIC1CL3Vzci9s b2NhbC9hYXJjaA0KY2hlY2tpbmcgd2hldGhlciB0aGUgQyBjb21waWxlciB3b3Jrcy4uLiBu bw0KY29uZmlndXJlOiBlcnJvcjogaW4gYC93cmtkaXJzL3Vzci9wb3J0cy9sYW5nL2djYzEz L3dvcmsvLmJ1aWxkL2FhcmNoNjQtcG9ydGJsZC1mcmVlYnNkMTUuMC9saWJnb21wJzoNCmNv bmZpZ3VyZTogZXJyb3I6IEMgY29tcGlsZXIgY2Fubm90IGNyZWF0ZSBleGVjdXRhYmxlcw0K U2VlIGBjb25maWcubG9nJyBmb3IgbW9yZSBkZXRhaWxzDQpnbWFrZVsyXTogKioqIFtNYWtl ZmlsZToyMjUwNTogY29uZmlndXJlLXN0YWdlMS10YXJnZXQtbGliZ29tcF0gRXJyb3IgNzcN CmdtYWtlWzJdOiBMZWF2aW5nIGRpcmVjdG9yeSAnL3dya2RpcnMvdXNyL3BvcnRzL2xhbmcv Z2NjMTMvd29yay8uYnVpbGQnDQpnbWFrZVsxXTogKioqIFtNYWtlZmlsZToyNDg2Mzogc3Rh Z2UxLWJ1YmJsZV0gRXJyb3IgMg0KZ21ha2VbMV06IExlYXZpbmcgZGlyZWN0b3J5ICcvd3Jr ZGlycy91c3IvcG9ydHMvbGFuZy9nY2MxMy93b3JrLy5idWlsZCcNCmdtYWtlOiAqKiogW01h a2VmaWxlOjI1MjExOiBib290c3RyYXAtbGVhbl0gRXJyb3IgMg0KPT09PiBDb21waWxhdGlv biBmYWlsZWQgdW5leHBlY3RlZGx5Lg0KDQoNCg0KLS0gDQpTaW5jZXJlbHksDQpEaW1hIChm bHVmZnlARnJlZUJTRC5vcmcsIGh0dHBzOi8vdC5tZS9GbHVmZnlCU0QsIEBmbHVmZnk6bWF0 cml4LWRldi5mcmVlYnNkLm9yZykNCihkZXNrdG9wLCBrZGUsIHgxMSwgb2ZmaWNlLCBwb3J0 cy1zZWN0ZWFtKUBGcmVlQlNEIHRlYW0NCg0K --------------mYj6JX2v0c3KVpcpRM0qmajy-- --------------Kh0QJAAboK996jzGV0o7kFPF Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmclU5EFAwAAAAAACgkQ+4ugndU5jymF IxAAkraHklACcpChl8uImV02K/snaAtOMu6lXJV9xyHr91bYp+UUmqaDQ2OSy5VsO/GY4kBUl+Ck mnFqHXqgA7Rxx44fUcoz5qyUU8KBxnMaWxabF1HmRuVnlCbd+DJbgNP/iiJ3d2/Frq0dnTsz085U XCzPfqzPG8tQVx7798N+tHh3DeQ/jJYJI2yEv01zq5apRbA68h+ZkeFQktBMIPy+B4Zda7ypTJeh gF+NF+FgMhh9Fo+6El1qkLwFl+4/IHuTu1E1eB1x3fQQ246bLEaHKnsZ36oyY5FyzEe9OesSEC7A I8wpiT7OC7uPnq1SlSXSAfeOq2Tjkq+rLLpdBgidRfaE7NqGIxF9tUjPOqIbPgWr2JvQKtDFMsPR DbMfcJ6NN2KK2YPanuBdoWGS6DO0+oMhohwyIp6br2dV31DEuN6NXQj8E3UYd50G/1xL8805rWYY BMsjb7U6l5pr0+sHMGjfLkUNg7qYWxThrbOmuiIT02jPdEODxzYGCAHEv5z6f90jVVUnvreLar8/ pclkPTycLgE/EbNsKIV9av6m+gda6lAQOS1zBxB/N4eGN2Pke19DRk9GYpdQjo4OxmkWlE1SHtZ1 pSG7U0AqskaT+361kL5Wu1vtDVrPrPjGaVRRpWj6cdO3YA4rc2C+sknj16DPAPWeBIcfYwz2daVq 5Ko= =hG9j -----END PGP SIGNATURE----- --------------Kh0QJAAboK996jzGV0o7kFPF-- From nobody Sat Nov 2 01:25:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgKmY02MKz5b7d3; Sat, 02 Nov 2024 01:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgKmX6Yy2z43Z8; Sat, 2 Nov 2024 01:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730510732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAESpOmmQzCLp8kLa2ZsssclnoMbR6fKZNxmJqdFSIw=; b=AMYl7kf5NjoaapFEC50BKrjNtPKJbFKIU8NtuqiX0hJcIwUm3Qd5bGhGghv+BsjHTR/EIO W24L3MRFGsbI5YYY2m2wLxCOiCqf0yLXTfBQZ7JmIZwqDi7yiMnGtv2yZmFiKeSDCQ2fVl KgPiQC1kVSbpS6BP4w9oyFMmgyfuVSf370h2JC70FJPULX87+5fZeXV61p+3tFP537UngE +Yw3lBVomnwVE7IDXGS/ioZTYcmeLVKVPKkGDSL9vRv8qN2/iG6ufWcd8S1JyLzRpQjKRP HjJmwCyYMH5MvybHSACd6SusoCGUmjcnkQq6SQy6Nyyp3n2kHD46GxuyteGqgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730510732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAESpOmmQzCLp8kLa2ZsssclnoMbR6fKZNxmJqdFSIw=; b=xLBpTFhW9NXBHMWp3mrxXxwkVOjAIPSU8EZdDlQtKO2DSEvNaxbkbzo950uqP/FezuQbcY +sVpxAXVcKuupRySJfIRWAdhZfGrACpA5IM6IElN+QRruySJlCdb7Pu9ncXAXWvEgf66gW Pd8t5y16BkV/UeUDI9YJt+EIFgmaVdBbaSI19TuNnaed+8bW08+2uRW+3Qz+/n9TVdLUbw MWoKB/XVR6kMLz/u10hGAOzO63WQwXW+Ko9Kuix+h9twG6xGIc3zzuSK0A5bg4JmGhWMxD IwquwQ1veW6H9XWuGv1wyX7eV3m4FYrwTrVJHeKLPsI0Eu3iD7W+kvpXAjyM3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730510732; a=rsa-sha256; cv=none; b=NQ2owhIl39sYtu3pJfdjY/GUS0VBu5ovoTnGN1nNqJmKsVHr43mHZJAzm/SeCHe4FcSuVJ OfqWrAVNryepmM7G7pKkbfuXI2JkSQeX2/k8rGBnEKLewKAmmaUIK0W3gCs3xyYcbHn9/r L543Jj38nkswiBQLs3kOQyu23XEhi6MN/E5ZKjDjTwbA0OpM58gpf9i4tZr5dD5d1BW7ms 9OwCNvubJBVrIayh2AC5zW2VWb7bQt2CXd2a5mS5GQVw8EHpQeQJwjGPQBMSagXSKVv2Sd O7CK86VduHi9rIA/OWFcVzP24BfDA4vtwOO+FGmKRgIdSVEZyHQ9vI4IuWp6sA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgKmX67nPzkdZ; Sat, 2 Nov 2024 01:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A21PWYt008248; Sat, 2 Nov 2024 01:25:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A21PWNq008245; Sat, 2 Nov 2024 01:25:32 GMT (envelope-from git) Date: Sat, 2 Nov 2024 01:25:32 GMT Message-Id: <202411020125.4A21PWNq008245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9b2705121ba2 - main - LinuxKPI: lockdep fix #includes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b2705121ba230bf71a1509cc928f0481dfbf31c Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2705121ba230bf71a1509cc928f0481dfbf31c commit 9b2705121ba230bf71a1509cc928f0481dfbf31c Author: Bjoern A. Zeeb AuthorDate: 2024-11-02 01:21:52 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-02 01:24:42 +0000 LinuxKPI: lockdep fix #includes Add sys/sytm.h for __diagused which unbreaks compilation of drm-kmod 5.10-lts on main. Sponsored by: The FreeBSD Foundation Reported by: Evgenii Khramtsov PR: 282479 Fixes: 5c92f84bb607 MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index 70a4e45867fe..93fe445f7057 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -30,6 +30,7 @@ #ifndef _LINUXKPI_LINUX_LOCKDEP_H_ #define _LINUXKPI_LINUX_LOCKDEP_H_ +#include #include #include From nobody Sat Nov 2 01:34:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgKzB3X4xz5b8fq; Sat, 02 Nov 2024 01:34:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgKzB2vYpz44Ym; Sat, 2 Nov 2024 01:34:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730511286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tmb1G0dZDqsgXBtqPE4x340QdQ12aeUfxuH1gOCxXyE=; b=JU6Eg5QM+MEqYzh2pglifaG0BC2SAPJxxF3Q9ZJ/usB3Y1seDUa/cnDLZuKirMhPNVs+sG 3vj1HnUF/U9JAdDSQdP7PcQ4RNhX66vAb6r9f8Cm4KhSDkWClnffg/hAoGL/F+5ejKv1vi LiLD8iFFdP1UvMlqWRpQHYe09BIUXiiNalj9bfwr56bw6Y4vbRy9b7p58WOcYQvNnBTsxs ULZioWTbPXccJFBN4N7BpR2QTwExe4EDje06CuuQe2/KwZO++MQgxlso4wMqA5iPDCIjro vxxOowm1wpk2QyQni0V4RA0L+n0VZsmJVn3st2W258wgoZ8uU5k2I6oWC44/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730511286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tmb1G0dZDqsgXBtqPE4x340QdQ12aeUfxuH1gOCxXyE=; b=CsdkG7ykXhLLneFop+1OzRTQeYeMm+McJU8rglmo0xL26X3nT+yXFwyHGibVS1ey4i1jLa A2+DDd0ZeVCH2LUIRLtr3DoGBuwKblfzEEvBzW9ANhPM0JwLPViPA3vGGAeGnVhM7yA47B o63QjWj96gUfO133dGZGDdYZ3kYGwRJ8KB+czeYUtpUMzsOvE/Xdx33cMYnlQbWJS913L4 Yt2nfezUJVnqgNI7aMUaKZqAE510gcvxtcXD3lesWYPIdKrU8Yacm+GcF+5lh0uKLyQU8o uf+8vCpAAh6O4YyWDOjArTavPck6DMoCQKK3NOlgippoWBW0IbnQf8JZXfNUjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730511286; a=rsa-sha256; cv=none; b=QybGvURM8wLbTjI69ku5eqI2wquBtZ7YqyYlRC5wtmK1t57nHOuuVc2iqB4gH5eApjb0l0 mnRmtkLXgfCIT7HHSGmKIVBXjkXlTVuQPj8lrhwI7u6SUp91/1G6CrflHdth9NPC52Xssn z1thdMmNBbQ8ZZqN4rpX+TmXnLmwI1npVuoJU4EjEI5PhCQkzBRoh/xWS4paKNiSGHys/W JJMaDNCuHOJjmrPoxIOCSFn8/dK9+oweoqujNoY6c5kDv8uFcEH92nYOAKBSECpXZVxaLM zhFJ5XYrv6AG1hRKwSrrDsKCkLNut4Jz9qeahku465FyOfYFgWgOJUPQz42Acw== Received: from [192.168.1.10] (c-73-231-46-254.hsd1.ca.comcast.net [73.231.46.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XgKz95mVQzLFZ; Sat, 2 Nov 2024 01:34:45 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.90.24102719 Date: Fri, 01 Nov 2024 18:34:42 -0700 Subject: Re: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs From: Ravi Pokala To: Colin Percival , , , Message-ID: <6E1A6F2E-C236-4A23-BFD2-8D917A02D5C2@panasas.com> Thread-Topic: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs References: <202410312247.49VMl6TW031342@gitrepo.freebsd.org> In-Reply-To: <202410312247.49VMl6TW031342@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Hi Colin, This seems to have broken arm64.LINT-FDT: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % less _.arm64.LINT-FDT ... -------------------------------------------------------------- >>> stage 3.1: building everything -------------------------------------------------------------- In file included from /usr/home/rpokala/freebsd/src/clean-main/sys/dev/gpio= //gpioaei.c:37: /usr/home/rpokala/freebsd/src/clean-main/sys/dev/acpica/acpivar.h:34:10: fa= tal error: 'acpi_if.h' file not found 34 | #include "acpi_if.h" | ^~~~~~~~~~~ 1 error generated. *** [gpioaei.o] Error code 1 make[8]: stopped making "all" in /usr/home/rpokala/freebsd/src/clean-main/s= ys/modules/gpio/gpioaei =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: > on behalf of Colin Percival > Date: Thursday, October 31, 2024 at 15:47 To: >, >, > Subject: git: 6540ac118473 - main - modules: gpioaei only on ACPI-supportin= g archs The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3D6540ac118473dde29cb02f786c79c6= 4f73834ca1 commit 6540ac118473dde29cb02f786c79c64f73834ca1 Author: Colin Percival > AuthorDate: 2024-10-31 22:45:03 +0000 Commit: Colin Percival > CommitDate: 2024-10-31 22:45:03 +0000 modules: gpioaei only on ACPI-supporting archs Fixes: 9709bda03cd0 ("GPIO: Add ACPI _AEI support") Pointy-hat to: cperciva Sponsored by: Amazon --- sys/modules/gpio/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index 1d7f69f1836d..66090b1393bf 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,10 +24,14 @@ # SUCH DAMAGE. # -SUBDIR =3D gpioaei gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR =3D gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR +=3D gpiokeys gpiopps .endif +.if ${MACHINE_CPUARCH} =3D=3D "aarch64" || ${MACHINE_CPUARCH} =3D=3D "amd64" || ${= MACHINE_CPUARCH} =3D=3D "i386" +SUBDIR +=3D gpioaei +.endif + .include From nobody Sat Nov 2 01:52:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgLMT3VMcz5b9lg; Sat, 02 Nov 2024 01:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgLMT2kbqz45p7; Sat, 2 Nov 2024 01:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730512341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oazx+QgS+4GS2TCJ7q/0GSGrFo65NGbHBVvHl9iz3/0=; b=Us1i6rjUO1ERBftyrmdpLdXmdKJserH2y3qmE12HfemsPWP3ACeHp55UKgCmXcq/UqWO7M EOJ4QJ28ZTJQ03e6rkAoveunSihAPSa1wNC7y0bx1JFEzdDBz7X8JTj2jY4oeLeJSUlPOY XkyZJFB2cnfa4a0SYt/GAwVUJD5+iNXupj743Mk9jJbuwFRevScHA7zQrFF1oxxoWZhvt0 mv60T8Q4a4TjzY98TRpEfJiiQzbI9tcM8pemAQyMdROa6xWMiAorDmu6wXu/SebMFyUgV5 iy85yKkucDEzF0FX1BXpFGKYPbOcnRQapF4LqcTIpvzaqEmEYZsbtEcCagxtgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730512341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oazx+QgS+4GS2TCJ7q/0GSGrFo65NGbHBVvHl9iz3/0=; b=d9GU7dc4qNQ7N8Ukee+noiYGFYFOlN9j1BQjm5+3DF/Iv9PIW9oyd8q67r+d/oPw8/TQer Mg5NxEwCRuhTrnBoCfZgMmMfDyzf3ANCR/cUmPyqwBri0v5VRC0rPnMCmq0jTOTH8RzYKP iR4BRj9BhV2/0wF+pHhU600lP+ODKjN2DdGLyzHtw4cbQlbq7sU9ls/CKmeQ3B8TVMIY0x FIy17l2MTyZFivC7a6M4AsCqyf30AHM503BGqk0N49yfsi/wUXrH3/Imn4+ouxB6ibtirH ZJHffIyTtK5qJkrcG07Ve4ypmKyskHwkhSYo6QPc6uI1BPEpzlF/eLVsXLLdgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730512341; a=rsa-sha256; cv=none; b=s3Cj3Ca9OSlZ2KKUZ6rBld11j0YJgopxx3WYB76hrkmZsLLY8StJ6y2wvbhuMcvI37Q/tG WCbTrJ9hGvLHSrBBmcvyUzvZuPJYlAVkd4Uj/Cpn5NhzYDtp8xLl0jPeWjcLwv4ts3gnMj j4YLJCEy+u6WgZgDRnHKSgau3Odd+wdwjvNHIZ92vnXIK7qLyOnV5GK9WjFc+FXnhbLhKH hUOum1ZkSvjMT1CgutqdEN0rFrig0X56GEm8Ji2vmLGPp82w4bZWrWpcJ4Bqn+CgSkTJAV Dc42l5Z0cpLilKUF+srYbT8gcfDSa5CbbNewjCcB3eP6wYqpOfecLaiAuyYTOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgLMT2Kyczllf; Sat, 2 Nov 2024 01:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A21qLYi062031; Sat, 2 Nov 2024 01:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A21qLos062028; Sat, 2 Nov 2024 01:52:21 GMT (envelope-from git) Date: Sat, 2 Nov 2024 01:52:21 GMT Message-Id: <202411020152.4A21qLos062028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b15889d6d22a - main - Cirrus-CI: switch to FreeBSD 13.3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b15889d6d22a36333dec4362aea426521281c72c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b15889d6d22a36333dec4362aea426521281c72c commit b15889d6d22a36333dec4362aea426521281c72c Author: Ed Maste AuthorDate: 2024-10-26 15:03:15 +0000 Commit: Ed Maste CommitDate: 2024-11-02 01:52:04 +0000 Cirrus-CI: switch to FreeBSD 13.3 Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 13719a3e2058..45c31c9f07b2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-2-release-amd64 + image: freebsd-13-3-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Sat Nov 2 02:13:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgLqQ6dp0z5bCV0 for ; Sat, 02 Nov 2024 02:13:06 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 4XgLqQ4p6Jz472m for ; Sat, 2 Nov 2024 02:13:06 +0000 (UTC) (envelope-from cperciva@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: (qmail 99336 invoked from network); 2 Nov 2024 02:13:06 -0000 Received: from unknown (HELO framework.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 2 Nov 2024 02:13:06 -0000 Received: (qmail 2526 invoked from network); 2 Nov 2024 02:13:05 -0000 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 2 Nov 2024 02:13:05 -0000 Message-ID: Date: Fri, 1 Nov 2024 19:13:05 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs To: Ravi Pokala , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202410312247.49VMl6TW031342@gitrepo.freebsd.org> <6E1A6F2E-C236-4A23-BFD2-8D917A02D5C2@panasas.com> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@freebsd.org; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFARnJlZUJTRC5vcmc+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSrYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT++ ig/9GZKdN2fHSyrANKZX38ivd7IX2wAYouqH9DrQM94W8IciaDLmarN4Pl9mY+aucMwQUSyp uNtKOJwKqhVVaalF9Zw0sRMH4CJuvT7vKCtZ3q1Okb7soRvFte4d+vXhvPxCvBFDA5JzU7Lg DR5eqqcvF1dN1OuCq16pl0zCOSH/Jr5ToE3LM3Av1KBGcZD7ZSzHRWsFjV5AOUJKySuA3GwJ e/jASQcQ0YfCnru8ntLmYg/2SKvZFlfthZiCBnAppMt4n4BUAw3TDvf10HIDtdneejawcbLS gofLCvGqumwbZYAMKWrFzT4+7KQvr0pOw8QD7EbxnB4f9hQ7UiVF8qWsyKU3iv6b5JLhbS59 ooKRccyOvdMLcVJ0ZdpqoxrNv061ZUqLL5RiWjBlc1qjBnDxeg5oyM0rT8WLftdgvyH6RQt0 KWngumBAT5AT2DUYL8Uz1490cqfO9K4yEGZAJB9XRVX1g2IWTOjae+0g9ZII+h91UngFz+Rz aKDeseKBbCGDOFXx1TqKiHl2g255ZnUxKYTlucFtguv4gDGBgEk4G9JaEWBw1IWblcKhxH7L 2vWsUhvwghjIxHdO/RkeIeHvSp4YZxCJ7a3TaJLYAlwYopfTKVzNhcDY5h5syEuoHjyJCxXK SyoJYAVu8Yl2KUhvOtOmL1VZ6xyHnpdMRWKJZ5jOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <6E1A6F2E-C236-4A23-BFD2-8D917A02D5C2@panasas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.86.0.0/16, country:US] X-Rspamd-Queue-Id: 4XgLqQ4p6Jz472m X-Spamd-Bar: ---- On 11/1/24 18:34, Ravi Pokala wrote: > This seems to have broken arm64.LINT-FDT: > > ================================================================ > % less _.arm64.LINT-FDT > ... > -------------------------------------------------------------- >>>> stage 3.1: building everything > -------------------------------------------------------------- > In file included from /usr/home/rpokala/freebsd/src/clean-main/sys/dev/gpio//gpioaei.c:37: > /usr/home/rpokala/freebsd/src/clean-main/sys/dev/acpica/acpivar.h:34:10: fatal error: 'acpi_if.h' file not found > 34 | #include "acpi_if.h" > | ^~~~~~~~~~~ > 1 error generated. > *** [gpioaei.o] Error code 1 > > make[8]: stopped making "all" in /usr/home/rpokala/freebsd/src/clean-main/sys/modules/gpio/gpioaei Oops. It was probably the earlier commit which broke it, but I'm clearly not good at kernel modules. Can you check if adding "acpi_if.h" to SRCS in src/sys/modules/gpio/gpioaei/Makefile fixes the problem? -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Sat Nov 2 05:13:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgQr74P3wz5blcc; Sat, 02 Nov 2024 05:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgQr73lcbz4QwJ; Sat, 2 Nov 2024 05:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730524439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGLSXKsZacnZKo1a+E2q3MnLqn2X8pXS8x2O+8L+TBI=; b=mz5DNmXPsM/tQSTKZ1R6TzeFfJoKB1xp/yqJ/w09Diagp22cwcIxP2r4x7Wfi+7v0oeVsR H9skYVQfYZ1BE8idgQTR7RseLLmRTtRn6gQl0nL3icCgDMnMtBpeFM13b/OrVMD99RfU58 /yXtJpB72KmMSqFZTPJe9M/mQvIJqo+4RBFMSa9FI/KjqMLnJ6ZT+Ljek7uyBXwUxh9PCg HrjvAskeNEyOydLkrxoty/hB2t3riIgWZHXP5f6ayBOyR3gQ5kV47Epyuse4TB18zp8I/1 SVfm8vXVK8+pEkzASJXe7fQrCmbxuloSFi229TNOyLb9OT00jPOe1J3Gs0gfog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730524439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MGLSXKsZacnZKo1a+E2q3MnLqn2X8pXS8x2O+8L+TBI=; b=Hrb2bd3sibNQezA1mg2kOl+LqivhbbU2BcFc6GadlF2bVgYsq1x77/1vTX6w3ct/ukRm2B BkHkqc2TqMcN6FjctaCV7TAv2OZVxMfOTbqyOENeYLo9ZJ1YJa6rkhUCJ6lV/xTm83tgkv qCkfewwcYr8MFyYoS8oBz+TVDoeFeX4olXUdyrzvo5r9il10qaJc5wyCxkMJDAlEGp2tuK +zzUt92oIqcGietGxcRizmm9mcWnTW4GY4LUQ6bLyKsIdjKFLbmq1tpuD5G1IsC2pgsBjh f48Or1BQ0UAUHu5Tc7Fb0EFSI/QIFFYVipR+vAUn9JNzytSQKYFfYHGH4AnsDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730524439; a=rsa-sha256; cv=none; b=ej+79KkhsXaxh6b3l1RbCYdWQ1fjRfl3UUOPOe8wubF7r1E+NZaOqhGuh1wq7k6pFER7kq 6iF0IRLkVQAhKKmv0aq4cWEeKor8NVNRGn7W9Cdqe3Jv71dvdVIx59B0chJ1cV2NYYaGUI fNI7mnnM8gmVJwNDSvNvfaGuYOklbIWyd0dsR7+Qtjar0G7pNuB6z5SFuIAHhLg3kNSme9 Lr4+AAfzQaZjuW1mpbwEx52tGbU1Zu+Gt/4JUK7emPQONVCS8Prlf/MGts/BG0zDAPvPhO 4lBm3HNeRmnriG7AhbPeiM+MDcFJKj+AcxEXSkTL5ee/97TTBH6UhJdA4tXc1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgQr73L2RzryQ; Sat, 2 Nov 2024 05:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A25DxdW035883; Sat, 2 Nov 2024 05:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A25Dx7h035880; Sat, 2 Nov 2024 05:13:59 GMT (envelope-from git) Date: Sat, 2 Nov 2024 05:13:59 GMT Message-Id: <202411020513.4A25Dx7h035880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ravi Pokala Subject: git: bb8b3b174118 - main - modules: gpioaei: Fix arm64.LINT-FDT breakage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb8b3b1741188ab284e8b48ec367961a480421cb Auto-Submitted: auto-generated The branch main has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8b3b1741188ab284e8b48ec367961a480421cb commit bb8b3b1741188ab284e8b48ec367961a480421cb Author: Ravi Pokala AuthorDate: 2024-11-02 05:08:11 +0000 Commit: Ravi Pokala CommitDate: 2024-11-02 05:08:11 +0000 modules: gpioaei: Fix arm64.LINT-FDT breakage 'acpi_if.h' was accidentally omitted from the module Makefile; add it. Fixes: 9709bda03cd0 --- sys/modules/gpio/gpioaei/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile index 514dcd80a35e..8f856af48eb7 100644 --- a/sys/modules/gpio/gpioaei/Makefile +++ b/sys/modules/gpio/gpioaei/Makefile @@ -4,6 +4,7 @@ KMOD= gpioaei SRCS= gpioaei.c SRCS+= \ + acpi_if.h \ bus_if.h \ device_if.h \ gpio_if.h \ From nobody Sat Nov 2 05:16:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgQtv4936z5blcq; Sat, 02 Nov 2024 05:16:23 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgQtv1N2mz4RVZ; Sat, 2 Nov 2024 05:16:22 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730524583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uvzzMskhkzRf3RIF9x4dsLLuauyJ2lardfg8J7OagCw=; b=mWy75DovRv/XIFQFFBecHdbRo7PGJK9tHk2WK8zqCRZTv0wKkDo1xQmyVb9K7ZwjpGM98T FTgKzUEy40AnfUsiJFCr5FtPtq7APCyWKZtoSKAdAKPVgmqmTY5NWlalY/bM+djm5JfI3T wZ5GsI4t8rTWDsPs3AxtO6C8RZskdZLiUxdrxrGQevBRnklHCfP9XQjlvClcK0eSkhJAuU KicwPC4N8V+eE2qKlBYOt3MPLmluknPuol82plmzrKWfbfT6gVPm721+AhJkwGphnWllE/ TbMxYe31tLthM2dIEtUur62i99opzodjpGZgvNYtNXsr9we78c6mzFOr2ij+bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730524583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uvzzMskhkzRf3RIF9x4dsLLuauyJ2lardfg8J7OagCw=; b=UsfxvBlAyqSNoEHVQ4yvex6PO2UYx1kyekaMp19TUZ57eLBy4+0xO0OnSFCF7yJcbgaTo3 dQWxvqqvrjvObzf90vTtqUnQAmWSfEbXlklv7HtOFAZbLx0UIHynSK5w5rli+9A+Vpikx1 tW2WJJw8Iyp4ZW2YEKbEqRTfMNkJ20b1cT5YqMTNHNaWtsaxYsBxTDjImjvsUPbQjdtcSN 0YtkiRFo/fOvX8/kvInm3CrDOQIfu07NCkBcCREAgFzapgAP06NUZDS0vLws8SBkKVNfEU lndcOcZ8/HRt1iy61keUQsFY+C7j3dJvyHX0zYRpGUjI3nUiWUTVEABUuCbqIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730524583; a=rsa-sha256; cv=none; b=ZQdECxXzbHUnnSuWFakFOyGbOFaHco2fNve11/QklhHVCitTpUBEimKbXXw2dUp1vS5h3T V3iRkosZUYRFa3fcT81yEaQS+3SBVeq0cjt9qJC2tH8Y9sfVRHbA3ugBpZt4fGHMs7k3ch hdel9+LD8trvCnYtJkj5mt6WQM5rlCTGzc17Dp0fW8JrgC8j6Ruyg/Kw7WFjFZabjzxdai l9dPUSE+kcr+I+pEjeaqrbEqCqPBrFIYeEiw2n5m34uU6VHrEUQBZ4uwTa/IeFBAzlHDq2 7hRuJik4s/gZr/lAu8J/qaKTXlWbEpmB8/cpkqWrX2n9sEmJ52yNkIg6Ie3q9w== Received: from [192.168.1.10] (c-73-231-46-254.hsd1.ca.comcast.net [73.231.46.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XgQtt29G3zPwm; Sat, 2 Nov 2024 05:16:22 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.90.24102719 Date: Fri, 01 Nov 2024 22:16:19 -0700 Subject: Re: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs From: Ravi Pokala To: Colin Percival , , , Message-ID: <0FC811CD-24E2-48E0-8F06-C75CFEB3FBBE@panasas.com> Thread-Topic: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting archs References: <202410312247.49VMl6TW031342@gitrepo.freebsd.org> <6E1A6F2E-C236-4A23-BFD2-8D917A02D5C2@panasas.com> In-Reply-To: List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Yes, it was the previous change, not this one. And yes, simply adding 'acpi= _if.h' to the Makefile did the trick. I went ahead and committed it: 9709bda= 03cd0 Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: > on behalf of Colin Percival > Date: Friday, November 1, 2024 at 19:13 To: Ravi Pokala >, >, >, > Subject: Re: 6540ac118473 - main - modules: gpioaei only on ACPI-supporting= archs On 11/1/24 18:34, Ravi Pokala wrote: > This seems to have broken arm64.LINT-FDT: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % less _.arm64.LINT-FDT > ... > -------------------------------------------------------------- >>>> stage 3.1: building everything > -------------------------------------------------------------- > In file included from /usr/home/rpokala/freebsd/src/clean-main/sys/dev/gp= io//gpioaei.c:37: > /usr/home/rpokala/freebsd/src/clean-main/sys/dev/acpica/acpivar.h:34:10: = fatal error: 'acpi_if.h' file not found > 34 | #include "acpi_if.h" > | ^~~~~~~~~~~ > 1 error generated. > *** [gpioaei.o] Error code 1 >=20 > make[8]: stopped making "all" in /usr/home/rpokala/freebsd/src/clean-main= /sys/modules/gpio/gpioaei Oops. It was probably the earlier commit which broke it, but I'm clearly not good at kernel modules. Can you check if adding "acpi_if.h" to SRCS in src/sys/modules/gpio/gpioaei/Makefile fixes the problem? --=20 Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Sat Nov 2 12:28:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgcVh4RNGz5bvkT; Sat, 02 Nov 2024 12:29:32 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgcVh1wsVz54Rs; Sat, 2 Nov 2024 12:29:32 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Sat, 02 Nov 2024 13:28:26 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1730550563; bh=5gELwMYNqyNc1x3MK/EFsYQMmBbMe/Ik4+Ww3p8jX4c=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=Hw6QULVaKgaWDAchprShnkDt/OH5KCoHVNRZV6/ZDUcg0IRLt19YjEkuWLxHuQLIR cdiMkRSsR1tfNVSzPdPeRCBUqZVJBeXFn6cYv7wg89KqIQzbkPdr7e+QUGhQQ4QNdk htASs45RfeohzuL5YZ5j5SgZXPJnMb4rOB5Q84H4xpiOTJaItN489bTktMlyKhRqMs 9sCb0R2yaqjeTwfQxsY6FvEFDsJHGcyPcK8X6/8PX/MgSYCo/YTPTv701bidr93H6m a4oOXoeMUZpCB5fD7SmgLLL91hLus8TaMoOCYf9RIG/5aMuGX0MgVwAbrSTXagWM4o F3CwpCPVkByxA== Message-ID: <87zfmhddlh.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Dima Panov Cc: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 In-Reply-To: <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE] X-Rspamd-Queue-Id: 4XgcVh1wsVz54Rs X-Spamd-Bar: ---- On Fri, 01 Nov 2024 23:17:53 +0100, Dima Panov wrote: > > Hello! > > On 23.10.2024 21:32, Dimitry Andric wrote: > > The branch main has been updated by dim: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=5deeebd8c6ca991269e72902a7a62cada57947f6 > > > > commit 5deeebd8c6ca991269e72902a7a62cada57947f6 > > Merge: 6e516c87b6d7 e6b732792813 > > Author: Dimitry Andric > > AuthorDate: 2024-10-21 12:59:26 +0000 > > Commit: Dimitry Andric > > CommitDate: 2024-10-23 18:27:38 +0000 > > > > Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 > > This updates llvm, clang, compiler-rt, libc++, libunwind, > > lld, lldb and > > openmp to llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6, > > a.k.a. 19.1.2 release. > > PR: 280562 > > MFC after: 1 month > > > > > After this update any lang/gcc* fails to build on aarch64 machine :( > > mkdir aarch64-portbld-freebsd15.0/libgomp > Checking multilib configuration for libgomp... > Configuring stage 1 in aarch64-portbld-freebsd15.0/libgomp > configure: creating cache ./config.cache > checking for --enable-version-specific-runtime-libs... no > checking for --enable-generated-files-in-srcdir... no > checking build system type... aarch64-portbld-freebsd15.0 > checking host system type... aarch64-portbld-freebsd15.0 > checking target system type... aarch64-portbld-freebsd15.0 > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a thread-safe mkdir -p... /wrkdirs/usr/ports/lang/gcc13/work/gcc-13.3.0/libgomp/../install-sh -c -d > checking for gawk... /usr/bin/awk > checking whether gmake sets $(MAKE)... yes > checking whether gmake supports nested variables... yes > ld-elf.so.1: /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/libgcc_s.so.1: version GCC_3.3 required by /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/xgcc not defined > checking for aarch64-portbld-freebsd15.0-gcc... /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/xgcc -B/wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/ -B/usr/local/aarch64-portbld-freebsd15.0/bin/ -B/usr/local/aarch > checking whether the C compiler works... no > configure: error: in `/wrkdirs/usr/ports/lang/gcc13/work/.build/aarch64-portbld-freebsd15.0/libgomp': > configure: error: C compiler cannot create executables > See `config.log' for more details > gmake[2]: *** [Makefile:22505: configure-stage1-target-libgomp] Error 77 > gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/gcc13/work/.build' > gmake[1]: *** [Makefile:24863: stage1-bubble] Error 2 > gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/gcc13/work/.build' > gmake: *** [Makefile:25211: bootstrap-lean] Error 2 > ===> Compilation failed unexpectedly. I could build lang/gcc1[34] on main-n273387-bb8b3b174118 (arm64): $ clang --version FreeBSD clang version 19.1.2 (https://github.com/llvm/llvm-project.git llvmorg-19.1.2-0-g7ba7d8e2f7b6) Target: aarch64-unknown-freebsd15.0 Thread model: posix InstalledDir: /usr/bin Build config: +assertions From nobody Sat Nov 2 13:54:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgfP83pGDz5c492; Sat, 02 Nov 2024 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfP83BNNz40Ft; Sat, 2 Nov 2024 13:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uQs6TvLIWDRGlUYoFDVacYhI2WNoatgWNXz/WgyKMPM=; b=wixmFgx00AkwNPQyTOWY7dA4n+mhMNuRFjwh2Gsm4RbH2yy/lWkREGJ2ZwyagiAgfoNPyw la6g+dXOkwr1oIID436HgM7FTfIKxW9S1MWTbGQRGfLqaBXcYdTwPPJQS7zPZ8VR7259Vc PqoH8UMBVbcPvfAcoTqzlthOmYHcjucJ+rHBsCU8mgTYopsMRnc5+18rv0/R6zgxF9v2K3 GzNMIfqLmTIAlckGfYdUo8oH3sDfjSpth6Lz4yeBW28N7bEg+8R/jICDuofS5CkXwriHUY PDNtAMl6nmgvCvxdbZnLvOxgSFxZWwps3cXfR5rD7msbhiVL9Uaxzf1si2AnRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uQs6TvLIWDRGlUYoFDVacYhI2WNoatgWNXz/WgyKMPM=; b=exdG1Jso+i4sHy2T4a6gVzZfFyx/gGlUOjKH20I82a2z8GqWGV8ypIBZ9/uMLn5nhOKIaN FTK/1ipPkc1Gyjebk9xARZuXj4phR4BluekimUxik1O955UKJtcDJLQJJ9uBofXVM/djuM kDzGNq573vblBcSTIS8y5pdbkSlB3G8oo+5MNhHv6jgLGBlepBhFg4dXhbXIQEEbWLLSUu 4Oj9b5j2I6U/Z+akptdPWpCld1XB/vj+cp0lDZEDe1cl/GhbtojF71aPnbsup/n1QwR4uu FGBiBG6ptK5V+2mnO/AKg6m81w5bVEz7zrRWQ6XBIRGpIlg8CwFh2GxmxaHGiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555692; a=rsa-sha256; cv=none; b=y0y05+l6MA33ddQS3beW1eM1lYV2lotmOto4ucirqWf8zNQyO+FRuwXhhPos2GFaccF+9k uwOtujrit+poPbryMTRQRD7s/JfF1msy4ASoPiGNlpE5u56s5o1gVXqRU1H3G0nwI7VCDl Qqp6Bix1mO2BQ7cz0cSc4O1oxQaLee78CpCmNJPMzMIr/wSUB8Wk7NceguG+/cj+dte+PQ Cjn3lDpqbhprVmJ6wDgDFsZuBKuH9XQ0UTcINaVDFjaOH/Xb1jSpdDde08SQ+6KgWpbHrW fqW/fcpfmL+eRnyXvHKhTClRk8Vi5YbM3hg7IRh/r3FWCIbAvOk0Kt/T0jnFLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgfP82ngGz16mX; Sat, 2 Nov 2024 13:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2DsqZx098789; Sat, 2 Nov 2024 13:54:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Dsq1k098786; Sat, 2 Nov 2024 13:54:52 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:52 GMT Message-Id: <202411021354.4A2Dsq1k098786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bd2fc1e7d0ff - main - nvme: Rename the per-I/O queue sysctl device nodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd2fc1e7d0fff1becd781645366f8e0ef5ca68df Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bd2fc1e7d0fff1becd781645366f8e0ef5ca68df commit bd2fc1e7d0fff1becd781645366f8e0ef5ca68df Author: John Baldwin AuthorDate: 2024-11-02 13:53:28 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:53:28 +0000 nvme: Rename the per-I/O queue sysctl device nodes Switch from dev.nvme.X.ioqY to dev.nvme.X.ioq.Y. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47400 --- sys/dev/nvme/nvme_sysctl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c index f3566e75225d..a5a44721f9f9 100644 --- a/sys/dev/nvme/nvme_sysctl.c +++ b/sys/dev/nvme/nvme_sysctl.c @@ -346,8 +346,8 @@ void nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr) { struct sysctl_ctx_list *ctrlr_ctx; - struct sysctl_oid *ctrlr_tree, *que_tree; - struct sysctl_oid_list *ctrlr_list; + struct sysctl_oid *ctrlr_tree, *que_tree, *ioq_tree; + struct sysctl_oid_list *ctrlr_list, *ioq_list; #define QUEUE_NAME_LENGTH 16 char queue_name[QUEUE_NAME_LENGTH]; int i; @@ -441,9 +441,13 @@ nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr) * of the sysctls to diagnose things. */ if (ctrlr->ioq != NULL) { + ioq_tree = SYSCTL_ADD_NODE(ctrlr_ctx, ctrlr_list, OID_AUTO, + "ioq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "I/O Queues"); + ioq_list = SYSCTL_CHILDREN(ioq_tree); + for (i = 0; i < ctrlr->num_io_queues; i++) { - snprintf(queue_name, QUEUE_NAME_LENGTH, "ioq%d", i); - que_tree = SYSCTL_ADD_NODE(ctrlr_ctx, ctrlr_list, OID_AUTO, + snprintf(queue_name, QUEUE_NAME_LENGTH, "%d", i); + que_tree = SYSCTL_ADD_NODE(ctrlr_ctx, ioq_list, OID_AUTO, queue_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IO Queue"); nvme_sysctl_initialize_queue(&ctrlr->ioq[i], ctrlr_ctx, que_tree); From nobody Sat Nov 2 13:54:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgfP94rlxz5c42S; Sat, 02 Nov 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfP94D1zz40N1; Sat, 2 Nov 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOPZWWISUe1yhIfrGvZRErEAi3m+akD8YptOXWlZEMw=; b=tNzXa70iptyh3QtcsqqHKdKNVRQBENq+PlK3q2YuUIo5M+cnPR+Eo6kqpOkWhSoJ6h/95H DIKtz7yio/y9SOiKnFXgkSvyO8eK5uLAa0f0oh+33tYT65CI5E1eGNaqGGMYbxv/W7EVTi /s9ztKJMfIhatyClZv5FTp4rkj1NLj77RbTgkHvsf9E8YCI+W53jZVwngtADg3Lhw6Pgjw 9Z7grKlcl+a0CsSOSB7/yZ++LY3u7dORqNYzi9JMaGPS//km94tPDVB/YkaNU85k5KAe4y s1xRaR55D1yOVouU9IRf4nmXgK3sKLLxkmRdL1kSTL25uQALEZ86WkKuCYju8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOPZWWISUe1yhIfrGvZRErEAi3m+akD8YptOXWlZEMw=; b=vtaotlROOXgZEzqG787B4hIyYJG7RhBXztmFDQsV0Uxe2oM0XAUSKaBWxrJkf2E6lXgca9 FQCKcfp43odPvG8FI3YNeLPYi0Hw41AwtXzH58kpf0Kkbtph4v1yj45liRrF7CuYG73xpe OkYuRg+f0wBykYOrpmu7jW/K5yqj5Io6xBzKDvhMr2yipxhtIUZe2UhYYHvsV75paHAcKO OUeS4G3VLalYhTC3KUMZ1njRMvYKGGrfW1SrNZi1bTshk9dJFl3VyEzw7Gj5qkdHTXMC1Q CykDojIiK/fbcInO/ZNMxYEfxShDamaQfRXQKZuotVKK3QjNAdDFUz8KQJMGnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555693; a=rsa-sha256; cv=none; b=AKTbAZldXscmFwLLaepambPxiTscZKvAbQzaLwqKOvhEKEfTCjRz5HRskQk0GwmZ+vW8aD xpYqGGJGUWTxS64nx3fkO4KpnNksNJGXsBoiXUg3ZEt2mQzLW1QjSEYNE/lc9cRqBgkXdj iOe2Q6mMRE25RJZ5MpYMhCLbCO6YE3CYfOxpV69ix3CigeTrNfWpr2y/Qn/gcr5YMdoBuL +GFV/lP73z6QJJ2XMHZqnsGGZHCRYEbzTp9kKsWujbFBLPWnIQePE+Den688ShkmiEO1LU 8IWlP2lb1ACJZgPyOpmtNFnqacd0KjjDdFMTD7K4xtrBAFshMJrhCwJ5nLbnOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgfP93qlqz16Zt; Sat, 2 Nov 2024 13:54:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2DsrVc098840; Sat, 2 Nov 2024 13:54:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Dsr7r098837; Sat, 2 Nov 2024 13:54:53 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:53 GMT Message-Id: <202411021354.4A2Dsr7r098837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 931dd5feb0a1 - main - nvmf: Add sysctl nodes for each queue pair List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 931dd5feb0a13d6f24d3de7055d344732de0e353 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=931dd5feb0a13d6f24d3de7055d344732de0e353 commit 931dd5feb0a13d6f24d3de7055d344732de0e353 Author: John Baldwin AuthorDate: 2024-11-02 13:54:13 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:54:13 +0000 nvmf: Add sysctl nodes for each queue pair These report the queue size, queue head, queue tail, and the number of commands submitted. Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf.c | 10 ++++++++-- sys/dev/nvmf/host/nvmf_qpair.c | 42 +++++++++++++++++++++++++++++++++++++++++- sys/dev/nvmf/host/nvmf_var.h | 5 ++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 12023ebf96f9..9d06b501d675 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -266,7 +266,7 @@ nvmf_establish_connection(struct nvmf_softc *sc, struct nvmf_ivars *ivars) /* Setup the admin queue. */ sc->admin = nvmf_init_qp(sc, ivars->hh->trtype, &ivars->hh->admin, - "admin queue"); + "admin queue", 0); if (sc->admin == NULL) { device_printf(sc->dev, "Failed to setup admin queue\n"); return (ENXIO); @@ -279,7 +279,7 @@ nvmf_establish_connection(struct nvmf_softc *sc, struct nvmf_ivars *ivars) for (u_int i = 0; i < sc->num_io_queues; i++) { snprintf(name, sizeof(name), "I/O queue %u", i); sc->io[i] = nvmf_init_qp(sc, ivars->hh->trtype, - &ivars->io_params[i], name); + &ivars->io_params[i], name, i); if (sc->io[i] == NULL) { device_printf(sc->dev, "Failed to setup I/O queue %u\n", i + 1); @@ -453,6 +453,7 @@ nvmf_attach(device_t dev) struct make_dev_args mda; struct nvmf_softc *sc = device_get_softc(dev); struct nvmf_ivars *ivars = device_get_ivars(dev); + struct sysctl_oid *oid; uint64_t val; u_int i; int error; @@ -467,6 +468,11 @@ nvmf_attach(device_t dev) sx_init(&sc->connection_lock, "nvmf connection"); TASK_INIT(&sc->disconnect_task, 0, nvmf_disconnect_task, sc); + oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "ioq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "I/O Queues"); + sc->ioq_oid_list = SYSCTL_CHILDREN(oid); + /* Claim the cdata pointer from ivars. */ sc->cdata = ivars->cdata; ivars->cdata = NULL; diff --git a/sys/dev/nvmf/host/nvmf_qpair.c b/sys/dev/nvmf/host/nvmf_qpair.c index 96cb5a8b0465..1aeb0535eacf 100644 --- a/sys/dev/nvmf/host/nvmf_qpair.c +++ b/sys/dev/nvmf/host/nvmf_qpair.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,7 @@ struct nvmf_host_qpair { u_int num_commands; uint16_t sqhd; uint16_t sqtail; + uint64_t submitted; struct mtx lock; @@ -41,6 +43,7 @@ struct nvmf_host_qpair { struct nvmf_host_command **active_commands; char name[16]; + struct sysctl_ctx_list sysctl_ctx; }; struct nvmf_request * @@ -212,6 +215,7 @@ nvmf_receive_capsule(void *arg, struct nvmf_capsule *nc) } else { cmd->req = STAILQ_FIRST(&qp->pending_requests); STAILQ_REMOVE_HEAD(&qp->pending_requests, link); + qp->submitted++; mtx_unlock(&qp->lock); nvmf_dispatch_command(qp, cmd); } @@ -221,9 +225,39 @@ nvmf_receive_capsule(void *arg, struct nvmf_capsule *nc) nvmf_free_request(req); } +static void +nvmf_sysctls_qp(struct nvmf_softc *sc, struct nvmf_host_qpair *qp, + bool admin, u_int qid) +{ + struct sysctl_ctx_list *ctx = &qp->sysctl_ctx; + struct sysctl_oid *oid; + struct sysctl_oid_list *list; + char name[8]; + + if (admin) { + oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, + "adminq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Admin Queue"); + } else { + snprintf(name, sizeof(name), "%u", qid); + oid = SYSCTL_ADD_NODE(ctx, sc->ioq_oid_list, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "I/O Queue"); + } + list = SYSCTL_CHILDREN(oid); + + SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "num_entries", CTLFLAG_RD, + NULL, qp->num_commands + 1, "Number of entries in queue"); + SYSCTL_ADD_U16(ctx, list, OID_AUTO, "sq_head", CTLFLAG_RD, &qp->sqhd, + 0, "Current head of submission queue (as observed by driver)"); + SYSCTL_ADD_U16(ctx, list, OID_AUTO, "sq_tail", CTLFLAG_RD, &qp->sqtail, + 0, "Current tail of submission queue (as observed by driver)"); + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "num_cmds", CTLFLAG_RD, + &qp->submitted, 0, "Number of commands submitted"); +} + struct nvmf_host_qpair * nvmf_init_qp(struct nvmf_softc *sc, enum nvmf_trtype trtype, - struct nvmf_handoff_qpair_params *handoff, const char *name) + struct nvmf_handoff_qpair_params *handoff, const char *name, u_int qid) { struct nvmf_host_command *cmd, *ncmd; struct nvmf_host_qpair *qp; @@ -236,6 +270,7 @@ nvmf_init_qp(struct nvmf_softc *sc, enum nvmf_trtype trtype, qp->sqtail = handoff->sqtail; strlcpy(qp->name, name, sizeof(qp->name)); mtx_init(&qp->lock, "nvmf qp", NULL, MTX_DEF); + (void)sysctl_ctx_init(&qp->sysctl_ctx); /* * Allocate a spare command slot for each pending AER command @@ -258,6 +293,7 @@ nvmf_init_qp(struct nvmf_softc *sc, enum nvmf_trtype trtype, qp->qp = nvmf_allocate_qpair(trtype, false, handoff, nvmf_qp_error, qp, nvmf_receive_capsule, qp); if (qp->qp == NULL) { + (void)sysctl_ctx_free(&qp->sysctl_ctx); TAILQ_FOREACH_SAFE(cmd, &qp->free_commands, link, ncmd) { TAILQ_REMOVE(&qp->free_commands, cmd, link); free(cmd, M_NVMF); @@ -268,6 +304,8 @@ nvmf_init_qp(struct nvmf_softc *sc, enum nvmf_trtype trtype, return (NULL); } + nvmf_sysctls_qp(sc, qp, handoff->admin, qid); + return (qp); } @@ -339,6 +377,7 @@ nvmf_destroy_qp(struct nvmf_host_qpair *qp) struct nvmf_host_command *cmd, *ncmd; nvmf_shutdown_qp(qp); + (void)sysctl_ctx_free(&qp->sysctl_ctx); TAILQ_FOREACH_SAFE(cmd, &qp->free_commands, link, ncmd) { TAILQ_REMOVE(&qp->free_commands, cmd, link); @@ -381,6 +420,7 @@ nvmf_submit_request(struct nvmf_request *req) ("%s: CID already busy", __func__)); qp->active_commands[cmd->cid] = cmd; cmd->req = req; + qp->submitted++; mtx_unlock(&qp->lock); nvmf_dispatch_command(qp, cmd); } diff --git a/sys/dev/nvmf/host/nvmf_var.h b/sys/dev/nvmf/host/nvmf_var.h index adf6d8bde3d9..0e52f36a80a5 100644 --- a/sys/dev/nvmf/host/nvmf_var.h +++ b/sys/dev/nvmf/host/nvmf_var.h @@ -22,6 +22,7 @@ struct nvmf_aer; struct nvmf_capsule; struct nvmf_host_qpair; struct nvmf_namespace; +struct sysctl_oid_list; typedef void nvmf_request_complete_t(void *, const struct nvme_completion *); @@ -85,6 +86,8 @@ struct nvmf_softc { u_int num_aer; struct nvmf_aer *aer; + struct sysctl_oid_list *ioq_oid_list; + eventhandler_tag shutdown_pre_sync_eh; eventhandler_tag shutdown_post_sync_eh; }; @@ -200,7 +203,7 @@ bool nvmf_update_ns(struct nvmf_namespace *ns, /* nvmf_qpair.c */ struct nvmf_host_qpair *nvmf_init_qp(struct nvmf_softc *sc, enum nvmf_trtype trtype, struct nvmf_handoff_qpair_params *handoff, - const char *name); + const char *name, u_int qid); void nvmf_shutdown_qp(struct nvmf_host_qpair *qp); void nvmf_destroy_qp(struct nvmf_host_qpair *qp); struct nvmf_request *nvmf_allocate_request(struct nvmf_host_qpair *qp, From nobody Sat Nov 2 13:54:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgfPC1CPXz5c40X; Sat, 02 Nov 2024 13:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfPB52G7z40QZ; Sat, 2 Nov 2024 13:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DyeU2SFAqK1apAOSoQ2g4C/KxpJ7I9cbFArojW7Ipg=; b=NLVsGFuyIW0yLvy5Mcc5q6ab4I8Zrhoj2JG1vaheguKEc3P5pi4nrzvwe6UArHdCGQWADW LNuhDJqDAVIojm8ESoF6E/07i8EdwJJDs58holVtsG/D7LfgjuH4MgK6sMDIBPxBxOlPaW PaPnlyiZiAwIeo1MP+H8RlnorftO1inqilL9S1enVM63+JymIEA/Ptis8G/a8WYKoyNHgX 46MU2K68BovlIegsTnnYXDVr9q380C2LoaZdkp3Hav1uyTLC8IzxahfkRKT2/WXn/23Gq2 eo19VvPQGbEi7mFsqOzteaxo6M6vw/4gZnsf8+yJXpNpSF2tuH3gmoYzRCubPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DyeU2SFAqK1apAOSoQ2g4C/KxpJ7I9cbFArojW7Ipg=; b=kw704VhAbPM94N8CKt2M7ETtsLviERtul6W42XgLgD4lP8qaTPXhfp4OJLDvJtVMMbuyjm iQzI5Pt+FWD7SQXwhJfSii50p7z4tqTK+x7ns4bnRaEBdqU7MRcUPSiVaRkSC73slUfQUo dWgVXkm/8+iAcNwfC924o5T0SVH1RaSadm/U8t5v+5EUHgAvRUqebHClkxMp77ZWK+B85m 6rT5+DjEaupMUaSUUr0eaceWk1/aK/y1ODmvlYw250lbSHRgkGakzFO9j+GN3kICoc4ukZ y/sybofoZF0EBJTh78cxMJB9TMvzKtcs7yY3L9NnXwXcnGnmKL6T9ecblAfsFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555694; a=rsa-sha256; cv=none; b=A5LEbm898u/OvPRI16k1YrVMJahLE2R3fV21iMliqRdN1IhyK+Rbw0a2cyILYXzNYD4Wf6 bEAvmOapgmsGRhGGIWJmItq6iGgq8unIqMOL8fK0MgdXwDKT+KxtsVSeUS0hSHDgKIDh3i GVaCyi4iyb2y9/HVmGVUxp5P9eKj9BIk3GdBdoskFrDidWO7TBAK4YWgFHHc1hbQqp/F6D Myb9ZeuzqmdK98O87/qvuD0P8/L9eJA5KsDQkiKh4cVW6ZnmBMKJ/MPcn2KymEYrADyvdQ tKeLH+qF3TpqhvVCq7vtX2NKKc/1OIMyoB3G62k+FBSVqOdg12ws2yf6ceDuxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgfPB4RLpz16Wt; Sat, 2 Nov 2024 13:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2Dsshx098903; Sat, 2 Nov 2024 13:54:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Dss4p098900; Sat, 2 Nov 2024 13:54:54 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:54 GMT Message-Id: <202411021354.4A2Dss4p098900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7b8dd078ea3c - main - libnvmf: Correctly set the controller and host PDA fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b8dd078ea3c6b836f514f47587672fd062279c8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b8dd078ea3c6b836f514f47587672fd062279c8 commit 7b8dd078ea3c6b836f514f47587672fd062279c8 Author: John Baldwin AuthorDate: 2024-11-02 13:54:20 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:54:20 +0000 libnvmf: Correctly set the controller and host PDA fields The caller supplied PDU data alignment (PDA) field from nvmf_association_params is the caller's restriction on data alignment (so affects received PDUs), and the PDA value received from the other end is the remote end's restriction (so affects transmitted PDUs). I had these backwards so that if the remote end advertised a PDA it was used as the receive PDA instead of the transmit PDA. Sponsored by: Chelsio Communications --- lib/libnvmf/nvmf_tcp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index 93948b9b5fd0..cc4c0b90b0fb 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -1024,8 +1024,8 @@ tcp_connect(struct nvmf_tcp_qpair *qp, struct nvmf_association *na, bool admin) return (false); } - qp->txpda = (params->tcp.pda + 1) * 4; - qp->rxpda = (ic_resp.cpda + 1) * 4; + qp->rxpda = (params->tcp.pda + 1) * 4; + qp->txpda = (ic_resp.cpda + 1) * 4; qp->header_digests = ic_resp.dgst.bits.hdgst_enable != 0; qp->data_digests = ic_resp.dgst.bits.ddgst_enable != 0; qp->maxr2t = params->tcp.maxr2t; @@ -1069,8 +1069,8 @@ tcp_accept(struct nvmf_tcp_qpair *qp, struct nvmf_association *na) return (false); } - qp->txpda = (params->tcp.pda + 1) * 4; - qp->rxpda = (ic_req.hpda + 1) * 4; + qp->rxpda = (params->tcp.pda + 1) * 4; + qp->txpda = (ic_req.hpda + 1) * 4; qp->header_digests = ic_resp.dgst.bits.hdgst_enable != 0; qp->data_digests = ic_resp.dgst.bits.ddgst_enable != 0; qp->maxr2t = le32toh(ic_req.maxr2t); From nobody Sat Nov 2 13:54:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgfPD2TfDz5c46V; Sat, 02 Nov 2024 13:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfPC5W0lz40HG; Sat, 2 Nov 2024 13:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AjawA0cuy7+mMpVI13ncofqetwFhS+qEpK9J3IRzfBM=; b=Vhc4VTaivCOZCxHP9lq3SFLXMVvoUkYwO0NsM4JMwuSl1h/kspfn9Y1s3NhDCrXT5IMTZ6 0cGpwOTd1iqemFqiugNysqP9n0ZflnIF5mgqiUs2f4WFCzjVCcjQfnqhf62ClibfL6YIWd yLZ2ruFvMN4VZZedy2twnb5hI7PozqYdwKle7GJ/uzK6GnXlyMhti6Ll0CcQFRynhdW9Cp 6ycr52kHAQ91O8vH3Vrh0K3OtrV1+O2zAD6vopzAwrijEXLcBYn7yBHVGpeN/DilnZjEMg adxHAgH0uVfrTjPOiU58RSRuvp1skbEHToki2ejN0xboEGgg/ugjaSowMDGe/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AjawA0cuy7+mMpVI13ncofqetwFhS+qEpK9J3IRzfBM=; b=hKFl526r/+QK/157fEl2iqOeN7zw/abJuXtl7mKwfLJco+Ue1Go/a2oaV7iK8IRWLGcq08 RJ3YFE4DLNZY9lUs8flaF9va2AlOAoYDEsOSFytJ4swCRAWRkoKPRTKJtNYdLAJPOpOrqn n690eyKlm9wlaGvX9esclp3ou9RRny+Q90v5h/g4kCVmo1resdz5FyvrFua5Ij3lKLrbTP l6/mazajaS5WAwf3+CO7p8wITk3BJ90yvmJwBANqKwxzBw0dlYESPq3CRSxusW7KH6rZNg bIZu7t3jtX+252TF0SZ6S4JgHrR+l1dkXJCGyk6Q5abxd578QyByxidv9TR5gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555695; a=rsa-sha256; cv=none; b=UPdbAK2Jt2JSN2tXfZkxEMUNHeQN6XnKIh0lBT7tax64Yn3UkikKwmb7bB9bl3PIZyxbZ2 sqUnndeTAj0KuTWEtFTYxIPybVbPxddMKX8EgumL20Rrf810kmCkKRXC3/7Xn0vdWQt0aI q0E0boxBODMdE2XD5gHSTZA0DP1ve+Y6yUzCbkgszcUxtUqx41KckYkuv8ww9wR0N2Q0Lf BodY60VNROOfLEXgFHVoeP9kkKa9jaDAkH13hHnhkixgEM8qO6Z6hjTcV6AP9h/vIYoX/e rAoeLgPA7F1VsqzD7sCFzAvpFy+HnvPth53pMYe1OaXqGDoN4K4tsOBM610YZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgfPC56zzz16q9; Sat, 2 Nov 2024 13:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2DstD3098949; Sat, 2 Nov 2024 13:54:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2DstIQ098946; Sat, 2 Nov 2024 13:54:55 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:55 GMT Message-Id: <202411021354.4A2DstIQ098946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 06b2ed7a3adf - main - nvmf_tcp: Correct padding calculation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06b2ed7a3adf023d8a8ce821616052f03dc18ed6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=06b2ed7a3adf023d8a8ce821616052f03dc18ed6 commit 06b2ed7a3adf023d8a8ce821616052f03dc18ed6 Author: John Baldwin AuthorDate: 2024-11-02 13:54:29 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:54:29 +0000 nvmf_tcp: Correct padding calculation PDU data alignment (PDA) isn't necessarily a power of 2, just a multiple of 4, so use roundup() instead of roundup2() to compute the PDU data offset (PDO). Sponsored by: Chelsio Communications --- lib/libnvmf/nvmf_tcp.c | 2 +- sys/dev/nvmf/nvmf_tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index cc4c0b90b0fb..264a5bb154a0 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -432,7 +432,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen, if (qp->header_digests) plen += sizeof(header_digest); if (data_len != 0) { - pdo = roundup2(plen, qp->txpda); + pdo = roundup(plen, qp->txpda); pad = pdo - plen; plen = pdo + data_len; if (qp->data_digests) diff --git a/sys/dev/nvmf/nvmf_tcp.c b/sys/dev/nvmf/nvmf_tcp.c index 2e33334b92ee..50adbfdd2917 100644 --- a/sys/dev/nvmf/nvmf_tcp.c +++ b/sys/dev/nvmf/nvmf_tcp.c @@ -442,7 +442,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen, plen += sizeof(digest); if (data_len != 0) { KASSERT(m_length(data, NULL) == data_len, ("length mismatch")); - pdo = roundup2(plen, qp->txpda); + pdo = roundup(plen, qp->txpda); pad = pdo - plen; plen = pdo + data_len; if (qp->data_digests) From nobody Sat Nov 2 13:54:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgfPF2lt0z5c448; Sat, 02 Nov 2024 13:54:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgfPF0TbJz40Qv; Sat, 2 Nov 2024 13:54:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMoXROx0Xxvm9RBvHUg+7pOOcC2pNDmQM3FPAF7JcXU=; b=BOUHLxu0YNEPGRUzdBPn2yd4EOTc7SuwrbScpC3FnZyd+qRAq5wBEtPKx+ZSQPqcKOYoYD vBRSNvrR1N77bkbR/LBech4fa49OO2NSFsvMX7JZDadxGnJNX39P13oKmCDDze/8Y8+gRy r0tZRjpWABO9Ye1sjf5W+VaalC9qqKxfS8m/WJ0RJ6kPopBYzG58+yvkwC6WNiPYAZzQSa rYC/U8BZ9Sd1i/HZP0+MfrKZPPpNDRCRxcZZSiHg3boK9IEJ6LhsN9CdjPcub7wbxZL/a8 UbtX+waOpXgNZnEpK28cBtmwXcrFDXbqM08VTTmmCyN/ekSeutMl2/eSUys/RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730555697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMoXROx0Xxvm9RBvHUg+7pOOcC2pNDmQM3FPAF7JcXU=; b=uVZx/qsvQc2O2WJ7yMlH3A5PxtFAS4iNQoH4WOomcUwsC15W2pUkRrl7ojD6yKMapdWRW0 JPvJfeh21a/G8JjPpTiVGX3HSChqX6m4MW+YccPV1Iibw0AVVIYbQhfImC3Jn3062P1qYd f043hBqPLyihx19SJ4usuFZ+UkOZ6TubsQJDjPsbC1LXtKr2FeewZCGRB0zX5CUPZ+TfxR anfqo7LORH2QPoHgVijQgylM42/145CbrqCDN9m0mX/VLGeeKVR/W7E5yFoKNAscbKQrtk vXDeGb30LlaMvV7KiLSPDiXpcF2xZKXUO3pSnqgsa7sbTa8rKZ10OJSEzmLGQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730555697; a=rsa-sha256; cv=none; b=on3++h5xPMWdf1TMYf9v+TOnmtIeMH9gpbtR6N2M5NZHruoWVBHo80Lh4q/t44nd3k4m14 a7Qshx/4NAM3i44gu6oWP9HcDB0n8dI69NW65AQkB1P9hOyD4VyCVCZwkzVcB99Xa28jq5 gDhlmQUxuabzV+89CD/zeN6VznfNzEJuksjyqy9RDEHYZL0RIqIcMr3WiTJaAeZySY4yMP qNmPa49iWV6p6u92NQ6n21sYEhjT7wsQHJ7MExHrisEFT1ovuyM0w98l8AEJ20lo21a6Mq Xgt5qdrMMOzynAIuRT90hS4yOr69SqFl3aM4xPsKx2vdoVhdaLFPUuvgDBD2Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgfPD66TWz16qB; Sat, 2 Nov 2024 13:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2DsuZ8099006; Sat, 2 Nov 2024 13:54:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2DsuuG099002; Sat, 2 Nov 2024 13:54:56 GMT (envelope-from git) Date: Sat, 2 Nov 2024 13:54:56 GMT Message-Id: <202411021354.4A2DsuuG099002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a6ec2147418c - main - nvmf: Deregister the post_sync eventhandler correctly during detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6ec2147418c29b259ff6b4f4274417b55419285 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a6ec2147418c29b259ff6b4f4274417b55419285 commit a6ec2147418c29b259ff6b4f4274417b55419285 Author: John Baldwin AuthorDate: 2024-11-02 13:54:36 +0000 Commit: John Baldwin CommitDate: 2024-11-02 13:54:36 +0000 nvmf: Deregister the post_sync eventhandler correctly during detach Previously the handler was removed from the wrong eventhandler list. Fixes: f46d4971b5af nvmf: Handle shutdowns more gracefully Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 9d06b501d675..2c438db2eb23 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -780,7 +780,7 @@ nvmf_detach(device_t dev) sx_xunlock(&sc->connection_lock); EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->shutdown_pre_sync_eh); - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->shutdown_post_sync_eh); + EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->shutdown_post_sync_eh); nvmf_destroy_sim(sc); for (i = 0; i < sc->cdata->nn; i++) { From nobody Sat Nov 2 14:16:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgftL2RbHz5c5ph; Sat, 02 Nov 2024 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgftL1t2vz439R; Sat, 2 Nov 2024 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXYOb6K6YImwaKhkeZqciWOprWFOaJ9pGhNkSh/M+ww=; b=dU6BnciaBXhzw3PxG4Z9DZgG81aeyYyr09zdU4VY+07M0tpqeR1U5JFvDOD4PLwuiDDnqN 93vMp/jHrNkyUcXlgUHt47QEpWVBRIIgjfKzgQFg1xEXDXCCwcCO9EoelNaMs9vfuU4XNq QBCWiDp9ORTlK3w7LxWLzAx55bHy9/F4qqRP7s/ADFg5N+QfsOcqwcGnpKPllph8tMs2UR qSr9lKm01mu4fKVvRA955RCVmUmJVbMjV5YuNesqDx5rtUZ+XpmUnlxnNJ1X2rCdXsw9Ct Bh4z4uoAieQ1dbcpJR96S6+kQO/+RoExVKMIV+KKowOCNzfHNGcponchmN2m3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXYOb6K6YImwaKhkeZqciWOprWFOaJ9pGhNkSh/M+ww=; b=e3YojGULMxicLqLYhLN2tuOi+6/ExEEBHfdkiX3bOb36bBxzijRoy8g+bcJfe6euU5DxcI QBBc8q52NU6aSRZ0U/LoBeQepTaaG1+ac+VvWc+cnF89rlXQlPGNSV5N4EaUNtJlQAqevz zJolWbE8sEI5vrnDpq4H8sB8mbm3anQNDOt2SRW9ink6q0zePKk4QwVi8gnzmU2WuTwkXU 6hWH2Nzq3FMVXrupvhR26S0nqIEEbJWaqtkLlOeUK8lpd1I69goUsXK3gAq/Zdyyl4NgN4 eWQrUWB+3DYrsA5dlZ3nFQIofUDthtEDRoSsN+xA+scSYLxolR4ROmZe25Z0rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730557002; a=rsa-sha256; cv=none; b=k/CG5xytywNAg0UmryqJ3dy4TBiWl+5EJ6nlj9zoyp9qa0vIs96DPbLgya6nNyV2Y+0BmX Ogu2jgB+qk6BgJQ/uFNT04LINBz4C0cE48g1r/K7CwsZcEYy20npXhjSUEbrZD61+9FRJj 5LTR7VLXmuD51akehMH3sdQejSh8iNdb7wkYmmHLKB+IBwgVxtmwgmsN2CxcuADYNL6UF6 DdWwdoLVuRbuIFuesTn9SHSOtW+o0S+8yGNoSqPrwD7wt65tpaHz1D9t6hJGchzqQiHd6Z i6eh2qmUWRQ8DyHVujetfOhV/BoS9Izc1E1r6pNqJbpPEMNFVcvlwewLBtV5dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgftL1Dxhz17bH; Sat, 2 Nov 2024 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2EGgRQ037985; Sat, 2 Nov 2024 14:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2EGgGI037982; Sat, 2 Nov 2024 14:16:42 GMT (envelope-from git) Date: Sat, 2 Nov 2024 14:16:42 GMT Message-Id: <202411021416.4A2EGgGI037982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3aac51cbb99a - main - nvme: Clarify a comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3aac51cbb99a22723803329ce9d241f2419e1dec Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3aac51cbb99a22723803329ce9d241f2419e1dec commit 3aac51cbb99a22723803329ce9d241f2419e1dec Author: Warner Losh AuthorDate: 2024-11-02 14:11:27 +0000 Commit: Warner Losh CommitDate: 2024-11-02 14:14:33 +0000 nvme: Clarify a comment Expand the comment a little to make it clearer: Once we've restarted, we're out of the resetting phase in our state machine. The controller has actually been out of reset since we started issuing commands to it earlier in the resetting phase. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index d8ad12fc9982..994994c3643f 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1804,7 +1804,8 @@ nvme_ctrlr_resume(struct nvme_controller *ctrlr) /* * Now that we've reset the hardware, we can restart the controller. Any * I/O that was pending is requeued. Any admin commands are aborted with - * an error. Once we've restarted, take the controller out of reset. + * an error. Once we've restarted, stop flagging the controller as being + * in the reset phase. */ nvme_ctrlr_start(ctrlr, true); (void)atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); From nobody Sat Nov 2 14:29:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgg9G3XFkz5c6fl; Sat, 02 Nov 2024 14:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgg9G2sltz44fC; Sat, 2 Nov 2024 14:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4NJoZ0LCpXY26ZL6Sb92p8NztfWdEm5VqmRTD6ZBFE=; b=jTW79eQ6Nal8bUXEcKz/POpJaFYWa5TVe7lqj70NpISjaM1NNoC5/4cduw7akgL1gZTSUY Vh+1i8iHCchwPW2OzrXlNaHDMQjXknGaitnXqhBSmigb7EHtuEQ/k0tRsAGiEI4cyzDLsF fIQLJROovio6ERv9ycBcYdu7kVufRIMqMWL9s0g/SeGNNq/mHwYoWtl6LXKDCUKxZlhy5N SS5WEzOQI00otlsnOwLjQGDu2VBVcPTL936hVDxJPT2VHPGntQO/GtgL6OTpZBVCybXBZ6 wLXbQE8rGe2AX5vYkPdQKw2dB9UuR01uP78ZEwM2yL2/p5DKZCD4waL8MTsbpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4NJoZ0LCpXY26ZL6Sb92p8NztfWdEm5VqmRTD6ZBFE=; b=bUg7UaUUaY4GesORctIhAxHotBgZfosWVB3cHmLw4fuGomp4PuQak4G99U6VggGGfYKhyI +hzn13Q92Ln/W2O1w36JC1t/+KE+9MxwE07uPOy4siE0SD3Ma+Dh1rBDmcoYm24UyAatX2 Ph8xveDcoMJI6lusHiIhCQf1loYjFLx3vPitOkeRp+9wTi27rdGK9POOwFKIkhSdVX1ukb iPQVyhOnsez++yTkzm9W23Tap8IC5oXnHUs2icaLHEWbQoT4/pEEhai0QMXTidqW9VU1tL H8WYjapRpsBYjNq43CYjoZg1QMLL8LBCvO49cfMn84tc/MdamCfd6Ji81q8bQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730557778; a=rsa-sha256; cv=none; b=WNesacJm89csrYu+73msQUmanHSDejFveisT5lpVSfoWRrAp0lVYTNhs+VTLmLxzT3vIu7 24pshLjENAnmEXnJtc4c5QIieDAfTvWVWXevRwhTQOMYg003tbRmuaECIMrxpj43rVW7B2 NBs7htYCk7CBv76vc56RttiJJ1Anj9vAXcHPt9OSDez3Ju14cl5KG0QJmkTDY5CdPVkTTT gk7bVOLTNK0uNqV8qDykerJvISW61dLcYSQVw/z4lpnD8fkgQFBoznVRvbu5420xHHExGv vCZxwZ415NlcKUaNpzMnWUOBD/N8s7GBWxQ2i0jf1iUNHyT7qP1lio5l40kHzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgg9G2C2Nz17FB; Sat, 2 Nov 2024 14:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2ETcSr057787; Sat, 2 Nov 2024 14:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2ETc4Z057784; Sat, 2 Nov 2024 14:29:38 GMT (envelope-from git) Date: Sat, 2 Nov 2024 14:29:38 GMT Message-Id: <202411021429.4A2ETc4Z057784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 16b24ba87227 - stable/14 - igc: Remove a bogus register write in igc_if_queues_free() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16b24ba8722735ee2657f07e32e5a5bf7ee62a2e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=16b24ba8722735ee2657f07e32e5a5bf7ee62a2e commit 16b24ba8722735ee2657f07e32e5a5bf7ee62a2e Author: Mark Johnston AuthorDate: 2024-10-26 21:04:59 +0000 Commit: Mark Johnston CommitDate: 2024-11-02 14:29:26 +0000 igc: Remove a bogus register write in igc_if_queues_free() As explained in PR 277038, iflib calls IFDI_DETACH() and then IFDI_QUEUES_FREE(). With igc, the latter writes to a register after it has been unmapped. igc_if_detach() already calls igc_release_hw_control(), and looking at callers of igc_if_queues_free(), that appears to be sufficient. So, just remove the igc_release_hw_control() call. PR: 277038 Reported by: Mike Belanger Reviewed by: kbowling Tested by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47293 (cherry picked from commit 35d05a14ed7e9935be1ed0fe965b91aaaa4c92ef) --- sys/dev/igc/if_igc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index dd89b27e134c..38fb1406b1c1 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2050,8 +2050,6 @@ igc_if_queues_free(if_ctx_t ctx) sc->rx_queues = NULL; } - igc_release_hw_control(sc); - if (sc->mta != NULL) { free(sc->mta, M_DEVBUF); } From nobody Sat Nov 2 14:29:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgg9Z1hvWz5c6xM; Sat, 02 Nov 2024 14:29:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgg9Y64VZz44s1; Sat, 2 Nov 2024 14:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmWqZxnYdzg9+PukNdciyRK5aIxeG2lsNfC/qx8eSg0=; b=Bnth98W+aUGOLSKP9rpKRuRwarpPRg3d8UIhNpQ7bgwNTm5keoTmJjxpAsphX//MBiPjJz Y9hCAtWg/8m5Jr6zaYCgEbsmV60ylKpCLg+cFOJBNi7n6uq5AmVFIp6sCtkEDkkOejaL+t 0GNsEfTg9+ufNPW6euwYbgAoy/oBR9d1Ix/qoo6ks84TBih0xVFuoBmEl7KbygRKimrUg1 sIfwGsjIlQVGaydXpHPzVxTXMbwpANAgW/PDEUc0Kj/spL4rYNTo34/oHEDGuff01nTNVD cEKtgREgrHuTG0YEugqs3execexY3TLl5gQ5OdqSgK1Hz2gTWDlmsoUUVdYDlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730557793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmWqZxnYdzg9+PukNdciyRK5aIxeG2lsNfC/qx8eSg0=; b=oyWENukfDRXuoZh4e8gnrV4MOdYkYGjvsZLyIexb2ysYB4hpRtFv5/ZgOir7hqK4SAfWVy OyWvBAAvrsiD4+cxVibBJkuKCHY3bgKeT1uH+fUVZS0e9G7Vvrz3aZGrK41BsPJ1CaN+oK 93DmYPaHlE4ao4/5oZVNiouje4xX/S2QWdeEMUGcfHeTVDvU7PHbDA3V3tAX5Ivv0bkHSK afiLprm8if5RBD1Oqwe6bbsYI3PV4nqZ7qneFhSWzHfyOMpmxdLOZNH22jALHny5V0w7+m URdtBXUgvCYKKA+a2o/ajp0NcOGYTPbwHC3tYCortEG3fwiLImyGLsfoJtK4Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730557793; a=rsa-sha256; cv=none; b=ug99EY2ANn9DZzDiB04PxW89jAxcBOQ0T87Jx9HsViVPVHK5XYZPJNOerlLnTQ6QUx+NWu Gz3PZOkAsQbAAXymI+wrzGxUg1MqOsjKIdnt6zkQA3kadTEgZAxxqd2Zvoj0gLv1qDoSJf 8SsHsl471eimxMPyDVBpmcdT5ThOjgiJKtPzZV1ko+JyB4JXk3Ua9pcd0fAUsfC8pXVUmy wiGqR6j6vxd/Yfsf7fR4/HBq0vkSSCQrr5S2mnDPwZXxB9G1/PO5fOuf570KkNR/QBKWb0 1DMMDYlFIKtFXWcCRUION7zTpCpO3c7EIyei2681sNP1FCGAEXk+Eyrbsxr5uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgg9Y47Lrz17FF; Sat, 2 Nov 2024 14:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2ETrYq057999; Sat, 2 Nov 2024 14:29:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2ETrwA057996; Sat, 2 Nov 2024 14:29:53 GMT (envelope-from git) Date: Sat, 2 Nov 2024 14:29:53 GMT Message-Id: <202411021429.4A2ETrwA057996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 57d879534096 - stable/13 - igc: Remove a bogus register write in igc_if_queues_free() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57d879534096d8b49d0e6ba72dae1783e9a1cccc Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=57d879534096d8b49d0e6ba72dae1783e9a1cccc commit 57d879534096d8b49d0e6ba72dae1783e9a1cccc Author: Mark Johnston AuthorDate: 2024-10-26 21:04:59 +0000 Commit: Mark Johnston CommitDate: 2024-11-02 14:29:46 +0000 igc: Remove a bogus register write in igc_if_queues_free() As explained in PR 277038, iflib calls IFDI_DETACH() and then IFDI_QUEUES_FREE(). With igc, the latter writes to a register after it has been unmapped. igc_if_detach() already calls igc_release_hw_control(), and looking at callers of igc_if_queues_free(), that appears to be sufficient. So, just remove the igc_release_hw_control() call. PR: 277038 Reported by: Mike Belanger Reviewed by: kbowling Tested by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47293 (cherry picked from commit 35d05a14ed7e9935be1ed0fe965b91aaaa4c92ef) --- sys/dev/igc/if_igc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 1daec6e09694..5851b715b932 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2051,8 +2051,6 @@ igc_if_queues_free(if_ctx_t ctx) sc->rx_queues = NULL; } - igc_release_hw_control(sc); - if (sc->mta != NULL) { free(sc->mta, M_DEVBUF); } From nobody Sat Nov 2 14:39:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XggNG44Wyz5c7VT; Sat, 02 Nov 2024 14:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XggNG39qlz45ck; Sat, 2 Nov 2024 14:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730558350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=537y3Sjll2lhJsGeCVOOR2r9Ky52SBJli2sNU+UbnuU=; b=ulsE7GWsiuD/yW8WjadZkm2y2gqtVp1fRjJO6MxLHN0uxY5PccHD7CLO91O0huXOyvq8tj hoMFs0qzsZLXecp34Cm/ZAMInF+Vl1D2ve2ApVz3zWdD8IFhab1lHfdlp/FCeASY60nQQl tyqQtbXZv4aLCf1GOLQFL3KG8ny0+mnqX8XpIAlebzUnmjdsq5R4qcpen+OUNsa+xxwHMz rSkROxNwX/2I9woAnlx7HCkxN+AncbgFWLI8eyPWICqOi8Qsd0Dzr0aY/I8cBn1hy46LV5 N8rmHvVWhuCzJZQxhx47C8m26Pe295pldzlXkSKvKbXTVBuKOlwZtZ/q3rh5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730558350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=537y3Sjll2lhJsGeCVOOR2r9Ky52SBJli2sNU+UbnuU=; b=naj1qcDBLLHhwFbXxmdu35ILTKvDPz0dsGs3gm+dWLdeQpaPMY3k9iYiwgpUl/xyrwfA7T u7s+52O+BahnQm1KR4NpnmvdqqV/xH67uNozkbWfHPwx/eSfjai9hScjKu76f8XNcbFnP8 u//ND74Jl2u1oid0UxlCW37t9X3AJGlIplQmOU0E+8SDfXO7lhjxEkviaHWT+DOyDwOXLf cCFTIZEmpaYMLLN7yreqXhTHbFaoIsAL4+/IetPxWQrmwZghDCueJJNl09p96D2FEJk9uc fRLUlsfscsLnLVxhBYR8j9gBkzcAwzvrdXbWXASGRC39VlD9RocJkBaSApnWFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730558350; a=rsa-sha256; cv=none; b=dYjcEl9K8y1n0Q/C4LZ0pnWsHobZ5yflacKM+kgPqmHsN9ZftP2itd4u/+pL6iizKSOOrp a1Vehyn4pfESCQswVv7RA714lXMf508ySAeo6bP/J4yQ0KtWVEW/Hqd8ySV5sV9uLwfl0a jLuIbzT35+CKHe77O4YJwYVC3T6p8ykOs5QGg3XTJhGipJxbQha/nqq1alM4ymULlkt+Du hf19jvcs7Gwnxb6IKyEuFESehefS5wlVUPvMf8YuwdzD4k0EClujIM79oMCw6sQqAKCROb T8tAhCkoRTFk/TsbXI8fQwVKNouymjM1YE2XvdIkJrweaOV9g6hx0uLKLP0/3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XggNG2mklz16tf; Sat, 2 Nov 2024 14:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2EdAeM076015; Sat, 2 Nov 2024 14:39:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2EdAff076012; Sat, 2 Nov 2024 14:39:10 GMT (envelope-from git) Date: Sat, 2 Nov 2024 14:39:10 GMT Message-Id: <202411021439.4A2EdAff076012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: adba3c74209e - main - vt: add comments for KDMKTONE ioctl implementation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adba3c74209eb5d2197b9092002cc9d7505fd3c6 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=adba3c74209eb5d2197b9092002cc9d7505fd3c6 commit adba3c74209eb5d2197b9092002cc9d7505fd3c6 Author: Ed Maste AuthorDate: 2024-11-01 16:29:32 +0000 Commit: Ed Maste CommitDate: 2024-11-02 14:39:04 +0000 vt: add comments for KDMKTONE ioctl implementation The KDMKTONE ioctl, introduced in commit 916347f77e6c, is used to beep the PC speaker. For historical reasons the frequency is specified as an 8254 PIT divisor for a 1.19MHz clock. Linux provides this same ioctl. Add a comment to vtterm_beep to avoid someone wanting to "fix" this in the future. Also add an XXX comment that the period unit is supposed to be "timer ticks." Note that nothing in the base system uses this ioctl. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47395 --- sys/dev/vt/vt_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 8f5e45306d61..87020b6e6f19 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1135,6 +1135,13 @@ vtterm_bell(struct terminal *tm) sysbeep(vw->vw_bell_pitch, vw->vw_bell_duration); } +/* + * Beep with user-provided frequency and duration as specified by a KDMKTONE + * ioctl (compatible with Linux). The frequency is specified as a 8254 PIT + * divisor for a 1.19MHz clock. + * + * See https://tldp.org/LDP/lpg/node83.html. + */ static void vtterm_beep(struct terminal *tm, u_int param) { @@ -1148,6 +1155,7 @@ vtterm_beep(struct terminal *tm, u_int param) return; } + /* XXX period unit is supposed to be "timer ticks." */ period = ((param >> 16) & 0xffff) * SBT_1MS; freq = 1193182 / (param & 0xffff); From nobody Sat Nov 2 15:22:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XghLj0w0Rz5cC85; Sat, 02 Nov 2024 15:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XghLj0Qbtz4Bs4; Sat, 2 Nov 2024 15:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730560973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvvezVJ4CJpI+7mKItXgU2TyzaE31a2R2ZUYHRAVSt4=; b=cW5bbTXbyTLYise+sEBdgihzL9t0qR/rVBHGuuaEFQA4PWxNbA6JM35utjB9eV5wo7H8a3 WE3YL75HuFdCMzk1M1zowypPSTfqr3fBjFXH31REaNqrF6hXFq/HX5ZDtMfyHDSkmrLuxg RWHydfZHYxpjeE5rpvoJxl0vqaoGL9qQDTcSlxg/G+ZmICGIXtXQWSc/vb5F3eZVuvcuAE 4JuaO8EdCC2j5tvbUiB7KRg60RTANv4AvXoEvyh//7GkpLCJAC9hbSMYMzhjG4isnLop2X kU4sEiDIgw0XuBLMzTyrt7I03x4vKT8rmcAww2GcDeFGC6NBSnMTfKPbUbRw2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730560973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tvvezVJ4CJpI+7mKItXgU2TyzaE31a2R2ZUYHRAVSt4=; b=jPdK2h+P6SibCFZVsToptmnutoBVgkRqHs57nPMCZAy0QgPWceDHoADv5qkNx5v7VBVOtH Cf5x8AbsGkT/QinesB+GbYKsbCFSrA/9nK3qSv2ELKO24ULPxJTMVqaFEISVL2uxnkm9Hz ys5J7zLUIZ+Xmn7TXTlDSfnc+EADOEnCBSrsJhW6AViwI+da72DwJer0SVFxHxQWA2kAcl pxPbIHO1khBWADQ0X9myTyUDXM6mZ7nG9PtObiDsZdTgvOjZd4TfoKHXYBofbegplw2nDL SANJqaJ2aq1LWzUYPuJJ1upFpCOxpCIjsOCm2bkfT4OFsn4LsY9bOocLHVGPRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730560973; a=rsa-sha256; cv=none; b=gsHJvQpvpj5NknMSwm9+EsVEaSLI3WIshX5BzKaIELQ66ouaCpe4moyPgp3b29zhz90APp +l3QWPZ6ZmOildCmYL+C9ap+vjQ3mdXXidhGSDuJY5Nbi0u1oIF0ck+OWJnMusMh+Owq6i 3gT7vv4HSGo+bLGSdjQ9en9nbJrJyNMu5cP7URQHLeD1tJLM5LBRdzk3H8TTWLLjPB+4X4 KoiQJvTwCrhcY8O0kOpa3rcZxA7chtS3CExeo9JlqvWoJgrTS9n20ralEnE2b4a9xahjE5 n07ImWHAtZF9bOo8/2qE0peEfChmTdrC9Jv5mtiWyDIx4ZJaLiPDdo8GQfUUSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XghLj02LLz18Yf; Sat, 2 Nov 2024 15:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2FMq55066951; Sat, 2 Nov 2024 15:22:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2FMql8066948; Sat, 2 Nov 2024 15:22:52 GMT (envelope-from git) Date: Sat, 2 Nov 2024 15:22:52 GMT Message-Id: <202411021522.4A2FMql8066948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fc2a3ec6fe6a - main - syscons: add deprecation notice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc2a3ec6fe6aa00d9be0c293c38e0ef9ac7e2b64 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fc2a3ec6fe6aa00d9be0c293c38e0ef9ac7e2b64 commit fc2a3ec6fe6aa00d9be0c293c38e0ef9ac7e2b64 Author: Ed Maste AuthorDate: 2024-11-01 16:51:01 +0000 Commit: Ed Maste CommitDate: 2024-11-02 15:22:24 +0000 syscons: add deprecation notice syscons(4) is not compatible with UEFI, does not support UTF-8, and is Giant-locked. There is no specific timeline yet for removing it, but support for the Giant lock is expected to go away in one or two major release cycles. Add a deprecation notice to avoid surprises, and help ensure that any material deficiencies in vt(4) become known. Reviewed by: manu, markj, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47396 --- share/man/man4/syscons.4 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man4/syscons.4 b/share/man/man4/syscons.4 index 19ecd5e3746e..7e31680ced3f 100644 --- a/share/man/man4/syscons.4 +++ b/share/man/man4/syscons.4 @@ -24,7 +24,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 May 25, 2022 +.Dd November 2, 2024 .Dt SYSCONS 4 .Os .Sh NAME @@ -69,6 +69,14 @@ In In .Pa /boot/loader.conf : .Cd kern.vty=sc +.Sh DEPRECATION NOTICE +The +.Nm +console is deprecated, and will be removed in a future version of +.Fx . +Users are advised to migrate to the +.Xr vt 4 +console instead. .Sh DESCRIPTION The .Nm From nobody Sat Nov 2 15:53:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgj1n5RKnz5cFS5; Sat, 02 Nov 2024 15:53:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgj1n4Sh8z4J3g; Sat, 2 Nov 2024 15:53:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730562797; 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=+Y/MZ5nQvJHfcG5Ub9titDC4HTcw1madMyPtYvPH3Mc=; b=dR6DZKCpVdriTF3xa3hjvWFkNcqC59fojcWKvWQQWRkmEd+/4vLsGqrPx8IQN/JSy43zBx Knar6+/oRuoLGoNgIhzgD/pGcrIVhUoqPJdNb+G7ud4RmikZgklCCXglza/jujwEcv/ZoH VIYtBJeA0lhrZP2MbSKUeC/IJG/zLuEE7REpq3rZrMxBejj62Q26i3ExzXuGCADYboDqFr 5qhq5kIGymAl6L1eCh5Ufn2x2audY/atUiTKMzhirgPLGuHQ7BVteX7fq6as7pydcNnP7t VS9vpTyaXcDRTcDkhpvvFmCuJk4cVqxB37EVfq4mPznNVA8gc2ZvydJlUJB36g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730562797; 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=+Y/MZ5nQvJHfcG5Ub9titDC4HTcw1madMyPtYvPH3Mc=; b=H9b4EONpB7vKgYhjaFYXXTBigPJAhErPFf6sPzFJQ26PTfa03XvZdP2bZshK4a3L5oS3+q A9HhgpS/7uiXb+Ain1ZAhH6qy7llUuS6S78q8Hp9Ai6DsZ3VccXmMIA41IZ5wqNME+/H89 ph+ZxuGl0ZFsQ63cvscYqWmLw+GOuuM1Bn1IL5Zx8Kv+MfHkubpAJf1T0i1HujKPHa3ERe ynlVzHrkrJvNsNAVTh61JqFmrnCT8hZTHSfdacP0xG3F01wG2sHWs9D0IHPDdG7XPuiTzM Us/KcSvMQdit7zfh4pOul+QNMXz/vFw4xDFF8S5MKORq+Ahni01fjPpfyoqKhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730562797; a=rsa-sha256; cv=none; b=Pg6e9mys1uf3Jqi/bRRHO/h2t+9vFqcdeaWC7BQef8QS3cFbi/ihhCOkXJolhuxwxIW8kK MsiWhq6/Xo6hUStJEMvMhOuNZqcChmde/ReU3aKqRiJALCcLEI506rVeyirCOny5/smPa2 UO9aEYmCH1e1Mqu2JvZtmeub4zvPpmMEejj6z2EY9maE9NMEL9V2Wz6QjlnEn8Vz3BSDbn GGHVoLbjc3KdgsfPdLNZfLbz78YTL9z6VJYe3K1BI7cDCLE7I+zhyI2d7fXj4bgg6peC5h +jcVF7CY416ZE6/nf3oYT5XpgMPqV9I5mf+CLuKUn4PV0LfJ0WqHsJznJ9Z2dg== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R10" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xgj1n3VkrzdMf; Sat, 2 Nov 2024 15:53:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0FBCE57193; Sat, 02 Nov 2024 16:53:16 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_B19CAE09-AAEC-4BB7-902B-C48FDA1FA578"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\)) Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 From: Dimitry Andric In-Reply-To: <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> Date: Sat, 2 Nov 2024 16:53:07 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> To: Dima Panov X-Mailer: Apple Mail (2.3731.700.6.1.9) --Apple-Mail=_B19CAE09-AAEC-4BB7-902B-C48FDA1FA578 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 Nov 2024, at 23:17, Dima Panov wrote: >=20 > Hello! >=20 > On 23.10.2024 21:32, Dimitry Andric wrote: >> The branch main has been updated by dim: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D5deeebd8c6ca991269e72902a7a62cad= a57947f6 >> commit 5deeebd8c6ca991269e72902a7a62cada57947f6 >> Merge: 6e516c87b6d7 e6b732792813 >> Author: Dimitry Andric >> AuthorDate: 2024-10-21 12:59:26 +0000 >> Commit: Dimitry Andric >> CommitDate: 2024-10-23 18:27:38 +0000 >> Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 >> This updates llvm, clang, compiler-rt, libc++, libunwind, = lld, lldb and >> openmp to llvm-project release/19.x = llvmorg-19.1.2-0-g7ba7d8e2f7b6, >> a.k.a. 19.1.2 release. >> PR: 280562 >> MFC after: 1 month >=20 >=20 > After this update any lang/gcc* fails to build on aarch64 machine :( >=20 > mkdir aarch64-portbld-freebsd15.0/libgomp > Checking multilib configuration for libgomp... > Configuring stage 1 in aarch64-portbld-freebsd15.0/libgomp > configure: creating cache ./config.cache > checking for --enable-version-specific-runtime-libs... no > checking for --enable-generated-files-in-srcdir... no > checking build system type... aarch64-portbld-freebsd15.0 > checking host system type... aarch64-portbld-freebsd15.0 > checking target system type... aarch64-portbld-freebsd15.0 > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a thread-safe mkdir -p... = /wrkdirs/usr/ports/lang/gcc13/work/gcc-13.3.0/libgomp/../install-sh -c = -d > checking for gawk... /usr/bin/awk > checking whether gmake sets $(MAKE)... yes > checking whether gmake supports nested variables... yes > ld-elf.so.1: = /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/libgcc_s.so.1: version = GCC_3.3 required by /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/xgcc = not defined > checking for aarch64-portbld-freebsd15.0-gcc... = /wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/xgcc = -B/wrkdirs/usr/ports/lang/gcc13/work/.build/./gcc/ = -B/usr/local/aarch64-portbld-freebsd15.0/bin/ -B/usr/local/aarch > checking whether the C compiler works... no > configure: error: in = `/wrkdirs/usr/ports/lang/gcc13/work/.build/aarch64-portbld-freebsd15.0/lib= gomp': > configure: error: C compiler cannot create executables > See `config.log' for more details > gmake[2]: *** [Makefile:22505: configure-stage1-target-libgomp] Error = 77 > gmake[2]: Leaving directory = '/wrkdirs/usr/ports/lang/gcc13/work/.build' > gmake[1]: *** [Makefile:24863: stage1-bubble] Error 2 > gmake[1]: Leaving directory = '/wrkdirs/usr/ports/lang/gcc13/work/.build' > gmake: *** [Makefile:25211: bootstrap-lean] Error 2 > =3D=3D=3D> Compilation failed unexpectedly. I cannot reproduce this. I have installed a fresh snapshot = (FreeBSD-15.0-CURRENT-arm64-aarch64-20241031-5212b9500116-273335), = installed the prerequisites, then did a full build of the default gcc, = which is currently lang/gcc13. All options defaulted. Do you have any non-default options select for these ports? -Dimitry --Apple-Mail=_B19CAE09-AAEC-4BB7-902B-C48FDA1FA578 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----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZyZK4wAKCRCwXqMKLiCW o0ZqAKCHB/qaClqmluC6GS/C1KI0nurBlQCfYVRfpS0+7qqGTgcUUHlNgbM3GVM= =vCH5 -----END PGP SIGNATURE----- --Apple-Mail=_B19CAE09-AAEC-4BB7-902B-C48FDA1FA578-- From nobody Sat Nov 2 16:03:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgjF81JBbz5cGgr; Sat, 02 Nov 2024 16:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgjF80pMjz4LSy; Sat, 2 Nov 2024 16:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730563388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7G0w3Cl/UP3VyzpwL1by1k56WxhRZyKtWIs9Zmthi8=; b=xgB/AdJI/tg3kVBY3PdrCmhLpuJsriz+5qVe98LTUBtvEs7LI8FmKYYh28QCIsMGOqNbxY gac0zsOGSQENi8G/GbPlkq3uh8KlOMXPyfi70NiaNsuHHxvFD6VUtE6wNx43velU5L1IbI Qqh368X6PJbeAZi6r0/9wJ+qcVO3l0l5+CATYWIqrzKeVG1ptXnxtsJgeTq6OwZbFZjw/q ajO2b2IP8qRKiGFmfObnk752SFk4rl8huSS+yqZCyZ52WfIh9sp20oVHgxVMj34c0DwSDl N+H2Ef5f/PQi3ZrXB/kl3L6Jcy73sSDV27vGKIAOIYEcgG0tiX/UHkI0iIUBuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730563388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7G0w3Cl/UP3VyzpwL1by1k56WxhRZyKtWIs9Zmthi8=; b=pn7M2ixWdqfthU2qrtACOAeLUTDKReT9Vse/zX7u5wAsZxhwJJzpk49QPvrL2XXbsLJqcZ X2sgukRdah7EgDpxmB93kjfm/6oi6PWM+fCzP32DMYt8xA3Y5D4BhhgT0Ao6ex47v5+TIq fVZ2my3QY2kcPbmn0InBflQUOfZocyOXCCiEnSMrSUwfbxLxJ445ktuC+96qlNx7Qv0V/O bHVRBxsHf2kVNBXL5i/OaxntDb8zRt5iR+QLY5+A7wzqPk70tAmWdHK+DsKyoUSP7P+etN gIpmJX8cAOJHX01Y85MNZMaggoWFXww2CENGghl2q/QQ1zLoYJ2TJudRG8dBPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730563388; a=rsa-sha256; cv=none; b=niCuTLaV8H+rwfvW8RkPu/Kao5qyN+kn/VoW604v13YGBztUhgxmyGSk+nWivG4SPP4lXK SLPtkzNR2l/fiYnmEsgSOD0Wnbjj20wHke1WAPPvVueK79dUcPtImCTy+fjVydzunnITPs TQKxZB/NiQYoJqsS2AR76zYggD+sy8h6sXABiT4CIsEEN+ihK02iTtFEsrDzAqxFw91CTs IGpuLCraCBtI5OdwKmIUs1An+OEtvPZYJoUpLuVXyRgtYturDoWSYApLjus8md0aVQsWLl T42Bq1Kt/efD2VZOo2xVaCKETowUdV0lLDuXOdmcOufM4nlHekTr9VFTmv1Mpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgjF80GYRz1BBB; Sat, 2 Nov 2024 16:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2G37F7041887; Sat, 2 Nov 2024 16:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2G37OZ041884; Sat, 2 Nov 2024 16:03:07 GMT (envelope-from git) Date: Sat, 2 Nov 2024 16:03:07 GMT Message-Id: <202411021603.4A2G37OZ041884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: d839cf2fbb47 - main - sctp: editorial cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d839cf2fbb47c52d5153fb366c51bd6f6a3dd0fd Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d839cf2fbb47c52d5153fb366c51bd6f6a3dd0fd commit d839cf2fbb47c52d5153fb366c51bd6f6a3dd0fd Author: Michael Tuexen AuthorDate: 2024-11-02 15:00:59 +0000 Commit: Michael Tuexen CommitDate: 2024-11-02 15:02:52 +0000 sctp: editorial cleanup Improve consistency, no functional change intended. MFC after: 3 days --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index e2248adfdfb6..c37fe2eed88a 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -312,7 +312,7 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, } } - sctp_ifap->localifa_flags &= (~SCTP_ADDR_VALID); + sctp_ifap->localifa_flags &= ~SCTP_ADDR_VALID; sctp_ifap->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE; out: SCTP_IPI_ADDR_RUNLOCK(); @@ -354,7 +354,7 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, } } - sctp_ifap->localifa_flags &= (~SCTP_ADDR_IFA_UNUSEABLE); + sctp_ifap->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE; sctp_ifap->localifa_flags |= SCTP_ADDR_VALID; out: SCTP_IPI_ADDR_RUNLOCK(); From nobody Sat Nov 2 16:34:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgjx90Fxrz5cJtY; Sat, 02 Nov 2024 16:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgjx86pdXz4SJf; Sat, 2 Nov 2024 16:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730565261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q8YiEGGoJM3mqvQAxUWADexf4GV/woQO6u1mH195d84=; b=sYic1+5Fe/UPaImnebB6DG6Y26jfwMe1c+YrmwlrV2s2hmMeNhKu/FiFL0E52nYCcG4ODD KWlVCzjW0Z5UZNiErnclmRM0c0WsQOr7HR3hnoEW4XirW7u0WxAP75hxk+70Y/uDDwgXyx FqPQuZbpJQOjEiGiGfRucIt7kU74RTRHC+FhBgPk3x9/9KiPU1owBpITMROH0LZVxjw0iM 7/SadWM/Hln/D+qBiFbsrca3f79HYZhhpPwEYTBbHZOZiVLVjGUuPpkP8JunS/wTukIoZZ WSavPl+AcJ4a4LcfaBfrUv36XcN7tkp+cYQTfcppCZ4KcauJCbJ93VqrnzQkVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730565261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q8YiEGGoJM3mqvQAxUWADexf4GV/woQO6u1mH195d84=; b=DrhsylcQCo2h1UEeUb3LI5X2e4wkrh7okg/NBa6ljcSot6PSuKAjNqWC0VRN2dzyYYjqQ/ IBjwcWlFCFeDdXLS+6gz503hUV8/TQzqDg9CcHRRDnAomi/0zyXNEycEMZEnsbpxkbcfrH L74Q0zQuYk5D2RYHZRu4CAS3JhRS/hSJcjp82DJL5vSHd/pz6KPsNG0XKDRPl5IDlsdVA+ 05QTDIG0u8iT46/0MUdGhru/nmqlWUBA6t7/aKUkMApAvQyvZejJ/eScaEyV9P2ojrHLgd rOWEWLWpTzE3Rs8UAPK2WOWkfT+y2Fw6qeAnIO7PARUT1D9DFpMU4iNjdEApcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730565261; a=rsa-sha256; cv=none; b=MH7ylEgiqDmlTgOWHChQTyQ5V9CPvPkIt3DV9Yq6b/Q5eWyqIXI22dbpHPr3IXpQKyqp3o 3HRUwB5JIqwNQjuDrikY+EU3mdhgGQoV9crthE0l9UfSLgMJfjYYyUSXphMrpOBm8S/+bK xFvB/7fL6kI1Ap5upspfZwQS6dybbkuAlbj7X3ckpQVyqL1tJi9iLiJgXMma94grrHYkGq OXGkC7E4n1h9eRAhmtWLlgOkO/iGacf/K+VuZR6bAoD0+ZNCn5LAtV1hbPKJq6ibLFpPbZ UOH7v1I04c9yGPm5Tg9aE1URWrtLYP1mV7cvpE2gdKgqNdyGRs8gZBC1AXUjPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgjx86Q0nz1BP0; Sat, 2 Nov 2024 16:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2GYKLU097937; Sat, 2 Nov 2024 16:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2GYKGt097934; Sat, 2 Nov 2024 16:34:20 GMT (envelope-from git) Date: Sat, 2 Nov 2024 16:34:20 GMT Message-Id: <202411021634.4A2GYKGt097934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bf11fdaf0d09 - main - sctp: don't consider the interface name when removing an address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf11fdaf0d095fecca61fa8b457d06e27fae5946 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bf11fdaf0d095fecca61fa8b457d06e27fae5946 commit bf11fdaf0d095fecca61fa8b457d06e27fae5946 Author: Michael Tuexen AuthorDate: 2024-11-02 15:33:02 +0000 Commit: Michael Tuexen CommitDate: 2024-11-02 15:33:02 +0000 sctp: don't consider the interface name when removing an address Checking the interface name can not be done consistently, so don't do it. MFC after: 3 days --- sys/netinet/sctp_bsd_addr.c | 3 +-- sys/netinet/sctp_pcb.c | 27 +++------------------------ sys/netinet/sctp_pcb.h | 2 +- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index a91b0dde5967..3c6952ab6f3c 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -338,8 +338,7 @@ sctp_addr_change(struct ifaddr *ifa, int cmd) (void *)ifa, ifa->ifa_addr, ifa_flags, 1); } else { sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr, - ifa->ifa_ifp->if_index, - ifa->ifa_ifp->if_xname); + ifa->ifa_ifp->if_index); /* * We don't bump refcount here so when it completes the diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index c37fe2eed88a..6d8757912f3e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -662,8 +662,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, */ SCTPDBG(SCTP_DEBUG_PCB4, "Lost an address change?\n"); /* Opps, must decrement the count */ - sctp_del_addr_from_vrf(vrf_id, addr, ifn_index, - if_name); + sctp_del_addr_from_vrf(vrf_id, addr, ifn_index); return (NULL); } SCTP_INCR_LADDR_COUNT(); @@ -688,7 +687,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, void sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, - uint32_t ifn_index, const char *if_name) + uint32_t ifn_index) { struct sctp_vrf *vrf; struct sctp_ifa *sctp_ifap; @@ -709,27 +708,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - bool valid = false; - - /*- - * The name has priority over the ifn_index - * if its given. - */ - if (if_name) { - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { - /* They match its a correct delete */ - valid = true; - } - } - if (!valid) { - /* last ditch check ifn_index */ - if (ifn_index == sctp_ifap->ifn_p->ifn_index) { - valid = true; - } - } - if (!valid) { - SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d ifname:%s does not match addresses\n", - ifn_index, ((if_name == NULL) ? "NULL" : if_name)); + if (ifn_index != sctp_ifap->ifn_p->ifn_index) { SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d ifname:%s - ignoring delete\n", sctp_ifap->ifn_p->ifn_index, sctp_ifap->ifn_p->ifn_name); SCTP_IPI_ADDR_WUNLOCK(); diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 86c244c71544..1249c2233c63 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -510,7 +510,7 @@ void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void sctp_del_addr_from_vrf(uint32_t vrfid, struct sockaddr *addr, - uint32_t ifn_index, const char *if_name); + uint32_t ifn_index); struct sctp_nets *sctp_findnet(struct sctp_tcb *, struct sockaddr *); From nobody Sat Nov 2 17:58:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xglpk066wz5cRGy; Sat, 02 Nov 2024 17:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xglpj6R85z4g7n; Sat, 2 Nov 2024 17:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730570333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WP+AUG2CpxLsM07ixEoHCYt9gEOK2uDIQmZUVo5PD4=; b=To/avi08JCvp9Pb5EtCspNPtwzjIW1J9eBXMsglEXJNVuey6AE/Qwvc/EIfSvnJGKzSgV4 qQavXm+Vv3w47GPD1ec8vDbEPymQSEhBkG7TpVX5rtA8orMivPmNQZP8LxE9bOOI7qAHyx nPFHLxWh+A7F1MnFVZc1wYOw8+BHrQ7AuNaDI7DcVzU1lHZSBf/Cb2b+qK6GK8OYjC6jzw 8H6OfX4uRFcf3yKOpecCtOml/4CXeb0U7a0ZE54VgWyE7ATnW3Ju0y9WMQ0iifJk5gvQkY YrLG+iDN1SxAvL+e7WoEv1vpLUIC/ngUK9jE3I+IAySPn19Ktq4W3+lfTfZj9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730570333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WP+AUG2CpxLsM07ixEoHCYt9gEOK2uDIQmZUVo5PD4=; b=R9Qy8NO+N88MZdS+/r0u2r6/mj67XbOLoq7KIbmAAbVP4lZZ31/YFjNntdsNyO+TeOx+1v 4KQWUmnW0XX/noluPB13q4QSL/H9H79FskhjKA8gwAU4daUCRL1jrgu1Fnvdj7EwJLKvGi 0bMuL59qhCaYRhks1giYhAMq5pYbZTknUFWsQ2gRICme+IPk3E9qk8SzJt7qAq1ZvWxQC1 v7a61EQ71MbihEXq/IFQIUc/ozZfpN3hBCfobv+KTqzIedbz+ohTKSd7LExpdnCjPd29+i QUoAjmRMhmx69sU2UxwpSLK6qtFbS9ZuhCWv7GV9VgazrJO2y6wUw1djL/UZKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730570333; a=rsa-sha256; cv=none; b=GBwiyUrLQ2wRbo2QyKQ0QEPuVPDyZwTqA/Dm+7rKfgm/HNoHbcixTEAtnFvVXFztT8fxbV 5SfJyYaki9ihRCES+zmoMLlVMxA32R9I6zjNXbesocwYFycfV2kcjYaQwhmbiZWmQZq6l+ vdU3/sX4X0yVa96D7NokpU2zBp629BwblqU3XC1CDGlRBckjF6/Tifuhjk2XMgkQYAb7ma f/A8i6K1gralz956F70/srklxE5UsWx6XgtqOHbPp/WochYl+IkD0p4xUcnVqwx2VshcY1 YeZ0d7lSOKBdasVegC0r+9PGnGW5S0emTDqvkhu5P4eST4tOEBw7M8kV4Nsbgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xglpj5vtDzDm5; Sat, 2 Nov 2024 17:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2HwrIU048405; Sat, 2 Nov 2024 17:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2HwrRO048402; Sat, 2 Nov 2024 17:58:53 GMT (envelope-from git) Date: Sat, 2 Nov 2024 17:58:53 GMT Message-Id: <202411021758.4A2HwrRO048402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 470a63cde428 - main - sctp: garbage collect two unused functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 470a63cde4285ea4a317b0bba966514c11f4ed5b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=470a63cde4285ea4a317b0bba966514c11f4ed5b commit 470a63cde4285ea4a317b0bba966514c11f4ed5b Author: Michael Tuexen AuthorDate: 2024-11-02 16:58:09 +0000 Commit: Michael Tuexen CommitDate: 2024-11-02 16:58:09 +0000 sctp: garbage collect two unused functions MFC after: 3 days --- sys/netinet/sctp_pcb.c | 84 -------------------------------------------------- sys/netinet/sctp_pcb.h | 12 -------- 2 files changed, 96 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 6d8757912f3e..03f1d2e944f1 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -276,90 +276,6 @@ sctp_delete_ifn(struct sctp_ifn *sctp_ifnp) sctp_free_ifn(sctp_ifnp); } -void -sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, - const char *if_name, uint32_t ifn_index) -{ - struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap; - - SCTP_IPI_ADDR_RLOCK(); - vrf = sctp_find_vrf(vrf_id); - if (vrf == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); - goto out; - } - sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "Can't find sctp_ifap for address\n"); - goto out; - } - if (sctp_ifap->ifn_p == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unusable\n"); - goto out; - } - if (if_name) { - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, if_name); - goto out; - } - } else { - if (sctp_ifap->ifn_p->ifn_index != ifn_index) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA owned by ifn_index:%d down command for ifn_index:%d - ignored\n", - sctp_ifap->ifn_p->ifn_index, ifn_index); - goto out; - } - } - - sctp_ifap->localifa_flags &= ~SCTP_ADDR_VALID; - sctp_ifap->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE; -out: - SCTP_IPI_ADDR_RUNLOCK(); -} - -void -sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, - const char *if_name, uint32_t ifn_index) -{ - struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap; - - SCTP_IPI_ADDR_RLOCK(); - vrf = sctp_find_vrf(vrf_id); - if (vrf == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); - goto out; - } - sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); - if (sctp_ifap == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "Can't find sctp_ifap for address\n"); - goto out; - } - if (sctp_ifap->ifn_p == NULL) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unusable\n"); - goto out; - } - if (if_name) { - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, if_name); - goto out; - } - } else { - if (sctp_ifap->ifn_p->ifn_index != ifn_index) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFA owned by ifn_index:%d down command for ifn_index:%d - ignored\n", - sctp_ifap->ifn_p->ifn_index, ifn_index); - goto out; - } - } - - sctp_ifap->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE; - sctp_ifap->localifa_flags |= SCTP_ADDR_VALID; -out: - SCTP_IPI_ADDR_RUNLOCK(); -} - /*- * Add an ifa to an ifn. * Register the interface as necessary. diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 1249c2233c63..736972c007d8 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -487,18 +487,6 @@ struct sctp_vrf *sctp_allocate_vrf(int vrfid); struct sctp_vrf *sctp_find_vrf(uint32_t vrfid); void sctp_free_vrf(struct sctp_vrf *vrf); -/*- - * Change address state, can be used if - * O/S supports telling transports about - * changes to IFA/IFN's (link layer triggers). - * If a ifn goes down, we will do src-addr-selection - * and NOT use that, as a source address. This does - * not stop the routing system from routing out - * that interface, but we won't put it as a source. - */ -void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index); -void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index); - struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrfid, void *ifn, uint32_t ifn_index, uint32_t ifn_type, From nobody Sat Nov 2 18:25:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgmP63Mthz5cThw; Sat, 02 Nov 2024 18:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgmP62ngSz4lfN; Sat, 2 Nov 2024 18:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730571914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ESdlHL4M6v5Ya2PrQN3gwQ9VHS1O7zKUbQkZ8qoYyM=; b=ucvYVRpN2x6s5opKmmz6Z16EknVuidpnFsVQj68oXKIS+nRQK4OdEyf8Ss1ISaLwMdts+w ma+oYYoBHQ/3igOMNp9oyrkdr62ta9hp1gTXowuBx/27jMqYDs1iRSTaEjpDf3Y1t/tOg+ 5BLSORFRG/4cjDXhIOx2FTkrhqZI/+QUAG9GyTsdhgr1I2E8BE/V3wd4fu8WCff1QF6N9y YCR9+uBBAbT8VL3T4INumTKat1tCJabp1HLmLqoAZP6ZRO+OORujIrP7aZPq8I+YyVtpW0 7sloUkDF/WzU4IRIbmCSjVlPImns8p01fE47E50qe1awtVXXuJ0PZKWYLOSSfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730571914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ESdlHL4M6v5Ya2PrQN3gwQ9VHS1O7zKUbQkZ8qoYyM=; b=Rf1kNO5mPvOcbbcAY15DWpj/0r224DFqmDFulh5x97YSMyZ2DziDkciPbzhoj6aqxI4015 lbRmORs6s3earieg1GMhpZcjL5pTYxuhGIN7RhFE2BTct7iqPH9kNXLxAp80b6I+sL17dP QnpJukD7O8pARDfsVqogf734gaEWLrIV2c9XSPQF036cV8yapT/SfdqrT/nKP3SY/xfyme nFlhUPH3+1y8if7HubN+CZJi5R/OfzAu+cYwco8CT295f06XufuHm3xNnOEJNAC47sM3sI 7eh8/HLCBhAl+CulDe16ld176svtNywuChf6n2OSfo7Ca3AoouX2m1b+tdXQRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730571914; a=rsa-sha256; cv=none; b=lOFF6aY/FVwOCXKnLXW6tgcN74XqVtAirfId9nsryvt8tm23xN+hT1hQ9heJebc4slV8Up NGXcSY+9d2X4nxPNY0RkLSNIj1vLVQUi1+7kO1l3HH9QolAyR+xzdZcMTEhPZVRPORLyt1 HO126FdjbuhtTqXCzZqQKGCMdHdZ49ctcvp5nAoM4aDfUl+9LNzYFlVN2l/ZAF+Y+WLyt/ YkZ2FrZW4b9qtGv0heba8WcZxpuhl54hmubyVNlKXsDIG8rf/hHF2aMumAESQSTLS1Iidy O4V/Q+X+y9vpU9zTs+Y8KUf2x+j67NhocheMONQVRtNJBNtzMlGPTTdZGjetJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgmP62KSVzG88; Sat, 2 Nov 2024 18:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2IPEed003264; Sat, 2 Nov 2024 18:25:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2IPEKB003261; Sat, 2 Nov 2024 18:25:14 GMT (envelope-from git) Date: Sat, 2 Nov 2024 18:25:14 GMT Message-Id: <202411021825.4A2IPEKB003261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3514f98940a0 - main - newbus: Introduce bus_get_pass() and hide bus_current_pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3514f98940a0d43264ef9e13990c8c70a4252e04 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3514f98940a0d43264ef9e13990c8c70a4252e04 commit 3514f98940a0d43264ef9e13990c8c70a4252e04 Author: Elliott Mitchell AuthorDate: 2024-10-06 00:19:04 +0000 Commit: Warner Losh CommitDate: 2024-11-02 18:25:34 +0000 newbus: Introduce bus_get_pass() and hide bus_current_pass There's no reason to write to bus_current_pass outside of the controlled times subr_bus.c does it, so move to an accessor and make bus_current_pass private to newbus. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1457 --- sys/arm/freescale/imx/imx6_anatop.c | 2 +- sys/arm/nvidia/drm2/tegra_host1x.c | 2 +- sys/arm/ti/omap4/omap4_prcm_clks.c | 2 +- sys/kern/subr_bus.c | 18 ++++++++++++++++-- sys/sys/bus.h | 4 +--- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/arm/freescale/imx/imx6_anatop.c b/sys/arm/freescale/imx/imx6_anatop.c index d0daa7c951de..740f185bfb8b 100644 --- a/sys/arm/freescale/imx/imx6_anatop.c +++ b/sys/arm/freescale/imx/imx6_anatop.c @@ -670,7 +670,7 @@ imx6_anatop_new_pass(device_t dev) * that attach on the CPU pass). */ sc = device_get_softc(dev); - if (!sc->cpu_init_done && bus_current_pass >= cpu_init_pass) { + if (!sc->cpu_init_done && bus_get_pass() >= cpu_init_pass) { sc->cpu_init_done = true; cpufreq_initialize(sc); initialize_tempmon(sc); diff --git a/sys/arm/nvidia/drm2/tegra_host1x.c b/sys/arm/nvidia/drm2/tegra_host1x.c index 4384ab0bc976..e04a50e4c003 100644 --- a/sys/arm/nvidia/drm2/tegra_host1x.c +++ b/sys/arm/nvidia/drm2/tegra_host1x.c @@ -448,7 +448,7 @@ host1x_new_pass(device_t dev) * but some of our FDT resources are not ready until BUS_PASS_DEFAULT */ sc = device_get_softc(dev); - if (sc->attach_done || bus_current_pass < BUS_PASS_DEFAULT) { + if (sc->attach_done || bus_get_pass() < BUS_PASS_DEFAULT) { bus_generic_new_pass(dev); return; } diff --git a/sys/arm/ti/omap4/omap4_prcm_clks.c b/sys/arm/ti/omap4/omap4_prcm_clks.c index 73ef67a19d47..63c679f178bc 100644 --- a/sys/arm/ti/omap4/omap4_prcm_clks.c +++ b/sys/arm/ti/omap4/omap4_prcm_clks.c @@ -1459,7 +1459,7 @@ omap4_prcm_new_pass(device_t dev) unsigned int freq; if (sc->attach_done || - bus_current_pass < (BUS_PASS_TIMER + BUS_PASS_ORDER_EARLY)) { + bus_get_pass() < (BUS_PASS_TIMER + BUS_PASS_ORDER_EARLY)) { bus_generic_new_pass(dev); return; } diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index c1f75dd30126..2dbe1072aa83 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -437,7 +437,7 @@ bus_topo_unlock(void) */ static driver_list_t passes = TAILQ_HEAD_INITIALIZER(passes); -int bus_current_pass = BUS_PASS_ROOT; +static int bus_current_pass = BUS_PASS_ROOT; /** * @internal @@ -474,6 +474,20 @@ driver_register_pass(struct driverlink *new) TAILQ_INSERT_TAIL(&passes, new, passlink); } +/** + * @brief Retrieve the current bus pass + * + * Retrieves the current bus pass level. Call the BUS_NEW_PASS() + * method on the root bus to kick off a new device tree scan for each + * new pass level that has at least one driver. + */ +int +bus_get_pass(void) +{ + + return (bus_current_pass); +} + /** * @brief Raise the current bus pass * @@ -481,7 +495,7 @@ driver_register_pass(struct driverlink *new) * method on the root bus to kick off a new device tree scan for each * new pass level that has at least one driver. */ -void +static void bus_set_pass(int pass) { struct driverlink *dl; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 4f34990cd10f..1f5e074cfe5a 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -818,9 +818,7 @@ void bus_data_generation_update(void); #define BUS_LOCATOR_UEFI "UEFI" #define BUS_LOCATOR_OFW "OFW" -extern int bus_current_pass; - -void bus_set_pass(int pass); +int bus_get_pass(void); /** * Routines to lock / unlock the newbus lock. From nobody Sat Nov 2 18:39:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgmjC5Sqdz5cVPJ; Sat, 02 Nov 2024 18:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgmjC4sdZz4mdQ; Sat, 2 Nov 2024 18:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730572751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMf3t6FEGFl5bQ2+QEqpSBQa00BT787Id8nTbf4p1Sg=; b=F9MCEBD2QGYy0NH7DWToDJaxEpX5QMES4AotMK9QzpzLwxGjM85KKIiiT8lERWoUJV96Gt 40iBO/h1gmlc7IckPRX3zgfcE+o5G9k3UMWp/kYDVdpjEnaxDEYUaeQcQYbBTUaswfPhPD 74MfWAxtVZW9WJW0QVW44gpx0XcyghwyRY7ewB3Vl+i4x4zTApkTEpq/1rFrgQnRj4BCVO KOkQUU6SP9aRm9VS7Rfy4dXzuuBqigZoOKDWSSSGKstEJiymoIJNK7QE4OefOiQ69lc6WU M7cg6e3dsICAjFv1VtHSxKf00v0BjYDM7XOqzbWRN7+ZmVIe4qPAiPbXnNfkzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730572751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMf3t6FEGFl5bQ2+QEqpSBQa00BT787Id8nTbf4p1Sg=; b=aQizaNkuPVoR4sSnsDXma1vs3nZ23cmIUB4FxLtmILXklyAWSOOxNhUEC2woS38lzZ6fTx UNEX5ITZ3qkLdtY+YeZnluwqrcYwNX0NedNAKeUhW7pdfoyHoottOe7+ESR7nnmsoThXa0 WbfLIj60deCJ/oZZuF7i204kCDOR/B4DjuaFO7IFF0yzaCBD08e4zLmvcSA/kUAOCwGEKc hF5rXR+fNx8lLU5Zf9iW8uOtfMaCqPCk1OIvTf1VuSFUIbHKFimJ1kkMCSSa8NEiq/avs0 kNW7PK0S647LV5eLSv/WQsxKBPTgfJ5EZnOP2ixc5rSYMvDdDmdn9oRnbyKAuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730572751; a=rsa-sha256; cv=none; b=dtD6YjN6O84Lex88D/qZlhbRh1G33kGjLq/c5P34qWGdXy5bry9j2VkTFj4Op9AAQ44jwf OMpe3tDzmLH7/b9ewcF5h6jKHoap0qpLolfFR/VzBe1TPcvFec7JM8SJhfPawjhoVW6/zP uQ4eSZVG2NbcI+BxkUY5+ZJi18TWkRZvXhmk1V5/0se7fqAgYwNiojqTtFgw+UZbdNWJNY g918iWVu7JAlg5o8IZez2tBaGpHZWZtlVmc0gVYDSzwX5imbdQuniCEfHf5WqFvGP2nVhM +LNS0TIViPmEVLtOAiobsp/YA+7GHuywE7T/02tb4arQUdODWtZYLnBbxnxtRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgmjC4Sn2zGJ0; Sat, 2 Nov 2024 18:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2IdBXL023089; Sat, 2 Nov 2024 18:39:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2IdBbP023086; Sat, 2 Nov 2024 18:39:11 GMT (envelope-from git) Date: Sat, 2 Nov 2024 18:39:11 GMT Message-Id: <202411021839.4A2IdBbP023086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5e5e4e1cf0c3 - main - cam: report sct/sc in that order List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e5e4e1cf0c3e46cbb120203d0f42415cd72cb6b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5e5e4e1cf0c3e46cbb120203d0f42415cd72cb6b commit 5e5e4e1cf0c3e46cbb120203d0f42415cd72cb6b Author: Warner Losh AuthorDate: 2024-11-02 18:28:54 +0000 Commit: Warner Losh CommitDate: 2024-11-02 18:28:54 +0000 cam: report sct/sc in that order This should have no effect on scripting, but when reading it, sct/sc is the natural order of things (and the order we print them in elsewhere). Report them in that order. Sponsored by: Netflix --- sys/cam/cam_periph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 4052ec2e1570..98236e3f5f5c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -2166,9 +2166,9 @@ cam_periph_devctl_notify(union ccb *ccb) { struct ccb_nvmeio *n = &ccb->nvmeio; - sbuf_printf(&sb, "sc=\"%02x\" sct=\"%02x\" cdw0=\"%08x\" ", - NVME_STATUS_GET_SC(n->cpl.status), - NVME_STATUS_GET_SCT(n->cpl.status), n->cpl.cdw0); + sbuf_printf(&sb, "sct=\"%02x\" sc=\"%02x\" cdw0=\"%08x\" ", + NVME_STATUS_GET_SCT(n->cpl.status), + NVME_STATUS_GET_SC(n->cpl.status), n->cpl.cdw0); type = "error"; break; } From nobody Sat Nov 2 19:24:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgnjm2Yzwz5cYnZ; Sat, 02 Nov 2024 19:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgnjm1zngz4syb; Sat, 2 Nov 2024 19:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730575484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9A5RgRzpu7YIr9wni7dIMk6QlBtv7ETvZc9cuq765I=; b=VhD/7g6LhNnKnQXH6MRVSh+ofgYk+HsQwtI/TCRk+WwAXHtL2VDMUmyfgHp34FDPWThY7g WGD3GPPgFB7chczlsAlQWPuH8xfxwNtOs1KXT4R3+PD5UDsLXgDSY2eYXfNNJIkRtjsMIo ZqclDzG1KGqlLeyjnD6zxFY1HldXiudj2wmGt72GJ4PO/ozQzlm/8rV3oOSHjfJlBdKmSf EIQy4Us6mvV/UsJcugJuzwDSnxc3Ft0ATrVXe9n6d7BNh2g28XH5bn0n5WsIf0WHXY7Tco nwQow1l+XlnUEOKln36UzjNiq97iPxDZP9Dl7FOSUo0h2dssr94wkfabKXL7OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730575484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9A5RgRzpu7YIr9wni7dIMk6QlBtv7ETvZc9cuq765I=; b=Aqpiuq3Rqj1PkKIr8H3I3g5c4/FQxTmQqgYKIYHz5PBeTQehLiaB2XxnnA5TvENR1fg/mC 6PKhns5djwZXTP5cNgkj077XXANbd3ASDRy0eDgHmEt7AJVgzixKmdvgxSzzf05Fup97ty 6ctvT8JUMdrV7uTkiTdQPwQ//AjkHgOyXZC8yj6ycnIXyVPAKhIvbin6QOIuWqobX88UyD /smWsk0iQccjOn49qbFDuEyEuJde5qaXKwLrqTquPyjrXkj4GcP8KvZLd0G3m3nr2JxUqx LYVqWlWaNBOSFGCLIS1tP4KHjQR4LcpOoIrBbg7wm1r15j3IBCz3oWs8QhaN8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730575484; a=rsa-sha256; cv=none; b=gzPCAG1l4AbpYNBUWg/bpNnQW3vNg/0XuvqqZLENEPcd/eqh8LnEHaf8Oc2Y/hb49pGAQM BKbG+EBK33ueaukmVEycV7VoZOfYWSgXAkVenXCgtLRjH0eNzGaxLnQ7oDYpDvap7RE4Wr G+y1JbwFboTi0vDf9LWTnCn2wx91tIDh+ma4mab6/M9jobmGM9TH9YvCviHho2Ve++EBC2 ylCPJv3L33Gr+ORASnZn4Hwu/teNZDW1vvOvrD43c7GSJNvQMCSd7zzMhPe6uip+S1SKrt HygWU2BczafK3pQ4dOsjg/HwYYD+omkx5dT++jEuIO1rQKKaegu9S2cqa/nuVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgnjm1b3vzHVf; Sat, 2 Nov 2024 19:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2JOiVn014345; Sat, 2 Nov 2024 19:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2JOijA014342; Sat, 2 Nov 2024 19:24:44 GMT (envelope-from git) Date: Sat, 2 Nov 2024 19:24:44 GMT Message-Id: <202411021924.4A2JOijA014342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 856e158dc4aa - main - freebsd-update: improve pkgbase check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 856e158dc4aa5e43f0f15fcd3089fc0d71861b0e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=856e158dc4aa5e43f0f15fcd3089fc0d71861b0e commit 856e158dc4aa5e43f0f15fcd3089fc0d71861b0e Author: Ed Maste AuthorDate: 2024-11-01 02:13:44 +0000 Commit: Ed Maste CommitDate: 2024-11-02 19:24:39 +0000 freebsd-update: improve pkgbase check The previous version used a case-insensitive match (default for -x). The presence of packages like freebsd-git-devtools and freebsd-ftpd would falsely trigger the packaged base check. Instead, just use `pkg which /usr/bin/uname` as a packaged base indication. pkg uses /usr/bin/uname to determine ABI, so we can rely on it existing. If it comes from a package then packaged base is in use. Also, extend the check to all freebsd-update commands. It is easier to just disallow all commands, and easier to test. Reported by: Mark Millard Reviewed by: manu Fixes: cf1aba2857c1 ("freebsd-update: refuse to operate on a pkgbase system") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47378 --- usr.sbin/freebsd-update/freebsd-update.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 80a8bf288251..ccd98a883dca 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1107,12 +1107,13 @@ check_pkgbase() if ! pkg -c ${BASEDIR} -N >/dev/null 2>/dev/null; then return fi - # Presence of FreeBSD-* package(s) indicates packaged base. - if ! pkg -c ${BASEDIR} info -q -x '^FreeBSD' 2>/dev/null; then + # uname(1) is used by pkg to determine ABI, so it should exist. + # If it comes from a package then this system uses packaged base. + if ! pkg -c ${BASEDIR} which /usr/bin/uname >/dev/null; then return fi cat < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 17d39df524a5 - stable/14 - Tentatively merge llvm fix for buildworld WITH_ASAN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 17d39df524a5003131398bc9fbdf8c9fef043d05 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=17d39df524a5003131398bc9fbdf8c9fef043d05 commit 17d39df524a5003131398bc9fbdf8c9fef043d05 Author: Dimitry Andric AuthorDate: 2024-10-28 17:33:49 +0000 Commit: Dimitry Andric CommitDate: 2024-11-02 19:37:27 +0000 Tentatively merge llvm fix for buildworld WITH_ASAN Building world using WITH_ASAN results in an assertion when compiling certain source files referencing ifuncs: Assertion failed: (isa(Callee) || isa(Callee)), function analyzeAllUses, file /root/freebsd/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp, line 514. This was already reported upstream a while ago, in , but now there is finally a candidate fix, which seems trivial so I am importing it right away. Reported by: markj PR: 280936 Pull Request: https://github.com/llvm/llvm-project/pull/113841 MFC after: 3 days (cherry picked from commit f3457ed94241be9d4c2c3ab337c9086d5c45c43f) --- contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp index 19991c1a7bae..3973a48139aa 100644 --- a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp +++ b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp @@ -506,7 +506,7 @@ void StackSafetyLocalAnalysis::analyzeAllUses(Value *Ptr, // dso_preemptable aliases or aliases with interposable linkage. const GlobalValue *Callee = dyn_cast(CB.getCalledOperand()->stripPointerCasts()); - if (!Callee) { + if (!Callee || isa(Callee)) { US.addRange(I, UnknownRange, /*IsSafe=*/false); break; } From nobody Sat Nov 2 19:41:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgp4k60xqz5cb0g; Sat, 02 Nov 2024 19:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgp4k3GWlz3wc9; Sat, 2 Nov 2024 19:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730576470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=auQMckqfprd2HqSjWsFFZGocQ8ndEuJTYx84tEVEQlY=; b=HQ4Rf/4joljXTkZ77Vp7M6LhwQULZpWOJQr+gDxhsPzwRmVtzLNOyOJxOWivKOP4Ir9RwQ dTguOiSkbPDN7tCvsWKRF/bccEGQfrtzqZeXYBEg+5VFec6O2A8gEuPJRwKhAe1KlTGcKr ebxCXBqonMJS4Yzgaw/J8TQoU82Pm4rhTjEgnnv9oShl+BRaARvsOSOgYgQBfjHLbSbIbr ryrbs378BZbNFyAEbkJs7L07CK/8jFBhStoT82LClUmSKQXvGNTBll+vAJcRhU1xXAyEBE NHAeT2q+Ixa/LnKFnamncH1tkCi9DptbdSZGkQVGdLl0BAjxo5M+t0WnzEL08g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730576470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=auQMckqfprd2HqSjWsFFZGocQ8ndEuJTYx84tEVEQlY=; b=aLw09K9XsqbmaD2yrBSywzN5xd7jQYC2PNUUqyZGEXoYJnbjsjnyRnHHL+WViBCC471dnm B4LxnyUfZO5++KoQMaOvvoft7NLwoWDBOCmo8k/bcH2F7TZgr1zUZmNxVSGxEwY9vDRLJL XG0LpC2qAfytmHBLBqeiRIDlmEEnGnDgKryCaNfP/uEcer/BXX0Gs/ykKZvdTzORNDMkzw SrMhkpNeYhN7tLKdvtdf8GxBNyNMAezCTX3Csm7afGLcuAWxGvYWy7XvCsbzKpbbn0N0u+ ghTh/rftwrYIfjVNvuw3dQE5K/zgl4U1qcHM6c9zIfTp1T3XGOjqRPFaS29jXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730576470; a=rsa-sha256; cv=none; b=FaMgyHbrozhdUFdLzLVLi5krvV3nrJ71IY7iQM38ZCR8dA+mYZ3Y+fVOYOCjvFbFiwmV1z jIE70kxh8MJ5fa3d5ivi0EN2YnFQyRzQNEarXLb7oZ2BJc33vvXLrXdeM+Nfjcsg5L+Dvx FH5gC3E3bSCk6Dy8Nx7cmtMHVpjBOYwGI4A8QhntzXpnvOaq9d2S8SrRPKpwwhxomdYwvU drJ3JnAjQ7ZzuJmkfA6haOiddvSLPxYlDVP8zqoxzZEbasg8Nxr2G93wDgCpT2ew6ioGOs JOZCHcNyC1Gy6zi6HxLgWqzh9PsFcaLZQAEJU1dLxvYaQCpInLloU5SBpgK/Vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgp4k2jNTzJ05; Sat, 2 Nov 2024 19:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2JfAXg044556; Sat, 2 Nov 2024 19:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2JfAAA044553; Sat, 2 Nov 2024 19:41:10 GMT (envelope-from git) Date: Sat, 2 Nov 2024 19:41:10 GMT Message-Id: <202411021941.4A2JfAAA044553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 814ddb3c8cda - stable/13 - Tentatively merge llvm fix for buildworld WITH_ASAN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 814ddb3c8cda06686c5fe10f67b63bc2457e97b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=814ddb3c8cda06686c5fe10f67b63bc2457e97b5 commit 814ddb3c8cda06686c5fe10f67b63bc2457e97b5 Author: Dimitry Andric AuthorDate: 2024-10-28 17:33:49 +0000 Commit: Dimitry Andric CommitDate: 2024-11-02 19:37:33 +0000 Tentatively merge llvm fix for buildworld WITH_ASAN Building world using WITH_ASAN results in an assertion when compiling certain source files referencing ifuncs: Assertion failed: (isa(Callee) || isa(Callee)), function analyzeAllUses, file /root/freebsd/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp, line 514. This was already reported upstream a while ago, in , but now there is finally a candidate fix, which seems trivial so I am importing it right away. Reported by: markj PR: 280936 Pull Request: https://github.com/llvm/llvm-project/pull/113841 MFC after: 3 days (cherry picked from commit f3457ed94241be9d4c2c3ab337c9086d5c45c43f) --- contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp index 19991c1a7bae..3973a48139aa 100644 --- a/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp +++ b/contrib/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp @@ -506,7 +506,7 @@ void StackSafetyLocalAnalysis::analyzeAllUses(Value *Ptr, // dso_preemptable aliases or aliases with interposable linkage. const GlobalValue *Callee = dyn_cast(CB.getCalledOperand()->stripPointerCasts()); - if (!Callee) { + if (!Callee || isa(Callee)) { US.addRange(I, UnknownRange, /*IsSafe=*/false); break; } From nobody Sat Nov 2 20:39:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqMx0qrzz5chJW; Sat, 02 Nov 2024 20:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqMx0F68z446w; Sat, 2 Nov 2024 20:39:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mq7OwEnL2Cy4UtF9xdu1P3Buv4LGAZDbt7UEcgZ1IVI=; b=LJrGDEC6Al6o5MB6hOoXi1/MMPGTM6nNi1If+0wOM6LQyUw7fesIuQ6HsQXBCsd2atMTZI sEDXZ668TP7IgV5ti9kAtWkfIHuaiMS+KjyEyP7kQwOjwUuer9C3QTJEA3Hcls6g9jXl1L lSEY2ZxM0dlO4SWb9GZlJ5XjTM+iYkpQDZ2JhJ/ZjvkrKPUJho91y+SYdTpFuJvGLXVPF/ 50qGykFgYRtC0UY8uzoThPB/QFudFYHcr38SYuSkb5F3cMUbEoJpvgqky5S14wOYdVYQSy oY8hyo6O+UMzerB51X0VMRevx9oGIZbLe+RWUOaTWz63NjSixallcRd+2ReqaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mq7OwEnL2Cy4UtF9xdu1P3Buv4LGAZDbt7UEcgZ1IVI=; b=cc5P2Kz8lwayvMZ9H8ifqC1Oe5BJ/J1fdv5gUnUqadxbZZqfe2zcT/ApXJeDycxJLQihMo SqwBBTZHvmLAchAIRJsD7vW2s3GHhwn4qj72zhK2cRG6PsbS/0wE56/EwaCtVyXdzOij6O yu+OxPKs7TleDT+2eYR3FzApA1QyveHU20xnBCNPv8CtNLj+aXoBQwMv/n931ZGOWxWLDH W06adqwcQSq7hDhaTEGXPimPDcX9aTEC7gZgVNoBUSeqeFca0cqe/rakASE/c2jd06qlLW 1mEPY/wsAeabxJjqJz8jfpL8kUPmRKXNwCYXg57PoGxeSxobAT3mWmo8M/rDbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579965; a=rsa-sha256; cv=none; b=jKhfnSDA47BqPofkp2IQZRhY69c+MuBlwRCrcdJF0ZyTDJz/R5tmFfbttv8VLMuEl38yL3 KABz0a8aWAR8pfCGlrZW6wjAwxjjVxJ+h3eOvwE2dkn267qBHP7fOKte5Eei/fK/5sJ9tA bCCcAHunY5+ud3LjqMwC1cmGeJ33GDs0cPtiG011kJt0sfD6jgHgdvSb5gvwlgzkkXbUUk M38EqjepNjJvZtdWixuRPFeHDtYa4E47eDmjNB9tTju4m2Oso8dXcv3AdXcVxeGtVB+D88 w78RwakTJkC2RRQFOeyX/WJWXyWMLWqaeAy/j38C85wSK/VZgNi6jLiFon4vwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqMw6yBmzKQm; Sat, 2 Nov 2024 20:39:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdOxt046003; Sat, 2 Nov 2024 20:39:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdO9h046000; Sat, 2 Nov 2024 20:39:24 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:24 GMT Message-Id: <202411022039.4A2KdO9h046000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 2e031fd0719b - main - cred: supplementary_group_member() => group_is_supplementary() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e031fd0719b567e66198bc76c8a1c6c9b7f2920 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2e031fd0719b567e66198bc76c8a1c6c9b7f2920 commit 2e031fd0719b567e66198bc76c8a1c6c9b7f2920 Author: Olivier Certner AuthorDate: 2024-07-16 20:55:53 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:35 +0000 cred: supplementary_group_member() => group_is_supplementary() The new name seems more immediately descriptive. While here, constify its signature ('struct ucred' isn't modified). While here, replace "supplemental" => "supplementary" in some comments. No functional change (intended). Reviewed by: mhorne, emaste Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46906 --- sys/kern/kern_prot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 95362ce8a310..4668bdea3fdd 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1280,13 +1280,13 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) * Returns whether gid designates a supplementary group in cred. */ static bool -supplementary_group_member(gid_t gid, struct ucred *cred) +group_is_supplementary(const gid_t gid, const struct ucred *const cred) { int l, h, m; /* - * Perform a binary search of the supplemental groups. This is possible - * because we sort the groups in crsetgroups(). + * Perform a binary search of the supplementary groups. This is + * possible because we sort the groups in crsetgroups(). */ l = 1; h = cred->cr_ngroups; @@ -1320,7 +1320,7 @@ groupmember(gid_t gid, struct ucred *cred) if (gid == cred->cr_groups[0]) return (true); - return (supplementary_group_member(gid, cred)); + return (group_is_supplementary(gid, cred)); } /* @@ -1333,7 +1333,7 @@ realgroupmember(gid_t gid, struct ucred *cred) if (gid == cred->cr_rgid) return (true); - return (supplementary_group_member(gid, cred)); + return (group_is_supplementary(gid, cred)); } /* @@ -2316,7 +2316,7 @@ crextend(struct ucred *cr, int n) /* * Copy groups in to a credential, preserving any necessary invariants. - * Currently this includes the sorting of all supplemental gids. + * Currently this includes the sorting of all supplementary gids. * crextend() must have been called before hand to ensure sufficient * space is available. */ From nobody Sat Nov 2 20:39:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqMy1bxLz5chFh; Sat, 02 Nov 2024 20:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqMy1BWcz43rD; Sat, 2 Nov 2024 20:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1qhytyhP56yig/BL53kUz3E4mTsh3BYRNpytXS60tKo=; b=mrHa4684m5wb672QXKRf9rDjHrFyHU+qFe7+pv8WT/50TdcUU985i1Bn6j145bX05zUU7Y YA00qyvEQBcDKlklfFjrkkART9yYiCCKd+17qDR7WgD8UlgnkzRm54iqu88aQMIp4LuV9K M/NPM2vQuTZ0wzJaCksMQ7xH+3B1xDXJWDEEy6EJRxnXU4d2nDPb2pR7D1MmOsvC4TXkXg zbRgvp1BT030H2zaWHu8HZo/vwLP5W4SHKepNiYlOAib6jXb03aNVs1HXZuJNm83W+zBH0 LRmoIt8dWZ+WsXz1LEHFyRo2M8vCXFaphkQad9YngcSPHkxWJLUz8qkVKIWBig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1qhytyhP56yig/BL53kUz3E4mTsh3BYRNpytXS60tKo=; b=hFu7+eOclbRYQh+4kJsly+DHGuPZ7+H79ca/UKHODQo/FphevO7yJdh7+1zDkeg5OMBab5 2z5o7p9o5wZ9ebI5Mu5o8Mpg3Q7IZ5R/APWPJ7pY00Y0gAb71EjebPe2t6FvvkfV1VotKY l0SpbIpgXWZWUsauA7wuit/ocAuoP242o1m5Z/Un4HOCsKnvI6oEJWsdtW7N/L0zj7Vvfx i3ZcHdXslhjeByzJ4/5Ak6XRiwqZ/vmuNZsEDZowjy0K2NfrEAQG2EcySxbjaEydHaMiKe RW1ifblRHaTLIZDY7J5NsaxranxF/y1vGpkhfapSxtBivoH0W891ZSViJ2XQYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579966; a=rsa-sha256; cv=none; b=VT9NE/IjLg/tzEptdPksD3hfu0w/wXbEtXQc/jq9szOeHviL3lvZ2VG9Xh6LG312yYjcy9 N4P82yhNXJPjzNLeQbHIn/Do0riog/fzriOarkturTnmYzNSF84d3NdZ3F4SfUCVLpC1eq n3eGTzfQTh1pxOIYC6sFOuxwiwbKIqARPcLcQVkoxCA2VzM4UuOV6BdiKoivsOzKzdtrtn eZ+sfYGV++Lm5ualfSq0hBwzRX4a+chELi2lqOGi1IA0aM71EBssoIn/6CIYjpS8uefG4V l3VX5QCGTawF4JHmbQfPEYGnotumZBKxw95cwNVbqftiASHE7fwd3AT8Y0C/Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqMy0p3jzKF8; Sat, 2 Nov 2024 20:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdQDi046067; Sat, 2 Nov 2024 20:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdQ85046064; Sat, 2 Nov 2024 20:39:26 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:26 GMT Message-Id: <202411022039.4A2KdQ85046064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: b15110fb0dc6 - main - cred: Constify signature of groupmember() and realgroupmember() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b15110fb0dc6f0480482616f22bda3a2a19fbd80 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b15110fb0dc6f0480482616f22bda3a2a19fbd80 commit b15110fb0dc6f0480482616f22bda3a2a19fbd80 Author: Olivier Certner AuthorDate: 2024-10-30 10:59:49 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:40 +0000 cred: Constify signature of groupmember() and realgroupmember() Reviewed by emaste Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47343 --- share/man/man9/groupmember.9 | 6 +++--- sys/kern/kern_prot.c | 4 ++-- sys/sys/ucred.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/share/man/man9/groupmember.9 b/share/man/man9/groupmember.9 index db2138ef088a..e7e28bae3ac9 100644 --- a/share/man/man9/groupmember.9 +++ b/share/man/man9/groupmember.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd August 18, 2023 +.Dd October 31, 2024 .Dt GROUPMEMBER 9 .Os .Sh NAME @@ -35,9 +35,9 @@ .In sys/param.h .In sys/ucred.h .Ft bool -.Fn groupmember "gid_t gid" "struct ucred *cred" +.Fn groupmember "gid_t gid" "const struct ucred *cred" .Ft bool -.Fn realgroupmember "gid_t gid" "struct ucred *cred" +.Fn realgroupmember "gid_t gid" "const struct ucred *cred" .Sh DESCRIPTION The .Fn groupmember diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 4668bdea3fdd..b2511ce1e6c8 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1307,7 +1307,7 @@ group_is_supplementary(const gid_t gid, const struct ucred *const cred) * supplementary groups). */ bool -groupmember(gid_t gid, struct ucred *cred) +groupmember(gid_t gid, const struct ucred *cred) { /* @@ -1328,7 +1328,7 @@ groupmember(gid_t gid, struct ucred *cred) * groups). */ bool -realgroupmember(gid_t gid, struct ucred *cred) +realgroupmember(gid_t gid, const struct ucred *cred) { if (gid == cred->cr_rgid) return (true); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 0d04a49eefb4..ee72af000a58 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -155,8 +155,8 @@ void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); -bool groupmember(gid_t gid, struct ucred *cred); -bool realgroupmember(gid_t gid, struct ucred *cred); +bool groupmember(gid_t gid, const struct ucred *cred); +bool realgroupmember(gid_t gid, const struct ucred *cred); #endif /* _KERNEL */ #endif /* !_SYS_UCRED_H_ */ From nobody Sat Nov 2 20:39:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqMz4Xvrz5chDT; Sat, 02 Nov 2024 20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqMz293Vz449f; Sat, 2 Nov 2024 20: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=1730579967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBozr4ElGQJjQfRZYRm75CWPOoImM3NnRcCu8MaCLQw=; b=YbNYpKsdUaRN9yRFIJdhRNstg+bzeD6lCY1yjW2Y/d6tHvxM5Wuu76VrDlnaAgMvFHNRma r0Tb+rHgnMkih3TJ784lgOlIJ8L0qStrSIh5oLYjHDPSoUQRbEbyXcS4CAu8jcU6tOIAiR GsWarm/Vs/WFBlAZL3x7weGTYfewbQSwWOB/4n88mynVbi9dH2nhFoNa8y/t+ZTgYBsNSa oLb2ctCgb4mYeTWnirM8dJn5fAIWB/GScu+VegAHn+zJCYM/DMqPvw2FgPe1RgaOldHz9L 6IA2dAcve3/7mxDV+8GHci2Ck+JOZoj6a7A6gGm8UK3BnXWxyO2P4cUfLH3jHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBozr4ElGQJjQfRZYRm75CWPOoImM3NnRcCu8MaCLQw=; b=Stm6pC4mXBipfyFdKe7eAo2Dw0sgyYVd2fUkg30cbh8n/AgY+HK9nb4o8LRGoTsLLv837X wL0T/U124olnIZvqhIvJtovCCgg+0khsrc85MpbzXqXxlOGzsVCs7KV6he1I6Z3DXeYHPT P8fOsf00b4PBlPtDeEsdAuAy+Arz72OrYJe5iA1uaSIBdh367j5II8O0NvMwcPAr/ZybDu cIM+TWmmNB6XKr9tFShIYw+DlUXne72aFw3cuMMq8oAt0w2OF25nR/9z/nL8Hp4SXr8btO wQP6dDDH1R1G0cQ8DF2EOocH/r+qa966TqimXNap/9L7g3PGf3T879+0I1lZ5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579967; a=rsa-sha256; cv=none; b=AcHIFh1pWG3mx1tj8zPNr1hMWl2GlN6+kMGFgV6s2zxKMiXvEMZem/2U6DzkyW8wOkP2Ee cOB6axh4xVzzOXDwtg0IKYtw/vfNkneyW9+IUFh8fTrMYWwT2AoYZrH7Zub52oUHK3ILYK KrQdwvLj7N6Mr+8qQ2mJ4zSID4deYkpI3GtAc3fmntYUke9roGglANOsf8jiX3US1FfiAR i1zY6kzUgAsDyvrVq3Lbqs4gETsybGjmtbEP6e6Pw+ePoTCCd+JDQsu+s5xDs7E0r4R8Mo BSZQSRINuLtd0Nb4GZNr4EYnL0Lv5o103fTKkYQRJfPZwi2C3grjLn1aJtLfFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqMz1n5zzKYG; Sat, 2 Nov 2024 20:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdRJA046109; Sat, 2 Nov 2024 20:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdRBI046106; Sat, 2 Nov 2024 20:39:27 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:27 GMT Message-Id: <202411022039.4A2KdRBI046106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 372605478c6f - main - cred: group_is_supplementary(): Use bsearch() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 372605478c6fe2c628f25428af201f866d7eb015 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=372605478c6fe2c628f25428af201f866d7eb015 commit 372605478c6fe2c628f25428af201f866d7eb015 Author: Olivier Certner AuthorDate: 2024-07-19 11:23:19 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:40 +0000 cred: group_is_supplementary(): Use bsearch() This makes that function use a more efficient version of binary search instead, and removes one more hand-rolled binary search code from the tree (and the kernel binary). Reviewed by: mhorne, emaste Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46907 --- sys/kern/kern_prot.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index b2511ce1e6c8..5ba5afc52915 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -832,6 +833,15 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) return (error); } +static int +gidp_cmp(const void *p1, const void *p2) +{ + const gid_t g1 = *(const gid_t *)p1; + const gid_t g2 = *(const gid_t *)p2; + + return ((g1 > g2) - (g1 < g2)); +} + int kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups) { @@ -1282,24 +1292,13 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) static bool group_is_supplementary(const gid_t gid, const struct ucred *const cred) { - int l, h, m; /* * Perform a binary search of the supplementary groups. This is * possible because we sort the groups in crsetgroups(). */ - l = 1; - h = cred->cr_ngroups; - - while (l < h) { - m = l + (h - l) / 2; - if (cred->cr_groups[m] < gid) - l = m + 1; - else - h = m; - } - - return (l < cred->cr_ngroups && cred->cr_groups[l] == gid); + return (bsearch(&gid, cred->cr_groups + 1, cred->cr_ngroups - 1, + sizeof(gid), gidp_cmp) != NULL); } /* From nobody Sat Nov 2 20:39:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN03WX5z5chPw; Sat, 02 Nov 2024 20:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN02vpsz440n; Sat, 2 Nov 2024 20:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rtuRyZLRXFXHYJ/8i7ebJ/RuNrZm9yNnrHz4RebBJOE=; b=eFYhDbt9V6jM0rjVhtFE9kj1wZLZCA8cjQE6MvcrcZxyreYg8E27nqmTv9fp6Z1jx7KsVs vZhwCL3aLJUI3Vw3xRSP9bkkKXzobD34Yg94ER4FWjG6i9SVkrTzoy/+0MqDpiLbVOBhc6 RQrdXVmdgaF3ui/g/eN3HhG9+EJgLFs7jVGl+Vjo8eUsWCCr4iUCaNRVX8dedEd8akSzbR F1ie44jijnkHPtWNZq+CEN7EsMpoLkWk9I723/iEtVQ2HB/CAGD8naNHlTMRcJ1FpRC5Dh kLWVzRRoPupxzshs5snJIq7fIaxMVBEC+dmupZQisWvd8wTGJYlOIX8gA/P/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rtuRyZLRXFXHYJ/8i7ebJ/RuNrZm9yNnrHz4RebBJOE=; b=nOi2ZruXOYG3/wWrJ6KJ2HrZ0FY0bbOB6Rgb54H1MW7KKt06xC7ohr31WMIlzaMEOZQ7iZ xudi7n2fyPKpq9ezXuKxokSKlpFbKY+kJZwihQ8YjDthXDdP7qfTDhukzmHZVfyhQsXi+E dJU6LbjK5HREai1UxKZqhjP1+2viEAyD3dDs/52UBT6KJNPkjJbOCp1y7JwZ4TWkXskHH1 AmNMEQ3ampivI0O+R8ruc7EusoFWRhw+47ZogditSKwntu2kt38q0h11X85z1+ln/R6Okb UMqfxUpTPvHwdtJodqO60zP1vm8FVly8uLhBoxGbRchAzCF9rLtbhYvbcuazLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579968; a=rsa-sha256; cv=none; b=DvR3i7QhV7h5MXhsCPcdWXxA3IVC8iCa7FNoYGQFKNHvZSvprWxuFXshpE4zLFzxxRvPMl Z1ksii7z2fodMMQCZvnfdJVSfyv9ghHRnjygyi5e7JV8hqE40nb2OQT8VprUQU1tMFXCWC kW+DWBwII94hDMcxCHOCKDJ7GYKt1EV93I/U4lQFVK1qlfgYiUDu8nIKoAW68iHze4oFWm Vf0rZItxGsrGcOY4nmWK5LHH/0CXul3sfgzt7LrbBaYoAilocxHZf+5/a16335g2EUaPpt fS4y6LNX8iqHd8fbxorhQnsd3znvUSDazqdegewMUgktbiOd4xoKANRKAL2Q0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN02WzSzKF9; Sat, 2 Nov 2024 20:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdSJ9046154; Sat, 2 Nov 2024 20:39:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdS64046151; Sat, 2 Nov 2024 20:39:28 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:28 GMT Message-Id: <202411022039.4A2KdS64046151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 6369544278b2 - main - cred: Make group_is_supplementary() public; New group_is_primary() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6369544278b2e4fb5203b10dab466ff7c72c0a25 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6369544278b2e4fb5203b10dab466ff7c72c0a25 commit 6369544278b2e4fb5203b10dab466ff7c72c0a25 Author: Olivier Certner AuthorDate: 2024-07-19 09:54:35 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:40 +0000 cred: Make group_is_supplementary() public; New group_is_primary() Reviewed by: mhorne Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46908 --- sys/kern/kern_prot.c | 2 +- sys/sys/ucred.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 5ba5afc52915..ed20950b12e5 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1289,7 +1289,7 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) /* * Returns whether gid designates a supplementary group in cred. */ -static bool +bool group_is_supplementary(const gid_t gid, const struct ucred *const cred) { diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index ee72af000a58..9fb3c63bbfdf 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -155,6 +155,17 @@ void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); + +/* + * Returns whether gid designates a primary group in cred. + */ +static inline bool +group_is_primary(const gid_t gid, const struct ucred *const cred) +{ + return (gid == cred->cr_groups[0] || gid == cred->cr_rgid || + gid == cred->cr_svgid); +} +bool group_is_supplementary(const gid_t gid, const struct ucred *const cred); bool groupmember(gid_t gid, const struct ucred *cred); bool realgroupmember(gid_t gid, const struct ucred *cred); #endif /* _KERNEL */ From nobody Sat Nov 2 20:39:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN15jZfz5chDW; Sat, 02 Nov 2024 20:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN13YCXz44B0; Sat, 2 Nov 2024 20:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FgxX+rHOYbpMPpxUAcJPxANxi/di3Eh+uNHPR1+csc=; b=bKhIX4+hxKS/MwkHc348bwgSFvwz/4D1RrLEJQZXE/eowbunEWp4/rblIDQJIj20lm3cIY J7w6gsAJDDJa9f+Pw8eMtraPGEi0zQc+6B9oQdRFYuvRWvJsLL9Fj1qY9K7w1Lh/TvSBh6 BiBvjcTwcHppyIQRnGH6X7YIw6snNazNhhNyJiIBGRZMrBw/YfvLUe1cTPKvyhe2zIZy+T SAW4vjrIv2OtRunVdqddziQYLcaL2XFIatHNzyjMzf/M/eY5QW0FXgmKS6H5YaLwJQKBAt saa1SpgQCXna+gA+aPuLivm4lvC3weboGcjUYyxcrDEDQgSL4BWxz9THO8Oq6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FgxX+rHOYbpMPpxUAcJPxANxi/di3Eh+uNHPR1+csc=; b=dj944A/qnmdRysP4ChgHTLrFZVn6VrW8WSmF7nQIDvndoFp+Yuhmj0IwgvwgbAaflPWgH6 ZGL0Rd6UJIBzIgCpDXRoPUdfrlBKqSK2nkrImM7mOX3qg9rAOCpLLpuog/HxThB5AcIuOk 8vy0XsEybTQnG8lKcC7EKEUEtXdEkapMzFtmo0kTYdb8WYYcts/heVjkEgiFa2OSdMSkRN 1KnZnRehA7KoeEZsB9keBzXb3vzyzFTNGO/iBb/0Kp+WAjFEQq6BLuBqhHvYLhZyQssihT akalkeW1vY7pEl0XJz6q3fp1b2RUJWJhZiKIPPy9yTDDd7ogFQgiFEqgrGsp3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579969; a=rsa-sha256; cv=none; b=i3bp5JWTQjA1aHaMrPUTegK+coDu1zuIVpfJI1eEa0i3VaZNZK8PhoOh7lrFAJtGUQfQl0 7UyFDmOC+9IuM5Ly4i3Ww8cKHf+1pnhMoBS5v9isl8qVnOp5GEkKgZ+wsNB9c1hf1umIzo rXfpDPV8AB9Z6x6J8lqpwsAeRJ2pUfYwVskrFHTFj2XEebAk7nMbaXjLfVygr46Wn+8keb TacX5EamhGkFGZIWmHH5xTg7AtTqsnfCDglVM8yj6LFwipHoIBFb8h13mUZaIjR8gnEfYJ P5m3YstPKYXZYtYAuPG86c+dE9SbjkKIemMLfmG3fCeSd1uhi+q5ooPwJFaCOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN139g2zKQn; Sat, 2 Nov 2024 20:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdT7b046208; Sat, 2 Nov 2024 20:39:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdTCl046205; Sat, 2 Nov 2024 20:39:29 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:29 GMT Message-Id: <202411022039.4A2KdTCl046205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 664b9fcb1c05 - main - cred: Separate constant for the number of inlined groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 664b9fcb1c051c17ba11d1e5e8a1db9938d76bd5 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=664b9fcb1c051c17ba11d1e5e8a1db9938d76bd5 commit 664b9fcb1c051c17ba11d1e5e8a1db9938d76bd5 Author: Olivier Certner AuthorDate: 2024-07-16 20:37:44 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:40 +0000 cred: Separate constant for the number of inlined groups CRED_SMALLGROUPS_NB now holds the number of inlined groups in field 'cr_smallgroups'. XU_NGROUPS stays the number of groups allowed in 'struct xucred'. The first is an implementation detail, while the second is part of a public interface. All mentions of XU_NGROUPS in the tree have been reviewed and only those concerning the implementation detail have been changed to use CRED_SMALLGROUPS_NB (they were all in 'kern_prot.c'). No functional change, as CRED_SMALLGROUPS_NB is set to 16, the same value as XU_NGROUPS. Reviewed by: mhorne (slightly different version) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46911 --- sys/kern/kern_prot.c | 6 +++--- sys/sys/ucred.h | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index ed20950b12e5..7ca08c3cf490 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -811,7 +811,7 @@ struct setgroups_args { int sys_setgroups(struct thread *td, struct setgroups_args *uap) { - gid_t smallgroups[XU_NGROUPS]; + gid_t smallgroups[CRED_SMALLGROUPS_NB]; gid_t *groups; int gidsetsize, error; @@ -819,7 +819,7 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) if (gidsetsize > ngroups_max + 1 || gidsetsize < 0) return (EINVAL); - if (gidsetsize > XU_NGROUPS) + if (gidsetsize > CRED_SMALLGROUPS_NB) groups = malloc(gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK); else groups = smallgroups; @@ -828,7 +828,7 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) if (error == 0) error = kern_setgroups(td, gidsetsize, groups); - if (gidsetsize > XU_NGROUPS) + if (gidsetsize > CRED_SMALLGROUPS_NB) free(groups, M_TEMP); return (error); } diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 9fb3c63bbfdf..4311a73b73a5 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -42,6 +42,14 @@ struct loginclass; #define XU_NGROUPS 16 +#if defined(_KERNEL) || defined(_WANT_UCRED) +/* + * Number of groups inlined in 'struct ucred'. It must stay reasonably low as + * it is also used by some functions to allocate an array of this size on the + * stack. + */ +#define CRED_SMALLGROUPS_NB 16 + /* * Credentials. * @@ -55,7 +63,6 @@ struct loginclass; * * See "Credential management" comment in kern_prot.c for more information. */ -#if defined(_KERNEL) || defined(_WANT_UCRED) struct ucred { struct mtx cr_mtx; long cr_ref; /* (c) reference count */ @@ -78,7 +85,8 @@ struct ucred { struct label *cr_label; /* MAC label */ gid_t *cr_groups; /* groups */ int cr_agroups; /* Available groups */ - gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ + /* storage for small groups */ + gid_t cr_smallgroups[CRED_SMALLGROUPS_NB]; }; #define NOCRED ((struct ucred *)0) /* no credential available */ #define FSCRED ((struct ucred *)-1) /* filesystem credential */ From nobody Sat Nov 2 20:39:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN269Jsz5chFp; Sat, 02 Nov 2024 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN24Klnz44Fw; Sat, 2 Nov 2024 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s08C1EMYC2omw7aGNiAozscUwotu13Kmn+yQR1zFqqY=; b=SKr3bWulw1sQJ/bZ+yqL/dp1XHrigsXRUkbr80XLdTNsC3HUrdSpaZOiuspDvIoSwRtdfd OkRVa1NSuTVjzlSb+UzVM6FTvt6JTkGmHk2eZrBGzK9zpwi5aAdJCHXRaXtE2P8ndk9Ere CdK8PNHCAGsyrNt94YRlARwjKWnmf6ybqGdNPvR5z3gOlfkVRZZMwJL7J2/90Z5m+6ckU2 f5dBZSD4SjyGHiu1H/XMT+Ipc819bmAzhHwTisQc07O/9xNzVk5Q9Hr8BhAViNCJnSG0vK qG8eR5+mMqiYk57/072sBrXVKpeQQnZgKZj3bEkKsFlr+VoM34Sj+gBey1Z9Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s08C1EMYC2omw7aGNiAozscUwotu13Kmn+yQR1zFqqY=; b=Q/WCoMRx5ssTUj/PGUm1mDh8cFK7EOj6OsKPoDQ0u/SPLLoJ9tkRvacen5dkHoQOzkwkYK MTG8zybGpu/+DO9MHo+tKDczsnJrftkpoBxAL/fSh/E+MYIesPJBvJabjgn5XITEjpERG+ 2vtJUAOkbijlOAGx5Gizi1YRYpQy2Cekk4P6BRP8bVPFAfcH/hQY5NWuIL54e/1U+4bAew 6Q0OSxvXhTrLyZ9XPJtsbiAdbKRG4ORj5vYWtH8kgkIdwZqZS1WF7bVugTi7PetQ5JVTSo RyQSo+I6N6WjmduiQvRn1McvmVw/LC1rV1z9jZxXKzC2dWbhe5iT0rCG/HHFuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579970; a=rsa-sha256; cv=none; b=xmuST4CGZyOSsjBikeiqM+oWtXVCQJ2U1kw8agK89OsWesVEAZfj4wRy20uGg8BrDL0LEz NnSme6IBJdAvk3A3U9282B2UR0FNZ7bFkT8yFvheechjG2i44Fk73ll6VnVJVJ72KppvTf 7zpLdIa0iEHBxNO0c+RhF/B9cM9K+6gusIapEtHXjoUchjbtT0hZ5KGdLejFmR5e3soIlR TC/aOl0OjXuG2c4I8hDDftZNCK2bf2vSGYpMf0vly7R6Pp4zcKEwp3nk84wGNvFckFIbZT UAICs2ztLtbu56Grz3ezxbqBSAu0gxRs7qtmEAtiKqxHbH72akW50ZLbmJCNzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN23xx6zKFB; Sat, 2 Nov 2024 20:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdU6U046272; Sat, 2 Nov 2024 20:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdUR1046269; Sat, 2 Nov 2024 20:39:30 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:30 GMT Message-Id: <202411022039.4A2KdUR1046269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: abd39811cd7e - main - cred: kern_setgroups(): Internally use int as number of groups' type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abd39811cd7e4bb928da503f4a5c79364ac8d0f5 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=abd39811cd7e4bb928da503f4a5c79364ac8d0f5 commit abd39811cd7e4bb928da503f4a5c79364ac8d0f5 Author: Olivier Certner AuthorDate: 2024-10-01 16:46:46 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:41 +0000 cred: kern_setgroups(): Internally use int as number of groups' type sys_setgroups() (and sys_getgroups()) was changed in commit "kern: fail getgroup and setgroup with negative int" (4bc2174a1b48) to take the number of groups as an 'int' (for sys_getgroups(), POSIX mandates this change; for sys_setgroups(), which it does not standardize, it's arguably for consistency). All our internal APIs related to groups on 'struct ucred', as well as related members on the latter, treat that number as an 'int' as well (and not a 'u_int'). Consequently, to avoid surprises, change kern_setgroups() to behave the same, and fix audit_arg_groupset() accordingly. With that change, everything is handled with signed integers internally. Update sanity checks accordingly. Reviewed by: mhorne Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46912 --- sys/kern/kern_prot.c | 16 ++++++++++++++-- sys/security/audit/audit.h | 2 +- sys/security/audit/audit_arg.c | 8 ++++---- sys/sys/syscallsubr.h | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 7ca08c3cf490..67e4428b039e 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -815,6 +815,15 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) gid_t *groups; int gidsetsize, error; + /* + * Sanity check size now to avoid passing too big a value to copyin(), + * even if kern_setgroups() will do it again. + * + * Ideally, the 'gidsetsize' argument should have been a 'u_int' (and it + * was, in this implementation, for a long time), but POSIX standardized + * getgroups() to take an 'int' and it would be quite entrapping to have + * setgroups() differ. + */ gidsetsize = uap->gidsetsize; if (gidsetsize > ngroups_max + 1 || gidsetsize < 0) return (EINVAL); @@ -843,13 +852,16 @@ gidp_cmp(const void *p1, const void *p2) } int -kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups) +kern_setgroups(struct thread *td, int ngrp, gid_t *groups) { struct proc *p = td->td_proc; struct ucred *newcred, *oldcred; int error; - MPASS(ngrp <= ngroups_max + 1); + /* Sanity check size. */ + if (ngrp < 0 || ngrp > ngroups_max + 1) + return (EINVAL); + AUDIT_ARG_GROUPSET(groups, ngrp); newcred = crget(); crextend(newcred, ngrp); diff --git a/sys/security/audit/audit.h b/sys/security/audit/audit.h index e7a9c83afbb3..b87dd52e0773 100644 --- a/sys/security/audit/audit.h +++ b/sys/security/audit/audit.h @@ -98,7 +98,7 @@ void audit_arg_rgid(gid_t rgid); void audit_arg_ruid(uid_t ruid); void audit_arg_sgid(gid_t sgid); void audit_arg_suid(uid_t suid); -void audit_arg_groupset(gid_t *gidset, u_int gidset_size); +void audit_arg_groupset(gid_t *gidset, int gidset_size); void audit_arg_login(char *login); void audit_arg_ctlname(int *name, int namelen); void audit_arg_mask(int mask); diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index c8ae56e87487..c667d3968817 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -263,13 +263,13 @@ audit_arg_suid(uid_t suid) } void -audit_arg_groupset(gid_t *gidset, u_int gidset_size) +audit_arg_groupset(gid_t *gidset, int gidset_size) { - u_int i; + int i; struct kaudit_record *ar; - KASSERT(gidset_size <= ngroups_max + 1, - ("audit_arg_groupset: gidset_size > (kern.ngroups + 1)")); + KASSERT(gidset_size >= 0 && gidset_size <= ngroups_max + 1, + ("audit_arg_groupset: gidset_size < 0 or > (kern.ngroups + 1)")); ar = currecord(); if (ar == NULL) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 2e0a362f90ad..6ee7c6d802c4 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -320,7 +320,7 @@ int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits); int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg); -int kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups); +int kern_setgroups(struct thread *td, int ngrp, gid_t *groups); int kern_setitimer(struct thread *, u_int, struct itimerval *, struct itimerval *); int kern_setpriority(struct thread *td, int which, int who, int prio); From nobody Sat Nov 2 20:39:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN372hlz5chFq; Sat, 02 Nov 2024 20:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN360RQz43tk; Sat, 2 Nov 2024 20:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qP6+/07OH4PnCLOwpfBQkj13lnKDXFNyd5kcA4h5olA=; b=xdu3MHF3eL4nXOb7WqNLzK/QNT0ZGVqX1A1jckbb4H84174r0Cl1IpuLRlATb4whRI7WYl SjRttMBLrXtn5S9l1QxxvTZ103DXO/U5il1T9hJIqxgcXoWeTwoN9IKeJAvxDNc4z1Mww7 w6KFH1f4Vh0TbjXfIARVaymq3BFRxgnGMasXD4YQdAs+44WLiiO/D/wR1phxtiJhRU/oje LJP2k2pbxn+RnOjlZfOB3x3WRzZLUPVE3foN5azzq4j5bH3UclRQwMVT8gBH9Emg4jOq8B 7keoJi2zBGJkc4cQ4sAeanDA+K6Ye35cCxXaCruBzKKZhX7EMmrFKkTmPpCzdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qP6+/07OH4PnCLOwpfBQkj13lnKDXFNyd5kcA4h5olA=; b=uAU8z52qjDjpW39Bn13wrna5emZC91I+cEexjaFor5Udh1T0dFJqP1U4dzRXJ9nCl6F9vI s0uA66EYn0V5sh/U1ALEVXL3VCRVfs70ovG3zC6zLLXoyiHL3K/cYQAiF4vcjuLFEEPgTN crr615Xv3bjHrx5X3z9TTa8IbVQzCP8Tjn7VquDJyzlTrgN7yaoP3VbflueY9isUoCKfs9 x7gkD0C6/SVQfUNkd6u2MbMf/sABpQhTchsjUQssFfKBwkJmKbWYsS7fbU7uDmc0X74hUc ik1FIFTrl5CgCQwDzaTAXLbsgNPfXBx8b/aZmhNPuAdYxEbBw7XVvLfapdXg5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579971; a=rsa-sha256; cv=none; b=jPJIAg2bQrzrShDD44Rol/4gagtxEbiYIL9PwKhBMX8wyGvhm/7FEEHhz4WMGjJhsfDLIm rb+ygqtnl26yWZAzD3Whg3W3SOJYNw6t64/pecI1hvExyL9kHktCXWA6pVEsD3pF0hd4hh CCJBCE154dJ2hKScRppn8eEDtj196BPzs8fJ2wQdQd7fyaehTZvPgTpJbHIN1Q70dHVniu 2Yk2T6DTD13fHVn/L8/jh4PtB0YZWyO2M/iiLjVqUIOiU3QOT+6yuQtzKqM04L7CO12i+Q /H+Yf52zyec5D9AhG6ncEr9raPWbmOOLaxYutHKd4LXoDQ2boZ7SRyWKhiFtxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN35KqnzKFC; Sat, 2 Nov 2024 20:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdVBw046332; Sat, 2 Nov 2024 20:39:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdVe7046329; Sat, 2 Nov 2024 20:39:31 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:31 GMT Message-Id: <202411022039.4A2KdVe7046329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 580904d995d5 - main - cred: 'kern.ngroups' tunable: Limit it to avoid internal overflows List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 580904d995d53ccd2492140a37107442d8b36dc0 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=580904d995d53ccd2492140a37107442d8b36dc0 commit 580904d995d53ccd2492140a37107442d8b36dc0 Author: Olivier Certner AuthorDate: 2024-10-01 17:00:43 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:41 +0000 cred: 'kern.ngroups' tunable: Limit it to avoid internal overflows As the comment introduced with the tunable said (but the code didn't do), make sure that 'ngroups_max' can't be INT_MAX, as this would cause overflow in the usual 'ngroups_max + 1' computations (as we store the effective GID and supplementary groups' IDs in the same array, and 'ngroups_max' only applies to supplementary groups). Further, we limit the maximum number of groups somewhat arbitrarily to ~17M so as to avoid overflow when computing the size in bytes of the groups set's backing array and to avoid obvious configuration errors. We really don't think that more than ~17M groups will ever be needed (if I'm proven wrong one day, please drop me a note about your use case). While here, document more precisely why NGROUPS_MAX needs to be the minimum value for 'ngroups_max'. Reviewed by: mhorne (older version) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46913 --- sys/kern/subr_param.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 7d58208a461f..19169ba63061 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -228,14 +228,32 @@ init_param1(void) TUNABLE_ULONG_FETCH("kern.sgrowsiz", &sgrowsiz); /* - * Let the administrator set {NGROUPS_MAX}, but disallow values - * less than NGROUPS_MAX which would violate POSIX.1-2008 or - * greater than INT_MAX-1 which would result in overflow. + * Let the administrator set {NGROUPS_MAX}. + * + * Values less than NGROUPS_MAX would violate POSIX/SuS (see the + * specification for , paragraph "Runtime Increasable + * Values"). + * + * On the other hand, INT_MAX would result in an overflow for the common + * 'ngroups_max + 1' computation (to obtain the size of the internal + * groups array, its first element being reserved for the effective + * GID). Also, the number of allocated bytes for the group array must + * not overflow on 32-bit machines. For all these reasons, we limit the + * number of supplementary groups to some very high number that we + * expect will never be reached in all practical uses and ensures we + * avoid the problems just exposed, even if 'gid_t' was to be enlarged + * by a magnitude. */ ngroups_max = NGROUPS_MAX; TUNABLE_INT_FETCH("kern.ngroups", &ngroups_max); if (ngroups_max < NGROUPS_MAX) ngroups_max = NGROUPS_MAX; + else { + const int ngroups_max_max = (1 << 24) - 1; + + if (ngroups_max > ngroups_max_max) + ngroups_max = ngroups_max_max; + } /* * Only allow to lower the maximal pid. From nobody Sat Nov 2 20:39:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN51qJGz5chQ6; Sat, 02 Nov 2024 20:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN46XjRz44GL; Sat, 2 Nov 2024 20:39:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNiB1l28rkDNQnBFgXBp0dvPBBkUTJneLm7cCeAWhXU=; b=kNxmeOgynDpyjMbaUgE866stT5qmFN0xKAuH/7JkuF4qyWrtdDTKm50jZQgleKgvsiYRbz aXwUNfi+Wvt8yR+0vyCYXEPZRhALDGr9OEYwztU0y1W33gvNPdkayNt0gz7IKYx/HUEHlX dahTvqES+4zYuuOYlb6/tfdXXciM7Svqbdd+4g8EpxQsTHc0A87JGd/hDA346sEMH54MhG WBexuzYmaWulbT47hGXz/9R0A0v6Se3Y2kOVhJeSzc3KJ8ZOhLNV9Pihtn+U6rDYGJXRVS A/yGpRVzvAtQi45+Khc7o2Hee6mwBFkMJVshkhhhggHiv6O+a5lFWYgd8C024g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNiB1l28rkDNQnBFgXBp0dvPBBkUTJneLm7cCeAWhXU=; b=lQTYDiXmbQIw/djuJizo94/56Z7OS7RdYLuMlHpAWFepdE5/UayJm84xi4pYxbBTMD3VsW Urbetju1kzWQz7lDMrTyl7OrspPK0lStfz+hGgLLy4rDWWjhPYmoaNZISK40hpcTffQmNl JicPUmUDztGljCCrPohCDOBYzZZEk6GQ6MPEr14dFTZVM57AspJxIXLjQxPR/7GE+KiCSS Ba7K2sIBoUb/+HkihJCHaYIuKmsael9qkYxCX6bLN6G0qOJcgCWedHA2HoX2rMwpzVlPh3 9thZFRPfbdXVqD4M0PCfLR+VTYocbWVdok6VJkhJ/kA8nWuxuv7QzAwfDYBiSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579972; a=rsa-sha256; cv=none; b=HA0HvTN4563HPlBd4fj8U7Oda5i+DK0GzETxZMBwrg+IqM3JKbqcMPbK/qdOaEjvlgITgH uYiEdbHrOM9qyC+KvzF97oRuSKv6XuCoUxyMhsBPeo9tDXsI/iOGk8qi8qLo8EcbcIzdVC omIE4z3sYFoSE4Fggg5xI+kl+QzSE5vIesAn1uvEeHOYCQe+pMBbmZkSefhgD0FIMuXDhF TQWtKDT1OMPIpZPTQ9MzxEfOQqmUR0/7RKw3lVofmli8I78zh2Wr2w/8ii2t/r4DNr5FDM KcdfGZ5ZfEvoxwsQMO42SYbFnuYlDg2nl2r1aDIKh/i3rolzLNBz5jkERpel1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN4686WzKlS; Sat, 2 Nov 2024 20:39:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdWmL046383; Sat, 2 Nov 2024 20:39:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdW33046380; Sat, 2 Nov 2024 20:39:32 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:32 GMT Message-Id: <202411022039.4A2KdW33046380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 6d2efbb34fdb - main - cred: crsetgroups(): Improve and factor out groups normalization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d2efbb34fdb59facbe6d83374ef4ab69d395866 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2efbb34fdb59facbe6d83374ef4ab69d395866 commit 6d2efbb34fdb59facbe6d83374ef4ab69d395866 Author: Olivier Certner AuthorDate: 2024-10-02 12:40:27 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:41 +0000 cred: crsetgroups(): Improve and factor out groups normalization The groups array has been sorted (not including the first element, which is always the effective GID) to enable performing a binary search for determining if some group is part of the supplementary groups set. Factor out this sorting operation into an internal normalization function (groups_normalize()), adding to it the removal of duplicates after the sort. Separating groups normalization code allows to perform it in advance, and in particular before calling MAC hooks which need the groups array to be sorted to perform better. This also enables sorting input arrays ahead of acquiring the process lock (which is not necessary for this operation). kern_setgroups() has been changed accordingly, so MAC modules implementing the mac_cred_check_setgroups() hook now can assume a normalized groups array (and also that it has at least one element, as if kern_setgroups() is passed no groups, the hook is called with an array of one element being the current effective GID, as this is effectively the effect of such a call to kern_setgroups()). Further commits introducing the setcred() system call and associated MAC hooks will also guarantee a normalized groups array to MAC modules implementing these hooks. Rename crsetgroups_locked() into crsetgroups_internal(), as it is no more "locked" than crsetgroups() itself. However, it can be called under any lock (as needed), whereas the second may sleep to allocate memory. Update their herald comments to make that explicit. In passing, using qsort() instead of the old open-coded insertion sort (in crsetgroups_locked()) fixes the performance concern about the latter when using a large number of groups. Also, our qsort() falls back to insertion sort for small arrays and in case the array is likely to be mostly sorted, so this shouldn't cause concerns for the small number of groups common case. While here, add assertions in inner modification routines to check that the passed credentials object has a reference count of exactly 1 (in particular, it must not be shared). Remove a redundant one from some outer routine. Reviewed by: mhorne Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46914 --- sys/kern/kern_prot.c | 168 ++++++++++++++++++++++++++++++++++++++------------ sys/sys/syscallsubr.h | 2 +- sys/sys/ucred.h | 2 +- 3 files changed, 131 insertions(+), 41 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 67e4428b039e..d87d008e0bc2 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -89,8 +89,22 @@ SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "BSD security policy"); static void crfree_final(struct ucred *cr); -static void crsetgroups_locked(struct ucred *cr, int ngrp, - gid_t *groups); + +static inline void +groups_check_positive_len(int ngrp) +{ + MPASS2(ngrp >= 0, "negative number of groups"); + MPASS2(ngrp != 0, "at least one group expected (effective GID)"); +} +static inline void +groups_check_max_len(int ngrp) +{ + MPASS2(ngrp <= ngroups_max + 1, "too many groups"); +} + +static void groups_normalize(int *ngrp, gid_t *groups); +static void crsetgroups_internal(struct ucred *cr, int ngrp, + const gid_t *groups); static int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); static int cr_canseeothergids(struct ucred *u1, struct ucred *u2); @@ -835,9 +849,9 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) error = copyin(uap->gidset, groups, gidsetsize * sizeof(gid_t)); if (error == 0) - error = kern_setgroups(td, gidsetsize, groups); + error = kern_setgroups(td, &gidsetsize, groups); - if (gidsetsize > CRED_SMALLGROUPS_NB) + if (groups != smallgroups) free(groups, M_TEMP); return (error); } @@ -851,25 +865,38 @@ gidp_cmp(const void *p1, const void *p2) return ((g1 > g2) - (g1 < g2)); } +/* + * CAUTION: This function normalizes 'groups', possibly also changing the value + * of '*ngrpp' as a consequence. + */ int -kern_setgroups(struct thread *td, int ngrp, gid_t *groups) +kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups) { struct proc *p = td->td_proc; struct ucred *newcred, *oldcred; - int error; + int ngrp, error; + ngrp = *ngrpp; /* Sanity check size. */ if (ngrp < 0 || ngrp > ngroups_max + 1) return (EINVAL); AUDIT_ARG_GROUPSET(groups, ngrp); + if (ngrp != 0) { + /* We allow and treat 0 specially below. */ + groups_normalize(ngrpp, groups); + ngrp = *ngrpp; + } newcred = crget(); crextend(newcred, ngrp); PROC_LOCK(p); oldcred = crcopysafe(p, newcred); #ifdef MAC - error = mac_cred_check_setgroups(oldcred, ngrp, groups); + error = ngrp == 0 ? + /* If 'ngrp' is 0, we'll keep just the current effective GID. */ + mac_cred_check_setgroups(oldcred, 1, oldcred->cr_groups) : + mac_cred_check_setgroups(oldcred, ngrp, groups); if (error) goto fail; #endif @@ -886,9 +913,9 @@ kern_setgroups(struct thread *td, int ngrp, gid_t *groups) * when running non-BSD software if we do not do the same. */ newcred->cr_ngroups = 1; - } else { - crsetgroups_locked(newcred, ngrp, groups); - } + } else + crsetgroups_internal(newcred, ngrp, groups); + setsugid(p); proc_set_cred(p, newcred); PROC_UNLOCK(p); @@ -1298,6 +1325,32 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) #endif /* REGRESSION */ } +#ifdef INVARIANTS +static void +groups_check_normalized(int ngrp, const gid_t *groups) +{ + gid_t prev_g; + + groups_check_positive_len(ngrp); + groups_check_max_len(ngrp); + + if (ngrp == 1) + return; + + prev_g = groups[1]; + for (int i = 2; i < ngrp; ++i) { + const gid_t g = groups[i]; + + if (prev_g >= g) + panic("%s: groups[%d] (%u) >= groups[%d] (%u)", + __func__, i - 1, prev_g, i, g); + prev_g = g; + } +} +#else +#define groups_check_normalized(...) +#endif + /* * Returns whether gid designates a supplementary group in cred. */ @@ -2158,7 +2211,6 @@ void crcopy(struct ucred *dest, struct ucred *src) { - KASSERT(dest->cr_ref == 1, ("crcopy of shared ucred")); bcopy(&src->cr_startcopy, &dest->cr_startcopy, (unsigned)((caddr_t)&src->cr_endcopy - (caddr_t)&src->cr_startcopy)); @@ -2293,6 +2345,8 @@ crextend(struct ucred *cr, int n) { int cnt; + MPASS2(cr->cr_ref == 1, "'cr_ref' must be 1 (referenced, unshared)"); + /* Truncate? */ if (n <= cr->cr_agroups) return; @@ -2326,52 +2380,88 @@ crextend(struct ucred *cr, int n) } /* - * Copy groups in to a credential, preserving any necessary invariants. - * Currently this includes the sorting of all supplementary gids. - * crextend() must have been called before hand to ensure sufficient - * space is available. + * Normalizes a set of groups to be applied to a 'struct ucred'. + * + * The set of groups is an array that must comprise the effective GID as its + * first element (so its length cannot be 0). + * + * Normalization ensures that elements after the first, which stand for the + * supplementary groups, are sorted in ascending order and do not contain + * duplicates. */ static void -crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups) +groups_normalize(int *ngrp, gid_t *groups) { - int i; - int j; - gid_t g; + gid_t prev_g; + int ins_idx; - KASSERT(cr->cr_agroups >= ngrp, ("cr_ngroups is too small")); + groups_check_positive_len(*ngrp); + groups_check_max_len(*ngrp); - bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t)); - cr->cr_ngroups = ngrp; + if (*ngrp == 1) + return; - /* - * Sort all groups except cr_groups[0] to allow groupmember to - * perform a binary search. - * - * XXX: If large numbers of groups become common this should - * be replaced with shell sort like linux uses or possibly - * heap sort. - */ - for (i = 2; i < ngrp; i++) { - g = cr->cr_groups[i]; - for (j = i-1; j >= 1 && g < cr->cr_groups[j]; j--) - cr->cr_groups[j + 1] = cr->cr_groups[j]; - cr->cr_groups[j + 1] = g; + qsort(groups + 1, *ngrp - 1, sizeof(*groups), gidp_cmp); + + /* Remove duplicates. */ + prev_g = groups[1]; + ins_idx = 2; + for (int i = 2; i < *ngrp; ++i) { + const gid_t g = groups[i]; + + if (g != prev_g) { + if (i != ins_idx) + groups[ins_idx] = g; + ++ins_idx; + prev_g = g; + } } + *ngrp = ins_idx; + + groups_check_normalized(*ngrp, groups); +} + +/* + * Internal function copying groups into a credential. + * + * 'ngrp' must be strictly positive. Either the passed 'groups' array must have + * been normalized in advance (see groups_normalize()), else it must be so + * before the structure is to be used again. + * + * This function is suitable to be used under any lock (it doesn't take any lock + * itself nor sleep, and in particular doesn't allocate memory). crextend() + * must have been called beforehand to ensure sufficient space is available. + * See also crsetgroups(), which handles that. + */ +static void +crsetgroups_internal(struct ucred *cr, int ngrp, const gid_t *groups) +{ + + MPASS2(cr->cr_ref == 1, "'cr_ref' must be 1 (referenced, unshared)"); + MPASS2(cr->cr_agroups >= ngrp, "'cr_agroups' too small"); + groups_check_positive_len(ngrp); + + bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t)); + cr->cr_ngroups = ngrp; } /* * Copy groups in to a credential after expanding it if required. - * Truncate the list to (ngroups_max + 1) if it is too large. + * + * May sleep in order to allocate memory (except if, e.g., crextend() was called + * before with 'ngrp' or greater). Truncates the list to (ngroups_max + 1) if + * it is too large. Array 'groups' doesn't need to be sorted. 'ngrp' must be + * strictly positive. */ void -crsetgroups(struct ucred *cr, int ngrp, gid_t *groups) +crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) { if (ngrp > ngroups_max + 1) ngrp = ngroups_max + 1; - crextend(cr, ngrp); - crsetgroups_locked(cr, ngrp, groups); + crsetgroups_internal(cr, ngrp, groups); + groups_normalize(&cr->cr_ngroups, cr->cr_groups); } /* diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 6ee7c6d802c4..a7f3d2307df1 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -320,7 +320,7 @@ int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits); int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg); -int kern_setgroups(struct thread *td, int ngrp, gid_t *groups); +int kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups); int kern_setitimer(struct thread *, u_int, struct itimerval *, struct itimerval *); int kern_setpriority(struct thread *td, int which, int who, int prio); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 4311a73b73a5..358bb3c5566e 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -162,7 +162,7 @@ struct ucred *crcowget(struct ucred *cr); void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); -void crsetgroups(struct ucred *cr, int n, gid_t *groups); +void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups); /* * Returns whether gid designates a primary group in cred. From nobody Sat Nov 2 20:39:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN62mYfz5ch96; Sat, 02 Nov 2024 20:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN60vbCz44MH; Sat, 2 Nov 2024 20:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0TQ7ty7VgrLBmC2yPMryAxuSDGfoD4TDDMgyPT+JvLI=; b=QXq+2IpGSPW3M2EPXsXjvHilhzZYCb91lAHtSd1jQHIx8/CpbGQg+mmJrCMgJIUU5yhvoC I+RT/NwLVXc6nBGD7Vx8utKwQtcJ5C+phAioer/B15t7BTMyV/EvUlrF22WXnFEZwvcB0v VMfmR+ulleVmyIO5B/U86qPPMy6FQer3noiCqFym/fC8umz0NOZ835FT1008tGj7ydRual cBllta2+Wo/Wj5vbwpkFcz5R164K6MtSHslK3Eayoxp8DUghY+i6y81wZeKEH/tchlnCMU i9OZzPcLDnkPij2EzlTe/Pm7a/2PhDPu/TG73+a3844MiaCN5X9VJXz38EBbYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0TQ7ty7VgrLBmC2yPMryAxuSDGfoD4TDDMgyPT+JvLI=; b=LcR3kJVtPItdaz5wbIOadOTa355Oh1wfFeGmcDsFCgMnyXq+Z9geuDhIO7WZ0E4R98pTy/ 6ledKNyKGvFZpP42xcNJ+KhBqWQW1VYe30aiIf99O/HtFjeejOXcFaedLihn6X4QNuoHW9 rgoqN5rgM/AFeQiI19rMsqRWiXSKbIl6awMAyyUaaSPHkntDvDF/glW4Yq35QMMVoW2LsJ uubMVz4cyKTiHcbVJrITXCUbvpC4REYZaWmD0Zme0V72KeEvlMiF9eP1xTELw0MkIzjIYE tWoBO4WLK+6wOPBzuY/9RaX7f8qjnjPtK5zQDKNehTJeNDEQ/wC49c4jT8nvbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579974; a=rsa-sha256; cv=none; b=qLscTySl3H33KSYXYpO6reaOCPzE3dai04QuEXrtKljUr+gNCeax58MB6auFyVfJDSBBvl tRzajWlnfV1ip4z8L0R5cLUuZ8qXxXcF0IhrrhgkXi9Ue2UbbHzfq87AvsvwwNnFpSNf8J mZ6USg/lDyANaQlC5Bq7tV4/uFIaX/qq+d/rCM3GBRDOcL2yrr8AgsWeb5lpXdLKvtCib/ TGZteakW/x/2AxNloKi0L/qsw/AZpQ0pjntTAUqOUq7I3NgzpxFqISu6L25UANKEF4S0gy FYKf9isbjFBGfXCOdHI13mYZP8vdV/3UIqmjQWqYvAHfdgIbWXvKl5Uf828Hhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN60SZHzKQp; Sat, 2 Nov 2024 20:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdX4Z046442; Sat, 2 Nov 2024 20:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdXmt046439; Sat, 2 Nov 2024 20:39:33 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:33 GMT Message-Id: <202411022039.4A2KdXmt046439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 634675067867 - main - cred: groupmember() and co.: Sanity check cred's groups (INVARIANTS) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 634675067867090e538b08e62ff9b14d3ffae5a3 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=634675067867090e538b08e62ff9b14d3ffae5a3 commit 634675067867090e538b08e62ff9b14d3ffae5a3 Author: Olivier Certner AuthorDate: 2024-11-01 15:11:23 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:42 +0000 cred: groupmember() and co.: Sanity check cred's groups (INVARIANTS) Leverage the normalization check functions introduced in the previous commit in all public-facing groups search functions to catch programming errors early. Approved by: markj (mentor) MFC after: 3 days --- sys/kern/kern_prot.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index d87d008e0bc2..a1dd3e934c35 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1358,6 +1358,8 @@ bool group_is_supplementary(const gid_t gid, const struct ucred *const cred) { + groups_check_normalized(cred->cr_ngroups, cred->cr_groups); + /* * Perform a binary search of the supplementary groups. This is * possible because we sort the groups in crsetgroups(). @@ -1381,6 +1383,8 @@ groupmember(gid_t gid, const struct ucred *cred) if (cred->cr_ngroups == 0) return (false); + groups_check_positive_len(cred->cr_ngroups); + if (gid == cred->cr_groups[0]) return (true); @@ -1394,6 +1398,14 @@ groupmember(gid_t gid, const struct ucred *cred) bool realgroupmember(gid_t gid, const struct ucred *cred) { + /* + * Although the equality test on 'cr_rgid' below doesn't access + * 'cr_groups', we check for the latter's length here as we assume that, + * if 'cr_ngroups' is 0, the passed 'struct ucred' is invalid, and + * 'cr_rgid' may not have been filled. + */ + groups_check_positive_len(cred->cr_ngroups); + if (gid == cred->cr_rgid) return (true); From nobody Sat Nov 2 20:39:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN72sS0z5chQC; Sat, 02 Nov 2024 20:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN71hMsz44Mc; Sat, 2 Nov 2024 20:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T7GKuNQCAMMy9L1xURpzpWOd1daC0E73I8BIcE8cZko=; b=ymDwIGtQvb6Q6APRnvLwZTj36vQIT+eMV7RLi5UGGmtOoD2alzldIF4+IyPNnvZmnVs+cw zUl6n7kgKPa3MgACXWKoE6rF/M4WdVKTufbuZCd8oiZ+XSOCbDwf60rXA2MnORFREESgE4 CT21wzsh7uUbXrgaGv8CDxbmGKzZBNaHYNypvm+NobHd+k8UraUFymY6hvbsM5CAiV7W3T WtlZlCl+dZNOV9WW0GuOb6OenuIa+deSJIh1Yq9qt6vp7xINP8oZ5BiaCLvS8aqtr4AsmX hKy6Vkn2wBmqwTs3GLDMxtDUFgOJ7wd0BfkkE4BleLHAILPY+iE4T+azxVo3Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T7GKuNQCAMMy9L1xURpzpWOd1daC0E73I8BIcE8cZko=; b=CaELE7620c/9kkfaIOfw4u2q5FlOK0MrQtPWqgWIzLbIf0q4TtEmhuBfkq4RhUyt+02ZJE O/Rmi8xvgy9XruCDaz+m9oj2XfhRxRZztADA5ln4SbKI+VKOhPcPhISGnrCKy572A5iOjd rQEXibNvAwHyOeAW7oS5kWbAHNhQWK+eR4aGAdsStSO6DQebqyVJZhiJqR9e85e7EC03qj GAhe+bM2F8iSf2eHo50Wx9e1fbSHjAEBX6A3C+qRrz+FqlRQGBfsegmkUDRSgQb9PFIFNZ qhtkj3rSKzbkqItQqWXK3KV/7ZXUNOMPc+E2S4qVZUi0f9aYQEXF1EoxUWY8/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579975; a=rsa-sha256; cv=none; b=ZoiJHCi/APL46dTp+tk45UGmCgRhsUIOHuJLGhgPumipvWcZGbTVAITvz6687ZcieJgQK1 vNM8ebOmarS9xjFQIZypaVi2tOrs3K+S1GZiWcqpm7KCVHkCnhDV7J+3RWdPuYOUCuCGNi e7uBHUz8MtrAIwqWyGVQHVblWi2WuK45LtZYKaXhqgIV++1bOvJ/wjoZ5mRl2+oMMPNY+m uG4HICwUUIUfW2S5RLN03MLQRs3+QqHJCzGJyGKRy6gfGendN0DBwVL/MO7pdG9cPzjB+/ BqgXQB3ywqENe+6vMbqyUdbKylgMzjYCf2FZ8OFKBytfQrMvte9BijuNvnYSTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN71J8HzKSd; Sat, 2 Nov 2024 20:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdZFD046481; Sat, 2 Nov 2024 20:39:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdZjE046478; Sat, 2 Nov 2024 20:39:35 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:35 GMT Message-Id: <202411022039.4A2KdZjE046478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ea26c0e79752 - main - cred: crextend(): Harden, simplify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea26c0e797525634dd25dede233ff2ded053cf2d Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ea26c0e797525634dd25dede233ff2ded053cf2d commit ea26c0e797525634dd25dede233ff2ded053cf2d Author: Olivier Certner AuthorDate: 2024-10-01 14:37:11 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:42 +0000 cred: crextend(): Harden, simplify Harden by adding more assertions, and a plain panic in case of an unrepresentable size for the groups array (this can never happen after the change of the 'kern.ngroups' computation to impose some not too high maximum value a few commits ago). Fix an impact in kern_setgroups(). Simplify by removing the iterative process whose purpose is actually to determine the closest power of two that is greater than the wanted number of bytes. Using the proper target quantity (number of bytes) incidentally helps with eliminating divisions (and the reliance on sizeof(gid_t) being a power of two). Reviewed by: mhorne (older version) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46915 --- sys/kern/kern_prot.c | 55 +++++++++++++++++++++++++++++++--------------------- sys/sys/ucred.h | 6 +++++- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index a1dd3e934c35..0f49d000dfd2 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -888,7 +888,8 @@ kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups) ngrp = *ngrpp; } newcred = crget(); - crextend(newcred, ngrp); + if (ngrp != 0) + crextend(newcred, ngrp); PROC_LOCK(p); oldcred = crcopysafe(p, newcred); @@ -2226,6 +2227,13 @@ crcopy(struct ucred *dest, struct ucred *src) bcopy(&src->cr_startcopy, &dest->cr_startcopy, (unsigned)((caddr_t)&src->cr_endcopy - (caddr_t)&src->cr_startcopy)); + /* + * Avoids an assertion in crsetgroups() -> crextend(). Ideally, + * 'cr_ngroups' should be moved out of 'struct ucred''s bcopied area, + * but this would break the ABI, so is deferred until there is a real + * need to change the ABI. + */ + dest->cr_ngroups = 0; dest->cr_flags = src->cr_flags; crsetgroups(dest, src->cr_ngroups, src->cr_groups); uihold(dest->cr_uidinfo); @@ -2350,45 +2358,48 @@ crcopysafe(struct proc *p, struct ucred *cr) } /* - * Extend the passed in credential to hold n items. + * Extend the passed-in credentials to hold n groups. + * + * Must not be called after groups have been set. */ void crextend(struct ucred *cr, int n) { - int cnt; + size_t nbytes; MPASS2(cr->cr_ref == 1, "'cr_ref' must be 1 (referenced, unshared)"); + MPASS2(cr->cr_ngroups == 0, "groups on 'cr' already set!"); + groups_check_positive_len(n); + groups_check_max_len(n); - /* Truncate? */ if (n <= cr->cr_agroups) return; + nbytes = n * sizeof(gid_t); + if (nbytes < n) + panic("Too many groups (memory size overflow)! " + "Computation of 'kern.ngroups' should have prevented this, " + "please fix it. In the meantime, reduce 'kern.ngroups'."); + /* - * We extend by 2 each time since we're using a power of two - * allocator until we need enough groups to fill a page. - * Once we're allocating multiple pages, only allocate as many - * as we actually need. The case of processes needing a - * non-power of two number of pages seems more likely than - * a real world process that adds thousands of groups one at a - * time. + * We allocate a power of 2 larger than 'nbytes', except when that + * exceeds PAGE_SIZE, in which case we allocate the right multiple of + * pages. We assume PAGE_SIZE is a power of 2 (the call to roundup2() + * below) but do not need to for sizeof(gid_t). */ - if ( n < PAGE_SIZE / sizeof(gid_t) ) { - if (cr->cr_agroups == 0) - cnt = MAX(1, MINALLOCSIZE / sizeof(gid_t)); - else - cnt = cr->cr_agroups * 2; - - while (cnt < n) - cnt *= 2; + if (nbytes < PAGE_SIZE) { + if (!powerof2(nbytes)) + /* fls*() return a bit index starting at 1. */ + nbytes = 1 << flsl(nbytes); } else - cnt = roundup2(n, PAGE_SIZE / sizeof(gid_t)); + nbytes = roundup2(nbytes, PAGE_SIZE); /* Free the old array. */ if (cr->cr_groups != cr->cr_smallgroups) free(cr->cr_groups, M_CRED); - cr->cr_groups = malloc(cnt * sizeof(gid_t), M_CRED, M_WAITOK | M_ZERO); - cr->cr_agroups = cnt; + cr->cr_groups = malloc(nbytes, M_CRED, M_WAITOK | M_ZERO); + cr->cr_agroups = nbytes / sizeof(gid_t); } /* diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 358bb3c5566e..b8a3b609abae 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -73,6 +73,10 @@ struct ucred { uid_t cr_uid; /* effective user id */ uid_t cr_ruid; /* real user id */ uid_t cr_svuid; /* saved user id */ + /* + * XXXOC: On the next ABI change, please move 'cr_ngroups' out of the + * copied area (crcopy() already copes with this change). + */ int cr_ngroups; /* number of groups */ gid_t cr_rgid; /* real group id */ gid_t cr_svgid; /* saved group id */ @@ -80,7 +84,7 @@ struct ucred { struct uidinfo *cr_ruidinfo; /* per ruid resource consumption */ struct prison *cr_prison; /* jail(2) */ struct loginclass *cr_loginclass; /* login class */ - void *cr_pspare2[2]; /* general use 2 */ + void *cr_pspare2[2]; /* general use 2 */ #define cr_endcopy cr_label struct label *cr_label; /* MAC label */ gid_t *cr_groups; /* groups */ From nobody Sat Nov 2 20:39:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN83vHPz5chQG; Sat, 02 Nov 2024 20:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN82zg9z44FN; Sat, 2 Nov 2024 20:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udMBqgu7bwJUpCr5gOazgYQaoxRdRzCO2SCEznmDP1Q=; b=Cl3YE3xnHTlqzaKlNwPIpTw7wOWmuo306/M9Te/Bf3omufzi5rlV/Ko8r+epVZVOmEXfjU eK2bfwSmRpKnscGLVNUht+9nu1hRC1Rvtx8R0oG6u20hYzbowmZpCUgDVM02Td9SGAw78M +DbpWCNoik6LMLbntPrKxDuMl5NxdIezaPSHr02uB67nZG+dYOPpIOvrtRE9chIgVKBpWv fn37+pXxxxgfxvkagiwqmfiA6Z80mNO+1a84bL78NfOjrwmDMzvgkpgsazgEGH9hdn3pMe w8xs5R8tEoM/UKlcHOEmpy4blRGDak9bFdmU4fTYVTG3gfMNyL8N1wb3YVlbpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udMBqgu7bwJUpCr5gOazgYQaoxRdRzCO2SCEznmDP1Q=; b=iQicRBcAAjB/t//IilM5T5yFQO9CqMMFCRZ/w6QmqSeA9dctud46OxOGJFa106sa/c0QVF K7AQkXwVM9tkAzMFbCj4RfhfEgTlHSwnM4ZhprYipcTxIyqSGb31YFxijG6bFxdMklH99U u7B+bSlW6CpQ+WGPxBP4fOAeguYTagpuKpBmcUjn5IyOuHYt9zczpaEMXM9bJDzCZEOODq 5GjH9aHSVtYulsv720lmxYKbS6OeXQ3jn/F8pD7TDdcyl987mZ2ZfWz4O7g//z3vXWGGpj kdNdgXEIyg8JzVUriucorFFHM6njH69Bgx4F1thb5rXokO02CSMeDmfOluGk9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579976; a=rsa-sha256; cv=none; b=Tsci/2rCOiPyB+MkkIPGwQmmPmLTJzt31bhsYqbUjz3hoROr823Y/CYYWbr+dcWbjfKR7Z WNCQ70bU0Xx5nHZVuYIZztY0Pf5G9GU5JkhvLoMMK2r+dg+OfaYdpQhO3Q1hZ7wCSjgKs0 yPbRXfOX+xFNg6NIq7Uu37EEXHToYvoyq9Un0ClWS2VKtgl+MpwzNJsLR2myr7yodC3Gqu 7AvvAZvsuktPHOqR5B4DTqmy2ROBUJgPrbjEcR4TtCdosAGOZgx6IMXSeztEbpbVcsgNmu klMcly7kd7mQHS5YTnqYANOS2ilsakJ+LjYA5p8OzC0wRDxItadrZbxjjuaz4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN82Td4zKQq; Sat, 2 Nov 2024 20:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdaKE046520; Sat, 2 Nov 2024 20:39:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Kda2O046517; Sat, 2 Nov 2024 20:39:36 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:36 GMT Message-Id: <202411022039.4A2Kda2O046517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: d4e0d4d92e01 - main - cred: New crsetgroups_fallback() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4e0d4d92e010b74404bddc87c1a1e8dbcaa25dd Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d4e0d4d92e010b74404bddc87c1a1e8dbcaa25dd commit d4e0d4d92e010b74404bddc87c1a1e8dbcaa25dd Author: Olivier Certner AuthorDate: 2024-10-02 14:16:20 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:42 +0000 cred: New crsetgroups_fallback() Similar to crsetgroups(), but allows an empty group array in input, treating it like a one-element array containing the passed fallback group. Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46917 --- sys/kern/kern_prot.c | 18 ++++++++++++++++++ sys/sys/ucred.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 0f49d000dfd2..504c79313408 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2487,6 +2487,24 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) groups_normalize(&cr->cr_ngroups, cr->cr_groups); } +/* + * Same as crsetgroups() but accepts an empty groups array. + * + * This function ensures that an effective GID is always present in credentials. + * An empty array is treated as a one-size one holding the passed effective GID + * fallback. + */ +void +crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, + const gid_t fallback) +{ + if (ngrp == 0) + /* Shortcut. */ + crsetgroups_internal(cr, 1, &fallback); + else + crsetgroups(cr, ngrp, groups); +} + /* * Get login name, if available. */ diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index b8a3b609abae..75156cca09a5 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -167,6 +167,8 @@ void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups); +void crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, + const gid_t fallback); /* * Returns whether gid designates a primary group in cred. From nobody Sat Nov 2 20:39:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqN96gHPz5chWq; Sat, 02 Nov 2024 20:39:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqN94H3Hz44Y1; Sat, 2 Nov 2024 20:39:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbhzOP/LJJuvIL40BPB5xAGqCqFS8D86yv2GsF7xM20=; b=bBl5V4JnM1MczDw+nrlBx7xpttNA3FePfvKHcRdwIgIMbc/ER9fRy+bxPD8kAJrbu8QZUc PWsSLEwnwcfx1GcwWayGSgBIn6edbm/slen0Qmg1KagjkD8wfPl7h+dWGtb24qlcDV9JCD sRMGnPLGxlnUJb33K+ufhAjdYQyaS2eUu5IwEDa0Vmu1RvYmzqbOnC9aJurH8QVFq21pAm uGaqiU0VwHQ2oG4a7DZi6++e6cxRFrASRELnb9MrLsVnILYl46p/eyzOvYCghqnUiMWqGX Y25nhPMr1yDcYYG2jhsERBk8zyZ3ypSGWDrl6to13iZrR0UhNG2Q4EMJvHm+yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbhzOP/LJJuvIL40BPB5xAGqCqFS8D86yv2GsF7xM20=; b=clZgmFjLe7uBEh8WWp/SzmDYAxPsTaZbdtBuH2VGTjxkDAzPAv4AiGplr4UiM4uIfIMJTf epKaYT7H/YnpD1rEReb9vnnxoLgOVus7QMjfsTauWHAoKKRcJ8k+QN78CkXfzfyR59+wLI jbPr6/xV2YQAYM1y8LRE1+1Kj29iILyxmn/+bnYhGeHSmJYjap86hQVqukjuO1mth41hOK dNvdGjp2LI9+yYHCXENhiORfZk8tdER0FFD4uJY1Po5Uj95W/6hgv+uA7ZNMzuLY72Larp HnJKxSIAA47JGFtmG9Qz6H8u2Ch5II1+qSncfDmBfvXTjOBqh2fYUydTnrm+ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579977; a=rsa-sha256; cv=none; b=c/tjXwxoj7WdNAFGDUq7iu67W4scMGOy6vbpuC7pLCJkvTGj1blev3oQwle4tmAM7W6XvQ fD6nUkiX729Ma6EnvIbQTO/6TJ5FZu5zeyyxctZnXYghE+u6P+mC11eRXYhr5TWZmCa5il wOjTx6RBCzrY/sipYodofY3kOB2MdcMD07hjBxmqx2DxIKTfweyA6iLF4E6tXo65w4IPBn FqUQ41lt/ulWN9jEaKQaUI6kwUvAejZIfAxj966jy3yJu2USppaVua5KM8WWpAsz7zJPUg qVPQaCjQxxE1oM3d1GZi3YfSKwjwO8OepHCXmnwYpG+zD1bRC/+kZVP0UfL6ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqN93tmRzKQr; Sat, 2 Nov 2024 20:39:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2Kdbb8046583; Sat, 2 Nov 2024 20:39:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2KdbAE046580; Sat, 2 Nov 2024 20:39:37 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:37 GMT Message-Id: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 commit cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 Author: Olivier Certner AuthorDate: 2024-10-02 14:28:59 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:37:42 +0000 nfs, rpc: Ensure kernel credentials have at least one group This fixes several bugs where some 'struct ucred' in the kernel, constructed from user input (via nmount(2)) or obtained from other servers (e.g., gssd(8)), could have an unfilled 'cr_groups' field and whose 'cr_groups[0]' (or 'cr_gid', which is an alias) was later accessed, causing an uninitialized access giving random access rights. Use crsetgroups_fallback() to enforce a fallback group when possible. For NFS, the chosen fallback group is that of the NFS server in the current VNET (NFSD_VNET(nfsrv_defaultgid)). There does not seem to be any sensible fallback available in rpc code (sys/rpc/svc_auth.c, svc_getcred()) on AUTH_UNIX (TLS or not), so just fail credential retrieval there. Stock NSS sources, rpc.tlsservd(8) or rpc.tlsclntd(8) provide non-empty group lists, so will not be impacted. Discussed with: rmacklem (by mail) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46918 --- sys/fs/nfs/nfs_commonport.c | 4 +++- sys/fs/nfs/nfs_commonsubs.c | 5 +++-- sys/fs/nfsserver/nfs_nfsdport.c | 6 +++++- sys/fs/nfsserver/nfs_nfsdsocket.c | 6 ++---- sys/kern/vfs_export.c | 12 ++++++++---- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- sys/rpc/svc_auth.c | 8 ++++++-- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 2db9af5b9ea9..11f31d1a0e9f 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -75,6 +75,7 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); int nfs_pnfsio(task_fn_t *, void *); @@ -258,7 +259,8 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) KASSERT(nfscr->nfsc_ngroups >= 0, ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid = nfscr->nfsc_uid; - crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups); + crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, + NFSD_VNET(nfsrv_defaultgid)); } /* diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 90b30f462106..ce4b0052714e 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4051,8 +4051,9 @@ nfssvc_idname(struct nfsd_idargs *nidp) */ cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; - crsetgroups(cr, nidp->nid_ngroup, grps); - cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + crsetgroups_fallback(cr, nidp->nid_ngroup, grps, + NFSD_VNET(nfsrv_defaultgid)); + cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 8a2a39052506..5160645ad73c 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3311,7 +3311,11 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp, NFSVNO_EXPORTANON(exp) || (nd->nd_flag & ND_AUTHNONE) != 0) { nd->nd_cred->cr_uid = credanon->cr_uid; - nd->nd_cred->cr_gid = credanon->cr_gid; + /* + * 'credanon' is already a 'struct ucred' that was built + * internally with calls to crsetgroups_fallback(), so + * we don't need a fallback here. + */ crsetgroups(nd->nd_cred, credanon->cr_ngroups, credanon->cr_groups); } else if ((nd->nd_flag & ND_GSS) == 0) { diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index df0c0edd1b59..d1b6198ba0e1 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -1422,13 +1422,11 @@ static struct ucred * nfsrv_createrootcred(void) { struct ucred *cr; - gid_t grp; cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = UID_ROOT; - grp = GID_WHEEL; - crsetgroups(cr, 1, &grp); - cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + crsetgroups_fallback(cr, 0, NULL, GID_WHEEL); + cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 996f3f74193f..c0337b1fe858 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -61,6 +61,10 @@ #include #include +#include + +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); + static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); #if defined(INET) || defined(INET6) @@ -133,8 +137,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; - crsetgroups(np->netc_anon, argp->ex_ngroups, - argp->ex_groups); + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, + argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; @@ -212,8 +216,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; - crsetgroups(np->netc_anon, argp->ex_ngroups, - argp->ex_groups); + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, + NFSD_VNET(nfsrv_defaultgid)); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index 1e6e71fa10ac..b1790dd167d5 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -537,7 +537,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred **crp, int *flavorp) cr = client->cl_cred = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; cr->cr_rgid = cr->cr_svgid = uc->gid; - crsetgroups(cr, uc->gidlen, uc->gidlist); + crsetgroups_fallback(cr, uc->gidlen, uc->gidlist, uc->gid); cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = crhold(cr); diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index 6acb1fb0d4b9..92f1ee0f2844 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -187,10 +187,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) if ((xprt->xp_tls & (RPCTLS_FLAGS_CERTUSER | RPCTLS_FLAGS_DISABLED)) == RPCTLS_FLAGS_CERTUSER && flavor == AUTH_UNIX) { + if (xprt->xp_ngrps <= 0) + return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xprt->xp_uid; crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); - cr->cr_rgid = cr->cr_svgid = xprt->xp_gidp[0]; + cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = cr; @@ -200,10 +202,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) switch (flavor) { case AUTH_UNIX: xcr = (struct xucred *) rqst->rq_clntcred; + if (xcr->cr_ngroups <= 0) + return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xcr->cr_uid; crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); - cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = cr; From nobody Sat Nov 2 20:39:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgqNC0xkrz5ch9D; Sat, 02 Nov 2024 20:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgqNB5QvRz44bS; Sat, 2 Nov 2024 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FYxlfPbSjZGriHIH5i35QbjKguHqfyMp0Zy6XqwPhvA=; b=m75tt6EMZOcSUXvZRgvo4D/2AytDZSHvNmeTtwG40krRyNsLAyATEnG/QYVxrjJ91Lhf1g dOOpJsWqCIWQpvdVojMxqtuElNieeNiFEjnatPx5HDQgmi1S0vFqO8yuQc48xCzSZ2PSi0 hKc1kIKLfbYvgOIwuERc8g3DCWa+MBJfhGb01EQ9wg48SHewEdUQVF0uw9YyfKrhk0JD10 /RNy4offBb0hxZwZZ6EktZ7Ir//XgY+OLGdNUX0BPgn7ft6qZ8hk6YcwolTgr1tPObHVAi fSenIzShpiQEt68NNJmulwj9f/2MW3dKRZvBzLbHb9OEmptUwEQNGTtYy6MsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FYxlfPbSjZGriHIH5i35QbjKguHqfyMp0Zy6XqwPhvA=; b=YyD0WLUnpI9vArVZlLENZlM8zpgjeDijPdcePiKl52yDxkawSrbJrBbFNzJVKzenVxOL5v 92U1V2XoK7YL7NPRpfUgb+iMuH+N35qpJNpG5xb7fSj+0ZPLkJPWhC7Sx9dtKloqUMjr5L YUVMliB70cORybjYCgb1fkrb1JAFyb8xV/6F8i1LTKLkr3Zv/l87rOeHY01pmvaJW241oH utduBw/evG2TmJNfHLpAJOPcSNcbCWlLh7goNSYZIJQq6YBpOvYWdaFFo1bU8xlGX04YEv oz0KFLWsB7LtniYUGbo6xbFM92np3Fk/MMV6ntnyTByq7SqKw8fGHL4AiAvAPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579978; a=rsa-sha256; cv=none; b=cZ0NMaimvUqlPVfWaR19aOS/5xGfu6q2hqdfLg2/mQRBSYuJIv+mm9e8xZQ2SDgyNRMYn+ C4tsEF3oS0OkZLDnMCFe08OXpwb0lPyEx8EjLV/GL0idleEDjAiT3IwG/cCt5VJprT+Bto zRCsU9FyuNmf0gXAfPByGzaevXxifOEwPjwGvw3uERYhCXuOU4PvVyp8bOLQAB/xaN3xuK mSBmkMIGgx1hEBQIdL3Dr/lX9I41ZXw51wvTUz/I9G3hRucbGnAxQnzXTc9toU216gQLgS KYIuIf83qee53j5g0tMIimG8l1CVZEMZdZNNWzzQXnSYakNQQhKX6AKn2KHM2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgqNB50FMzKFD; Sat, 2 Nov 2024 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2KdcWt046631; Sat, 2 Nov 2024 20:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Kdc28046628; Sat, 2 Nov 2024 20:39:38 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:38 GMT Message-Id: <202411022039.4A2Kdc28046628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 3f313682e030 - main - cred: groupmember(): Remove tolerance for empty 'cr_groups' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f313682e030f1c99d9b223093e84d0a53a109af Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3f313682e030f1c99d9b223093e84d0a53a109af commit 3f313682e030f1c99d9b223093e84d0a53a109af Author: Olivier Certner AuthorDate: 2024-11-01 16:12:15 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:38:21 +0000 cred: groupmember(): Remove tolerance for empty 'cr_groups' This tolerance had been introduced in commit caa309c8811d ("nfsd: Fix handling of credentials with cr_ngroups == 0", on 2024/10/21). Now that NFS has been modified in the previous commit (cfbe7a62dc62, "nfs, rpc: Ensure kernel credentials have at least one group") to rule out credentials with empty 'cr_groups' (and thus, no 'cr_gid'), remove it back. This basically reverts the above-mentioned commit except for the not directly related modifications it contains, which are still valid. Discussed with: rmacklem (by mail) Approved by: markj (mentor) MFC after: 3 days --- sys/kern/kern_prot.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 504c79313408..b522edbf4e69 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1377,13 +1377,6 @@ bool groupmember(gid_t gid, const struct ucred *cred) { - /* - * The nfsd server can use a credential with zero groups in it - * when certain mapped export credentials are specified via exports(5). - */ - if (cred->cr_ngroups == 0) - return (false); - groups_check_positive_len(cred->cr_ngroups); if (gid == cred->cr_groups[0]) From nobody Sat Nov 2 22:03:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgsDQ6sW0z5cqLY; Sat, 02 Nov 2024 22:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgsDQ4q70z4JlX; Sat, 2 Nov 2024 22:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730584982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aJeizzkN4jWoykrX0DBVI3HHVIPAE0plnXS67MC4rB8=; b=FhmysAINDRohR1tUSWDcKeMnDM6EaxD/6XsrRfuxqITgzMMFSv/gvnFZB6nqQmQnyTEVwL mQD0Bt7kJ7gM3EedCCfMszAVXWwP/pjBMmST7RCRPJ8za2RFnTyKs3W1O8QEjfnOp72mzq Lr7g/NnvqDdobmmmncJDF5HJvgamUMrEQDGiLBUthk+vzJ0qE0+4zI6DDnEgv7+R2ci+j0 r20PBM1XpZNcbdyuTG3taE0jf87FPNMN9FuH9aT0X2La+DOPlyLyCm3GeyZg1Gbw/oN6ju uKkL4taFJaZYHqWav+gSuFXz9uktYQ73lXyL2g0rQOTw12rY+WoEydpbeym8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730584982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aJeizzkN4jWoykrX0DBVI3HHVIPAE0plnXS67MC4rB8=; b=PsfaLsVlsA/06C2IbzPJZ+nw4IzZvUks3kVNkBFHdlEMn65vKHh6TLSXev6Z3M1E6H+ozq m2m2xvQYzCd1QJ5VKdHdYZoHqdKFKeDDn96bzSuMayhi6pbiH2APRsEsf7v7tF1i5fyuDA cwZbVgXz0nBzWjWucQptyLOeADZxvRl2+frKQ3RwMI6TQL0gV8Kky/66PX6NwxX0Qk63Uh zOof/7yK0AY8bDYV05xhbT+ul7i6KboNDlD15ESoUNtpk6vf3X5/u8pOfsG8uUkN/XpHME oJufQOfcLRFaCPkzWVV3vdeIuIFLdgO1AmYYybyr61esi5i8P0Ns8qjWciFBzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730584982; a=rsa-sha256; cv=none; b=fAASl2rKrj6Ms6cv5DE9VqErescZBRFvCtIv0GRzKCxy/n/s9avX4KCO0MnD0ShDQtUpmw fq6pyGzq3SMvqKVKnXpknM7ZbEk8nJBknXj4gHtY/VgyNVnxLpwa2kFAwOMZTSPxkExBOb 9TXcQC+n8gtj4/nw2gQyDs8LhLw2eV66BYI/29DBHt4+fhpaFJIdr146Y+1JBOp0ijUiu3 v4NDw788c1UzMArT4aH2WR17gU7+s0cJlp0G8A9OOAH0kraWvEsjmekrTQ6+Ru5uNpIcKZ 7/0UBKXQLv3Kt8VjrEDAxCDM6gw0v3o16X0FdMkbdjmh7gdFMKlhAIeh4uK8pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgsDQ4QLyzMdL; Sat, 2 Nov 2024 22:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2M323X012102; Sat, 2 Nov 2024 22:03:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2M322V012099; Sat, 2 Nov 2024 22:03:02 GMT (envelope-from git) Date: Sat, 2 Nov 2024 22:03:02 GMT Message-Id: <202411022203.4A2M322V012099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c2ba66d4d01f - main - loader: Fix boot menu on BIOS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2ba66d4d01f23303352bfe3cbd50ff5d9a05947 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2ba66d4d01f23303352bfe3cbd50ff5d9a05947 commit c2ba66d4d01f23303352bfe3cbd50ff5d9a05947 Author: Warner Losh AuthorDate: 2024-11-02 22:02:44 +0000 Commit: Warner Losh CommitDate: 2024-11-02 22:02:44 +0000 loader: Fix boot menu on BIOS Only the gfx-enabled boot loader supports unicode. Otherwise, we have to use the old cons25 / ibmpc upper code page drawing characters. Check to see if we have the gfx.term_drawbox function. If we do, we support the unicode drawing characters. If we don't, then we have an older loader that doesn't support it *OR* we have the reduced function, text-only boot loader. In either of those cases, we need to use the old graphics characters. Abstract all those details into core.hasUnicode function. PR: 282465 MFC After: 2 day Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D47403 --- stand/lua/core.lua | 9 +++++++++ stand/lua/drawer.lua | 32 +++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 72b19462ae5c..3582720f2a81 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -543,6 +543,15 @@ function core.nextConsoleChoice() end end +-- The graphical-enabled loaders have unicode drawing character support. The +-- text-only ones do not. We check the old and new bindings for term_drawrect as +-- a proxy for unicode support, which will work on older boot loaders as well +-- as be future proof for when we remove the old binding. This also abstracts +-- out the test to one spot in case we start to export this notion more directly. +function core.hasUnicode() + return gfx.term_drawrect ~= nil or loader.term_drawrect ~= nil +end + -- Sanity check the boot loader revision -- Loaders with version 3.0 have everything that we need without backwards -- compatible hacks. Warn users that still have old versions to upgrade so diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 3a462930b86b..e55702ffee6c 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -506,23 +506,45 @@ drawer.frame_styles = { top_right = "+", bottom_right = "+", }, - ["single"] = { +} + +if core.hasUnicode() then + -- unicode based framing characters + drawer.frame_styles["single"] = { horizontal = "\xE2\x94\x80", vertical = "\xE2\x94\x82", top_left = "\xE2\x94\x8C", bottom_left = "\xE2\x94\x94", top_right = "\xE2\x94\x90", bottom_right = "\xE2\x94\x98", - }, - ["double"] = { + } + drawer.frame_styles["double"] = { horizontal = "\xE2\x95\x90", vertical = "\xE2\x95\x91", top_left = "\xE2\x95\x94", bottom_left = "\xE2\x95\x9A", top_right = "\xE2\x95\x97", bottom_right = "\xE2\x95\x9D", - }, -} + } +else + -- non-unicode cons25-style framing characters + drawer.frame_styles["single"] = { + horizontal = "\xC4", + vertical = "\xB3", + top_left = "\xDA", + bottom_left = "\xC0", + top_right = "\xBF", + bottom_right = "\xD9", + } + drawer.frame_styles["double"] = { + horizontal = "\xCD", + vertical = "\xBA", + top_left = "\xC9", + bottom_left = "\xC8", + top_right = "\xBB", + bottom_right = "\xBC", + } +end function drawer.drawscreen(menudef) -- drawlogo() must go first. From nobody Sat Nov 2 22:16:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgsX22vPvz5crSC; Sat, 02 Nov 2024 22:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgsX22LsXz4Ljp; Sat, 2 Nov 2024 22:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730585794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUJo7Holcw101p/BGU/F2tcCjAYXTVAGkxeoz3xHr50=; b=pXzZJqkNwniwy4y+qywBa9zujMRXSQ3wE9WCmTctd4rMvMydBesSVo6UnBffoD7ZegonnP fpf3McLGvkp1uN91FK1Wl9s7nrI2pveC2hfKHPFjbVffRih5AsoHc89I3xA3vVm3o8I8Ns sFOq1z5Et3ly4eqITSdexTIliCXXdRX6RxbdZgGm7hI6U7br59Hw8v8ZdxjNK/q0KUJ5NE sOVQMUxd9XohzYU/UovUbPDBe3nG1oAt/rz3SLrABkzw7roTfFlAtiG4ajrVtabYPeHcX5 RD6mxDAcfy2W4kAYLzPRItIhuB1NhWUrd3uC1LZlFNWpgl1sgarUpOJYM2PtTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730585794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUJo7Holcw101p/BGU/F2tcCjAYXTVAGkxeoz3xHr50=; b=G1WKyb4Yok7apIMfkm4DNIZL3/YSZEfF2VCM89na50Cp1eVWGpRfB2lnHCjQpeQLZ9yYyt 0zRpnU3Cim46QKWq/07LOibY8TOMnf4Y/qfaTnypEEqEdkgFbQDPnMRQrcQLltD2Ua25da GvvbSgRFb6K09nQJGPyUGafJ4h7IOIpf9oq2j/eb1BXGZHxxasSW9IHYk9CiUHrD6W5c+l WCf+P4I2+SoiHkUfm40g1iTgaDMv5CC9UhiE0rIXh9lgMRS1WIibgojO/KTmD3E1yrCW4u vtJhb/XL41APtQTIZW80LmVZHaA2u8SD24Ur/V8SmnRm63JSSKJHxHE23uTcEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730585794; a=rsa-sha256; cv=none; b=ZSkWO18IlqhIZqgbEIYHxTn2wKPhu+s8qj0Dt8bb4NpbJhsdx4GX+E6iDKpVTf9xJIIwTs cuSVyS4leEJrL7dt1+hRnnAURAGd1XaV21fQ1zS7B9FcvL1sV+ctRCc491+OYNNTWlb16u e3YYymsn72ZYisPwk+doGkJqOw/x+Affnp8hqd9J25mksUUqrrHvkTPJrIfSlonoEBm2nV njlmJYJ8qMiZZ/AEZTivpkEkeOZytVSsLIF95UtSaeIGXfI8HxJ+Xc/y3PpU2y7Dq80VkA 8JpxWRQ+2gBH07eoYYbmuNjUqUNyRwZAFUdh/fIHEpuYx/GPGkfk5mQD6mgBew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgsX21p99zMdr; Sat, 2 Nov 2024 22:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2MGYMh032010; Sat, 2 Nov 2024 22:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2MGYPt032007; Sat, 2 Nov 2024 22:16:34 GMT (envelope-from git) Date: Sat, 2 Nov 2024 22:16:34 GMT Message-Id: <202411022216.4A2MGYPt032007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 47ef2a131091 - main - loader.efi: Fix LOADER_NET_SUPPORT=no builds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ef2a131091508e049ab10cad7f91a3c1342cd9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=47ef2a131091508e049ab10cad7f91a3c1342cd9 commit 47ef2a131091508e049ab10cad7f91a3c1342cd9 Author: Tatiana AuthorDate: 2024-11-02 22:13:58 +0000 Commit: Warner Losh CommitDate: 2024-11-02 22:13:58 +0000 loader.efi: Fix LOADER_NET_SUPPORT=no builds We include too many references to networking things in the non-networking build for loader.efi. Ifdef out netserver command when we are disabling network support to resolve. PR: 277528 MFC After: 2 days Reviewed by: imp --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 0e2c580d1a8a..500fcba20938 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -1960,6 +1960,7 @@ command_chain(int argc, char *argv[]) COMMAND_SET(chain, "chain", "chain load file", command_chain); +#if defined(LOADER_NET_SUPPORT) extern struct in_addr servip; static int command_netserver(int argc, char *argv[]) @@ -1990,3 +1991,4 @@ command_netserver(int argc, char *argv[]) COMMAND_SET(netserver, "netserver", "change or display netserver URI", command_netserver); +#endif From nobody Sat Nov 2 23:46:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgvWz12D7z5cypy; Sat, 02 Nov 2024 23:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgvWz0Cgvz4Sb1; Sat, 2 Nov 2024 23:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730591199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wV+m9EeHsBwOVwd1En6yt8H7tBfbuvUOJy0QqeFOfcA=; b=yOhxJYsYw5SV+vSXG9iA/ca9BRdxp2woGFNXn44wlKMaEWXEy2+Jwi90wIoYbO62JJQN3a u0h6h5sucaT6aTpLvgHdfkXsNHDciZpDsYZ3T/r5dTNMD0hEnrUq0QGQDUsGh4KR00d3VX ctYFmVvgCwuUMgNizAVGWI1493YuPbUQCKmGBZoY9seeZEdfMBIUigupyktkGf/gPLfxV6 +M3LN13iQVzun1pwVryARW6BkSqIWHf77tOINkGarxo7IAp8K+AXMN6rEzi8N0/yxUrf0u YH7HomaKso7FY7StO72Xhkl01hO5QHWUeNXzTQ9DoBCMuB6O0vbKxeYWtB9s/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730591199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wV+m9EeHsBwOVwd1En6yt8H7tBfbuvUOJy0QqeFOfcA=; b=BPcYufdDexqSmNu1wMpOD0J3b+78hO+K0CZhvXY1jWC8VPJyQUzXsWdwDwPh8G7d0fu/lv 5zjxPtMBwMEGWVLh5kuRWLETtK9wf7l20mNIsZMM+igFSV0MCWyCxLGpCkrRh/l2VDP2dn XPhdOM+v512AuEdAVOJuJDXj2N9JuF23VkuTp26TyoCkstRgWlJw3bJXD0khq7HIJKExLw VPGS3JzyMmmrnBjIxOwFUcj6lN48FlCfmFGIcPV8gAMbiSaZEM8i/rm0Ys82cC/UiTiCgK 11M5Ym5/F8GgzR3zEmT1cyo/JSvBHqH5w6Q3SnY1Vb2IT1JynZYJzeNuFMfCIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730591199; a=rsa-sha256; cv=none; b=L47ThckoXeigbUTImf7N3Cn3pKcUSbihrb6RQi9Qc8ecUlBcD/GfAHSxi8fgU7fMuLRNDr /Mko5hG1XnDg1aSN1S53gy/cameJWTlOT1zsKc+mbBBpuXUZVNxcX7WZV2F9Lpn3+u5O43 TGlYcqrKGSl1EiRmT8walAs/Wz1JScxW0vUkc1vqMdnQgPoMIogXyDtVPSfUsgueRXKLb0 abWP0xjqcVu1HLkDcpNNaS5wXaqH2YlLfbQVAE25J60acKqKsVqloWcCcnZdgIJ95/t+3l cUeua84308H4DGZsqYiTBk5iPwcNWJYWym3DQJFl0Xj64G01DdDM2R6EriiGSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgvWy6qSmzPsH; Sat, 2 Nov 2024 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2NkcBC097563; Sat, 2 Nov 2024 23:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2NkcUp097560; Sat, 2 Nov 2024 23:46:38 GMT (envelope-from git) Date: Sat, 2 Nov 2024 23:46:38 GMT Message-Id: <202411022346.4A2NkcUp097560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0a9bec17447c - main - x86/iommu/amd_reg.h: AMD IOMMU registers definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a9bec17447c1256b046a03dbf5cd40ced437b56 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0a9bec17447c1256b046a03dbf5cd40ced437b56 commit 0a9bec17447c1256b046a03dbf5cd40ced437b56 Author: Konstantin Belousov AuthorDate: 2024-04-12 04:23:13 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-02 23:45:40 +0000 x86/iommu/amd_reg.h: AMD IOMMU registers definitions Reviewed by: emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47255 --- sys/x86/iommu/amd_reg.h | 746 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 746 insertions(+) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h new file mode 100644 index 000000000000..33f744c65cc6 --- /dev/null +++ b/sys/x86/iommu/amd_reg.h @@ -0,0 +1,746 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __X86_IOMMU_AMD_REG_H +#define __X86_IOMMU_AMD_REG_H + +/* + * MMIO Registers. Offsets and bits definitions. + */ + +#define AMDIOMMU_DEVTAB_BASE 0x0000 +#define AMDIOMMU_CMDBUF_BASE 0x0008 +#define AMDIOMMU_EVNTLOG_BASE 0x0010 +#define AMDIOMMU_CTRL 0x0018 +#define AMDIOMMU_EXCL_BASE 0x0020 +#define AMDIOMMU_EXCL_RANGE 0x0028 +#define AMDIOMMU_EFR 0x0030 +#define AMDIOMMU_PPRLOG_BASE 0x0038 +#define AMDIOMMU_HWEV_UPPER 0x0040 +#define AMDIOMMU_HWEV_LOWER 0x0048 +#define AMDIOMMU_HWEV_STATUS 0x0050 + +#define AMDIOMMU_SMIF_0 0x0060 +#define AMDIOMMU_SMIF_1 0x0068 +#define AMDIOMMU_SMIF_2 0x0070 +#define AMDIOMMU_SMIF_3 0x0078 +#define AMDIOMMU_SMIF_4 0x0080 +#define AMDIOMMU_SMIF_5 0x0088 +#define AMDIOMMU_SMIF_6 0x0090 +#define AMDIOMMU_SMIF_7 0x0098 +#define AMDIOMMU_SMIF_8 0x00a0 +#define AMDIOMMU_SMIF_9 0x00a8 +#define AMDIOMMU_SMIF_10 0x00b0 +#define AMDIOMMU_SMIF_11 0x00b8 +#define AMDIOMMU_SMIF_12 0x00c0 +#define AMDIOMMU_SMIF_13 0x00c8 +#define AMDIOMMU_SMIF_14 0x00d0 +#define AMDIOMMU_SMIF_15 0x00d8 + +#define AMDIOMMU_VAPIC_LOG_BASE 0x00e0 +#define AMDIOMMU_VAPIC_LOG_TAIL 0x00e8 +#define AMDIOMMU_PPRLOGB_BASE 0x00f0 +#define AMDIOMMU_EVNTLOGB_BASE 0x00f0 + +#define AMDIOMMU_DEVTAB_S1_BASE 0x0100 +#define AMDIOMMU_DEVTAB_S2_BASE 0x0108 +#define AMDIOMMU_DEVTAB_S3_BASE 0x0110 +#define AMDIOMMU_DEVTAB_S4_BASE 0x0118 +#define AMDIOMMU_DEVTAB_S5_BASE 0x0120 +#define AMDIOMMU_DEVTAB_S6_BASE 0x0128 +#define AMDIOMMU_DEVTAB_S7_BASE 0x0130 + +#define AMDIOMMU_DSFX 0x0138 +#define AMDIOMMU_DSCX 0x0140 +#define AMDIOMMU_DSSX 0x0148 + +#define AMDIOMMU_MSI_VEC0 0x0150 +#define AMDIOMMU_MSI_VEC1 0x0154 +#define AMDIOMMU_MSI_CAP_H 0x0158 +#define AMDIOMMU_MSI_ADDR_LOW 0x015c +#define AMDIOMMU_MSI_ADDR_HIGH 0x0160 +#define AMDIOMMU_MSI_DATA 0x0164 +#define AMDIOMMU_MSI_MAPCAP 0x0168 + +#define AMDIOMMU_PERFOPT 0x016c + +#define AMDIOMMU_x2APIC_CTRL 0x0170 +#define AMDIOMMU_PPRI_CTRL 0x0178 +#define AMDIOMMU_GALOGI_CTRL 0x0180 + +#define AMDIOMMU_vIOMMU_STATUS 0x0190 + +#define AMDIOMMU_MARC0_BASE 0x0200 +#define AMDIOMMU_MARC0_RELOC 0x0208 +#define AMDIOMMU_MARC0_LEN 0x0210 +#define AMDIOMMU_MARC1_BASE 0x0218 +#define AMDIOMMU_MARC1_RELOC 0x0220 +#define AMDIOMMU_MARC1_LEN 0x0228 +#define AMDIOMMU_MARC2_BASE 0x0230 +#define AMDIOMMU_MARC2_RELOC 0x0238 +#define AMDIOMMU_MARC2_LEN 0x0240 +#define AMDIOMMU_MARC3_BASE 0x0248 +#define AMDIOMMU_MARC3_RELOC 0x0250 +#define AMDIOMMU_MARC3_LEN 0x0258 + +#define AMDIOMMU_EFR2 0x01a0 + +#define AMDIOMMU_CMDBUF_HEAD 0x2000 +#define AMDIOMMU_CMDBUF_TAIL 0x2008 +#define AMDIOMMU_EVNTLOG_HEAD 0x2010 +#define AMDIOMMU_EVNTLOG_TAIL 0x2018 +#define AMDIOMMU_CMDEV_STATUS 0x2020 +#define AMDIOMMU_PPRLOG_HEAD 0x2030 +#define AMDIOMMU_PPRLOG_TAIL 0x2038 +#define AMDIOMMU_vAPICLOG_HEAD 0x2040 +#define AMDIOMMU_vAPICLOG_TAIL 0x2048 +#define AMDIOMMU_PPRLOGB_HEAD 0x2050 +#define AMDIOMMU_PPRLOGB_TAIL 0x2058 +#define AMDIOMMU_EVNTLOGB_HEAD 0x2070 +#define AMDIOMMU_EVNTLOGB_TAIL 0x2078 +#define AMDIOMMU_PPRLOG_AUR 0x2080 +#define AMDIOMMU_PPRLOG_EAI 0x2088 +#define AMDIOMMU_PPRLOGB_AUR 0x2090 + +/* + * IOMMU Control Register AMDIOMMU_CTRL fields + */ +#define AMDIOMMU_CTRL_EN 0x0000000000000001ull /* IOMMU En */ +#define AMDIOMMU_CTRL_HTTUN_EN 0x0000000000000002ull /* HT Tun Trans En */ +#define AMDIOMMU_CTRL_EVNTLOG_EN 0x0000000000000004ull /* Event Log En */ +#define AMDIOMMU_CTRL_EVENTINT_EN 0x0000000000000008ull /* Event Log Intr En */ +#define AMDIOMMU_CTRL_COMWINT_EN 0x0000000000000010ull /* Compl Wait Intr En */ +#define AMDIOMMU_CTRL_INVTOUT_MASK 0x00000000000000e0ull /* IOTLB Inv Timeout*/ +#define AMDIOMMU_CTRL_INVTOUT_NO 0x0000000000000000ull +#define AMDIOMMU_CTRL_INVTOUT_1MS 0x0000000000000020ull +#define AMDIOMMU_CTRL_INVTOUT_10MS 0x0000000000000040ull +#define AMDIOMMU_CTRL_INVTOUT_100MS 0x0000000000000060ull +#define AMDIOMMU_CTRL_INVTOUT_1S 0x0000000000000080ull +#define AMDIOMMU_CTRL_INVTOUT_10S 0x00000000000000a0ull +#define AMDIOMMU_CTRL_INVTOUT_100S 0x00000000000000b0ull +#define AMDIOMMU_CTRL_INVTOUT_RSRV 0x00000000000000e0ull +#define AMDIOMMU_CTRL_PASSPW 0x0000000000000100ull /* HT Pass Posted Wr */ +#define AMDIOMMU_CTRL_REPASSPW 0x0000000000000200ull /* HT Resp Pass Posted Wr */ +#define AMDIOMMU_CTRL_COHERENT 0x0000000000000400ull /* HT Coherent Reads */ +#define AMDIOMMU_CTRL_ISOC 0x0000000000000800ull /* HT Isoc Reads */ +#define AMDIOMMU_CTRL_CMDBUF_EN 0x0000000000001000ull /* Start CMD proc En */ +#define AMDIOMMU_CTRL_PPRLOG_EN 0x0000000000002000ull /* Periph Page Req Log En */ +#define AMDIOMMU_CTRL_PPRINT_EN 0x0000000000004000ull /* Periph Page Req Intr En */ +#define AMDIOMMU_CTRL_PPR_EN 0x0000000000008000ull /* Periph Page Req En */ +#define AMDIOMMU_CTRL_GT_EN 0x0000000000010000ull /* Guest En */ +#define AMDIOMMU_CTRL_GA_EN 0x0000000000020000ull /* Guest vAPIC En */ +#define AMDIOMMU_CTRL_SMIF_EN 0x0000000000400000ull /* SMI Filter En */ +#define AMDIOMMU_CTRL_SLFWB_DIS 0x0000000000800000ull /* Self WriteBack Dis */ +#define AMDIOMMU_CTRL_SMIFLOG_EN 0x0000000001000000ull /* SMI Filter Log En */ +#define AMDIOMMU_CTRL_GAM_EN_MASK 0x000000000e000000ull /* Guest vAPIC Mode En */ +#define AMDIOMMU_CTRL_GAM_EN_vAPIC_GM0 0x0000000000000000ull /* IRTE.GM = 0 */ +#define AMDIOMMU_CTRL_GAM_EN_vAPIC_GM1 0x0000000002000000ull /* IRTE.GM = 1 */ +#define AMDIOMMU_CTRL_GALOG_EN 0x0000000010000000ull /* Guest vAPIC GA Log En */ +#define AMDIOMMU_CTRL_GAINT_EN 0x0000000020000000ull /* Guest vAPIC GA Intr En */ +#define AMDIOMMU_CTRL_DUALPPRLOG_MASK 0x00000000c0000000ull /* Dual Periph Page Req Log En */ +#define AMDIOMMU_CTRL_DUALPPRLOG_A 0x0000000000000000ull /* Use Log A */ +#define AMDIOMMU_CTRL_DUALPPRLOG_B 0x0000000040000000ull /* Use Log B */ +#define AMDIOMMU_CTRL_DUALPPRLOG_SWAP 0x0000000080000000ull /* Auto-swap on full */ +#define AMDIOMMU_CTRL_DUALPPRLOG_RSRV 0x00000000c0000000ull +#define AMDIOMMU_CTRL_DUALEVNTLOG_MASK 0x0000000300000000ull /* Dual Event Log En */ +#define AMDIOMMU_CTRL_DUALEVNTLOG_A 0x0000000000000000ull /* Use Log A Buf */ +#define AMDIOMMU_CTRL_DUALEVNTLOG_B 0x0000000100000000ull /* Use Log B Buf */ +#define AMDIOMMU_CTRL_DUALEVNTLOG_SWAP 0x0000000200000000ull /* Auto-swap on full */ +#define AMDIOMMU_CTRL_DUALEVNTLOG_RSRV 0x0000000300000000ull +#define AMDIOMMU_CTRL_DEVTABSEG_MASK 0x0000001c00000000ull /* Dev Table Segm */ +#define AMDIOMMU_CTRL_DEVTABSEG_1 0x0000000000000000ull /* 1 Segment */ +#define AMDIOMMU_CTRL_DEVTABSEG_2 0x0000000400000000ull /* 2 Segments */ +#define AMDIOMMU_CTRL_DEVTABSEG_4 0x0000000800000000ull /* 4 Segments */ +#define AMDIOMMU_CTRL_DEVTABSEG_8 0x0000000c00000000ull /* 8 Segments */ +#define AMDIOMMU_CTRL_PRIVABRT_MASK 0x0000006000000000ull /* Privilege Abort En */ +#define AMDIOMMU_CTRL_PRIVABRT_USR 0x0000000000000000ull /* Privilege Abort User */ +#define AMDIOMMU_CTRL_PRIVABRT_ALL 0x0000002000000000ull /* Privilege Abort Always */ +#define AMDIOMMU_CTRL_PPRAUTORSP_EN 0x0000008000000000ull /* PPR Auto Resp En */ +#define AMDIOMMU_CTRL_MARC_EN 0x0000010000000000ull /* Memory Addr Routing En */ +#define AMDIOMMU_CTRL_BLKSTOPMRK_EN 0x0000020000000000ull /* Block StopMark En */ +#define AMDIOMMU_CTRL_PPRAUTORESPA_EN 0x0000040000000000ull /* PPR Auto Resp Always En */ +#define AMDIOMMU_CTRL_EPH_EN 0x0000200000000000ull /* Enh PPR Handling En */ +#define AMDIOMMU_CTRL_HADUP_MASK 0x0000c00000000000ull /* Access and Dirty in host PT */ +#define AMDIOMMU_CTRL_GDUP_DIS 0x0001000000000000ull /* Dis Dirty in guest PT */ +#define AMDIOMMU_CTRL_XT_EN 0x0004000000000000ull /* x2APIC mode */ +#define AMDIOMMU_CTRL_INTCAPXT_EN 0x0008000000000000ull /* x2APIC mode for IOMMU intrs */ +#define AMDIOMMU_CTRL_vCMD_EN 0x0010000000000000ull /* vCMD buffer proc En */ +#define AMDIOMMU_CTRL_vIOMMU_EN 0x0020000000000000ull /* vIOMMU En */ +#define AMDIOMMU_CTRL_GAUP_DIS 0x0040000000000000ull /* Dis Access in guest PT */ +#define AMDIOMMU_CTRL_GAPPI_EN 0x0080000000000000ull /* Guest APIC phys proc intr En */ +#define AMDIOMMU_CTRL_TMPM_EN 0x0100000000000000ull /* Tiered Mem Page Migration En */ +#define AMDIOMMU_CTRL_GGCR3TRP_PHYS 0x0400000000000000ull /* GCR3 is GPA (otherwise SPA) */ +#define AMDIOMMU_CTRL_IRTCACHE_DIS 0x0800000000000000ull /* IRT Caching Dis */ +#define AMDIOMMU_CTRL_GSTBUFTRP_MODE 0x1000000000000000ull /* See spec */ +#define AMDIOMMU_CTRL_SNPAVIC_MASK 0xe000000000000000ull /* MBZ */ + +/* + * IOMMU Extended Feature Register AMDIOMMU_EFR fields + */ +#define AMDIOMMU_EFR_XT_SUP 0x0000000000000004ull /* x2APIC */ +#define AMDIOMMU_EFR_HWEV_SUP 0x0000000000000100ull /* HW Event regs */ +#define AMDIOMMU_EFR_PC_SUP 0x0000000000000200ull /* Perf counters */ +#define AMDIOMMU_EFR_HATS_MASK 0x0000000000000c00ull /* Host Addr Trans Size */ +#define AMDIOMMU_EFR_HATS_4LVL 0x0000000000000000ull +#define AMDIOMMU_EFR_HATS_5LVL 0x0000000000000400ull +#define AMDIOMMU_EFR_HATS_6LVL 0x0000000000000800ull +#define AMDIOMMU_EFR_DEVTBLSEG_MASK 0x000000c000000000ull /* DevTbl segmentation */ +#define AMDIOMMU_EFR_DEVTBLSEG_SHIFT 38 + +/* IOMMU Command Pointers (Head/Tail) registers fields */ +#define AMDIOMMU_CMDPTR_MASK 0x000000000007fff0ull + +/* IOMMU Command Buffer Base fields */ +#define AMDIOMMU_CMDBUF_BASE_SZSHIFT 56 /* Shift for size */ +#define AMDIOMMU_CMDBUF_MAX (512 * 1024) + +/* IOMMU Event Log Base register fields */ +#define AMDIOMMU_EVNTLOG_BASE_SZSHIFT 56 /* Shift for size */ +#define AMDIOMMU_EVNTLOG_MIN 256 +#define AMDIOMMU_EVNTLOG_MAX 32768 + +/* IOMMU Hardware Event Status register fields */ +#define AMDIOMMU_HWEVS_HEV 0x00000001 /* HW Ev Valid */ +#define AMDIOMMU_HWEVS_HEO 0x00000002 /* HW Ev Overfl */ + +/* + * IOMMU Command and Event Status register fields. + * From the spec, all defined bits are either RO or RW1C. As a consequence, + * single bit can be safely written to the register to clean a specific + * condition. + */ +#define AMDIOMMU_CMDEVS_EVOVRFLW 0x00000001 +#define AMDIOMMU_CMDEVS_EVLOGINT 0x00000002 +#define AMDIOMMU_CMDEVS_COMWAITINT 0x00000004 +#define AMDIOMMU_CMDEVS_EVLOGRUN 0x00000008 +#define AMDIOMMU_CMDEVS_CMDBUFRUN 0x00000010 +#define AMDIOMMU_CMDEVS_PPROVRFLW 0x00000020 +#define AMDIOMMU_CMDEVS_PPRINT 0x00000040 +#define AMDIOMMU_CMDEVS_PPRLOGRUN 0x00000080 +#define AMDIOMMU_CMDEVS_GALOGRUN 0x00000100 +#define AMDIOMMU_CMDEVS_GALOVRFLW 0x00000200 +#define AMDIOMMU_CMDEVS_GAINT 0x00000400 +#define AMDIOMMU_CMDEVS_PPROVRFLWB 0x00000800 +#define AMDIOMMU_CMDEVS_PPRLOGACTIVE 0x00001000 +#define AMDIOMMU_CMDEVS_RESV1 0x00002000 +#define AMDIOMMU_CMDEVS_RESV2 0x00004000 +#define AMDIOMMU_CMDEVS_EVOVRFLWB 0x00008000 +#define AMDIOMMU_CMDEVS_EVLOGACTIVE 0x00010000 +#define AMDIOMMU_CMDEVS_PPROVRFLWEB 0x00020000 +#define AMDIOMMU_CMDEVS_PPROVRFLWE 0x00040000 + +/* + * Device Table Entry (DTE) + */ +struct amdiommu_dte { + u_int v:1; /* Valid */ + u_int tv:1; /* Translation Valid */ + u_int rsrv0:5; + u_int had:2; /* Host Access Dirty */ + u_int pgmode:3; /* Paging Mode */ + uint64_t ptroot:40; /* Page Table Root */ + u_int ppr:1; /* PPR En */ + u_int gprp:1; /* Guest PPR Resp with PASID */ + u_int giov:1; /* Guest IO Prot Valid */ + u_int gv:1; /* Guest Translation Valid */ + u_int glx:2; /* Guest Levels Translated */ + u_int gcr3root0:3; /* GCR3 root pointer part */ + u_int ir:1; /* Read Perm */ + u_int iw:1; /* Write Perm */ + u_int rsrv1:1; + u_int domainid:16; /* domain tag */ + u_int gcr3root1:16; /* GCR3 root pointer part */ + u_int i:1; /* IOTLB En */ + u_int se:1; /* Suppress IO Fault Events */ + u_int sa:1; /* Suppress All IO Fault Events */ + u_int pioctl:2; /* Port IO Control */ + u_int cache:1; /* IOTLB Cache Hint */ + u_int sd:1; /* Snoop Disable */ + u_int ex:1; /* Allow Exclusion */ + u_int sysmgt:2; /* System Management Msg Handling */ + u_int sats:1; /* Secure/Non-secure ATS */ + u_int gcr3root2:21; /* GCR3 root pointer part */ + u_int iv:1; /* Intr Map Valid */ + u_int inttablen:4; /* log2 Intr Table Len */ + u_int ig:1; /* Ignore Unmapped Interrupts */ + uint64_t intrroot:46; /* Interrupt Table Root (-low 6bits) */ + u_int rsrv2:2; + u_int gpm:2; /* Guest Paging Mode */ + u_int initpass:1; /* INIT pass-through */ + u_int eintpass:1; /* ExtInt pass-through */ + u_int nmipass:1; /* NMI pass-through */ + u_int hptmode:1; /* Host Page Table Mode Hint */ + u_int intctl:2; /* Interrupt Control */ + u_int lint0pass:1; /* LINT0 pass-through */ + u_int lint1pass:1; /* LINT1 pass-through */ + u_int rsrv3:15; + u_int vimu:1; /* Virtualize IOMMU En */ + u_int gdevid:16; /* Guest Dev Id */ + u_int gid:16; /* Guest Id */ + u_int rsrv4:5; + u_int rsrv5:1; /* Not Checked, sw avail */ + u_int attrv:1; /* Attr Override Valid */ + u_int mode0fc:1; /* Replace for PTE.FC */ + u_int snoopattr:8; /* GuestPTE.PAT -> ATS.N xlat */ +} __packed; +_Static_assert(sizeof(struct amdiommu_dte) == 8 * sizeof(uint32_t), "DTE"); + +#define AMDIOMMU_DTE_HAD_NAND 0x0 /* No Access, No Dirty */ +#define AMDIOMMU_DTE_HAD_AND 0x1 /* Access, No Dirty */ +#define AMDIOMMU_DTE_HAD_RSRV 0x2 +#define AMDIOMMU_DTE_HAD_AD 0x3 /* Access, Dirty */ + +#define AMDIOMMU_DTE_PGMODE_1T1 0x0 /* SPA = GPA */ +#define AMDIOMMU_DTE_PGMODE_1LV 0x1 /* 1 Level PT */ +#define AMDIOMMU_DTE_PGMODE_2LV 0x2 /* 2 Level PT */ +#define AMDIOMMU_DTE_PGMODE_3LV 0x3 /* 3 Level PT */ +#define AMDIOMMU_DTE_PGMODE_4LV 0x4 /* 4 Level PT */ +#define AMDIOMMU_DTE_PGMODE_5LV 0x5 /* 5 Level PT */ +#define AMDIOMMU_DTE_PGMODE_6LV 0x6 /* 6 Level PT */ +#define AMDIOMMU_DTE_PGMODE_RSRV 0x7 + +#define AMDIOMMU_DTE_GLX_1LV 0x0 /* 1 Level GCR3 */ +#define AMDIOMMU_DTE_GLX_2LV 0x1 /* 2 Level GCR3 */ +#define AMDIOMMU_DTE_GLX_3LV 0x2 /* 3 Level GCR3 */ +#define AMDIOMMU_DTE_GLX_RSRV 0x3 + +#define AMDIOMMU_DTE_PIOCTL_DIS 0x0 +#define AMDIOMMU_DTE_PIOCTL_EN 0x1 +#define AMDIOMMU_DTE_PIOCTL_MAP 0x2 +#define AMDIOMMU_DTE_PIOCTL_RSRV 0x3 + +#define AMDIOMMU_DTE_SYSMGT_DIS 0x0 /* Target Abort */ +#define AMDIOMMU_DTE_SYSMGT_FW 0x0 /* Forwarded All */ +#define AMDIOMMU_DTE_SYSMGT_FWI 0x0 /* Forwarded INT */ +#define AMDIOMMU_DTE_SYSMGT_T 0x0 /* Translated */ + +#define AMDIOMMU_DTE_GPM_4LV 0x0 /* 4 Level */ +#define AMDIOMMU_DTE_GPM_5LV 0x1 /* 4 Level */ +#define AMDIOMMU_DTE_GPM_RSRV1 0x2 +#define AMDIOMMU_DTE_GPM_RSRV2 0x3 + +#define AMDIOMMU_DTE_INTCTL_DIS 0x0 /* Target Abort */ +#define AMDIOMMU_DTE_INTCTL_FW 0x1 /* Forward Unmapped */ +#define AMDIOMMU_DTE_INTCTL_MAP 0x2 /* Forward Remapped */ +#define AMDIOMMU_DTE_INTCTL_RSRV 0x3 + +#define AMDIOMMU_PGTBL_MAXLVL 6 + +/* + * Page Table Entry (PTE/PDE) + */ +#define AMDIOMMU_PTE_PR 0x0001 /* Present, AKA V */ +#define AMDIOMMU_IGN1 0x0002 +#define AMDIOMMU_IGN2 0x0004 +#define AMDIOMMU_IGN3 0x0008 +#define AMDIOMMU_IGN4 0x0010 +#define AMDIOMMU_PTE_A 0x0020 /* Accessed */ +#define AMDIOMMU_PTE_D 0x0040 /* Dirty */ +#define AMDIOMMU_IGN5 0x0080 +#define AMDIOMMU_IGN6 0x0100 +#define AMDIOMMU_PTE_NLVL_MASK 0x0e00 /* Next Level */ +#define AMDIOMMU_PTE_NLVL_SHIFT 9 +#define AMDIOMMU_PTE_NLVL_7h 0x0e00 /* Magic Next Level */ +#define AMDIOMMU_PTE_PA_MASK 0x000ffffffffff000ull +#define AMDIOMMU_PTE_PA_SHIFT 12 +#define AMDIOMMU_PTE_PMC_MASK 0x0600000000000000ull /* Page Migr */ +#define AMDIOMMU_PTE_U 0x0800000000000000ull /* ATS.U */ +#define AMDIOMMU_PTE_FC 0x1000000000000000ull /* Force Coh */ +#define AMDIOMMU_PTE_IR 0x2000000000000000ull /* Read Perm */ +#define AMDIOMMU_PTE_IW 0x4000000000000000ull /* Write Perm */ +#define AMDIOMMU_PTE_IGN7 0x8000000000000000ull + +/* + * IRTEs + */ + +/* vAPIC is not enabled, guestmode = 0 */ +struct amdiommu_irte_basic_novapic { + u_int remapen:1; /* 0 - Target Abort */ + u_int supiopf:1; /* Supress IO_PAGE_FAULT events */ + u_int inttype:3; + u_int rqeoi:1; /* Request EOI */ + u_int dm:1; /* Dest Mode */ + u_int guestmode:1; /* MBZ */ + u_int dest:8; /* Destination APIC */ + u_int vector:8; + u_int rsrv:8; +} __packed; +_Static_assert(sizeof(struct amdiommu_irte_basic_novapic) == + 1 * sizeof(uint32_t), "IRTE 1"); + +/* vAPIC is enabled, guestmode = 0 */ +struct amdiommu_irte_basic_vapic { + u_int remapen:1; /* 0 - Target Abort */ + u_int supiopf:1; /* Supress IO_PAGE_FAULT events */ + u_int inttype:3; + u_int rqeoi:1; /* Request EOI */ + u_int dm:1; /* Dest Mode */ + u_int guestmode:1; /* MBZ */ + u_int dest:8; /* Destination APIC */ + u_int rsrv0:16; + u_int rsrv1:32; + u_int vector:8; + u_int rsrv2:24; + u_int rsrv3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_irte_basic_vapic) == + 4 * sizeof(uint32_t), "IRTE 2"); + +/* vAPIC is enabled, guestmode = 1 */ +struct amdiommu_irte_guest_vapic { + u_int remapen:1; /* 0 - Target Abort */ + u_int supiopf:1; /* Supress IO_PAGE_FAULT events */ + u_int galogintr:1; + u_int rsrv0:2; + u_int gappidis:1; /* supress GAPPI */ + u_int isrun:1; /* Guest Running hint */ + u_int guestmode:1; /* MB1 */ + u_int dest:8; /* Destination APIC for dorbell */ + u_int rsrv1:16; + u_int gatag:32; + u_int vector:8; + u_int rsrv2:4; + uint64_t vapicrp:40; /* 51:12 bits of SPA for APIC backing page */ + u_int rsrv3:12; +} __packed; +_Static_assert(sizeof(struct amdiommu_irte_guest_vapic) == + 4 * sizeof(uint32_t), "IRTE 3"); + +/* vAPIC is enabled, guestmode = 0, x2APIC */ +struct amdiommu_irte_basic_vapic_x2 { + u_int remapen:1; /* 0 - Target Abort */ + u_int supiopf:1; /* Supress IO_PAGE_FAULT events */ + u_int inttype:3; + u_int rqeoi:1; /* Request EOI */ + u_int dm:1; /* Dest Mode */ + u_int guestmode:1; /* MBZ */ + u_int dest0:24; /* Destination APIC 23:0 */ + u_int rsrv0:32; + u_int vector:8; + u_int rsrv1:24; + u_int rsrv2:24; + u_int dest1:8; /* Destination APIC 31:24 */ +} __packed; +_Static_assert(sizeof(struct amdiommu_irte_basic_vapic_x2) == + 4 * sizeof(uint32_t), "IRTE 4"); + +/* vAPIC is enabled, guestmode = 1, x2APIC */ +struct amdiommu_irte_guest_vapic_x2 { + u_int remapen:1; /* 0 - Target Abort */ + u_int supiopf:1; /* Supress IO_PAGE_FAULT events */ + u_int galogintr:1; + u_int rsrv0:2; + u_int gappidis:1; /* supress GAPPI */ + u_int isrun:1; /* Guest Running hint */ + u_int guestmode:1; /* MB1 */ + u_int dest0:24; /* Destination APIC for dorbell 23:0 */ + u_int gatag:32; + u_int vector:8; + u_int rsrv2:4; + uint64_t vapicrp:40; /* 51:12 bits of SPA for APIC backing page */ + u_int rsrv3:4; + u_int dest1:8; /* Destination APIC 31:24 */ +} __packed; +_Static_assert(sizeof(struct amdiommu_irte_guest_vapic_x2) == + 4 * sizeof(uint32_t), "IRTE 5"); + +#define AMDIOMMU_IRTE_INTTYPE_FIXED 0 +#define AMDIOMMU_IRTE_INTTYPE_ARBITR 1 + +#define AMDIOMMU_IRTE_DM_LOGICAL 1 +#define AMDIOMMU_IRTE_DM_PHYSICAL 1 + +/* + * Commands + */ + +struct amdiommu_cmd_generic { + u_int w0:32; + union { + u_int ww1:32; + struct { + u_int w1:28; + u_int op:4; + }; + }; + u_int w2:32; + u_int w3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_generic) == + 4 * sizeof(uint32_t), "CMD_GENERIC"); + +#define AMDIOMMU_CMD_SZ_SHIFT 4 /* Shift for cmd count + to ring offset */ +#define AMDIOMMU_CMD_SZ sizeof(struct amdiommu_cmd_generic) + /* Command size */ +_Static_assert((1 << AMDIOMMU_CMD_SZ_SHIFT) == AMDIOMMU_CMD_SZ, + "CMD size shift"); + +struct amdiommu_cmd_completion_wait { + u_int s:1; + u_int i:1; + u_int f:1; + u_int address0:29; /* Store Address 31:3 */ + u_int address1:20; /* Store Address 51:32 */ + u_int rsrv:8; + u_int op:4; + u_int data0:32; + u_int data1:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_completion_wait) == + 4 * sizeof(uint32_t), "CMD_COMPLETION_WAIT"); + +struct amdiommu_cmd_invalidate_devtab_entry { + u_int devid:16; + u_int rsrv0:16; + u_int rsrv1:28; + u_int op:4; + u_int rsrv2:32; + u_int rsrv3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_invalidate_devtab_entry) == + 4 * sizeof(uint32_t), "CMD_INVALIDATE_DEVTAB_ENTRY"); + +struct amdiommu_cmd_invalidate_iommu_pages { + u_int pasid:20; + u_int rsrv0:12; + u_int domainid:16; + u_int rsrv1:12; + u_int op:4; + u_int s:1; + u_int pde:1; + u_int gn:1; + u_int rsrv2:9; + uint64_t address:52; /* Address 63:12 */ +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_invalidate_iommu_pages) == + 4 * sizeof(uint32_t), "CMD_INVALIDATE_IOMMU_PAGES"); + +struct amdiommu_cmd_invalidate_iotlb_pages { + u_int devid:16; + u_int pasid1:8; + u_int maxpend0:8; + u_int queueid:16; + u_int pasid0:8; + u_int pasid2:4; + u_int op:4; + u_int s:1; + u_int rsrv0:1; + u_int gn:1; + u_int rsrv1:1; + u_int type:2; + u_int rsrv2:6; + uint64_t address:52; /* Address 63:12 */ +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_invalidate_iotlb_pages) == + 4 * sizeof(uint32_t), "CMD_INVALIDATE_IOTLB_PAGES"); + +struct amdiommu_cmd_invalidate_interrupt_table { + u_int devid:16; + u_int rsrv0:16; + u_int rsrv1:28; + u_int op:4; + u_int rsrv2:32; + u_int rsrv3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_invalidate_interrupt_table) == + 4 * sizeof(uint32_t), "CMD_INVALIDATE_INTERRUPT_TABLE"); + +struct amdiommu_cmd_prefetch_iommu_pages { + u_int devid:16; + u_int rsrv0:8; + u_int pfcount:8; + u_int pasid:20; + u_int rsrv1:8; + u_int op:4; + u_int s:1; + u_int rsrv2:1; + u_int gn:1; + u_int rsrv3:1; + u_int inval:1; /* Invalidate First */ + u_int rsrv4:7; + uint64_t address:52; /* Address 63:12 */ +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_prefetch_iommu_pages) == + 4 * sizeof(uint32_t), "CMD_PREFETCH_IOMMU_PAGES"); + +struct amdiommu_cmd_complete_ppr_request { + u_int devid:16; + u_int rsrv0:16; + u_int pasid:20; + u_int rsrv1:8; + u_int op:4; + u_int rsrv2:2; + u_int gn:1; + u_int rsrv3:29; + u_int compltag:16; + u_int rsrv4:16; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_complete_ppr_request) == + 4 * sizeof(uint32_t), "CMD_COMPLETE_PPR_REQUEST"); + +struct amdiommu_cmd_invalidate_iommu_all { + u_int rsrv0:32; + u_int op:4; + u_int rsrv1:28; + u_int rsrv2:32; + u_int rsrv3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_invalidate_iommu_all) == + 4 * sizeof(uint32_t), "CMD_INVALIDATE_IOMMU_ALL"); + +struct amdiommu_cmd_insert_guest_event { + u_int rsrv0:32; + u_int guestid:16; + u_int rsrv1:12; + u_int op:4; + u_int rsrv2:32; + u_int rsrv3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_insert_guest_event) == + 4 * sizeof(uint32_t), "CMD_INSERT_GUEST_EVENT"); + +struct amdiommu_cmd_reset_vmmio { + u_int guestid:16; + u_int rsrv0:11; + u_int all:1; + u_int rsrv1:3; + u_int vcmd:1; + u_int rsrv2:27; + u_int op:4; + u_int rsrv3:32; + u_int rsrv4:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_cmd_reset_vmmio) == + 4 * sizeof(uint32_t), "CMD_RESET_VMMIO"); + +#define AMDIOMMU_CMD_COMPLETION_WAIT 0x1 +#define AMDIOMMU_CMD_INVALIDATE_DEVTAB_ENTRY 0x2 +#define AMDIOMMU_CMD_INVALIDATE_IOMMU_PAGES 0x3 +#define AMDIOMMU_CMD_INVALIDATE_IOTLB_PAGES 0x4 +#define AMDIOMMU_CMD_INVALIDATE_INTERRUPT_TABLE 0x5 +#define AMDIOMMU_CMD_PREFETCH_IOMMU_PAGES 0x6 +#define AMDIOMMU_CMD_COMPLETE_PPR_REQUEST 0x7 +#define AMDIOMMU_CMD_INVALIDATE_IOMMU_ALL 0x8 +#define AMDIOMMU_CMD_INSERT_GUEST_EVENT 0x9 +#define AMDIOMMU_CMD_RESET_VMMIO 0xa + +/* + * Logging + */ +struct amdiommu_event_generic { + u_int w0:32; + union { + u_int ww1:32; + struct { + u_int w1:28; + u_int code:4; + }; + }; + u_int w2:32; + u_int w3:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_event_generic) == + 4 * sizeof(uint32_t), "EVENT_GENERIC"); + +#define AMDIOMMU_EV_SZ_SHIFT 4 /* Shift for event count + to ring offset */ +#define AMDIOMMU_EV_SZ sizeof(struct amdiommu_event_generic) + /* Event size */ +_Static_assert((1 << AMDIOMMU_EV_SZ_SHIFT) == AMDIOMMU_EV_SZ, + "Event size shift"); + +struct amdiommu_event_ill_dev_table_entry { + u_int devid:16; + u_int pasid1:4; + u_int rsrv0:7; + u_int vnr:1; + u_int rsrv1:1; + u_int vevent:1; + u_int vptr:1; + u_int vcmd:1; + u_int pasid:16; + u_int gn:1; + u_int rsrv2:2; + u_int i:1; + u_int rsrv3:1; + u_int rw:1; + u_int rsrv4:1; + u_int rz:1; + u_int tr:1; + u_int rsrv5:3; + u_int code:4; + u_int rsrv6:2; + u_int addr1:30; + u_int addr2:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_event_ill_dev_table_entry) == + 4 * sizeof(uint32_t), "EVENT_ILLEGAL_DEV_TABLE_ENTRY"); + +struct amdiommu_event_io_page_fault_entry { + u_int devid:16; + u_int pasid1:4; + u_int rsrv0:7; + u_int vnr:1; + u_int rsrv1:1; + u_int vevent:1; + u_int vptr:1; + u_int vcmd:1; + u_int pasid:16; /* also domain id */ + u_int gn:1; + u_int nx:1; + u_int us:1; + u_int i:1; + u_int pr:1; + u_int rw:1; + u_int pe:1; + u_int rz:1; + u_int tr:1; + u_int rsrv2:3; + u_int code:4; + u_int addr1:32; + u_int addr2:32; +} __packed; +_Static_assert(sizeof(struct amdiommu_event_io_page_fault_entry) == + 4 * sizeof(uint32_t), "EVENT_IO_PAGE_FAULT_ENTRY"); + +#define AMDIOMMU_EV_ILL_DEV_TABLE_ENTRY 0x1 +#define AMDIOMMU_EV_IO_PAGE_FAULT 0x2 +#define AMDIOMMU_EV_DEV_TAB_HW_ERROR 0x3 +#define AMDIOMMU_EV_PAGE_TAB_HW_ERROR 0x4 +#define AMDIOMMU_EV_ILL_CMD_ERROR 0x5 +#define AMDIOMMU_EV_CMD_HW_ERROR 0x6 +#define AMDIOMMU_EV_IOTLB_INV_TIMEOUT 0x7 +#define AMDIOMMU_EV_INVALID_DEV_REQ 0x8 +#define AMDIOMMU_EV_INVALID_PPR_REQ 0x9 +#define AMDIOMMU_EV_COUNTER_ZERO 0xa /* Typo in table 42? */ + +#endif /* __X86_IOMMU_AMD_REG_H */ From nobody Sat Nov 2 23:46:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XgvX02W8Zz5cyXh; Sat, 02 Nov 2024 23:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XgvX0188xz4Ssx; Sat, 2 Nov 2024 23:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730591200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNtsJHWe9EPoyfu0DoEALveo1KrQKj2twm1/9djZZeY=; b=rEqJDUeGppkTQcQgjUXrdo9tNz+6N0japVf4ULjk+saPUFHGgHLmQlrJqSZg+B00lDLYQe nOrJOGwwgXX/BWPNuLsMqH8celX5pXj6dHE8Ggq8vbn6Q4/z3snkKRK3k+cpPBXnN8tGGb DITeehfRS8CBuarH7rxMF1oeKoRQ+TQGdl2SyKQWrbEVLAZ1Bt0SOVA7TYNQq2hF97kaCZ qqkS8CaRiYM2uM6VM0WELwGyzDPsyDD2+C4edrtJdWmds0gee2ARNjGFYAbUs5yGoGbqpp +u1jRsWNroM9GwZEWDNcuqmLBfgwzX/fQdnuHT8/RaRIrKL0hkOTNABwfdaplg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730591200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oNtsJHWe9EPoyfu0DoEALveo1KrQKj2twm1/9djZZeY=; b=YCa+bHpBNI15MagFVLiSI3v1USe8E28tBs8vQ7rM+kYhg0zsxwSIdKIYrqbsIoG04yV8C5 I/zxby4pTQU0UNDKdW/mZn9ByFQ5+wtG3HV0DRRosNtSO13R0Vr0Gu4lEN1EaCie7Ks4C8 gdQzdScgRMk8A98Hd35Ol/ZHt0yyeAweUMC2p4ZlsYYC96VbmFyjbYkc0BudrZBawrM8ta a4PbSh/679jGCr+56jXY8germ7hMQ9LiIigLIsQDBqQwqlZT9v4C8go/lrihgwdUlRr6lN tJcHauIJHloWXjJZuATTN+BqamVc5LGrPnWXHEBLqIUq55kRAq5RM1n1r9DrFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730591200; a=rsa-sha256; cv=none; b=rwu8tjMYZSUZ4Bd+MkJu03PFNKYnij4FwrBHuMtbikcODDz79FxgXIW0oAzudrU2Uzqia5 m0Ew8S9/wMDCt0HPi5UWoXoXjeWQXgK9xJfnxLltwa9X6vzzRW9We3F1nnoNZeYT5H8ByX Qh1sX4wP+YkuwqU+b5TkIahSs3oGeHD/ahzvaR+gEZXgl6WroJdCXEgyZ/cQEacaslw9dZ hA4aPLgAnfmMoE8p+25fwHJq9CMGLaQMujuAIFYMRgxENz6D39LfWrz5w07AHK9QPXb7kY jr0S9M2JcrvyCZCzrT18uoRe891D/T4OKM9dSkhiwOJ9rDxxiG4EdDAzaO7YKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XgvX00lX2zQ8S; Sat, 2 Nov 2024 23:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A2NkecM097609; Sat, 2 Nov 2024 23:46:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2NkeBT097606; Sat, 2 Nov 2024 23:46:40 GMT (envelope-from git) Date: Sat, 2 Nov 2024 23:46:40 GMT Message-Id: <202411022346.4A2NkeBT097606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0f5116d7efe3 - main - AMD IOMMU driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f5116d7efe33c81f0b24b56eec78af37898f500 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0f5116d7efe33c81f0b24b56eec78af37898f500 commit 0f5116d7efe33c81f0b24b56eec78af37898f500 Author: Konstantin Belousov AuthorDate: 2024-05-12 10:20:11 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-02 23:45:40 +0000 AMD IOMMU driver This driver is functionally equivalent to the in-tree Intel DMAR code. It handles busdma and interrupt remapping from the host OS. There is no integration with bhyve, and the stub iommu drivers in bhyve code cannot coexist with this driver (planned). The biggest architectural problem with the code is that the AMD IOMMU units are enumerated as PCIe-attached security devices, which is much later after HPET and IOAPIC drivers attached and actived interrupts. Because of this, HPET FSB interrupts and IOAPIC interrupts are always identity-mapped. The code is of late alpha quality. By default the driver is disabled. To enable for testing, set in loader.conf: hw.amdiommu.enable=1 hw.iommu.dma=1 <- to enable iommu busdma hw.iommu.ir=1 <- to enable interrupt remapping Discussed with: emaste Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47256 --- sys/conf/files.x86 | 6 + sys/x86/iommu/amd_cmd.c | 360 +++++++++++++ sys/x86/iommu/amd_ctx.c | 639 +++++++++++++++++++++++ sys/x86/iommu/amd_drv.c | 1205 +++++++++++++++++++++++++++++++++++++++++++ sys/x86/iommu/amd_event.c | 323 ++++++++++++ sys/x86/iommu/amd_idpgtbl.c | 396 ++++++++++++++ sys/x86/iommu/amd_intrmap.c | 391 ++++++++++++++ sys/x86/iommu/amd_iommu.h | 243 +++++++++ 8 files changed, 3563 insertions(+) diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index 7c05544f03da..df206b314b38 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -344,6 +344,12 @@ x86/cpufreq/hwpstate_amd.c optional cpufreq x86/cpufreq/hwpstate_intel.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq +x86/iommu/amd_cmd.c optional acpi iommu pci +x86/iommu/amd_ctx.c optional acpi iommu pci +x86/iommu/amd_drv.c optional acpi iommu pci +x86/iommu/amd_event.c optional acpi iommu pci +x86/iommu/amd_idpgtbl.c optional acpi iommu pci +x86/iommu/amd_intrmap.c optional acpi iommu pci x86/iommu/intel_ctx.c optional acpi iommu pci x86/iommu/intel_drv.c optional acpi iommu pci x86/iommu/intel_fault.c optional acpi iommu pci diff --git a/sys/x86/iommu/amd_cmd.c b/sys/x86/iommu/amd_cmd.c new file mode 100644 index 000000000000..bbc2a8e0ad9f --- /dev/null +++ b/sys/x86/iommu/amd_cmd.c @@ -0,0 +1,360 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void +amdiommu_enable_cmdbuf(struct amdiommu_unit *unit) +{ + AMDIOMMU_ASSERT_LOCKED(unit); + + unit->hw_ctrl |= AMDIOMMU_CTRL_CMDBUF_EN; + amdiommu_write8(unit, AMDIOMMU_CTRL, unit->hw_ctrl); +} + +static void +amdiommu_disable_cmdbuf(struct amdiommu_unit *unit) +{ + AMDIOMMU_ASSERT_LOCKED(unit); + + unit->hw_ctrl &= ~AMDIOMMU_CTRL_CMDBUF_EN; + amdiommu_write8(unit, AMDIOMMU_CTRL, unit->hw_ctrl); +} + + +static void +amdiommu_enable_qi_intr(struct iommu_unit *iommu) +{ + struct amdiommu_unit *unit; + + unit = IOMMU2AMD(iommu); + AMDIOMMU_ASSERT_LOCKED(unit); + unit->hw_ctrl |= AMDIOMMU_CTRL_COMWINT_EN; + amdiommu_write8(unit, AMDIOMMU_CTRL, unit->hw_ctrl); + amdiommu_write8(unit, AMDIOMMU_CMDEV_STATUS, + AMDIOMMU_CMDEVS_COMWAITINT); +} + +static void +amdiommu_disable_qi_intr(struct iommu_unit *iommu) +{ + struct amdiommu_unit *unit; + + unit = IOMMU2AMD(iommu); + AMDIOMMU_ASSERT_LOCKED(unit); + unit->hw_ctrl &= ~AMDIOMMU_CTRL_COMWINT_EN; + amdiommu_write8(unit, AMDIOMMU_CTRL, unit->hw_ctrl); +} + +static void +amdiommu_cmd_advance_tail(struct iommu_unit *iommu) +{ + struct amdiommu_unit *unit; + + unit = IOMMU2AMD(iommu); + AMDIOMMU_ASSERT_LOCKED(unit); + amdiommu_write8(unit, AMDIOMMU_CMDBUF_TAIL, unit->x86c.inv_queue_tail); +} + +static void +amdiommu_cmd_ensure(struct iommu_unit *iommu, int descr_count) +{ + struct amdiommu_unit *unit; + uint64_t head; + int bytes; + + unit = IOMMU2AMD(iommu); + AMDIOMMU_ASSERT_LOCKED(unit); + bytes = descr_count << AMDIOMMU_CMD_SZ_SHIFT; + for (;;) { + if (bytes <= unit->x86c.inv_queue_avail) + break; + /* refill */ + head = amdiommu_read8(unit, AMDIOMMU_CMDBUF_HEAD); + head &= AMDIOMMU_CMDPTR_MASK; + unit->x86c.inv_queue_avail = head - unit->x86c.inv_queue_tail - + AMDIOMMU_CMD_SZ; + if (head <= unit->x86c.inv_queue_tail) + unit->x86c.inv_queue_avail += unit->x86c.inv_queue_size; + if (bytes <= unit->x86c.inv_queue_avail) + break; + + /* + * No space in the queue, do busy wait. Hardware must + * make a progress. But first advance the tail to + * inform the descriptor streamer about entries we + * might have already filled, otherwise they could + * clog the whole queue.. + * + * See dmar_qi_invalidate_locked() for a discussion + * about data race prevention. + */ + amdiommu_cmd_advance_tail(iommu); + unit->x86c.inv_queue_full++; + cpu_spinwait(); + } + unit->x86c.inv_queue_avail -= bytes; +} + +static void +amdiommu_cmd_emit(struct amdiommu_unit *unit, const struct + amdiommu_cmd_generic *cmd) +{ + AMDIOMMU_ASSERT_LOCKED(unit); + + memcpy(unit->x86c.inv_queue + unit->x86c.inv_queue_tail, cmd, + sizeof(*cmd)); + unit->x86c.inv_queue_tail += AMDIOMMU_CMD_SZ; + KASSERT(unit->x86c.inv_queue_tail <= unit->x86c.inv_queue_size, + ("tail overflow 0x%x 0x%jx", unit->x86c.inv_queue_tail, + (uintmax_t)unit->x86c.inv_queue_size)); + unit->x86c.inv_queue_tail &= unit->x86c.inv_queue_size - 1; +} + +static void +amdiommu_cmd_emit_wait_descr(struct iommu_unit *iommu, uint32_t seq, + bool intr, bool memw, bool fence) +{ + struct amdiommu_unit *unit; + struct amdiommu_cmd_completion_wait c; + + unit = IOMMU2AMD(iommu); + AMDIOMMU_ASSERT_LOCKED(unit); + + bzero(&c, sizeof(c)); + c.op = AMDIOMMU_CMD_COMPLETION_WAIT; + if (memw) { + uint32_t x; + + c.s = 1; + x = unit->x86c.inv_waitd_seq_hw_phys; + x >>= 3; + c.address0 = x; + x = unit->x86c.inv_waitd_seq_hw_phys >> 32; + c.address1 = x; + c.data0 = seq; + } + if (fence) + c.f = 1; + if (intr) + c.i = 1; + amdiommu_cmd_emit(unit, (struct amdiommu_cmd_generic *)&c); +} + +static void +amdiommu_qi_invalidate_emit(struct iommu_domain *adomain, iommu_gaddr_t base, + iommu_gaddr_t size, struct iommu_qi_genseq *pseq, bool emit_wait) +{ + struct amdiommu_domain *domain; + struct amdiommu_unit *unit; + struct amdiommu_cmd_invalidate_iommu_pages c; + u_int isize; + + domain = IODOM2DOM(adomain); + unit = domain->unit; + AMDIOMMU_ASSERT_LOCKED(unit); + bzero(&c, sizeof(c)); + c.op = AMDIOMMU_CMD_INVALIDATE_IOMMU_PAGES; + c.domainid = domain->domain; + isize = IOMMU_PAGE_SIZE; /* XXXKIB handle superpages */ + + for (; size > 0; base += isize, size -= isize) { + amdiommu_cmd_ensure(AMD2IOMMU(unit), 1); + c.s = 0; + c.pde = 1; + c.address = base >> IOMMU_PAGE_SHIFT; + amdiommu_cmd_emit(unit, (struct amdiommu_cmd_generic *)&c); + } + iommu_qi_emit_wait_seq(AMD2IOMMU(unit), pseq, emit_wait); +} + +void +amdiommu_qi_invalidate_all_pages_locked_nowait(struct amdiommu_domain *domain) +{ + struct amdiommu_unit *unit; + struct amdiommu_cmd_invalidate_iommu_pages c; + + unit = domain->unit; + AMDIOMMU_ASSERT_LOCKED(unit); + bzero(&c, sizeof(c)); + c.op = AMDIOMMU_CMD_INVALIDATE_IOMMU_PAGES; + c.domainid = domain->domain; + + /* + * The magic specified in the note for INVALIDATE_IOMMU_PAGES + * description. + */ + c.s = 1; + c.pde = 1; + c.address = 0x7ffffffffffff; + + amdiommu_cmd_ensure(AMD2IOMMU(unit), 1); + amdiommu_cmd_emit(unit, (struct amdiommu_cmd_generic *)&c); +} + +void +amdiommu_qi_invalidate_wait_sync(struct iommu_unit *iommu) +{ + struct iommu_qi_genseq gseq; + + amdiommu_cmd_ensure(iommu, 1); + iommu_qi_emit_wait_seq(iommu, &gseq, true); + IOMMU2AMD(iommu)->x86c.inv_seq_waiters++; + amdiommu_cmd_advance_tail(iommu); + iommu_qi_wait_for_seq(iommu, &gseq, true); +} + +void +amdiommu_qi_invalidate_ctx_locked_nowait(struct amdiommu_ctx *ctx) +{ + struct amdiommu_cmd_invalidate_devtab_entry c; + + amdiommu_cmd_ensure(AMD2IOMMU(CTX2AMD(ctx)), 1); + bzero(&c, sizeof(c)); + c.op = AMDIOMMU_CMD_INVALIDATE_DEVTAB_ENTRY; + c.devid = ctx->context.rid; + amdiommu_cmd_emit(CTX2AMD(ctx), (struct amdiommu_cmd_generic *)&c); +} + + +void +amdiommu_qi_invalidate_ctx_locked(struct amdiommu_ctx *ctx) +{ + amdiommu_qi_invalidate_ctx_locked_nowait(ctx); + amdiommu_qi_invalidate_wait_sync(AMD2IOMMU(CTX2AMD(ctx))); +} + +void +amdiommu_qi_invalidate_ir_locked_nowait(struct amdiommu_unit *unit, + uint16_t devid) +{ + struct amdiommu_cmd_invalidate_interrupt_table c; + + AMDIOMMU_ASSERT_LOCKED(unit); + + amdiommu_cmd_ensure(AMD2IOMMU(unit), 1); + bzero(&c, sizeof(c)); + c.op = AMDIOMMU_CMD_INVALIDATE_INTERRUPT_TABLE; + c.devid = devid; + amdiommu_cmd_emit(unit, (struct amdiommu_cmd_generic *)&c); +} + +void +amdiommu_qi_invalidate_ir_locked(struct amdiommu_unit *unit, uint16_t devid) +{ + amdiommu_qi_invalidate_ir_locked_nowait(unit, devid); + amdiommu_qi_invalidate_wait_sync(AMD2IOMMU(unit)); +} + +static void +amdiommu_qi_task(void *arg, int pending __unused) +{ + struct amdiommu_unit *unit; + + unit = IOMMU2AMD(arg); + iommu_qi_drain_tlb_flush(AMD2IOMMU(unit)); + + AMDIOMMU_LOCK(unit); + if (unit->x86c.inv_seq_waiters > 0) + wakeup(&unit->x86c.inv_seq_waiters); + AMDIOMMU_UNLOCK(unit); +} + +int +amdiommu_init_cmd(struct amdiommu_unit *unit) +{ + uint64_t qi_sz, rv; + + unit->x86c.qi_buf_maxsz = ilog2(AMDIOMMU_CMDBUF_MAX / PAGE_SIZE); + unit->x86c.qi_cmd_sz = AMDIOMMU_CMD_SZ; + iommu_qi_common_init(AMD2IOMMU(unit), amdiommu_qi_task); + get_x86_iommu()->qi_ensure = amdiommu_cmd_ensure; + get_x86_iommu()->qi_emit_wait_descr = amdiommu_cmd_emit_wait_descr; + get_x86_iommu()->qi_advance_tail = amdiommu_cmd_advance_tail; + get_x86_iommu()->qi_invalidate_emit = amdiommu_qi_invalidate_emit; + + rv = pmap_kextract((uintptr_t)unit->x86c.inv_queue); + + /* + * See the description of the ComLen encoding for Command + * buffer Base Address Register. + */ + qi_sz = ilog2(unit->x86c.inv_queue_size / PAGE_SIZE) + 8; + rv |= qi_sz << AMDIOMMU_CMDBUF_BASE_SZSHIFT; + + AMDIOMMU_LOCK(unit); + amdiommu_write8(unit, AMDIOMMU_CMDBUF_BASE, rv); + amdiommu_enable_cmdbuf(unit); + amdiommu_enable_qi_intr(AMD2IOMMU(unit)); + AMDIOMMU_UNLOCK(unit); + + return (0); +} + +static void +amdiommu_fini_cmd_helper(struct iommu_unit *iommu) +{ + amdiommu_disable_cmdbuf(IOMMU2AMD(iommu)); + amdiommu_disable_qi_intr(iommu); +} + +void +amdiommu_fini_cmd(struct amdiommu_unit *unit) +{ + iommu_qi_common_fini(AMD2IOMMU(unit), amdiommu_fini_cmd_helper); +} diff --git a/sys/x86/iommu/amd_ctx.c b/sys/x86/iommu/amd_ctx.c new file mode 100644 index 000000000000..b3e85350a995 --- /dev/null +++ b/sys/x86/iommu/amd_ctx.c @@ -0,0 +1,639 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static MALLOC_DEFINE(M_AMDIOMMU_CTX, "amdiommu_ctx", "AMD IOMMU Context"); +static MALLOC_DEFINE(M_AMDIOMMU_DOMAIN, "amdiommu_dom", "AMD IOMMU Domain"); + +static void amdiommu_unref_domain_locked(struct amdiommu_unit *unit, + struct amdiommu_domain *domain); + +static struct amdiommu_dte * +amdiommu_get_dtep(struct amdiommu_ctx *ctx) +{ + return (&CTX2AMD(ctx)->dev_tbl[ctx->context.rid]); +} + +void +amdiommu_domain_unload_entry(struct iommu_map_entry *entry, bool free, + bool cansleep) +{ + struct amdiommu_domain *domain; + struct amdiommu_unit *unit; + + domain = IODOM2DOM(entry->domain); + unit = DOM2AMD(domain); + + /* + * If "free" is false, then the IOTLB invalidation must be performed + * synchronously. Otherwise, the caller might free the entry before + * dmar_qi_task() is finished processing it. + */ + if (free) { + AMDIOMMU_LOCK(unit); + iommu_qi_invalidate_locked(&domain->iodom, entry, true); + AMDIOMMU_UNLOCK(unit); + } else { + iommu_qi_invalidate_sync(&domain->iodom, entry->start, + entry->end - entry->start, cansleep); + iommu_domain_free_entry(entry, false); + } +} + +static bool +amdiommu_domain_unload_emit_wait(struct amdiommu_domain *domain, + struct iommu_map_entry *entry) +{ + return (true); /* XXXKIB */ +} + +void +amdiommu_domain_unload(struct iommu_domain *iodom, + struct iommu_map_entries_tailq *entries, bool cansleep) +{ + struct amdiommu_domain *domain; + struct amdiommu_unit *unit; + struct iommu_map_entry *entry, *entry1; + int error __diagused; + + domain = IODOM2DOM(iodom); + unit = DOM2AMD(domain); + + TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { + KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, + ("not mapped entry %p %p", domain, entry)); + error = iodom->ops->unmap(iodom, entry, + cansleep ? IOMMU_PGF_WAITOK : 0); + KASSERT(error == 0, ("unmap %p error %d", domain, error)); + } + if (TAILQ_EMPTY(entries)) + return; + + AMDIOMMU_LOCK(unit); + while ((entry = TAILQ_FIRST(entries)) != NULL) { + TAILQ_REMOVE(entries, entry, dmamap_link); + iommu_qi_invalidate_locked(&domain->iodom, entry, + amdiommu_domain_unload_emit_wait(domain, entry)); + } + AMDIOMMU_UNLOCK(unit); +} + +static void +amdiommu_domain_destroy(struct amdiommu_domain *domain) +{ + struct iommu_domain *iodom; + struct amdiommu_unit *unit; + + iodom = DOM2IODOM(domain); + + KASSERT(TAILQ_EMPTY(&domain->iodom.unload_entries), + ("unfinished unloads %p", domain)); + KASSERT(LIST_EMPTY(&iodom->contexts), + ("destroying dom %p with contexts", domain)); + KASSERT(domain->ctx_cnt == 0, + ("destroying dom %p with ctx_cnt %d", domain, domain->ctx_cnt)); + KASSERT(domain->refs == 0, + ("destroying dom %p with refs %d", domain, domain->refs)); + + if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) { + AMDIOMMU_DOMAIN_LOCK(domain); + iommu_gas_fini_domain(iodom); + AMDIOMMU_DOMAIN_UNLOCK(domain); + } + if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { + if (domain->pgtbl_obj != NULL) + AMDIOMMU_DOMAIN_PGLOCK(domain); + amdiommu_domain_free_pgtbl(domain); + } + iommu_domain_fini(iodom); + unit = DOM2AMD(domain); + free_unr(unit->domids, domain->domain); + free(domain, M_AMDIOMMU_DOMAIN); +} + +static iommu_gaddr_t +lvl2addr(int lvl) +{ + int x; + + x = IOMMU_PAGE_SHIFT + IOMMU_NPTEPGSHIFT * lvl; + /* Level 6 has only 8 bits for page table index */ + if (x >= NBBY * sizeof(uint64_t)) + return (-1ull); + return (1ull < (1ull << x)); +} + +static void +amdiommu_domain_init_pglvl(struct amdiommu_unit *unit, + struct amdiommu_domain *domain) +{ + iommu_gaddr_t end; + int hats, i; + uint64_t efr_hats; + + end = DOM2IODOM(domain)->end; + for (i = AMDIOMMU_PGTBL_MAXLVL; i > 1; i--) { + if (lvl2addr(i) >= end && lvl2addr(i - 1) < end) + break; + } + domain->pglvl = i; + + efr_hats = unit->efr & AMDIOMMU_EFR_HATS_MASK; + switch (efr_hats) { + case AMDIOMMU_EFR_HATS_6LVL: + hats = 6; + break; + case AMDIOMMU_EFR_HATS_5LVL: + hats = 5; + break; + case AMDIOMMU_EFR_HATS_4LVL: + hats = 4; + break; + default: + printf("amdiommu%d: HATS %#jx (reserved) ignoring\n", + unit->iommu.unit, (uintmax_t)efr_hats); + return; + } + if (hats >= domain->pglvl) + return; + + printf("amdiommu%d: domain %d HATS %d pglvl %d reducing to HATS\n", + unit->iommu.unit, domain->domain, hats, domain->pglvl); + domain->pglvl = hats; + domain->iodom.end = lvl2addr(hats); +} + +static struct amdiommu_domain * +amdiommu_domain_alloc(struct amdiommu_unit *unit, bool id_mapped) +{ + struct amdiommu_domain *domain; + struct iommu_domain *iodom; + int error, id; + + id = alloc_unr(unit->domids); + if (id == -1) + return (NULL); + domain = malloc(sizeof(*domain), M_AMDIOMMU_DOMAIN, M_WAITOK | M_ZERO); + iodom = DOM2IODOM(domain); + domain->domain = id; + LIST_INIT(&iodom->contexts); + iommu_domain_init(AMD2IOMMU(unit), iodom, &amdiommu_domain_map_ops); + + domain->unit = unit; + + domain->iodom.end = id_mapped ? ptoa(Maxmem) : BUS_SPACE_MAXADDR; + amdiommu_domain_init_pglvl(unit, domain); + iommu_gas_init_domain(DOM2IODOM(domain)); + + if (id_mapped) { + domain->iodom.flags |= IOMMU_DOMAIN_IDMAP; + } else { + error = amdiommu_domain_alloc_pgtbl(domain); + if (error != 0) + goto fail; + /* Disable local apic region access */ + error = iommu_gas_reserve_region(iodom, 0xfee00000, + 0xfeefffff + 1, &iodom->msi_entry); + if (error != 0) + goto fail; + } + + return (domain); + +fail: + amdiommu_domain_destroy(domain); + return (NULL); +} + +static struct amdiommu_ctx * +amdiommu_ctx_alloc(struct amdiommu_domain *domain, uint16_t rid) +{ + struct amdiommu_ctx *ctx; + + ctx = malloc(sizeof(*ctx), M_AMDIOMMU_CTX, M_WAITOK | M_ZERO); + ctx->context.domain = DOM2IODOM(domain); + ctx->context.tag = malloc(sizeof(struct bus_dma_tag_iommu), + M_AMDIOMMU_CTX, M_WAITOK | M_ZERO); + ctx->context.rid = rid; + ctx->context.refs = 1; + return (ctx); +} + +static void +amdiommu_ctx_link(struct amdiommu_ctx *ctx) +{ + struct amdiommu_domain *domain; + + domain = CTX2DOM(ctx); + IOMMU_ASSERT_LOCKED(domain->iodom.iommu); + KASSERT(domain->refs >= domain->ctx_cnt, + ("dom %p ref underflow %d %d", domain, domain->refs, + domain->ctx_cnt)); + domain->refs++; + domain->ctx_cnt++; + LIST_INSERT_HEAD(&domain->iodom.contexts, &ctx->context, link); +} + +static void +amdiommu_ctx_unlink(struct amdiommu_ctx *ctx) +{ + struct amdiommu_domain *domain; + + domain = CTX2DOM(ctx); + IOMMU_ASSERT_LOCKED(domain->iodom.iommu); + KASSERT(domain->refs > 0, + ("domain %p ctx dtr refs %d", domain, domain->refs)); + KASSERT(domain->ctx_cnt >= domain->refs, + ("domain %p ctx dtr refs %d ctx_cnt %d", domain, + domain->refs, domain->ctx_cnt)); + domain->refs--; + domain->ctx_cnt--; + LIST_REMOVE(&ctx->context, link); +} + +struct amdiommu_ctx * +amdiommu_find_ctx_locked(struct amdiommu_unit *unit, uint16_t rid) +{ + struct amdiommu_domain *domain; + struct iommu_ctx *ctx; + + AMDIOMMU_ASSERT_LOCKED(unit); + + LIST_FOREACH(domain, &unit->domains, link) { + LIST_FOREACH(ctx, &domain->iodom.contexts, link) { + if (ctx->rid == rid) + return (IOCTX2CTX(ctx)); + } + } + return (NULL); +} + +struct amdiommu_domain * +amdiommu_find_domain(struct amdiommu_unit *unit, uint16_t rid) +{ + struct amdiommu_domain *domain; + struct iommu_ctx *ctx; + + AMDIOMMU_LOCK(unit); + LIST_FOREACH(domain, &unit->domains, link) { + LIST_FOREACH(ctx, &domain->iodom.contexts, link) { + if (ctx->rid == rid) + break; + } + } + AMDIOMMU_UNLOCK(unit); + return (domain); +} + +static void +amdiommu_free_ctx_locked(struct amdiommu_unit *unit, struct amdiommu_ctx *ctx) +{ + struct amdiommu_dte *dtep; + struct amdiommu_domain *domain; + + AMDIOMMU_ASSERT_LOCKED(unit); + KASSERT(ctx->context.refs >= 1, + ("amdiommu %p ctx %p refs %u", unit, ctx, ctx->context.refs)); + + /* + * If our reference is not last, only the dereference should + * be performed. + */ + if (ctx->context.refs > 1) { + ctx->context.refs--; + AMDIOMMU_UNLOCK(unit); + return; + } + + KASSERT((ctx->context.flags & IOMMU_CTX_DISABLED) == 0, + ("lost ref on disabled ctx %p", ctx)); + + /* + * Otherwise, the device table entry must be cleared before + * the page table is destroyed. + */ + dtep = amdiommu_get_dtep(ctx); + dtep->v = 0; + atomic_thread_fence_rel(); + memset(dtep, 0, sizeof(*dtep)); + + domain = CTX2DOM(ctx); + amdiommu_qi_invalidate_ctx_locked_nowait(ctx); + amdiommu_qi_invalidate_ir_locked_nowait(unit, ctx->context.rid); + amdiommu_qi_invalidate_all_pages_locked_nowait(domain); + amdiommu_qi_invalidate_wait_sync(AMD2IOMMU(CTX2AMD(ctx))); + + if (unit->irte_enabled) + amdiommu_ctx_fini_irte(ctx); + + amdiommu_ctx_unlink(ctx); + free(ctx->context.tag, M_AMDIOMMU_CTX); + free(ctx, M_AMDIOMMU_CTX); + amdiommu_unref_domain_locked(unit, domain); +} + +static void +amdiommu_free_ctx(struct amdiommu_ctx *ctx) +{ + struct amdiommu_unit *unit; + + unit = CTX2AMD(ctx); + AMDIOMMU_LOCK(unit); + amdiommu_free_ctx_locked(unit, ctx); +} + +static void +amdiommu_unref_domain_locked(struct amdiommu_unit *unit, + struct amdiommu_domain *domain) +{ + AMDIOMMU_ASSERT_LOCKED(unit); + KASSERT(domain->refs >= 1, + ("amdiommu%d domain %p refs %u", unit->iommu.unit, domain, + domain->refs)); + KASSERT(domain->refs > domain->ctx_cnt, + ("amdiommu%d domain %p refs %d ctx_cnt %d", unit->iommu.unit, + domain, domain->refs, domain->ctx_cnt)); + + if (domain->refs > 1) { + domain->refs--; + AMDIOMMU_UNLOCK(unit); + return; + } + + LIST_REMOVE(domain, link); + AMDIOMMU_UNLOCK(unit); + + taskqueue_drain(unit->iommu.delayed_taskqueue, + &domain->iodom.unload_task); + amdiommu_domain_destroy(domain); +} + +static void +dte_entry_init_one(struct amdiommu_dte *dtep, struct amdiommu_ctx *ctx, + vm_page_t pgtblr, uint8_t dte, uint32_t edte) +{ + struct amdiommu_domain *domain; + struct amdiommu_unit *unit; + + domain = CTX2DOM(ctx); + unit = DOM2AMD(domain); + + dtep->tv = 1; + /* dtep->had not used for now */ + dtep->ir = 1; + dtep->iw = 1; + dtep->domainid = domain->domain; + dtep->pioctl = AMDIOMMU_DTE_PIOCTL_DIS; + + /* fill device interrupt passing hints from IVHD. */ + dtep->initpass = (dte & ACPI_IVHD_INIT_PASS) != 0; + dtep->eintpass = (dte & ACPI_IVHD_EINT_PASS) != 0; + dtep->nmipass = (dte & ACPI_IVHD_NMI_PASS) != 0; + dtep->sysmgt = (dte & ACPI_IVHD_SYSTEM_MGMT) >> 4; + dtep->lint0pass = (dte & ACPI_IVHD_LINT0_PASS) != 0; + dtep->lint1pass = (dte & ACPI_IVHD_LINT1_PASS) != 0; + + if (unit->irte_enabled) { + dtep->iv = 1; + dtep->i = 0; + dtep->inttablen = ilog2(unit->irte_nentries); + dtep->intrroot = pmap_kextract(unit->irte_x2apic ? + (vm_offset_t)ctx->irtx2 : + (vm_offset_t)ctx->irtb) >> 6; + + dtep->intctl = AMDIOMMU_DTE_INTCTL_MAP; + } + + if ((DOM2IODOM(domain)->flags & IOMMU_DOMAIN_IDMAP) != 0) { + dtep->pgmode = AMDIOMMU_DTE_PGMODE_1T1; + } else { + MPASS(domain->pglvl > 0 && domain->pglvl <= + AMDIOMMU_PGTBL_MAXLVL); + dtep->pgmode = domain->pglvl; + dtep->ptroot = VM_PAGE_TO_PHYS(pgtblr) >> 12; + } + + atomic_thread_fence_rel(); + dtep->v = 1; +} + +static void +dte_entry_init(struct amdiommu_ctx *ctx, bool move, uint8_t dte, uint32_t edte) +{ + struct amdiommu_dte *dtep; + struct amdiommu_unit *unit; + struct amdiommu_domain *domain; + int i; + + domain = CTX2DOM(ctx); + unit = DOM2AMD(domain); + + dtep = amdiommu_get_dtep(ctx); + KASSERT(dtep->v == 0, + ("amdiommu%d initializing valid dte @%p %#jx", + CTX2AMD(ctx)->iommu.unit, dtep, (uintmax_t)(*(uint64_t *)dtep))); + + if (iommu_is_buswide_ctx(AMD2IOMMU(unit), + PCI_RID2BUS(ctx->context.rid))) { + MPASS(!move); + for (i = 0; i <= PCI_BUSMAX; i++) { + dte_entry_init_one(&dtep[i], ctx, domain->pgtblr, + dte, edte); + } + } else { + dte_entry_init_one(dtep, ctx, domain->pgtblr, dte, edte); + } +} + +struct amdiommu_ctx * +amdiommu_get_ctx_for_dev(struct amdiommu_unit *unit, device_t dev, uint16_t rid, + int dev_domain, bool id_mapped, bool rmrr_init, uint8_t dte, uint32_t edte) +{ + struct amdiommu_domain *domain, *domain1; + struct amdiommu_ctx *ctx, *ctx1; + int bus, slot, func; + + if (dev != NULL) { + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + } else { + bus = PCI_RID2BUS(rid); + slot = PCI_RID2SLOT(rid); + func = PCI_RID2FUNC(rid); + } + AMDIOMMU_LOCK(unit); + KASSERT(!iommu_is_buswide_ctx(AMD2IOMMU(unit), bus) || + (slot == 0 && func == 0), + ("iommu%d pci%d:%d:%d get_ctx for buswide", AMD2IOMMU(unit)->unit, + bus, slot, func)); + ctx = amdiommu_find_ctx_locked(unit, rid); + if (ctx == NULL) { + /* + * Perform the allocations which require sleep or have + * higher chance to succeed if the sleep is allowed. + */ + AMDIOMMU_UNLOCK(unit); + domain1 = amdiommu_domain_alloc(unit, id_mapped); + if (domain1 == NULL) + return (NULL); + if (!id_mapped) { + /* + * XXXKIB IVMD seems to be less significant + * and less used on AMD than RMRR on Intel. + * Not implemented for now. + */ + } + ctx1 = amdiommu_ctx_alloc(domain1, rid); *** 2674 LINES SKIPPED *** From nobody Sun Nov 3 00:40:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xgwjf3Y2wz5b5Jl; Sun, 03 Nov 2024 00:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xgwjf2hLCz4XZV; Sun, 3 Nov 2024 00:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730594406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/m8lX1XngYKzNon9xt782wOt4Rj5iMmN0/mbtFR4GY=; b=V2j6jbSlF/UX++GdoHHIiSubQMYijppWVKL3IyjcyyVAKI/9ZnToWtazFVEINDIHCyS4bt sxMHAXdeuxpl0ZsJ795HgX3VrOIvOrBiEQ9GTbGioTx0neD6hRX6LeCg4+QlreLXhTYalt fmjkxgdslQ/8I4tAEVizOm7k3r5Ua4n+i93hNaQSVrwyFN7s18BLFTVPJ0AJ1EbbvBGaEm fjYZWHxdyiCE1UT4obnCFlRuypzy6ESJDdPFQx66VVAhKZyU561LUXhO6GOltRkIS5gcBg N1wsv88N5kgd0yHEKjHeEj6LItcfrjtobTL6yQdI54JKgC05aH28v4ICDDWyyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730594406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/m8lX1XngYKzNon9xt782wOt4Rj5iMmN0/mbtFR4GY=; b=iOVCxz2qzFi9Tz9G5Ur9rFcoZ4I1tq+mQarNi7B0VEJoHDOU7ce+a10nrp8V7zzKb/Pc/8 mW96mvYoUDYo53zBYhohrKES0y66C2z4FT86Lz32gxJvBwS5CViEQK8MOgiApbXXqKC0fO HxZvEb2Jp/4bq8QLHlKObdK3wabV4EOxoQ0v3dQFOJ5R2wHQZU80wAXpMmIcg34yLUp4Vl myqY7r61IN4FyZXkJ9G8FIBGHmrqhfgnvYi2fh7gEXIg1YvL2/X+PKhh5e2xeCoL1ekdkz 71M8yT8vs2bp73zUbD4W5Qir8ScGhLYLhft9u0IztNa5fbiAYctd0YwcdJ7x7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730594406; a=rsa-sha256; cv=none; b=jthdbKgUcIswkNLV6x3YrsfkPAXY6yKfKUn00ADMvZVbvzMrdMaqzymSOetG03R47Yw/bL /uyA6OzuckvZry3xONKhLgJZVGnYJ8PPJ6jwyUbdAU/CP/3FzepnoNuEC3uJcWXyRde5l0 9qs3Abhazq1rnKzAttdIPFOJDYEGpd/2/kdUNkihYAaMu4ePAaPvGAsRUU0nXmS3Rw3XpX g+eggq35QDBpkTjudaTXbc+i4TPugSyd6aLMrsaXtKl1CMUO9oYsTU3JTDKfvfk+DCNqAy L1KivqNn3fIbY9O24w3l5rpw+627K284ue5xbm/4ozv2CclK2v9ZxurApySYxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xgwjf2HYyzRls; Sun, 3 Nov 2024 00:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A30e6pP094303; Sun, 3 Nov 2024 00:40:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A30e6ks094297; Sun, 3 Nov 2024 00:40:06 GMT (envelope-from git) Date: Sun, 3 Nov 2024 00:40:06 GMT Message-Id: <202411030040.4A30e6ks094297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 05bc70bab4ff - stable/14 - x86: do not leak msi_lock in msix_alloc() on iommu remapping failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 05bc70bab4ff1dcc3eec8d9c47d469f78c08ba9e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=05bc70bab4ff1dcc3eec8d9c47d469f78c08ba9e commit 05bc70bab4ff1dcc3eec8d9c47d469f78c08ba9e Author: Konstantin Belousov AuthorDate: 2024-10-27 01:39:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 00:39:43 +0000 x86: do not leak msi_lock in msix_alloc() on iommu remapping failure (cherry picked from commit 439fa16e1fd35181898b61264b205bf3b7103a41) --- sys/x86/x86/msi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c index c8e7db9469ed..9d5a51f9753c 100644 --- a/sys/x86/x86/msi.c +++ b/sys/x86/x86/msi.c @@ -723,6 +723,7 @@ again: if (error != 0) { msi->msi_dev = NULL; apic_free_vector(cpu, vector, i); + mtx_unlock(&msi_lock); return (error); } msi->msi_remap_cookie = cookie; From nobody Sun Nov 3 03:58:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh16K6x5Gz5bgXM; Sun, 03 Nov 2024 03:58:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh16K4xr0z4tZ7; Sun, 3 Nov 2024 03:58:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730606297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oOUwQ0ndfENZKJGvhFht+h1lGikK9FaSwCLFNUmMv5Y=; b=N/P8095bK5jryvjmdBA7azRuEyN/l7HFfu6DgsPv73JLgq1AI1O0fMY8sBZw6yi+N6hwdy nhu33RRlE8beqGAICnJFdt4nB+ucP3DGKAomtrhtwE/4Q7uq4Nwp0IxyCGpNRsQUd1Kq80 N5v5+OI37FLKrVTxDO4hq6CZJuDeekFaZ2w+SfnphloIR3D3/ciRCRbb13ItfrDUyDZe8m hAViQbr0IFZAEsCz398ymb/7/NCk8EaGQZtr10svVAFki3AhjzPFB1w1kY2KCOjb9CaZ+c CKRL6ii9FYulrmrSQ54l7u7v53WhX+nPK9JkpDA+7it/hFU33Byvwj3tUaF81Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730606297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oOUwQ0ndfENZKJGvhFht+h1lGikK9FaSwCLFNUmMv5Y=; b=V/g37OSZSf12SpiFTkPZnQ2EToN+C922UjuPFk0WZKMUnHezSSzZc2gVOwP+mefu9wXdpx Z7Y74+FO/IuW1lIRPS6kun5YmsSfYJS8zpMvJtWzmU9Q6RkL/E3B8WH0rnCWGs3v3/oqtx TnQ/WtszS0N8Thctd52hgUNViULB2TUalBt3oDHa15wXrxPdk6ty5kKVlcVH/mYWxrBrn0 tPPPHLe6IJ3S9rUUL1Kk9N6lWmG1fFawvjcOSW/TUV3nvzg9ikRlc6x8mGp4+aQwNju/e6 mz1IX06rVcc3C0Tnp9ndLh+TDm+7xxBrBu3i8Sv1qUVehojJEL+nNwfaWzPRNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730606297; a=rsa-sha256; cv=none; b=Bv858a9JoDO6EICGfXrpoJspskSGZBI5pFiuMyQwcR3p4GMafATDQFxbZ0o8tg0kJd/846 hQZB8clhuyWzBLW3BY9sflRLeNyQdK9i5N6YKwHf9UyP2EvzWuJ7NxYJCY0KE4oGt1PR6o VC39+l1/9o/NBUDYgw3m5Xf2xM583lzkPxdYtLm1ju0cSyTM2CGlzVb2a/AhfQMVhGGrmo HdnwJe3mHFaCqfVcDtvJqvt0PFioJmqdoXoLbnjGjmDrns9gAI+FeQRPNF3WUSGB91jj04 U1GGxYBCBw6KLuKoZZqMBE8HvaLeCAXz+DQTZO7BK7X0yxXzMaoIFSXcOLxfeA== Received: from [192.168.1.10] (c-73-231-46-254.hsd1.ca.comcast.net [73.231.46.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xh16J6dVWz17mC; Sun, 3 Nov 2024 03:58:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.90.24110120 Date: Sat, 02 Nov 2024 20:58:12 -0700 Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group From: Ravi Pokala To: Olivier Certner , , , Message-ID: <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> Thread-Topic: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> In-Reply-To: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Hi Olivier, This appears to break amd64.MINIMAL and amd64.MINIMALUP: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % less _.amd64.MINIMAL linking kernel.full ld: error: undefined symbol: vnet_entry_nfsrv_defaultgid >>> referenced by vfs_export.c:141 (sys/kern/vfs_export.c:141) >>> vfs_export.o:(vfs_export) >>> referenced by vfs_export.c:220 (sys/kern/vfs_export.c:220) >>> vfs_export.o:(vfs_export) --- kernel.full --- *** [kernel.full] Error code 1 make[5]: stopped making "all" in amd64.amd64/sys/MINIMAL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: > on behalf of Olivier Certner > Date: Saturday, November 2, 2024 at 13:39 To: >, >, > Subject: git: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials hav= e at least one group The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dcfbe7a62dc62e8a5d7520cb5eb8ad7= c4a9418e26 commit cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 Author: Olivier Certner > AuthorDate: 2024-10-02 14:28:59 +0000 Commit: Olivier Certner > CommitDate: 2024-11-02 20:37:42 +0000 nfs, rpc: Ensure kernel credentials have at least one group This fixes several bugs where some 'struct ucred' in the kernel, constructed from user input (via nmount(2)) or obtained from other servers (e.g., gssd(8)), could have an unfilled 'cr_groups' field and whose 'cr_groups[0]' (or 'cr_gid', which is an alias) was later accessed, causing an uninitialized access giving random access rights. Use crsetgroups_fallback() to enforce a fallback group when possible. For NFS, the chosen fallback group is that of the NFS server in the current VNET (NFSD_VNET(nfsrv_defaultgid)). There does not seem to be any sensible fallback available in rpc code (sys/rpc/svc_auth.c, svc_getcred()) on AUTH_UNIX (TLS or not), so just fail credential retrieval there. Stock NSS sources, rpc.tlsservd(8) or rpc.tlsclntd(8) provide non-empty group lists, so will not be impacted. Discussed with: rmacklem (by mail) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46918 --- sys/fs/nfs/nfs_commonport.c | 4 +++- sys/fs/nfs/nfs_commonsubs.c | 5 +++-- sys/fs/nfsserver/nfs_nfsdport.c | 6 +++++- sys/fs/nfsserver/nfs_nfsdsocket.c | 6 ++---- sys/kern/vfs_export.c | 12 ++++++++---- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- sys/rpc/svc_auth.c | 8 ++++++-- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 2db9af5b9ea9..11f31d1a0e9f 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -75,6 +75,7 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); int nfs_pnfsio(task_fn_t *, void *); @@ -258,7 +259,8 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr= ) KASSERT(nfscr->nfsc_ngroups >=3D 0, ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid =3D nfscr->nfsc_uid; - crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups); + crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, + NFSD_VNET(nfsrv_defaultgid)); } /* diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 90b30f462106..ce4b0052714e 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4051,8 +4051,9 @@ nfssvc_idname(struct nfsd_idargs *nidp) */ cr =3D crget(); cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D nidp->nid_uid; - crsetgroups(cr, nidp->nid_ngroup, grps); - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; + crsetgroups_fallback(cr, nidp->nid_ngroup, grps, + NFSD_VNET(nfsrv_defaultgid)); + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; cr->cr_prison =3D curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdpor= t.c index 8a2a39052506..5160645ad73c 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3311,7 +3311,11 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexs= tuff *exp, NFSVNO_EXPORTANON(exp) || (nd->nd_flag & ND_AUTHNONE) !=3D 0) { nd->nd_cred->cr_uid =3D credanon->cr_uid; - nd->nd_cred->cr_gid =3D credanon->cr_gid; + /* + * 'credanon' is already a 'struct ucred' that was built + * internally with calls to crsetgroups_fallback(), so + * we don't need a fallback here. + */ crsetgroups(nd->nd_cred, credanon->cr_ngroups, credanon->cr_groups); } else if ((nd->nd_flag & ND_GSS) =3D=3D 0) { diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsds= ocket.c index df0c0edd1b59..d1b6198ba0e1 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -1422,13 +1422,11 @@ static struct ucred * nfsrv_createrootcred(void) { struct ucred *cr; - gid_t grp; cr =3D crget(); cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D UID_ROOT; - grp =3D GID_WHEEL; - crsetgroups(cr, 1, &grp); - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; + crsetgroups_fallback(cr, 0, NULL, GID_WHEEL); + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; cr->cr_prison =3D curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 996f3f74193f..c0337b1fe858 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -61,6 +61,10 @@ #include #include +#include + +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); + static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structu= re"); #if defined(INET) || defined(INET6) @@ -133,8 +137,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= ep, np->netc_exflags =3D argp->ex_flags; np->netc_anon =3D crget(); np->netc_anon->cr_uid =3D argp->ex_uid; - crsetgroups(np->netc_anon, argp->ex_ngroups, - argp->ex_groups); + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, + argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); np->netc_anon->cr_prison =3D &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors =3D argp->ex_numsecflavors; @@ -212,8 +216,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= ep, np->netc_exflags =3D argp->ex_flags; np->netc_anon =3D crget(); np->netc_anon->cr_uid =3D argp->ex_uid; - crsetgroups(np->netc_anon, argp->ex_ngroups, - argp->ex_groups); + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, + NFSD_VNET(nfsrv_defaultgid)); np->netc_anon->cr_prison =3D &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors =3D argp->ex_numsecflavors; diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_r= pcsec_gss.c index 1e6e71fa10ac..b1790dd167d5 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -537,7 +537,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred *= *crp, int *flavorp) cr =3D client->cl_cred =3D crget(); cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D uc->uid; cr->cr_rgid =3D cr->cr_svgid =3D uc->gid; - crsetgroups(cr, uc->gidlen, uc->gidlist); + crsetgroups_fallback(cr, uc->gidlen, uc->gidlist, uc->gid); cr->cr_prison =3D curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp =3D crhold(cr); diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index 6acb1fb0d4b9..92f1ee0f2844 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -187,10 +187,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= int *flavorp) if ((xprt->xp_tls & (RPCTLS_FLAGS_CERTUSER | RPCTLS_FLAGS_DISABLED)) =3D=3D RPCTLS_FLAGS_CERTUSER && flavor =3D=3D AUTH_UNIX) { + if (xprt->xp_ngrps <=3D 0) + return (FALSE); cr =3D crget(); cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xprt->xp_uid; crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); - cr->cr_rgid =3D cr->cr_svgid =3D xprt->xp_gidp[0]; + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; cr->cr_prison =3D curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp =3D cr; @@ -200,10 +202,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= int *flavorp) switch (flavor) { case AUTH_UNIX: xcr =3D (struct xucred *) rqst->rq_clntcred; + if (xcr->cr_ngroups <=3D 0) + return (FALSE); cr =3D crget(); cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xcr->cr_uid; crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; cr->cr_prison =3D curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp =3D cr; From nobody Sun Nov 3 06:41:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh4kv60qSz5bxh3; Sun, 03 Nov 2024 06:41:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh4kv1hhZz49vC; Sun, 3 Nov 2024 06:41:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id 7UFEtapQkAHbZ7UIut3GIG; Sun, 03 Nov 2024 06:41:40 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7UIttM5U4GvSV7UIuty6GK; Sun, 03 Nov 2024 06:41:40 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=FpSm/Hrq c=1 sm=1 tr=0 ts=67271b24 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=cOLrLDMxAAAA:8 a=vUPWEWiMAAAA:8 a=fY1FzLYsdD8ry1HIQnYA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=P0s3qUPvOpV5zndjNR8V:22 a=s3Yi14Of9AgBIP63TAoC:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id EAE673D3; Sat, 02 Nov 2024 23:41:38 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id C6B06286; Sat, 02 Nov 2024 23:41:38 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ravi Pokala cc: Olivier Certner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group In-reply-to: <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> Comments: In-reply-to Ravi Pokala message dated "Sat, 02 Nov 2024 20:58:12 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 02 Nov 2024 23:41:38 -0700 Message-Id: <20241103064138.C6B06286@slippy.cwsent.com> X-CMAE-Envelope: MS4xfPDdSmstVY4HyyP2bSnOfdR7H03OhDK2mGRlW04zXLpDmB1bqCJYsXTJNoUzsNt8pKH0Kfy/iRNCR3AkSS701ekSFhXRDmKBG2v8p5Gt9UkYhWQC8foc KgtZuDTBL/vjzBvAL1D+O5p69u3Gyu97+yrHYsmVbc/suFEfEOiGL5Y0LweJ8Ip63ioSouoczgHYxxm2Xy8AOaJV/gCRbdeEOOpNggbHKe41W5E1ykBCIikW ydYbkur4drVg1F1jXhcs8ThyySwJToBARBHgzOyI2hI0Fr4mXJeuAnsN/4kgFiDZSo3BTf3Dd/sKKRJTuF5fTmxMG/GLy5vJLlDOhHk8aFoSan13iqNtIDCH 3EDQ4Fsv X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Xh4kv1hhZz49vC X-Spamd-Bar: ---- It also causes a panic when mountd is started. I'll post details later. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com>, Ravi Pokala writ es: > Hi Olivier, > > This appears to break amd64.MINIMAL and amd64.MINIMALUP: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 > D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > 3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % less _.amd64.MINIMAL > linking kernel.full > ld: error: undefined symbol: vnet_entry_nfsrv_defaultgid > >>> referenced by vfs_export.c:141 (sys/kern/vfs_export.c:141) > >>> vfs_export.o:(vfs_export) > >>> referenced by vfs_export.c:220 (sys/kern/vfs_export.c:220) > >>> vfs_export.o:(vfs_export) > --- kernel.full --- > *** [kernel.full] Error code 1 > > make[5]: stopped making "all" in amd64.amd64/sys/MINIMAL > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 > D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > 3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Thanks, > > Ravi (rpokala@) > > =EF=BB=BF-----Original Message----- > From: d.org>> on behalf of Olivier Certner org>> > Date: Saturday, November 2, 2024 at 13:39 > To: >, commits-src-all@FreeBSD.org >, commits-src-main@FreeBSD.org > > Subject: git: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials hav= > e at least one group > > > The branch main has been updated by olce: > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dcfbe7a62dc62e8a5d7520cb5eb8ad7 > = > c4a9418e26 5= > eb8ad7c4a9418e26> > > > commit cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 > Author: Olivier Certner > > AuthorDate: 2024-10-02 14:28:59 +0000 > Commit: Olivier Certner > > CommitDate: 2024-11-02 20:37:42 +0000 > > > nfs, rpc: Ensure kernel credentials have at least one group > > > This fixes several bugs where some 'struct ucred' in the kernel, > constructed from user input (via nmount(2)) or obtained from other > servers (e.g., gssd(8)), could have an unfilled 'cr_groups' field and > whose 'cr_groups[0]' (or 'cr_gid', which is an alias) was later > accessed, causing an uninitialized access giving random access rights. > > > Use crsetgroups_fallback() to enforce a fallback group when possible. > For NFS, the chosen fallback group is that of the NFS server in the > current VNET (NFSD_VNET(nfsrv_defaultgid)). > > > There does not seem to be any sensible fallback available in rpc code > (sys/rpc/svc_auth.c, svc_getcred()) on AUTH_UNIX (TLS or not), so just > fail credential retrieval there. Stock NSS sources, rpc.tlsservd(8) or > rpc.tlsclntd(8) provide non-empty group lists, so will not be impacted. > > > Discussed with: rmacklem (by mail) > Approved by: markj (mentor) > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D46918 freebsd.org/D46918> > --- > sys/fs/nfs/nfs_commonport.c | 4 +++- > sys/fs/nfs/nfs_commonsubs.c | 5 +++-- > sys/fs/nfsserver/nfs_nfsdport.c | 6 +++++- > sys/fs/nfsserver/nfs_nfsdsocket.c | 6 ++---- > sys/kern/vfs_export.c | 12 ++++++++---- > sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- > sys/rpc/svc_auth.c | 8 ++++++-- > 7 files changed, 28 insertions(+), 15 deletions(-) > > > diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c > index 2db9af5b9ea9..11f31d1a0e9f 100644 > --- a/sys/fs/nfs/nfs_commonport.c > +++ b/sys/fs/nfs/nfs_commonport.c > @@ -75,6 +75,7 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); > > > NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); > NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); > +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > > > int nfs_pnfsio(task_fn_t *, void *); > > > @@ -258,7 +259,8 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr= > ) > KASSERT(nfscr->nfsc_ngroups >=3D 0, > ("newnfs_copycred: negative nfsc_ngroups")); > cr->cr_uid =3D nfscr->nfsc_uid; > - crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups); > + crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, > + NFSD_VNET(nfsrv_defaultgid)); > } > > > /* > diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c > index 90b30f462106..ce4b0052714e 100644 > --- a/sys/fs/nfs/nfs_commonsubs.c > +++ b/sys/fs/nfs/nfs_commonsubs.c > @@ -4051,8 +4051,9 @@ nfssvc_idname(struct nfsd_idargs *nidp) > */ > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D nidp->nid_uid; > - crsetgroups(cr, nidp->nid_ngroup, grps); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + crsetgroups_fallback(cr, nidp->nid_ngroup, grps, > + NFSD_VNET(nfsrv_defaultgid)); > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > #ifdef MAC > diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdpor= > t.c > index 8a2a39052506..5160645ad73c 100644 > --- a/sys/fs/nfsserver/nfs_nfsdport.c > +++ b/sys/fs/nfsserver/nfs_nfsdport.c > @@ -3311,7 +3311,11 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexs= > tuff *exp, > NFSVNO_EXPORTANON(exp) || > (nd->nd_flag & ND_AUTHNONE) !=3D 0) { > nd->nd_cred->cr_uid =3D credanon->cr_uid; > - nd->nd_cred->cr_gid =3D credanon->cr_gid; > + /* > + * 'credanon' is already a 'struct ucred' that was built > + * internally with calls to crsetgroups_fallback(), so > + * we don't need a fallback here. > + */ > crsetgroups(nd->nd_cred, credanon->cr_ngroups, > credanon->cr_groups); > } else if ((nd->nd_flag & ND_GSS) =3D=3D 0) { > diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsds= > ocket.c > index df0c0edd1b59..d1b6198ba0e1 100644 > --- a/sys/fs/nfsserver/nfs_nfsdsocket.c > +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c > @@ -1422,13 +1422,11 @@ static struct ucred * > nfsrv_createrootcred(void) > { > struct ucred *cr; > - gid_t grp; > > > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D UID_ROOT; > - grp =3D GID_WHEEL; > - crsetgroups(cr, 1, &grp); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + crsetgroups_fallback(cr, 0, NULL, GID_WHEEL); > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > #ifdef MAC > diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c > index 996f3f74193f..c0337b1fe858 100644 > --- a/sys/kern/vfs_export.c > +++ b/sys/kern/vfs_export.c > @@ -61,6 +61,10 @@ > #include > #include > > > +#include > + > +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > + > static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structu= > re"); > > > #if defined(INET) || defined(INET6) > @@ -133,8 +137,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= > ep, > np->netc_exflags =3D argp->ex_flags; > np->netc_anon =3D crget(); > np->netc_anon->cr_uid =3D argp->ex_uid; > - crsetgroups(np->netc_anon, argp->ex_ngroups, > - argp->ex_groups); > + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, > + argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); > np->netc_anon->cr_prison =3D &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors =3D argp->ex_numsecflavors; > @@ -212,8 +216,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= > ep, > np->netc_exflags =3D argp->ex_flags; > np->netc_anon =3D crget(); > np->netc_anon->cr_uid =3D argp->ex_uid; > - crsetgroups(np->netc_anon, argp->ex_ngroups, > - argp->ex_groups); > + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, > + NFSD_VNET(nfsrv_defaultgid)); > np->netc_anon->cr_prison =3D &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors =3D argp->ex_numsecflavors; > diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_r= > pcsec_gss.c > index 1e6e71fa10ac..b1790dd167d5 100644 > --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > @@ -537,7 +537,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred *= > *crp, int *flavorp) > cr =3D client->cl_cred =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D uc->uid; > cr->cr_rgid =3D cr->cr_svgid =3D uc->gid; > - crsetgroups(cr, uc->gidlen, uc->gidlist); > + crsetgroups_fallback(cr, uc->gidlen, uc->gidlist, uc->gid); > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D crhold(cr); > diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c > index 6acb1fb0d4b9..92f1ee0f2844 100644 > --- a/sys/rpc/svc_auth.c > +++ b/sys/rpc/svc_auth.c > @@ -187,10 +187,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= > int *flavorp) > if ((xprt->xp_tls & (RPCTLS_FLAGS_CERTUSER | > RPCTLS_FLAGS_DISABLED)) =3D=3D RPCTLS_FLAGS_CERTUSER && > flavor =3D=3D AUTH_UNIX) { > + if (xprt->xp_ngrps <=3D 0) > + return (FALSE); > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xprt->xp_uid; > crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); > - cr->cr_rgid =3D cr->cr_svgid =3D xprt->xp_gidp[0]; > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D cr; > @@ -200,10 +202,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= > int *flavorp) > switch (flavor) { > case AUTH_UNIX: > xcr =3D (struct xucred *) rqst->rq_clntcred; > + if (xcr->cr_ngroups <=3D 0) > + return (FALSE); > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xcr->cr_uid; > crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D cr; > > > > From nobody Sun Nov 3 06:57:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh54f5P3lz5byyW; Sun, 03 Nov 2024 06:57:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh54f4Xtqz4DpH; Sun, 3 Nov 2024 06:57:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id 7EBTta8l2AHbZ7UXqt3GaQ; Sun, 03 Nov 2024 06:57:06 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7UXotN009KHV87UXptUOdB; Sun, 03 Nov 2024 06:57:06 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=67271ec2 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=cOLrLDMxAAAA:8 a=vUPWEWiMAAAA:8 a=-cOMWAlaZ4LkG71dmHEA:9 a=LLLFqS9aDXjDBAfi:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=P0s3qUPvOpV5zndjNR8V:22 a=s3Yi14Of9AgBIP63TAoC:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 487E4489; Sat, 02 Nov 2024 23:57:04 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 4377C114; Sat, 02 Nov 2024 23:57:04 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ravi Pokala cc: Olivier Certner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group In-reply-to: <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> Comments: In-reply-to Ravi Pokala message dated "Sat, 02 Nov 2024 20:58:12 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 02 Nov 2024 23:57:04 -0700 Message-Id: <20241103065704.4377C114@slippy.cwsent.com> X-CMAE-Envelope: MS4xfOv6mxESjr3boa2vBlHaJBswoxYcT/XcJpzT8nLKenjq0GZCtX0gVOiP91i6aM7Xo/ZvEoW5b5tVDwtmG35VTOOBeJtSD89o8T/cPYNcEvOqdMtCcgal iiYFM3ywsUQSgJIC8+8Tm0Eab/DIH8pkgoXPVrEudzGkBMJsTXpmkdGEoQplCn6POaQ7xmT81PQVetwJp3bwS+6U0qXFxeia3VoQLJYYf8CZ5xtTy5xcJ1kQ QF0JyFwnlYqLz9lU+ELb4KW+8UkDUeSkwCmOoyIJhPg1NnocqwhQUHrAMpJek0y1sae1isz/u3vDpM3NEaLQvSnpT9hrPnjHWheLQ68dXPg6rNMMzacCWBF9 xsePe8+E X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Xh54f4Xtqz4DpH X-Spamd-Bar: ---- One of these commits causes a panic when yppasswd is started. The relevant details are below. However on my laptop the panic is in mountd. No core dump was captured on that machine. cwsys dumped core - see /var/crash/vmcore.22 Sat Nov 2 23:29:29 PDT 2024 FreeBSD cwsys 15.0-CURRENT FreeBSD 15.0-CURRENT #59 komquats-n273418-0f5116d7efe3: Sat Nov 2 19:32:30 PDT 2024 root@slippy:/export/obj/opt/src/git-src/amd64.amd64/sys/BREAK amd64 panic: page fault Reading symbols from /boot/kernel/kernel... Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug... Reading symbols from /boot/kernel/geom_mirror.ko... Reading symbols from /usr/lib/debug//boot/kernel/geom_mirror.ko.debug... Reading symbols from /boot/kernel/sem.ko... Reading symbols from /usr/lib/debug//boot/kernel/sem.ko.debug... Reading symbols from /boot/kernel/zfs.ko... Reading symbols from /usr/lib/debug//boot/kernel/zfs.ko.debug... Reading symbols from /boot/kernel/amdtemp.ko... Reading symbols from /usr/lib/debug//boot/kernel/amdtemp.ko.debug... Reading symbols from /boot/kernel/amdsmn.ko... Reading symbols from /usr/lib/debug//boot/kernel/amdsmn.ko.debug... Reading symbols from /boot/kernel/if_nfe.ko... Reading symbols from /usr/lib/debug//boot/kernel/if_nfe.ko.debug... Reading symbols from /boot/kernel/aibs.ko... Reading symbols from /usr/lib/debug//boot/kernel/aibs.ko.debug... Reading symbols from /boot/kernel/filemon.ko... Reading symbols from /usr/lib/debug//boot/kernel/filemon.ko.debug... Reading symbols from /boot/kernel/dtraceall.ko... Reading symbols from /usr/lib/debug//boot/kernel/dtraceall.ko.debug... Reading symbols from /boot/kernel/profile.ko... Reading symbols from /usr/lib/debug//boot/kernel/profile.ko.debug... Reading symbols from /boot/kernel/opensolaris.ko... Reading symbols from /usr/lib/debug//boot/kernel/opensolaris.ko.debug... Reading symbols from /boot/kernel/dtrace.ko... Reading symbols from /usr/lib/debug//boot/kernel/dtrace.ko.debug... Reading symbols from /boot/kernel/systrace_freebsd32.ko... Reading symbols from /usr/lib/debug//boot/kernel/systrace_freebsd32.ko.debug ... Reading symbols from /boot/kernel/systrace.ko... Reading symbols from /usr/lib/debug//boot/kernel/systrace.ko.debug... Reading symbols from /boot/kernel/sdt.ko... Reading symbols from /usr/lib/debug//boot/kernel/sdt.ko.debug... Reading symbols from /boot/kernel/kinst.ko... Reading symbols from /usr/lib/debug//boot/kernel/kinst.ko.debug... Reading symbols from /boot/kernel/fasttrap.ko... Reading symbols from /usr/lib/debug//boot/kernel/fasttrap.ko.debug... Reading symbols from /boot/kernel/fbt.ko... Reading symbols from /usr/lib/debug//boot/kernel/fbt.ko.debug... Reading symbols from /boot/kernel/dtnfscl.ko... Reading symbols from /usr/lib/debug//boot/kernel/dtnfscl.ko.debug... Reading symbols from /boot/kernel/dtmalloc.ko... Reading symbols from /usr/lib/debug//boot/kernel/dtmalloc.ko.debug... Reading symbols from /boot/kernel/dtaudit.ko... Reading symbols from /usr/lib/debug//boot/kernel/dtaudit.ko.debug... Reading symbols from /boot/kernel/if_sk.ko... Reading symbols from /usr/lib/debug//boot/kernel/if_sk.ko.debug... Reading symbols from /boot/kernel/cpufreq.ko... Reading symbols from /usr/lib/debug//boot/kernel/cpufreq.ko.debug... Reading symbols from /boot/kernel/if_lagg.ko... Reading symbols from /usr/lib/debug//boot/kernel/if_lagg.ko.debug... Reading symbols from /boot/kernel/if_infiniband.ko... Reading symbols from /usr/lib/debug//boot/kernel/if_infiniband.ko.debug... Reading symbols from /boot/kernel/fdescfs.ko... Reading symbols from /usr/lib/debug//boot/kernel/fdescfs.ko.debug... Reading symbols from /boot/kernel/nullfs.ko... Reading symbols from /usr/lib/debug//boot/kernel/nullfs.ko.debug... Reading symbols from /boot/kernel/if_bridge.ko... Reading symbols from /usr/lib/debug//boot/kernel/if_bridge.ko.debug... Reading symbols from /boot/kernel/bridgestp.ko... Reading symbols from /usr/lib/debug//boot/kernel/bridgestp.ko.debug... Reading symbols from /boot/kernel/fusefs.ko... Reading symbols from /usr/lib/debug//boot/kernel/fusefs.ko.debug... Reading symbols from /boot/kernel/geom_uzip.ko... Reading symbols from /usr/lib/debug//boot/kernel/geom_uzip.ko.debug... Reading symbols from /boot/kernel/autofs.ko... Reading symbols from /usr/lib/debug//boot/kernel/autofs.ko.debug... __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:57 57 __asm("movq %%gs:%c1,%0" : "=r" (td) (kgdb) #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:5 7 td = #1 doadump (textdump=textdump@entry=1) at /opt/src/git-src/sys/kern/kern_shutdown.c:404 error = 0 coredump = #2 0xffffffff806dafee in kern_reboot (howto=260) at /opt/src/git-src/sys/kern/kern_shutdown.c:524 once = 0 #3 0xffffffff806db517 in vpanic (fmt=0xffffffff80b03e2b "%s", ap=ap@entry=0xfffffe008ed86890) at /opt/src/git-src/sys/kern/kern_shutdown.c:979 buf = "page fault", '\000' __pc = 0x0 __pc = 0x0 __pc = 0x0 other_cpus = {__bits = {13, 0 }} td = 0xfffff80009381740 bootopt = newpanic = #4 0xffffffff806db343 in panic (fmt=) at /opt/src/git-src/sys/kern/kern_shutdown.c:892 ap = {{gp_offset = 16, fp_offset = 48, overflow_arg_area = 0xfffffe008ed868c0, reg_save_area = 0xfffffe008ed86860}} #5 0xffffffff80a81aab in trap_fatal (frame=0xfffffe008ed86970, eva=40) at /opt/src/git-src/sys/amd64/amd64/trap.c:950 __pc = 0x0 __pc = 0x0 __pc = 0x0 softseg = {ssd_base = 0, ssd_limit = 1048575, ssd_type = 27, ssd_dpl = 0, ssd_p = 1, ssd_long = 1, ssd_def32 = 0, ssd_gran = 1} code = 0 ss = 40 type = gdt = handled = #6 0xffffffff80a81af6 in trap_pfault (frame=, usermode=false, signo=, ucode=) at /opt/src/git-src/sys/amd64/amd64/trap.c:758 __pc = 0x0 __pc = 0x0 __pc = 0x0 td = 0xfffff80009381740 p = eva = map = ftype = rv = #7 No locals. #8 0xffffffff807b6de0 in vfs_hang_addrlist (mp=0xfffffe008517c100, argp=0xfffffe008ed86b60, nep=) at /opt/src/git-src/sys/kern/vfs_export.c:141 smask = 0x0 np = i = saddr = error = rnh = off = rn = _tid = _v = _v = _size = _malloc_item = #9 vfs_export (mp=mp@entry=0xfffffe008517c100, argp=argp@entry=0xfffffe008ed86b60, do_exjail=true) at /opt/src/git-src/sys/kern/vfs_export.c:408 error = pr = 0xffffffff80e60260 nep = 0xfffff8001d04dd00 cr = new_nep = #10 0xffffffff807c3ad9 in vfs_domount_update (td=td@entry=0xfffff80009381740 , vp=0xfffff8002ab30370, fsflags=, fsflags@entry=2167056, jail_export=, optlist=optlist@entry=0xfffffe008ed86d70) at /opt/src/git-src/sys/kern/vfs_mount.c:1515 o2export = {ex_flags = 964, ex_root = 4294967295, ex_anon = { cr_version = 0, cr_uid = 0, cr_ngroups = -16128, cr_groups = { 4294966784, 0, 0, 137604104, 4294965248, 2396547888, 4294966784, 2155596019, 4294967295, 101272584, 4294965248, 716374896, 4294965248, 2396548144, 4294966784, 2396548144}, { _cr_unused1 = 0xfffffe008ed86b30, cr_pid = -1898419408}}, ex_addr = 0xffffffff807bc7db , ex_addrlen = 88 'X', ex_mask = 0xfffff80006093370, ex_masklen = 176 '\260', ex_indexfile = 0xffffffff807bc0c1 "=", ex_numsecflavors = 4, ex_secflavors = {0, 1866625232, -2048, -2131875320, -1}} export = {ex_flags = 384, ex_root = 0, ex_uid = 0, ex_ngroups = 3, ex_groups = 0xfffff80005876d80, ex_addr = 0x0, ex_addrlen = 0 '\000', ex_mask = 0x0, ex_masklen = 0 '\000', ex_indexfile = 0x0, ex_numsecflavors = 1, ex_secflavors = {1, 0, 0, 0, 0}} mp = 0xfffffe008517c100 flag = 4297068560 vfs_suser_failed = error = rootvp = 0xfffff8002ab30370 fsid_up = mnt_union = 0 export_error = 0 len = bufp = i = grps = 0xfffff80005876d80 fsid_up_len = #11 0xffffffff807bee30 in vfs_domount (td=0xfffff80009381740, fstype=fstype@entry=0xfffff8006f4270b0 "ufs", fspath=fspath@entry=0xfffff8006f427090 "/usr", fsflags=fsflags@entry=2167056, jail_export=false, optlist=optlist@entry=0xfffffe008ed86d70) at /opt/src/git-src/sys/kern/vfs_mount.c:1692 nd = {ni_dirp = 0xfffff8006f427090 "/usr", ni_segflg = UIO_SYSSPACE, ni_rightsneeded = 0xffffffff80e00538 , ni_startdir = 0x0, ni_rootdir = 0xfffff80006094c08, ni_topdir = 0x0, ni_dirfd = -100, ni_lcf = 0, ni_filecaps = {fc_rights = { cr_rights = {0, 0}}, fc_ioctls = 0x0, fc_nioctls = -1, fc_fcntls = 0}, ni_vp = 0xfffff8002ab30370, ni_dvp = 0xfffff80006093370, ni_resflags = 1, ni_debugflags = 63488, ni_loopcnt = 0, ni_pathlen = 1, ni_next = 0xfffff800085ae404 "", ni_cnd = {cn_flags = 335806548, cn_cred = 0xfffff80003215100, cn_nameiop = LOOKUP, cn_lkflags = 524288, cn_pnbuf = 0xfffff800085ae400 "/usr", cn_nameptr = 0xfffff800085ae401 "usr", cn_namelen = 3}, ni_cap_tracker = {tqh_first = 0x0, tqh_last = 0xfffffe008ed86ce0}, ni_dvp_seqc = 64, ni_vp_seqc = 0} error = 0 vfsp = 0x0 vp = 0x3 pathbuf = #12 0xffffffff807bdf36 in vfs_donmount (td=td@entry=0xfffff80009381740, fsflags=, fsflags@entry=2101264, fsoptions=0xfffff8002aa90900) at /opt/src/git-src/sys/kern/vfs_mount.c:9 97 optlist = 0xfffff8006f4270d0 fspath = 0xfffff8006f427090 "/usr" errmsg = fspathlen = errmsg_len = errmsg_pos = 5 autoro = false error = 0 fstypelen = fstype = 0xfffff8006f4270b0 "ufs" has_nonexport = jail_export = opt = tmp_opt = #13 0xffffffff807bd5a0 in sys_nmount (td=0xfffff80009381740, uap=) at /opt/src/git-src/sys/kern/vfs_mount.c:474 auio = 0xfffff8002aa90900 flags = 2101264 iovcnt = error = 0 #14 0xffffffff80a82365 in syscallenter (td=0xfffff80009381740) at /opt/src/git-src/sys/amd64/amd64/../../kern/subr_syscall.c:189 se = 0xffffffff80e59ba0 p = 0xfffffe0085179060 sa = error = sy_thr_static = true traced = _tid = _v = _v = _audit_entered = _tid = _v = _v = _tid = _v = _v = #15 amd64_syscall (td=0xfffff80009381740, traced=0) at /opt/src/git-src/sys/amd64/amd64/trap.c:1192 ksi = {ksi_link = {tqe_next = 0xffffffff80a81548 , tqe_prev = 0xfffffe008ed86ed0}, ksi_info = { si_signo = -2140252247, si_errno = -1, si_code = 154670912, si_pid = -2048, si_uid = 3064555200, si_status = 284, si_addr = 0xfffffe008ed86e80, si_value = {sival_int = -2140785242, sival_ptr = 0xffffffff806635a6 , sigval_int = -2140785242, sigval_ptr = 0xffffffff806635a6 }, _reason = { _fault = {_trapno = -1898418560}, _timer = { _timerid = -1898418560, _overrun = -512}, _mesgq = { _mqd = -1898418560}, _poll = {_band = -2196626706816}, _capsicum = {_syscall = -1898418560}, __spare__ = { __spare1__ = -2196626706816, __spare2__ = {-2140783412, -1, 0, 0, 70, 0, 0}}}}, ksi_flags = 15, ksi_sigq = 0xfffffe008ed86ec0} #16 No locals. #17 0x0000276f876440aa in ?? () No symbol table info available. Backtrace stopped: Cannot access memory at address 0x276f84b0a718 (kgdb) (kgdb) Tracing command "clock", '\000' pid 2 tid 100038 (CPU 0) #0 cpustop_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1525 #1 0xffffffff80a4f958 in ipi_nmi_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1482 #2 0xffffffff80a80e2f in trap (frame=0xffffffff811b9440 ) at /opt/src/git-src/sys/amd64/amd64/trap.c:235 #3 #4 rdtsc () at /opt/src/git-src/sys/amd64/include/cpufunc.h:309 #5 delay_tsc (n=1) at /opt/src/git-src/sys/x86/x86/delay.c:64 #6 delay_tc (n=1) at /opt/src/git-src/sys/x86/x86/delay.c:84 #7 DELAY (n=1) at /opt/src/git-src/sys/x86/x86/delay.c:113 #8 0xffffffff81c2668a in sk_marv_miibus_readreg (sc_if=0xfffffe0091018000, phy=, reg=) at /opt/src/git-src/sys/dev/sk/if_sk.c:597 #9 sk_miibus_readreg (dev=, phy=, reg=) at /opt/src/git-src/sys/dev/sk/if_sk.c:447 #10 0xffffffff8049921a in MIIBUS_READREG (dev=0xfffff800057fb900, phy=0, reg=1) at ./miibus_if.h:27 #11 e1000phy_status (sc=0xfffff80005807000) at /opt/src/git-src/sys/dev/mii/e1000phy.c:417 #12 0xffffffff80499187 in e1000phy_service (sc=0xfffff80005807000, mii=, cmd=1) at /opt/src/git-src/sys/dev/mii/e1000phy.c:4 01 #13 0xffffffff8049cd77 in mii_tick (mii=0xfffff80005807080) at /opt/src/git-src/sys/dev/mii/mii.c:597 #14 0xffffffff81c252ea in sk_yukon_tick ( xsc_if=xsc_if@entry=0xfffffe0091018000) at /opt/src/git-src/sys/dev/sk/if_sk.c:2883 #15 0xffffffff806fa1dd in softclock_call_cc (c=0xfffffe0091018038, cc=cc@entry=0xffffffff81f290c0, direct=direct@entry=0) at /opt/src/git-src/sys/kern/kern_timeout.c:729 #16 0xffffffff806fb8b4 in softclock_thread (arg=arg@entry=0xffffffff81f290c0 ) at /opt/src/git-src/sys/kern/kern_timeout.c:861 #17 0xffffffff80692abb in fork_exit ( callout=0xffffffff806fb7c0 , arg=0xffffffff81f290c0, frame=0xfffffe008e8aef40) at /opt/src/git-src/sys/kern/kern_fork.c:1151 #18 Tracing command "mountd", '\000' pid 3196 tid 100515 (CPU 1) #0 __curthread () at /opt/src/git-src/sys/amd64/include/pcpu_aux.h:57 #1 doadump (textdump=textdump@entry=1) at /opt/src/git-src/sys/kern/kern_shutdown.c:404 #2 0xffffffff806dafee in kern_reboot (howto=260) at /opt/src/git-src/sys/kern/kern_shutdown.c:524 #3 0xffffffff806db517 in vpanic (fmt=0xffffffff80b03e2b "%s", ap=ap@entry=0xfffffe008ed86890) at /opt/src/git-src/sys/kern/kern_shutdown.c:979 #4 0xffffffff806db343 in panic (fmt=) at /opt/src/git-src/sys/kern/kern_shutdown.c:892 #5 0xffffffff80a81aab in trap_fatal (frame=0xfffffe008ed86970, eva=40) at /opt/src/git-src/sys/amd64/amd64/trap.c:950 #6 0xffffffff80a81af6 in trap_pfault (frame=, usermode=false, signo=, ucode=) at /opt/src/git-src/sys/amd64/amd64/trap.c:758 #7 #8 0xffffffff807b6de0 in vfs_hang_addrlist (mp=0xfffffe008517c100, argp=0xfffffe008ed86b60, nep=) at /opt/src/git-src/sys/kern/vfs_export.c:141 #9 vfs_export (mp=mp@entry=0xfffffe008517c100, argp=argp@entry=0xfffffe008ed86b60, do_exjail=true) at /opt/src/git-src/sys/kern/vfs_export.c:408 #10 0xffffffff807c3ad9 in vfs_domount_update (td=td@entry=0xfffff80009381740 , vp=0xfffff8002ab30370, fsflags=, fsflags@entry=2167056, jail_export=, optlist=optlist@entry=0xfffffe008ed86d70) at /opt/src/git-src/sys/kern/vfs_mount.c:1515 #11 0xffffffff807bee30 in vfs_domount (td=0xfffff80009381740, fstype=fstype@entry=0xfffff8006f4270b0 "ufs", fspath=fspath@entry=0xfffff8006f427090 "/usr", fsflags=fsflags@entry=2167056, jail_export=false, optlist=optlist@entry=0xfffffe008ed86d70) at /opt/src/git-src/sys/kern/vfs_mount.c:1692 #12 0xffffffff807bdf36 in vfs_donmount (td=td@entry=0xfffff80009381740, fsflags=, fsflags@entry=2101264, fsoptions=0xfffff8002aa90900) at /opt/src/git-src/sys/kern/vfs_mount.c:9 97 #13 0xffffffff807bd5a0 in sys_nmount (td=0xfffff80009381740, uap=) at /opt/src/git-src/sys/kern/vfs_mount.c:474 #14 0xffffffff80a82365 in syscallenter (td=0xfffff80009381740) at /opt/src/git-src/sys/amd64/amd64/../../kern/subr_syscall.c:189 #15 amd64_syscall (td=0xfffff80009381740, traced=0) at /opt/src/git-src/sys/amd64/amd64/trap.c:1192 #16 #17 0x0000276f876440aa in ?? () Backtrace stopped: Cannot access memory at address 0x276f84b0a718 Tracing command "kernel", '\000' pid 0 tid 100248 (CPU 2) #0 cpustop_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1525 #1 0xffffffff80a4f958 in ipi_nmi_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1482 #2 0xffffffff80a80e2f in trap (frame=0xfffffe0011185f30) at /opt/src/git-src/sys/amd64/amd64/trap.c:235 #3 #4 LZ4_compressCtx (ctx=0xfffffe00b3c40000, source=0xfffffe00bd371000 , dest=0xfffffe00c895d004 , isize=131072, osize=114684) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:532 #5 real_LZ4_compress ( source=0xfffffe00bd371000 , dest=0xfffffe00c895d004 , isize=131072, osize=114684) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:863 #6 zfs_lz4_compress_buf (s_start=0xfffffe00bd371000, d_start=0xfffffe00c895d000, s_len=131072, d_len=114688, n=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:66 #7 zfs_lz4_compress (src=0xfffff80022646080, dst=0xfffff80075509f00, s_len=131072, d_len=114688, n=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:104 #8 0xffffffff816a3231 in zio_compress_data (c=, src=0xfffff80022646080, dst=dst@entry=0xfffffe008eafcdd0, s_len=131072, d_len=114688, level=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio_compress.c:155 #9 0xffffffff8169b8fa in zio_write_compress (zio=0xfffffe00bdc374c0) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:1916 #10 0xffffffff816996d8 in __zio_execute (zio=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:2427 #11 zio_execute (zio=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:2338 #12 0xffffffff80741e62 in taskqueue_run_locked ( queue=queue@entry=0xfffff800061db800) at /opt/src/git-src/sys/kern/subr_taskqueue.c:517 #13 0xffffffff80743052 in taskqueue_thread_loop ( arg=arg@entry=0xfffff800057e1d60) at /opt/src/git-src/sys/kern/subr_taskqueue.c:829 #14 0xffffffff80692abb in fork_exit ( callout=0xffffffff80742f90 , arg=0xfffff800057e1d60, frame=0xfffffe008eafcf40) at /opt/src/git-src/sys/kern/kern_fork.c:1151 #15 Tracing command "kernel", '\000' pid 0 tid 100247 (CPU 3) #0 cpustop_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1525 #1 0xffffffff80a4f958 in ipi_nmi_handler () at /opt/src/git-src/sys/x86/x86/mp_x86.c:1482 #2 0xffffffff80a80e2f in trap (frame=0xfffffe0011193f30) at /opt/src/git-src/sys/amd64/amd64/trap.c:235 #3 #4 0xffffffff8158e5e9 in LZ4_compressCtx (ctx=0xfffffe00b3c3c000, source=0xfffffe00bd0d1000 , dest=0xfffffe00c829d004 , isize=131072, osize=114684) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:617 #5 real_LZ4_compress ( source=0xfffffe00bd0d1000 , dest=0xfffffe00c829d004 , isize=131072, osize=114684) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:863 #6 zfs_lz4_compress_buf (s_start=0xfffffe00bd0d1000, d_start=0xfffffe00c829d000, s_len=131072, d_len=114688, n=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:66 #7 zfs_lz4_compress (src=0xfffff80075fab880, dst=0xfffff80022c4be00, s_len=131072, d_len=114688, n=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/lz4_zfs.c:104 #8 0xffffffff816a3231 in zio_compress_data (c=, src=0xfffff80075fab880, dst=dst@entry=0xfffffe008eb01dd0, s_len=131072, d_len=114688, level=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio_compress.c:155 #9 0xffffffff8169b8fa in zio_write_compress (zio=0xfffffe00be1d0980) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:1916 #10 0xffffffff816996d8 in __zio_execute (zio=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:2427 #11 zio_execute (zio=) at /opt/src/git-src/sys/contrib/openzfs/module/zfs/zio.c:2338 #12 0xffffffff80741e62 in taskqueue_run_locked ( queue=queue@entry=0xfffff800061db800) at /opt/src/git-src/sys/kern/subr_taskqueue.c:517 #13 0xffffffff80743052 in taskqueue_thread_loop ( arg=arg@entry=0xfffff800057e1d60) at /opt/src/git-src/sys/kern/subr_taskqueue.c:829 #14 0xffffffff80692abb in fork_exit ( callout=0xffffffff80742f90 , arg=0xfffff800057e1d60, frame=0xfffffe008eb01f40) at /opt/src/git-src/sys/kern/kern_fork.c:1151 #15 (kgdb) -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com>, Ravi Pokala writ es: > Hi Olivier, > > This appears to break amd64.MINIMAL and amd64.MINIMALUP: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 > D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > 3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % less _.amd64.MINIMAL > linking kernel.full > ld: error: undefined symbol: vnet_entry_nfsrv_defaultgid > >>> referenced by vfs_export.c:141 (sys/kern/vfs_export.c:141) > >>> vfs_export.o:(vfs_export) > >>> referenced by vfs_export.c:220 (sys/kern/vfs_export.c:220) > >>> vfs_export.o:(vfs_export) > --- kernel.full --- > *** [kernel.full] Error code 1 > > make[5]: stopped making "all" in amd64.amd64/sys/MINIMAL > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 > D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > 3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Thanks, > > Ravi (rpokala@) > > =EF=BB=BF-----Original Message----- > From: d.org>> on behalf of Olivier Certner org>> > Date: Saturday, November 2, 2024 at 13:39 > To: >, commits-src-all@FreeBSD.org >, commits-src-main@FreeBSD.org > > Subject: git: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials hav= > e at least one group > > > The branch main has been updated by olce: > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dcfbe7a62dc62e8a5d7520cb5eb8ad7 > = > c4a9418e26 5= > eb8ad7c4a9418e26> > > > commit cfbe7a62dc62e8a5d7520cb5eb8ad7c4a9418e26 > Author: Olivier Certner > > AuthorDate: 2024-10-02 14:28:59 +0000 > Commit: Olivier Certner > > CommitDate: 2024-11-02 20:37:42 +0000 > > > nfs, rpc: Ensure kernel credentials have at least one group > > > This fixes several bugs where some 'struct ucred' in the kernel, > constructed from user input (via nmount(2)) or obtained from other > servers (e.g., gssd(8)), could have an unfilled 'cr_groups' field and > whose 'cr_groups[0]' (or 'cr_gid', which is an alias) was later > accessed, causing an uninitialized access giving random access rights. > > > Use crsetgroups_fallback() to enforce a fallback group when possible. > For NFS, the chosen fallback group is that of the NFS server in the > current VNET (NFSD_VNET(nfsrv_defaultgid)). > > > There does not seem to be any sensible fallback available in rpc code > (sys/rpc/svc_auth.c, svc_getcred()) on AUTH_UNIX (TLS or not), so just > fail credential retrieval there. Stock NSS sources, rpc.tlsservd(8) or > rpc.tlsclntd(8) provide non-empty group lists, so will not be impacted. > > > Discussed with: rmacklem (by mail) > Approved by: markj (mentor) > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D46918 freebsd.org/D46918> > --- > sys/fs/nfs/nfs_commonport.c | 4 +++- > sys/fs/nfs/nfs_commonsubs.c | 5 +++-- > sys/fs/nfsserver/nfs_nfsdport.c | 6 +++++- > sys/fs/nfsserver/nfs_nfsdsocket.c | 6 ++---- > sys/kern/vfs_export.c | 12 ++++++++---- > sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- > sys/rpc/svc_auth.c | 8 ++++++-- > 7 files changed, 28 insertions(+), 15 deletions(-) > > > diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c > index 2db9af5b9ea9..11f31d1a0e9f 100644 > --- a/sys/fs/nfs/nfs_commonport.c > +++ b/sys/fs/nfs/nfs_commonport.c > @@ -75,6 +75,7 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); > > > NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); > NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); > +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > > > int nfs_pnfsio(task_fn_t *, void *); > > > @@ -258,7 +259,8 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr= > ) > KASSERT(nfscr->nfsc_ngroups >=3D 0, > ("newnfs_copycred: negative nfsc_ngroups")); > cr->cr_uid =3D nfscr->nfsc_uid; > - crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups); > + crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, > + NFSD_VNET(nfsrv_defaultgid)); > } > > > /* > diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c > index 90b30f462106..ce4b0052714e 100644 > --- a/sys/fs/nfs/nfs_commonsubs.c > +++ b/sys/fs/nfs/nfs_commonsubs.c > @@ -4051,8 +4051,9 @@ nfssvc_idname(struct nfsd_idargs *nidp) > */ > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D nidp->nid_uid; > - crsetgroups(cr, nidp->nid_ngroup, grps); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + crsetgroups_fallback(cr, nidp->nid_ngroup, grps, > + NFSD_VNET(nfsrv_defaultgid)); > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > #ifdef MAC > diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdpor= > t.c > index 8a2a39052506..5160645ad73c 100644 > --- a/sys/fs/nfsserver/nfs_nfsdport.c > +++ b/sys/fs/nfsserver/nfs_nfsdport.c > @@ -3311,7 +3311,11 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexs= > tuff *exp, > NFSVNO_EXPORTANON(exp) || > (nd->nd_flag & ND_AUTHNONE) !=3D 0) { > nd->nd_cred->cr_uid =3D credanon->cr_uid; > - nd->nd_cred->cr_gid =3D credanon->cr_gid; > + /* > + * 'credanon' is already a 'struct ucred' that was built > + * internally with calls to crsetgroups_fallback(), so > + * we don't need a fallback here. > + */ > crsetgroups(nd->nd_cred, credanon->cr_ngroups, > credanon->cr_groups); > } else if ((nd->nd_flag & ND_GSS) =3D=3D 0) { > diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsds= > ocket.c > index df0c0edd1b59..d1b6198ba0e1 100644 > --- a/sys/fs/nfsserver/nfs_nfsdsocket.c > +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c > @@ -1422,13 +1422,11 @@ static struct ucred * > nfsrv_createrootcred(void) > { > struct ucred *cr; > - gid_t grp; > > > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D UID_ROOT; > - grp =3D GID_WHEEL; > - crsetgroups(cr, 1, &grp); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + crsetgroups_fallback(cr, 0, NULL, GID_WHEEL); > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > #ifdef MAC > diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c > index 996f3f74193f..c0337b1fe858 100644 > --- a/sys/kern/vfs_export.c > +++ b/sys/kern/vfs_export.c > @@ -61,6 +61,10 @@ > #include > #include > > > +#include > + > +NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > + > static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structu= > re"); > > > #if defined(INET) || defined(INET6) > @@ -133,8 +137,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= > ep, > np->netc_exflags =3D argp->ex_flags; > np->netc_anon =3D crget(); > np->netc_anon->cr_uid =3D argp->ex_uid; > - crsetgroups(np->netc_anon, argp->ex_ngroups, > - argp->ex_groups); > + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, > + argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); > np->netc_anon->cr_prison =3D &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors =3D argp->ex_numsecflavors; > @@ -212,8 +216,8 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *n= > ep, > np->netc_exflags =3D argp->ex_flags; > np->netc_anon =3D crget(); > np->netc_anon->cr_uid =3D argp->ex_uid; > - crsetgroups(np->netc_anon, argp->ex_ngroups, > - argp->ex_groups); > + crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, > + NFSD_VNET(nfsrv_defaultgid)); > np->netc_anon->cr_prison =3D &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors =3D argp->ex_numsecflavors; > diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_r= > pcsec_gss.c > index 1e6e71fa10ac..b1790dd167d5 100644 > --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > @@ -537,7 +537,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred *= > *crp, int *flavorp) > cr =3D client->cl_cred =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D uc->uid; > cr->cr_rgid =3D cr->cr_svgid =3D uc->gid; > - crsetgroups(cr, uc->gidlen, uc->gidlist); > + crsetgroups_fallback(cr, uc->gidlen, uc->gidlist, uc->gid); > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D crhold(cr); > diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c > index 6acb1fb0d4b9..92f1ee0f2844 100644 > --- a/sys/rpc/svc_auth.c > +++ b/sys/rpc/svc_auth.c > @@ -187,10 +187,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= > int *flavorp) > if ((xprt->xp_tls & (RPCTLS_FLAGS_CERTUSER | > RPCTLS_FLAGS_DISABLED)) =3D=3D RPCTLS_FLAGS_CERTUSER && > flavor =3D=3D AUTH_UNIX) { > + if (xprt->xp_ngrps <=3D 0) > + return (FALSE); > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xprt->xp_uid; > crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); > - cr->cr_rgid =3D cr->cr_svgid =3D xprt->xp_gidp[0]; > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D cr; > @@ -200,10 +202,12 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp,= > int *flavorp) > switch (flavor) { > case AUTH_UNIX: > xcr =3D (struct xucred *) rqst->rq_clntcred; > + if (xcr->cr_ngroups <=3D 0) > + return (FALSE); > cr =3D crget(); > cr->cr_uid =3D cr->cr_ruid =3D cr->cr_svuid =3D xcr->cr_uid; > crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); > - cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_groups[0]; > + cr->cr_rgid =3D cr->cr_svgid =3D cr->cr_gid; > cr->cr_prison =3D curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > *crp =3D cr; > > > > From nobody Sun Nov 3 09:47:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh8sj3MTrz5cFCq; Sun, 03 Nov 2024 09:47:53 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh8sj2TLmz4VDf; Sun, 3 Nov 2024 09:47:53 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730627273; 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=wMooJTNZZ/ue+JHX8N0dz346Gwh24jZx0Y8TgHciIZU=; b=J98vYj/rU1yqee2ins9uJhcGZCXFtTu3N+kSiuFbbNstIK64VINJg8tiRkgqwQHRtcyMNr ojyPH7JZdnhkqQqAVYHIZI40wnmbTQRMrnLsSQZFFD6AZZAv4wy9UM7FM4ngr8kDLZ6IGA VdJvWKpZk2c5thKy1GuEmbq3rF3Xm+Ibdf9Ix9pcwOr/FNj/JlpzuBGVBC7csvHHkKqs9M sJh4+TezjOX8QLx7jA0DBa5gFC3F4josbqORwUBPmL8RvIdWsLwX+4PorTkfIK88zjz6Pp 2KiNVwb614KJSAMmw14YYBP/E9+Yb+/K/Y+imVhxh+EEsXcVM5Hv6tV95gDapQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730627273; 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=wMooJTNZZ/ue+JHX8N0dz346Gwh24jZx0Y8TgHciIZU=; b=OyyWBF8CMpvUwV+Lp3fixIf1o4XGWh1aWPgUI9AVy6BfLr9uXvOyGsk9j/6fEtb6MIwn/U yTJTxY7MftAqrre46K495GaRrOG+KjzisHLLnLYLd23IRp75yLUJ1jytwF8QWjQsy03nLb s5+8ytowXrBevUmjxWhQDgyPmBSroruabWe59Ob8FJyoPd4EoLPDxjYhfMLSx/fAajNUni nndGsUd42CnNUXg+49EYF58ovJAOQPBlBG3vhM2H/o0xLHSwsyVbWWI6MX0xD/761g+AVO 1ulltpjVVi1gDAkLoa6ok0e8IyfytsvISas1wlZdYgg2Rei1BUy/jHnIdIF95A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730627273; a=rsa-sha256; cv=none; b=AJksll3Ui40Y3YXyVWshRKg9yPF3drY9hpMcQHSppxLtxW9gPTHMemtElBvK9q50109VHx QKrGvkLlYC2BkOkS+irZ2UcAtqDWWFZHu38keh0Ofu2yo8RbE5F6/3JaVv2ADftJeDetPh UbCWSbeW0l+3/UOkzjGpf6io0lFzh8W7LaEh0L3Tc4NMI1ND/egOhort8knQMutesLSMu9 hl64keRbUhFMOCT3sBUcLyV2vt1Cta+DPfsHLyO09OGwM0uGh2E3jTGeuL5wXB05FdyGTQ 07GQ36VjtnmWT8dQXhy6yxMSuxNmfI5QEF8cobMvqjXxkR7sE4L2UHchuFARdA== Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xh8sh4rW8z1FRp; Sun, 3 Nov 2024 09:47:52 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Ravi Pokala , Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group Date: Sun, 03 Nov 2024 10:47:44 +0100 Message-ID: <2583578.0dHE6SNnxz@ravel> In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> <20241103065704.4377C114@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4132862.BRNeRiNLvY"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart4132862.BRNeRiNLvY Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Olivier Certner Date: Sun, 03 Nov 2024 10:47:44 +0100 Message-ID: <2583578.0dHE6SNnxz@ravel> In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> MIME-Version: 1.0 Hello, > One of these commits causes a panic when yppasswd is started. The relevant > details are below. > > However on my laptop the panic is in mountd. No core dump was captured on > that machine. I'm sorry for the inconvenience caused. Starting to investigate based on the info you provided, will post an update as things get clearer (and if they don't I'll revert the series pending more investigation). Thanks and regards. -- Olivier Certner --nextPart4132862.BRNeRiNLvY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmcnRsAACgkQjKEwQJce Jiec5Q//Q9J0R4/HVvn5AfhLxXUKuQkgPlVAwkhPJ5SlHujWX05LpWYO4cix5WZ9 XpqKKEgQbaor3M2k5NlpCtx8AYFD036q6tc9qtdVagC2A2TunM5N9LMB4AkyUpwI woPRKdUiPfGeC2iANrpWqw4zD+Q2dtt1TqY0KP4wkBRa/0qQmsC6LZv4u1QbSjkN vzHYWKogv8TizenZQ4LAeHqFwoy+j16yKBX8jR3sM5axwr23d6ir8VoRNVpSSG2o nDUFrKlRlgjtHnjTKcUkxk/+1Dp1+28urjLxVdpbq1VvxQUuViWgPFyjy54PUbXK 4qQD/WJgqZZwdh4p2waGnTh0pX6Ws873k8jbWyDmvmTR2LTEtuT70rmdTAiWndrL upzn0lENE3oWd7lynLBFb7WJf31rThOevPa3xIjUZV98RTvVA+sggPwBrb9GbYet noWgq9om2GX79a6LhYYdCLGBSoE9EV8507Ynzulo21AMZDIkmN+6CayUW5V/cOpN jz7hLQJCY6U43yyhjPL7XrpyVVp0Gz/cO7zZau59sqCcwf4qu2ZwyUTC3wlDg32L 8GLkHJgiy3+kKoRMiwLxKnvMBaNIhfN8SKsNbGxFjIKHVmQ96lE5Cz7JiL665NZk WNuNH4vovK/1esvFHswHEzTld2pgK6LqmHs+pliHK6WT9qiJu5U= =zaNT -----END PGP SIGNATURE----- --nextPart4132862.BRNeRiNLvY-- From nobody Sun Nov 3 10:23:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh9fm4zDhz5bnvy; Sun, 03 Nov 2024 10:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh9fm4WZ5z4Yv7; Sun, 3 Nov 2024 10:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730629408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=labcbSzhWBwuJBrP7yYfdizt0EMs70FbnFBN4GR98Go=; b=weDlXi8GtFCOYQq34EE9wRmbOyOiXPZ5aJH2nPI0hh1aaORKZQDFW6rds/iNU2WcMnDpgX RBG0vFBiWDkeOJ2lFDKRcfkQ+PxxCL7K2mP75BklOKTqbX23wT53XDCRfQLq6n1jNWQ2d+ 6/0j8zdGBtr/EFcLie3aDa6jJRkYu6lIdWv08BijlNERDRANjZ27155+1+PkLvXtzK/kpp wThdbKf4AmOu50JjdHHS+7VJVmm4mAjH1KU4kFVToW9fCz4c9pwtfz8EzNqmFYUZYUwRe8 0PS6zshohjYALtMwvDnK7UoHIoit6QYm4W3bWOrswYV5aOGnMnQGBZi/13oOSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730629408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=labcbSzhWBwuJBrP7yYfdizt0EMs70FbnFBN4GR98Go=; b=g9gr3SEUBsnUZF2TU4i2OXc7Ow1I+04/grrOILPdUQdD9ebJ3dkQ9UsZf/V+7TuwOOsFYw qRTm6a4bjqUQxxlGMptMMNEql52yCViydZ2O5yQ7mNl3XglvmeVBveRCAezdSKR+f0Ur+Y V8f+ClpWziKdjyyM5Ef6vckHU48W7NDwyk9pEpW8eNzsJA1Ez6amnyEayWQ3D+P8Zssx09 ZYPUKIG04H5K9rW9HeO/Lx1LdwQr/6YEzLKfhmeLBnARl7fpjox3tqFB5i9QMuCg8xzjXH 1B7CDwIeGwFmQ0YlhDqj0QTAPTdST7fQW3H1Koo8RaZP8CuyvT1nt1rhDmldqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730629408; a=rsa-sha256; cv=none; b=yC1i+QBYHI5Qy0s8jnyhoBTcmI9uOF/lVOXaaXyQPzYbIiXkY73WLu7O2Y4mAlv1IFxplU qoaNw6pJg62gAg/cETwDl3FMzzEPaGLajX4EPSKe06cxQG55rra8WzTMyChPa7JD7LEAAn LTg0R/xh1y7wRP4Q3EZRDiaeF7896noimDkfbpNLKnajI1SarHgU0NRyfLpzzQ/eDkZXEk 6MA86N483KN71SfjU4ISUXgZPyvTKmO8oL+0IO2B/CXoJB9d9YwKZXX25/RTeW97neiqgI b9mXpBVqz0rFt9ktApMblcgBd3vIB6bO62rk4KJSGuBgTPyyRXtITjs4GO+6HA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xh9fm46qJzkj1; Sun, 3 Nov 2024 10:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3ANSWH083124; Sun, 3 Nov 2024 10:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3ANSHq083121; Sun, 3 Nov 2024 10:23:28 GMT (envelope-from git) Date: Sun, 3 Nov 2024 10:23:28 GMT Message-Id: <202411031023.4A3ANSHq083121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 523913c94371 - main - sctp: improve handling of address changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 523913c94371ab50a8129cbab820394d25f7a269 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=523913c94371ab50a8129cbab820394d25f7a269 commit 523913c94371ab50a8129cbab820394d25f7a269 Author: Michael Tuexen AuthorDate: 2024-11-03 09:20:08 +0000 Commit: Michael Tuexen CommitDate: 2024-11-03 09:20:08 +0000 sctp: improve handling of address changes Identify interfaces consistenly by the pair of the ifn pointer and the index. This avoids a use after free when the ifn and or index was reused. Reported by: bz, pho, and others MFC after: 3 days --- sys/netinet/sctp_bsd_addr.c | 1 + sys/netinet/sctp_pcb.c | 23 +++++++++++++---------- sys/netinet/sctp_pcb.h | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index 3c6952ab6f3c..a10fbcc5ca40 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -338,6 +338,7 @@ sctp_addr_change(struct ifaddr *ifa, int cmd) (void *)ifa, ifa->ifa_addr, ifa_flags, 1); } else { sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr, + (void *)ifa->ifa_ifp, ifa->ifa_ifp->if_index); /* diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 03f1d2e944f1..56d36dc9f34e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -193,12 +193,11 @@ sctp_find_ifn(void *ifn, uint32_t ifn_index) struct sctp_ifnlist *hash_ifn_head; SCTP_IPI_ADDR_LOCK_ASSERT(); + KASSERT(ifn != NULL, ("sctp_find_ifn(NULL, %u) called", ifn_index)); hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_FOREACH(sctp_ifnp, hash_ifn_head, next_bucket) { - if (sctp_ifnp->ifn_index == ifn_index) { - break; - } - if (ifn != NULL && sctp_ifnp->ifn_p == ifn) { + if (sctp_ifnp->ifn_index == ifn_index && + sctp_ifnp->ifn_p == ifn) { break; } } @@ -439,7 +438,8 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, if (sctp_ifap != NULL) { /* The address being added is already or still known. */ if (sctp_ifap->ifn_p != NULL) { - if (sctp_ifap->ifn_p->ifn_index == ifn_index) { + if (sctp_ifap->ifn_p->ifn_index == ifn_index && + sctp_ifap->ifn_p->ifn_p == ifn) { SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, @@ -578,7 +578,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, */ SCTPDBG(SCTP_DEBUG_PCB4, "Lost an address change?\n"); /* Opps, must decrement the count */ - sctp_del_addr_from_vrf(vrf_id, addr, ifn_index); + sctp_del_addr_from_vrf(vrf_id, addr, ifn, ifn_index); return (NULL); } SCTP_INCR_LADDR_COUNT(); @@ -603,7 +603,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, void sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, - uint32_t ifn_index) + void *ifn, uint32_t ifn_index) { struct sctp_vrf *vrf; struct sctp_ifa *sctp_ifap; @@ -624,9 +624,12 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - if (ifn_index != sctp_ifap->ifn_p->ifn_index) { - SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d ifname:%s - ignoring delete\n", - sctp_ifap->ifn_p->ifn_index, sctp_ifap->ifn_p->ifn_name); + if (ifn_index != sctp_ifap->ifn_p->ifn_index || + ifn != sctp_ifap->ifn_p->ifn_p) { + SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d (p) ifname:%s - ignoring delete\n", + sctp_ifap->ifn_p->ifn_index, + sctp_ifap->ifn_p->ifn_p, + sctp_ifap->ifn_p->ifn_name); SCTP_IPI_ADDR_WUNLOCK(); return; } diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 736972c007d8..2bec2bc32d4e 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -498,7 +498,7 @@ void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void sctp_del_addr_from_vrf(uint32_t vrfid, struct sockaddr *addr, - uint32_t ifn_index); + void *ifn, uint32_t ifn_index); struct sctp_nets *sctp_findnet(struct sctp_tcb *, struct sockaddr *); From nobody Sun Nov 3 10:35:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xh9xD1h0sz5bpHl; Sun, 03 Nov 2024 10:36:00 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xh9xC6gv5z4Zbm; Sun, 3 Nov 2024 10:35:59 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730630159; 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=gfGYoqpOgxu5D0URDDUelnvwULtsVOZlplOwXngGRU8=; b=p4GivA4Ecx/N41r/8+LQXAHwlA+8LBI0kKyH5zHNkBtaV8qebr6l+c/pG8r6gXC5jCx346 anFs7Eu5LD1GG1OXHji4KIEQrn2CR5dsIo8D2U+bUw/yzVYTwL0Z4Aos/Kj1nOT0WocM8k VeMrftfWBFigOP5TRliaadyahDQI0PXJqDDVSCsBLjB/PSt0t329yqwZMjLBXO5yRrKjoe 8hGKmL1jHCSfERA8YcMGHYhTDBedTRnUHjLw027uKewne2k+/tRyrByvrJU0Q4Yob1z/X4 aPg1Nhh09scRKKyPhFr6t1xZA640HghXS7aNc9vrdq4V9D+HKA87kzIX5Hpicw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730630159; 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=gfGYoqpOgxu5D0URDDUelnvwULtsVOZlplOwXngGRU8=; b=irNWapylOXjnW2wv8AdRtM3KT9WeqtMUTTWOxO6REv7K1swNVIfGCIsAz2lrb+hX88UI8J vnWCVZVnKo55xjGpnnZDqrFbqVJT1df8mabzFYhXQgmRpOKXq+8PnXu0G08y2e10q2iVAw 8JMvJc1plbWi18dHIl4+mctCQQWu1TrXx2qQ+aN86W504/TWQjGzD+PiIodLq+OJxL82nI Ck/v84Qn9D2W2wJZhZr7huJwNcHhgnnF3agH60uDCNO/dHjk9nrKgRSss/1itvLqqJpoZa pFTv6cB21tXtxGp2VpPCEdQTXkbpKRAdmccu6FrEcL6zIKabXUQbbDPa1mmx8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730630159; a=rsa-sha256; cv=none; b=wVsrVkVOhulMBSYHcYn7hpKxVExNoPj6WPx6mcFVNeRcNQuriIa+SPiF5FPm7to6SibD0A fGeoUcfg0Q4BY7dgsB8QN9xQZ2zzODgZ+SVODmG8FbUvmmUoOBVxSPnA0uP4FDqRCMFKe7 eMfqjF8iu4Bzhg8UPBVJ9NtBf46FNXlhNV7nmGVDQ7a21WTUwvOBO5nh8X2Mm9zpOaERLS lgEuIwfQxtTRaACY2XOiZe1GzRWUeOJoelgI74EEBT9+zydD5clSt4eIrHgU39XDBAT6hQ PN0SUQm708LvWK3VabW+d+Gp198ajrepPRLIPk5pK3L3QPAvL1gQTrElUSScLA== Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xh9xC1yTmz1GnR; Sun, 3 Nov 2024 10:35:59 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Ravi Pokala , Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group Date: Sun, 03 Nov 2024 11:35:53 +0100 Message-ID: <3070589.hHqAuc6tWs@ravel> In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> <20241103065704.4377C114@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2434776.THHZn3L5Ee"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart2434776.THHZn3L5Ee Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Olivier Certner Date: Sun, 03 Nov 2024 11:35:53 +0100 Message-ID: <3070589.hHqAuc6tWs@ravel> In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> MIME-Version: 1.0 I now probably know what is going on and will post a patch soon (to fix both MINIMAL build and your panics). Is your "BREAK" kernel configuration omitting INET or NFSD? -- Olivier Certner --nextPart2434776.THHZn3L5Ee Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmcnUgkACgkQjKEwQJce JidUmRAAir7DYlRibHnyEepriQnIdsKYGCCp+U0QVPx6jSfMCfnelyhCtAZSWrjr Z8tTe6cqMyRXu9RuJFXmAuHV6iSO9EkLyQ9PfMSOYXqljWpDwu3bqtUPgCpd+lEI h1mCoE67zSYWFp4nZPLbQDfPOKM7ur43qvAVanaqn89976h/oJsV8+axGginBnKw ezedmCBQtl6tN3UGoal0eoswDR3Ok7dhOF3TAJ3j8oU9PmQjM6wLbDINgWXGpE2w qRq8QREY8KOxK3hg9mrlvyDNRjcQ0xPR01nlDrAI8xM/+Ki7eU3CR/jlcrW9/7xK 78uQlKjN4h5OOZ1PgLi1w69ix2lnbGkKY+6xhPJURvFFqzRUmUKbNb2sr1SlQs1e BdzGODaFeWy+gsdBoMEgxYQngEC+uQ7yK5HB6Ji8t3fEy2aiZMQcMeeuZadJXGwa aY9la4qWHx4Obwn0dxcMp6CWGB3VmA2oTEgYTyqXl6UVifkCw3pFtKBa/GXxvtMP hxbCbUBLx9ZJtPG6NrOiJVIdaRnK6224fhAnveKV8cbLYr4QIKH324vDm1zR9tOh 6jsmxSIlKns6uRKZNys/CgH8JnaUEXhegMyBaIZtq+8qWqknId9coNF0v+4vDmhb akc9i7LcauEWySmr0p15K+ubvR4f4KgmZSou0XB8XUbm1YLO+xY= =NBY2 -----END PGP SIGNATURE----- --nextPart2434776.THHZn3L5Ee-- From nobody Sun Nov 3 10:46:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhBB20sNTz5bqgD; Sun, 03 Nov 2024 10:47:06 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhBB16T7fz4bg3; Sun, 3 Nov 2024 10:47:05 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730630825; 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=elDFDGiw02Fx9qNupKO6RWCGxLJ7A3yJt+MHuyRxI6M=; b=RAS7qx5nRq6fc32YtyJ87mm73MKfTmJmZqDOrEDmgnaeE1w0M8WwyPU0QIm5bh2g/9d/uV Df7dQe2Q5Lrr3LLg105afHuMxehHOBbcM8Mm+1pVtDy/sl5KOdaphWEAlOlZnsbqtAwE6r LZ3ywI+3Z1cQlLuO7BWihERDeD6xuZs+8Ux2TkyAS71hGnio60z6PVzfE8pzUKmNJlu69W I0MXY4X2Dgn414vMrLCo4pRxVTie6AhEaQXwhcMvY08HqW/VKZeKBVy69NO7hrqi8m748v SU8Oa+DB5sLg8Y3HAmlf/FL4F8MovYW/UTrAcTvo+09jgTIgRzJnB0kTKEiT3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730630825; 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=elDFDGiw02Fx9qNupKO6RWCGxLJ7A3yJt+MHuyRxI6M=; b=ohjGKblKn0G0hpq9FU8icJ+tzIMwxu3uWo1NGm2WUw4yhVQnHb0HPARM/xoxIngfe8L+RW FaPa7+73Q1wJ41iW0DdZRHiScQbhdxYcng6XCxrjkiA75FK3WY3zY+xXX/Sm08KSO5yEAs VOxQP/YYLD1YhYZEldIpFnvPXpY6Yro/LOgOco4wWdgmNHy6q1I4Tgz+FRJboK+bILhm2N AVuCRLc2F9xCTAjdziABfwZUY8TumJJx339NahFae3mYm51tbYYXy0MigOuflg+DPfFGIA Gzd+YvC8qsOzGNs5TzTVnQ9qrqKYSIuOUsivHs4osA6+G3k+H+LoXLfZUng8dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730630825; a=rsa-sha256; cv=none; b=eH9Hn8wViGXWsf1pa877HCwWw9Dv0muXSmM/9pDxY83sVC8WbBYBCWFcsoy3Q82wC1iWWZ j7hsa+9pxQwxj2mGD38bti95oMSJn+Q/BQShKTJsAAUbUikc6q3Nxl5BVIZPvvAO1Picor HQKuZWlYEDcGX7nqh8GA5HS0aZkmA6UcliwKaOB1yqcmrj3jAyIbV7nZVaADW7EBvrv6qA 3K8l95HDkzw8iuN7M0HFUpqiAUUO01frtubTzAUxxkSBwTvkBFyTVVw2jFMwv1lHObdi9f eMaA4iUvFde6LrQUs+WAWIsGb2omYdzEZWb13EmNfR8EmHCbshzPncUfibeMGw== Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XhBB11g4Zz1GH1; Sun, 3 Nov 2024 10:47:05 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Ravi Pokala , Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group Date: Sun, 03 Nov 2024 11:46:58 +0100 Message-ID: <2884013.iL6vRArjjl@ravel> In-Reply-To: <3070589.hHqAuc6tWs@ravel> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <20241103065704.4377C114@slippy.cwsent.com> <3070589.hHqAuc6tWs@ravel> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1977332.vslOlgHxSZ"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart1977332.vslOlgHxSZ Content-Type: multipart/mixed; boundary="nextPart86592338.0ko45tJjV3"; protected-headers="v1" Content-Transfer-Encoding: 7Bit From: Olivier Certner Date: Sun, 03 Nov 2024 11:46:58 +0100 Message-ID: <2884013.iL6vRArjjl@ravel> In-Reply-To: <3070589.hHqAuc6tWs@ravel> MIME-Version: 1.0 This is a multi-part message in MIME format. --nextPart86592338.0ko45tJjV3 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Could you please test the attached patch and confirm it fixes the problems you're seeing? -- Olivier Certner --nextPart86592338.0ko45tJjV3 Content-Disposition: attachment; filename="0001-nfs-Fallback-to-GID_NOGROUP-on-no-groups.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-nfs-Fallback-to-GID_NOGROUP-on-no-groups.patch" >From ab37cd80635b52f59fbce53f942cddd79002f233 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Sun, 3 Nov 2024 11:26:37 +0100 Subject: [PATCH] nfs: Fallback to GID_NOGROUP on no groups We cannot unconditionally access nfsd's VNET variables in 'sys/kern/vfs_export.c' nor 'sys/fs/nfsserver/nfs_nfsdsubs.c', as they may not have been compiled in depending on build options. So, forget about the extra mile of using the configured default group and use the hardcoded GID_NOGROUP (which differs only on systems running nfsuserd(8) and with a non-default UID for their "nogroup" group). Fixes: cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have at least one group") --- sys/fs/nfs/nfs_commonport.c | 3 +-- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/kern/vfs_export.c | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 11f31d1a0e9f..0c94f4e7dc52 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -73,11 +73,10 @@ uint32_t nfs_srvmaxio = NFS_SRVMAXIO; NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); int nfs_pnfsio(task_fn_t *, void *); static int nfs_realign_test; static int nfs_realign_count; @@ -258,11 +257,11 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) KASSERT(nfscr->nfsc_ngroups >= 0, ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid = nfscr->nfsc_uid; crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); } /* * Map args from nfsmsleep() to msleep(). */ diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index ce4b0052714e..81c558d768ea 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4050,11 +4050,11 @@ nfssvc_idname(struct nfsd_idargs *nidp) * but using the group list provided. */ cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; crsetgroups_fallback(cr, nidp->nid_ngroup, grps, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC mac_cred_associate_nfsd(cr); diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index c0337b1fe858..a314bda164de 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -38,10 +38,11 @@ #include "opt_inet.h" #include "opt_inet6.h" #include #include +#include #include #include #include #include #include @@ -59,14 +60,10 @@ #include #include #include -#include - -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); - static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); #if defined(INET) || defined(INET6) static struct radix_node_head *vfs_create_addrlist_af( struct radix_node_head **prnh, int off); @@ -136,11 +133,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np = &nep->ne_defexported; np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, - argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); + argp->ex_groups, GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; bcopy(argp->ex_secflavors, np->netc_secflavors, sizeof(np->netc_secflavors)); @@ -215,11 +212,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, } np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; bcopy(argp->ex_secflavors, np->netc_secflavors, sizeof(np->netc_secflavors)); --nextPart86592338.0ko45tJjV3-- --nextPart1977332.vslOlgHxSZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmcnVKIACgkQjKEwQJce JieGVhAAsPXb7nT5upWhApQjVKFeAbzKhQKNZ84pYzdpPJ0UEFb82TwG46ex4scA axeE8qn5HGnSqLk4VO+KRsbLjEcsxQWJ4vB0t0uO/bZz5HlYD4FYg/+OS7m6uY+6 Wd4Mf7NHs2fvP0Dy7+8y80tRuXYssTGKKWkIMfclC84vXnDtE9FdZZxNT0/+2WGO 6ZH6tewyd3BQDIpmyzWOE/7/AfRBUIFP1hvJH7PXVhrra6dTXJxtx1zCVozEOzBz lcPv6GVf6lnrIvpDc35Yy6JybQ4BTPGHLrGd7w25dyswSqr+qvjRSE/oqW9M4e4T LpEIHO2A4gIVnt7OsyiAltAOI2PfTpFQWtFeAJp9GFZS4v74jACxKo+LmMRQ8x6/ xDM+sEgVCZQlsI1oPN1gbiyYLgdT6Y76jJek55KSEUDSAoKdurT2XxLs8Pa+GHmA CawNoLLCNUTd8Qn2+4eHbVDFX/3/8nYUQiAQcHd6VmR67gFQTOO1JF8Fa7X0xY9J fVR1hemixWlfyoubWNe34YGWDYahmV3xCpYI7WJt1kPoj8m2VUmauun2UY0DHSnU g8IVBQRTUJLfjiy7QTJodn5FmUp/J9dNoBxiklsVvw5HaTSQ8TOPbKT2ISQdzex+ oUolIjqnngvhBB1+cZrXYMxWxa2b828XzmFrOxV2cU2beJxIZaw= =uSOS -----END PGP SIGNATURE----- --nextPart1977332.vslOlgHxSZ-- From nobody Sun Nov 3 11:33:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhCCD5qQjz5bw0n; Sun, 03 Nov 2024 11:33:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhCCD2PS3z4g8h; Sun, 3 Nov 2024 11:33:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id 7YDUtdgizMArN7Yr1tXhO0; Sun, 03 Nov 2024 11:33:11 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7YqztMmiRGvSV7Yr0tyEoJ; Sun, 03 Nov 2024 11:33:11 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=FpSm/Hrq c=1 sm=1 tr=0 ts=67275f77 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=6I5d2MoRAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=ShowX6p6M9huD16F-WMA:9 a=CjuIK1q_8ugA:10 a=ZXulRonScM0A:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 143DA75B; Sun, 03 Nov 2024 03:33:09 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id D6D6B77; Sun, 03 Nov 2024 03:33:08 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Olivier Certner cc: Ravi Pokala , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group In-reply-to: <3070589.hHqAuc6tWs@ravel> References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> <20241103065704.4377C114@slippy.cwsent.com> <3070589.hHqAuc6tWs@ravel> Comments: In-reply-to Olivier Certner message dated "Sun, 03 Nov 2024 11:35:53 +0100." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Nov 2024 03:33:08 -0800 Message-Id: <20241103113308.D6D6B77@slippy.cwsent.com> X-CMAE-Envelope: MS4xfDb1Hue+CBzJ2/DxS5geLpIXSWf1go2h44bsEgsLjh1ZS1d4nvgkjPTnw1WkpRMPQh/9dp2ZBUKsftYW+BNklnzIaGjCE9LkvrsIcuVmro3ne1VoHBD4 /xXLgOxQ0yMZL2pooKZoKkYkcVOIY3mwOapPPlkYtn4pgOUj6u6IN8ztW6Xu7sRKrl+9k+hnTTQ61UBrd1ZMKKLdw7c+52NsZYSiBqvYQwpfl/t5AaYGpYwN NPrfhj/ZDkntSJJvDGxwu3+xbfafIZbGxuUmNZrG4gXm2jRxDK5t3ONAbEqigyyZB5d6NJIVlTE2H25IjxIo2A6NwK5fCUHM3FqfrIQ/FEh2KInKkHzluTfY HigqXwCQ X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XhCCD2PS3z4g8h X-Spamd-Bar: ---- In message <3070589.hHqAuc6tWs@ravel>, Olivier Certner writes: > --nextPart2434776.THHZn3L5Ee > Content-Transfer-Encoding: 7Bit > Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" > From: Olivier Certner > Date: Sun, 03 Nov 2024 11:35:53 +0100 > Message-ID: <3070589.hHqAuc6tWs@ravel> > In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> > MIME-Version: 1.0 > > I now probably know what is going on and will post a patch soon (to fix both > MINIMAL build and your panics). > > Is your "BREAK" kernel configuration omitting INET or NFSD? No. All it does is allow me to hit break (ctrl-e c l 1 using comms/com-console on serial console) to break to debugger any time while the server is running. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Sun Nov 3 11:33:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhCCH2BCWz5bvnS; Sun, 03 Nov 2024 11:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhCCH0Z4Nz4g6q; Sun, 3 Nov 2024 11:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730633595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBi4RyTzIrtkDYVaEvR5I6SjIE5sV7T1hm8tbitJkI=; b=Y+BLs9rwceG8RaxiugfiSBIRBpiIsIX5Lv29Gi63y/GlAZP6i5sAbRxSdQQZFbLfj+hXAy hpJ+KGaZrhwqNPVDWWZcVf3AQhKJcTfg9kNncjO7kAyoFrUVu/OGUTECIK1qo6IybgGAXr UUIZIJTzxd3iteXjwK8V+IYPLJCxPHMGvgtRf1+YkGvse5JgppkWQxOe20sgNpplozyfa6 sPLLPE+U5rzNX+hSKUpMqykPN/RRtKaTAJPvaimL/6ygfg5ZmgL7IQHlCxzKBuchY5o9q1 UR6UHhuUTfF2hI4Uq5Vh9Eq5iuDTjyuGN1SgMxBV15xe9tSU48kx53Q5Bsf2hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730633595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBi4RyTzIrtkDYVaEvR5I6SjIE5sV7T1hm8tbitJkI=; b=QKminqHOwIbya+hoBDhG/n51gu/dX2NrlR/NNfr26xapho9GFF8olzPx+mCAGOr7t8h4a/ aAJmKnsTVmjSseD6ucjgCac94NxhUITKx3y9hDOM4Oisj/t6lcifjEfRyYiixcUbwRa92n FCYHEI2K7/DsUJPp7Cb9VgxashRoNexycs0zAZ0tnZDRNxzQz6gBYPBql2KgAfh5uThvef 80WjcCFFz5Um9ENabY9o86ekygx5UO2n8O6hufDStFmtxL7jnXz3CC8IbTD8brIJrgmU+O t59+8N9WsJJq2wu+aID3eIBNbcMqcTYLcVDljtMJ39vI/E/s6JyjME0tY8HMuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730633595; a=rsa-sha256; cv=none; b=ZAGo7JLKCIEuCkMZmjsIwg2QIBJEx3f5BkkCZXBJfYWi2D8R+QQIXTdH2aBxegq38STDtb KFYhcrjOJ3GQqITB8lopWx7LVKC+4MiAgwnRDDoch9sD3C/AQ5w+OfTbifnf/xgo812ild Z5BdKBTexgjIQ9y0VblbBfay/VLIBnDfvqMCsWCpv58DjmG84fsNO2vX/nUTS39KTP4UoA /3p2MFKsiBdQP9OTPnznCffS/SSC5ggd4YjuFMSZB+c6JVhv2l/mr7tdW3niic4BTd62ot LQ4wWOj3+Rec/rJ18FMM5Wawm+NeW0MwhQyRpF5eVHULwCZQ5FFqXvSbr3dfyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhCCG6z5Mzncb; Sun, 3 Nov 2024 11:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3BXEXC012750; Sun, 3 Nov 2024 11:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3BXE5n012747; Sun, 3 Nov 2024 11:33:14 GMT (envelope-from git) Date: Sun, 3 Nov 2024 11:33:14 GMT Message-Id: <202411031133.4A3BXE5n012747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 518a1163d0aa - main - sctp: fix debug message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 518a1163d0aa73b26da1dd1a4bb186042ea3c66e Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=518a1163d0aa73b26da1dd1a4bb186042ea3c66e commit 518a1163d0aa73b26da1dd1a4bb186042ea3c66e Author: Michael Tuexen AuthorDate: 2024-11-03 10:20:54 +0000 Commit: Michael Tuexen CommitDate: 2024-11-03 10:20:54 +0000 sctp: fix debug message MFC after: 3 days --- sys/netinet/sctp_pcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 56d36dc9f34e..6bbbacfa761e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -626,7 +626,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (sctp_ifap->ifn_p) { if (ifn_index != sctp_ifap->ifn_p->ifn_index || ifn != sctp_ifap->ifn_p->ifn_p) { - SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d (p) ifname:%s - ignoring delete\n", + SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d (%p) ifname:%s - ignoring delete\n", sctp_ifap->ifn_p->ifn_index, sctp_ifap->ifn_p->ifn_p, sctp_ifap->ifn_p->ifn_name); From nobody Sun Nov 3 13:17:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhFXP1KBnz5c66r; Sun, 03 Nov 2024 13:18:13 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 4XhFXN63Drz4qTC; Sun, 3 Nov 2024 13:18:12 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a9a1b71d7ffso586581866b.1; Sun, 03 Nov 2024 05:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730639889; x=1731244689; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ducdZoK2Zhf4X5R048aYL/z418Y//iMl5mnDtpTsxAw=; b=kLTU2Z9bGySJ1zPNb3MCWt6IC7XjBzdTAqT2pPjYTvViLds2FpoExnUc1YNswSOPUi ZNEed8iLyu/BlZeZ0434wPxpxixxKhqWdMp9jPvm4fgleaidfDK6Of509vmuPTeE42i0 ANq8J+1yKVue10rPMTP3Y6WLuTYXgNjxwQgAhomDwZ6JBv664+YD0XyYOw1gKruKWas2 PNn/XwEbQcWm3GLV9wNmLX6Z9hdXaC1kzRbseJ3beHa/vU+BKsd7WlU1HBUmLbhQEI9O Tn0R6a30lb520HeHwXEKYQpsssf26I3AfFHGyyBsl+QPZ542u5Xhjp0GAri4SrT5PqD3 89Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730639889; x=1731244689; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ducdZoK2Zhf4X5R048aYL/z418Y//iMl5mnDtpTsxAw=; b=edgKBDDFjoEe+VzMEeEw8K/BXiZ2stUcnxLFVZ24UUOzC+gtF1UR3HcNKdYCBBxfsI 4cOChZs3e9J/6U5Ta+lF+8037NAtwLCJbhicQNMKBnXuwUsurw8+ES+mAAr02XUL2MyE zqzDKuCu0fNkMdFWGwZRo97G40emu35fIYkpH34ll1q7WhmZ52eyn5n2x9lpYYS9fa5D 9DlReJItfm81ZNz3MNNW0hBQXU6GUTELVLB8F7e1ze3HZkp0TffDoLoyzrWCm+Hpsc49 jHYBQhBMouLKD8tXBFjCu231GSM3ijKp/NfQQ0rNNsFlYp+iOi8w33PvEqTH4KxVcbT2 3tUw== X-Forwarded-Encrypted: i=1; AJvYcCWDZIkaZJhUhTOitrPp/EZ2KxJ1UwM8c6WpD2iCkVnpggCZFUqiwpid0EwupAtMbCBUXeiwxPa0obihRgyMwTtA4wSBEco=@freebsd.org, AJvYcCWoEu4YogJX2buLO9cTCAinvR5WSjHF3rTccnJH9PjKiKVzjV1sQ3ggrFrOas6GwLjZOR+bUxCm6vNIacUu7vU=@freebsd.org, AJvYcCXQdU6N0WI1/tJ4Psre5snrkzuq57jj7TWWwl2WaJrqhUtuHbhglhuVU1lO/BP/3lzhAH8m7opGBw==@freebsd.org, AJvYcCXZTNKWrMb8nsHk+cTKlBfSVx/qaRK1OVshbPhyF7zALGcdLTbxlIKSFPLHUKyHF/tvPuqk5BgV4mE/ehCe8uToOs1u@freebsd.org X-Gm-Message-State: AOJu0YwTm/T1HFcRXRLbtdPGg6B7OKHr3HDe6ZWl7cXvp1EL0R5GCWWs Jw5cMgIXYebIM9JBQKBVaUwghhbfFAFj12zTszH4okE0viTHxylwmNYhfyTxGfQWXiwaAuMMe/r YkYsPQx6eHsU29gWg+Z8XM3SvZptA4bU= X-Google-Smtp-Source: AGHT+IHLerKRNYRPxVlA6PE9nn/AKjgFKBQlg7LlFrXwirukLidLy1RdyiKfzFuvm12GQnx0GkhNiitIKgYBPBTOeOM= X-Received: by 2002:a17:906:6a12:b0:a99:f746:385 with SMTP id a640c23a62f3a-a9e3a573d11mr1832164566b.1.1730639889289; Sun, 03 Nov 2024 05:18:09 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202411022039.4A2KdbAE046580@gitrepo.freebsd.org> <9307D0CC-6D10-4F86-AE3B-43E7D6DA19A9@panasas.com> <20241103065704.4377C114@slippy.cwsent.com> <3070589.hHqAuc6tWs@ravel> <20241103113308.D6D6B77@slippy.cwsent.com> In-Reply-To: <20241103113308.D6D6B77@slippy.cwsent.com> From: Rick Macklem Date: Sun, 3 Nov 2024 05:17:58 -0800 Message-ID: Subject: Re: cfbe7a62dc62 - main - nfs, rpc: Ensure kernel credentials have at least one group To: Cy Schubert Cc: Olivier Certner , Ravi Pokala , 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-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4XhFXN63Drz4qTC X-Spamd-Bar: ---- On Sun, Nov 3, 2024 at 3:33=E2=80=AFAM Cy Schubert wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > > In message <3070589.hHqAuc6tWs@ravel>, Olivier Certner writes: > > --nextPart2434776.THHZn3L5Ee > > Content-Transfer-Encoding: 7Bit > > Content-Type: text/plain; charset=3D"UTF-8"; protected-headers=3D"v1" > > From: Olivier Certner > > Date: Sun, 03 Nov 2024 11:35:53 +0100 > > Message-ID: <3070589.hHqAuc6tWs@ravel> > > In-Reply-To: <20241103065704.4377C114@slippy.cwsent.com> > > MIME-Version: 1.0 > > > > I now probably know what is going on and will post a patch soon (to fix= both > > MINIMAL build and your panics). > > > > Is your "BREAK" kernel configuration omitting INET or NFSD? > > No. All it does is allow me to hit break (ctrl-e c l 1 using > comms/com-console on serial console) to break to debugger any time while > the server is running. Since the nfscommon can be loaded as a module (ie. not always present), I think you'll need to use UID_NOBODY and GID_NOGROUP instead of nfsrv_XXX outside of the nfs code. There is also the issue of it being NFSD_VNET(), which sho= uld not be used outside of the NFS code. It is currently just a VNET variable, but bz@ was thinking of changing that someday. Sorry I didn't spot this during the review, rick > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=3D0 > > > From nobody Sun Nov 3 14:51:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhHcR0FWbz5cGgn; Sun, 03 Nov 2024 14:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhHcQ6ntPz49QD; Sun, 3 Nov 2024 14:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730645511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jjr8yhry1DAH3gnK0Oic9BPNO5eggFFKMi4ubermdBI=; b=kzNT3ptLCiKSU4JADz/qo1hfZ30wtl8qjb7K/XC6XS0NMGhqR+glI+twomcSXZS6ByLbTU Gs0l3tSQHIkYijKRwYwLB13rCGkPaBnaPtGaBs4U+6au8po4S7HVccHYyjyQZJK4rBopu1 UPxVe1buLcTiwYtB94HxaVIqk66uD6nLKZ6VHY/yjmzV7c1Rkk3tQndHQxRZZ5did9rvQy zIgOVu8tssJh3y0Sk3dlLCNgNqJfnIr808/VGVjiTqrpx72uax63TzevRInNTDdDu2Y18D D8djo+JmsdKJm+8q44k2xK3nUYhDk5YqawFy0ucylYYxU99jGO90W4GUAvVX5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730645511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jjr8yhry1DAH3gnK0Oic9BPNO5eggFFKMi4ubermdBI=; b=HCnamA+6l/HiAwvsWx+p64eaDLWLwWUCX3wyLjlv0rTCpX22xkprgP5J+ra8eNFudNI0b7 MapqEdDsE+JwpYHdYJIqE6MUAjFDlmiknQbc1i6p2srqEg3Wat1hHEm9G+dZM5XsOVFYAS k2xgMOZDlapWNYOirEvJfH4v12DpVyR915RJjs+/S8OBxyE2WihGCIycXHOwedxL41ebbB Usx7Gwq/XLFYQktjuDoxHMJsUotI4rXnQnEB25FGLihe/vl9eVNBl/5DnOl3baFq+2ZMd5 roYHwHAx40Dw9jNAdq/oy+1KOTyONFOyxSKYCqOkKK/CJBPKDeNL3gRv5TC5/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730645511; a=rsa-sha256; cv=none; b=SByFIgok9Lkjzq4QZzFc36xvoalzn1ZZ/7N0rLqreCAZX6Xra+G7vI3JIlhHq6VHyn3YWv jf8uIBq03k6hRMGAwACeF7sH311PmercauipDmGTy1NFOtYcuD37ur7c9CPkhAdFs1O40I DxrKRWcZdHSZxtAQ3T72YexN7EYQ+lTtj0XYCxdAnLKx7RZHhHyIT6ZgBFI1sOx4EmgfBU +L2zJx3N65UfeAyuEObSj5EM/QOTdf/Uq13CDUYE9Ic+yz5g08gBnbbI/uqLlXRey0XlcI MOfEfysznIMcexd16FQzkmxUE8HhmSRheGtBDbP9mwZ/sLch8inOdwG+B1DAPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhHcQ6JBSztdP; Sun, 3 Nov 2024 14:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3Epoa7082399; Sun, 3 Nov 2024 14:51:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3EpoJU082396; Sun, 3 Nov 2024 14:51:50 GMT (envelope-from git) Date: Sun, 3 Nov 2024 14:51:50 GMT Message-Id: <202411031451.4A3EpoJU082396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d9901a23bd2f - stable/14 - libcxxrt: Update to upstream 6f2fdfebcd62 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d9901a23bd2f4e6aeef7f628f946134c4698fc38 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d9901a23bd2f4e6aeef7f628f946134c4698fc38 commit d9901a23bd2f4e6aeef7f628f946134c4698fc38 Author: Ed Maste AuthorDate: 2024-10-31 15:51:29 +0000 Commit: Ed Maste CommitDate: 2024-11-03 14:51:37 +0000 libcxxrt: Update to upstream 6f2fdfebcd62 Interesting fixes: 3cbfe5a556fe Avoid noreturn warning on terminate() (cherry picked from commit 2dccd21949f26b1bdf5e7cf258b760fffd3bf259) --- contrib/libcxxrt/exception.cc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc index c87fe5ac4468..5034809a1380 100644 --- a/contrib/libcxxrt/exception.cc +++ b/contrib/libcxxrt/exception.cc @@ -237,7 +237,7 @@ static_assert(offsetof(__cxa_dependent_exception, unwindHeader) == namespace std { - void unexpected(); + [[noreturn]] void unexpected(); class exception { public: @@ -1530,28 +1530,34 @@ namespace std if (0 != info && 0 != info->terminateHandler) { info->terminateHandler(); - // Should not be reached - a terminate handler is not expected to - // return. - abort(); } - terminateHandler.load()(); + else + { + terminateHandler.load()(); + } + // Should not be reached - a terminate handler is not expected + // to return. + abort(); } /** * Called when an unexpected exception is encountered (i.e. an exception * violates an exception specification). This calls abort() unless a * custom handler has been set.. */ - void unexpected() + [[noreturn]] void unexpected() { static __cxa_thread_info *info = thread_info(); if (0 != info && 0 != info->unexpectedHandler) { info->unexpectedHandler(); - // Should not be reached - a terminate handler is not expected to - // return. - abort(); } - unexpectedHandler.load()(); + else + { + unexpectedHandler.load()(); + } + // Should not be reached - a unexpected handler is not expected + // to return. + abort(); } /** * Returns whether there are any exceptions currently being thrown that From nobody Sun Nov 3 15:05:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhHvf6TRZz5cH8s; Sun, 03 Nov 2024 15:05: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhHvf5vPsz4DH6; Sun, 3 Nov 2024 15:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730646302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oPKu12PeCKsuv7ygIsMv2IQR0eoT2LyAUnHDtmgF/mc=; b=X8VOf9ZIDq6IFIJ8eSd45VMsAEM2ur1EiEHUvi1PqQLeYLzlzZ1fJ9E0cUkt3k81zDa6iC vBrojNdJoEuEa35qFx4Knc1N1PcKk34k/70I5gmTGKi9KQMdF3mdhZdxsyaSAOtqgbkOrX Gx2UwsUk6YQv8+eLlopFFgOYaHmYwKrEM3H6ZMG6tLBbpERMyB0RKssUqkzyjCSmgMmQbR cgxBKCVemnu3qYJsJHt+D1OUI7iJL/iDuruW9hCeUpiKKNybArAojzjztZotckBiAWG/iL peu2Y1jDqiqHJMaG2Y/cGvVRFdld0a1z2q6GtHmviFel6bewW8pYOXjP9hkmTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730646302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oPKu12PeCKsuv7ygIsMv2IQR0eoT2LyAUnHDtmgF/mc=; b=v8i8xWJZYKWo0MBw+pmGswdRTysVMRCl7UzhxFDfw46q75wmXUQ208VOMYG6nl2L2ZGd6G Pm7dAJ/u4qJRbpoidG+ALktPO394p9ysXQovV6c+rjV3WgvnzOSrEA3ot4BL/ARgbWqF1O CYDQCQ9QPf8TCJbjdjQZW2W61DObL18b2QRtSNxqQWIcZ4N9qQP6mDNefZGJyqHYakmMXh xvgFKZ42dz9T8VLZeANzNHl44ZYlxN4nwYZqmdZmQsCFhcHbWajTHRRcJD1gPyrWPiUhKv qTl9F/6FnLCw0a0lgYTAsdGZZGRfpHxFhpTaiS2iWx1MV8eoIvgNsEn5vVsXTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730646302; a=rsa-sha256; cv=none; b=sLJ0KSAxYXIkS5vzXBvOP04BnGRYEa04VhmyfF9xHYykLwEQhinlQzj7dEmVSqNsOM0en8 nZ18ucADr9VReQkEliD4wwU+PI1By8uvmSeYTdjhOCIYUGNBtNQdBtfRUTwOe/rSz2b3Bf jE4uxZTRS1lof3/3azUNIq9QsYs3TjQGs+sQMs1roR7awMGGMbvaxr8iE5tUhT7QWMKmnv 3Eoz7rFaARYL4hb4DUMPTHzBU8PTzfINRP1XV9w56yAh9mSXDLj5WCCLtKjkrHPmYzy5hR jlhGeqSRFjQW9Wjcq3EAYn3PVfP0EHUegaOaNOBGIOXjkRn76L2dSRp0yHlH2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhHvf5WJGztB7; Sun, 3 Nov 2024 15:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3F52Xo005532; Sun, 3 Nov 2024 15:05:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3F52b1005529; Sun, 3 Nov 2024 15:05:02 GMT (envelope-from git) Date: Sun, 3 Nov 2024 15:05:02 GMT Message-Id: <202411031505.4A3F52b1005529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3e3e2c632847 - stable/14 - resolver.5: Fix example Google DNS server address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e3e2c6328475ab8460f6f57aa2696c544d9ddec Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3e3e2c6328475ab8460f6f57aa2696c544d9ddec commit 3e3e2c6328475ab8460f6f57aa2696c544d9ddec Author: Paula Breton AuthorDate: 2024-10-31 07:11:04 +0000 Commit: Ed Maste CommitDate: 2024-11-03 15:04:46 +0000 resolver.5: Fix example Google DNS server address MFC after: 3 days Signed-off-by: Paula Breton (cherry picked from commit e7f0f4f9206e8b0f411847b293c7b79eb84f0e51) --- share/man/man5/resolver.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/resolver.5 b/share/man/man5/resolver.5 index 525a681cb564..c3ec226efa6d 100644 --- a/share/man/man5/resolver.5 +++ b/share/man/man5/resolver.5 @@ -238,7 +238,7 @@ nameserver 192.168.2.1 # Fallback nameservers, in this case these from Google. nameserver 8.8.8.8 -nameserver 4.4.4.4 +nameserver 8.8.4.4 # Attach an OPT pseudo-RR for the EDNS0 extension, # as specified in RFC 2671. From nobody Sun Nov 3 15:39:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhJgv2cjtz5cKns; Sun, 03 Nov 2024 15:39:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 4XhJgt4zwhz4JLY; Sun, 3 Nov 2024 15:39:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6cbd005d0f9so25542766d6.3; Sun, 03 Nov 2024 07:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730648393; x=1731253193; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=mMxFRKFnl7O+DayhaDOp04PX2kTZlL0pEAM5JH+3+mo=; b=DYnz56Dc043w+EdMgzyxSf17UkusHYhnjseKON0KfTNZuP9LHKxhlx5dTTNRYf++BN PPSU2rN/cLXIY0Avw6dp/D0d8gj9AoAMYC08kYx1cmj5XHObHEYLc4845NgpXeQeglw4 ICEPk9iFDBN4QnhXJjwmtEY5tnvQ6XK9nurvdexDZ3MP565Ue4gHRa5qVxd+IdsF29Fl o7oMCE6ZVRCkF8g1TDHCS6dnIDMa7lZGIkXNwa1l85L17Nbknd2xRAZwjmMSKg4mVkjk j857BhBdUrtIJ+gMVTClh7TCtwkPvL9N88ZXDS+x35U6g+18/3kmPwctQymEg+7dEoT5 evHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730648393; x=1731253193; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mMxFRKFnl7O+DayhaDOp04PX2kTZlL0pEAM5JH+3+mo=; b=qlBJ7M0e2bJQST/crtIBWaVjmJ3P5h3azk2663Kjsu1+Nbcwbeb3iEcqq86JdIgQVw hyffaeeO9D3RDKJLoksdahmtHHxF4tN8uBJRzRuTPM3/zBJgEvMCf3FcvRzMBSgooh2V L2twm4cfpN7qaOR2lE9SyVYmMtQuNYma2m1NWvvDuEMhiz8x2GM8NSZ/RjJDFcP+H6J5 adk8PbD/e79slUhHWBqU9yOeBd2d6TVTKqqHdCeYT5r0IU+XAOoR+ZcjaTlasOPNwjTO PrHcOXNAsrWVBu+ds8+9PKyPWqUvM8FyBixSwTsdKzXYSRvx8tRT59izTUdZZI9f3oQ5 iPqA== X-Forwarded-Encrypted: i=1; AJvYcCX6ZD8fJ7axrMVOCYXI8m3FxH0C739gJ8+Kd7BnADmOK6W+hII9F7SPveGkSfiu6sQd/TeyWsM/zky4HVKX7BPJeKQN@freebsd.org, AJvYcCXsoXIcHT+OiMPCvdUCyYxwRKHeDo9FUOEJP5KONyGOd82eSQTY7v+mpdBIJznOzEBWmQuwa/ZQlmUjRqzMACukwDHxdyQ=@freebsd.org X-Gm-Message-State: AOJu0YxrABOr5iHeCwdBomqDIMour2Uvf7PbLcWMstMVxSEDlJ1AVh7G I8H1BbrGYaKtwfDiHPt7KP6dfpCG7eL+IXjwwxagOB1OxEoFeOdZJNl8Sg== X-Google-Smtp-Source: AGHT+IGm7lpEkS7TvANNbgshNlznPcHVysIpV3ubgeePxZT2BviKKYuaPqukjYwGJVZNlGvmMPnIaQ== X-Received: by 2002:a05:6214:5b02:b0:6cb:5605:ffb2 with SMTP id 6a1803df08f44-6d35c14e001mr153985256d6.24.1730648392877; Sun, 03 Nov 2024 07:39:52 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d3541782desm39387096d6.112.2024.11.03.07.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 07:39:52 -0800 (PST) Date: Sun, 3 Nov 2024 10:39:50 -0500 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0f5116d7efe3 - main - AMD IOMMU driver Message-ID: References: <202411022346.4A2NkeBT097606@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202411022346.4A2NkeBT097606@gitrepo.freebsd.org> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XhJgt4zwhz4JLY X-Spamd-Bar: ---- On Sat, Nov 02, 2024 at 11:46:40PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0f5116d7efe33c81f0b24b56eec78af37898f500 > > commit 0f5116d7efe33c81f0b24b56eec78af37898f500 > Author: Konstantin Belousov > AuthorDate: 2024-05-12 10:20:11 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-11-02 23:45:40 +0000 > > AMD IOMMU driver > > This driver is functionally equivalent to the in-tree Intel DMAR code. > It handles busdma and interrupt remapping from the host OS. There is no > integration with bhyve, and the stub iommu drivers in bhyve code cannot > coexist with this driver (planned). > > The biggest architectural problem with the code is that the AMD IOMMU > units are enumerated as PCIe-attached security devices, which is much > later after HPET and IOAPIC drivers attached and actived interrupts. > Because of this, HPET FSB interrupts and IOAPIC interrupts are always > identity-mapped. > > The code is of late alpha quality. By default the driver is disabled. > To enable for testing, set in loader.conf: > hw.amdiommu.enable=1 > hw.iommu.dma=1 <- to enable iommu busdma > hw.iommu.ir=1 <- to enable interrupt remapping > > Discussed with: emaste > Sponsored by: Advanced Micro Devices (AMD) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D47256 This appears to break loading of vmm.ko, as sys/amd64/vmm/amd/amdiommu.c already defines a driver called "amdiommu". Perhaps the module in vmm should be renamed to amdviiommu or so? From nobody Sun Nov 3 15:47:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhJr4680dz5cLQl; Sun, 03 Nov 2024 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhJr45gY4z4LWm; Sun, 3 Nov 2024 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730648820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bFuqZg4UsN7WfihmFbdnCWx6Ya0ThGjcuO/wtUlYcec=; b=Y6YuoNf4a216G1hdjnSel6LIPK5Y+6/3JZ90px8lTEqrJAxyNIkAdZLQnReTODkCSyOhSb 7Yo4u2LOG/BorADQvtpv/wwjnd43tI2p8axyKsZiqlGqy/svZgH+6JItE3vohl4mdqzLRA qwnFCiOD2vO5kJ45knip3yRFwmA7wMDKSCEtmbOWFbp3ftzC84KJ9zCR/W8mhsHg2iLm6v IfyL2UbkbI2pL7/jZSnqrMeb9sK41vmIhF4c1rytvFy1OJd4bbuiHYLH3vjc4DKstWAp1u LUnoUPYO9dauTcaN4RSodEcXmie4wSJt/lV0qRlNwNB+ZVhxfcYt69sgTuChYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730648820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bFuqZg4UsN7WfihmFbdnCWx6Ya0ThGjcuO/wtUlYcec=; b=uk6qOwvD4qqHyZvoojghMAdLrBSY4V+EpvQ69dncuHXtdmGdyaquU8Fz562o9m/llnp92k OXQqXcCkWobLFunTRo4+7P7PxmDXIMkawWgWfSGm7jnCEEWbZvRFr7PBkc+X+dcyDguD1A KDGI4XM5xHDPpQoUx8sIxeCtXUEQWPc7sDcjI6yLloekfh8jZeh5Q5DDwz+O7F8QZ2GsK2 ykUuDmCwa/xQldzwwytlmSSIuxlADefbpBQwVOVbW5hhVvHIHckcUlKHgBxjsjjcuyIulH qUzICgfs5zcDAodHAgV32V+bp4A+oBhALErfdWE2G6VWenhHOd87H3Vte+ONrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730648820; a=rsa-sha256; cv=none; b=WbCHzLmG3qoepWwofiiySkQaiixyebk9PeLUKGZ3t8gUN6PTzoL3oVJDfRUNpcsk57DjQK 3ExBIYkBsox6vx14M7yuEBaU+fCb8z3OG4LZGG2FXTebUmWbrpH9Lrh/brzFipSXfyTkHC xcjVsLxYOkDBf2LVr0GJ/rkrJtkohePn+2/rSVSF5f7WA6hwh9XDs1KU381mGvGJzb+rWQ FcYxX/l4iYp91HjAyNuIAouim/Y3meoSeUGA/uOLqZtGUm7tNhfzBP/kECTvx2CWoIyBI7 edehX8LhC6l83tySplldNzAcVTEqJbukCqlvvQbOZTNg0jRHpIthAwO/7da89g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhJr44YwTzvX6; Sun, 3 Nov 2024 15:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3Fl0oc079125; Sun, 3 Nov 2024 15:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Fl0Lh079122; Sun, 3 Nov 2024 15:47:00 GMT (envelope-from git) Date: Sun, 3 Nov 2024 15:47:00 GMT Message-Id: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5169d4307eb9c8b7bb0bd46d600012bcc12cbdae Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5169d4307eb9c8b7bb0bd46d600012bcc12cbdae commit 5169d4307eb9c8b7bb0bd46d600012bcc12cbdae Author: Olivier Certner AuthorDate: 2024-11-03 10:26:37 +0000 Commit: Olivier Certner CommitDate: 2024-11-03 15:45:43 +0000 nfs: Fallback to GID_NOGROUP on no groups We cannot unconditionally access nfsd's VNET variables in 'sys/kern/vfs_export.c' nor 'sys/fs/nfsserver/nfs_nfsdsubs.c', as they may not have been compiled in depending on build options. So, forget about the extra mile of using the configured default group and use the hardcoded GID_NOGROUP (which differs only on systems running nfsuserd(8) and with a non-default GID for their "nogroup" group). Reported by: rpokala, bapt (MINIMAL compile breakup) Reported by: cy, David Wolfskill (panics caused by mountd(8)) Approved by: markj (mentor) Fixes: cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have at least one group") --- sys/fs/nfs/nfs_commonport.c | 3 +-- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/kern/vfs_export.c | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 11f31d1a0e9f..0c94f4e7dc52 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -75,7 +75,6 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); int nfs_pnfsio(task_fn_t *, void *); @@ -260,7 +259,7 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid = nfscr->nfsc_uid; crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); } /* diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index ce4b0052714e..81c558d768ea 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4052,7 +4052,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; crsetgroups_fallback(cr, nidp->nid_ngroup, grps, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index c0337b1fe858..a314bda164de 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -61,10 +62,6 @@ #include #include -#include - -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); - static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); #if defined(INET) || defined(INET6) @@ -138,7 +135,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, - argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); + argp->ex_groups, GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; @@ -217,7 +214,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, - NFSD_VNET(nfsrv_defaultgid)); + GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; From nobody Sun Nov 3 16:02:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9m173fz5cMc3; Sun, 03 Nov 2024 16:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9m0g0Mz4MkX; Sun, 3 Nov 2024 16:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPwFZs4s4A9WfzCItZDP0kZNAwVpq91PGiYMTkMPRq0=; b=dC7BRiwSq/ZxuA7nDIuvomMmqUaypg97ikY4BjzfDzjiTwBGwoo/aFSQ36pfnRU2YVVMEn 5VD1yMufnfdZlWt8XNpjD5o03sJlqoqrLfCQjHCyBd3cBIbD374H+q7xeWPaw/j7ignGcz vfLaz7DWmRjI2fwT9RIygCw3yK9/1+Ct7J2EdK70hcZP2oaH4iDLYLd3QGU/LTpSaY68xK +cRkHD3nVVtgBgTsCiEyF/jigVnKxyqVl+C3oLYEE6/NxqclecSwHqzldmUVE1hY2KV0LF IWNm1oxuoB8iT/Z7bGnNQRmwrT3uBv+0gbc3fLuPW4XFRsvzkznatmJBE+0k5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPwFZs4s4A9WfzCItZDP0kZNAwVpq91PGiYMTkMPRq0=; b=poSY7b2THM8kIT/ISsjse3nzXdUm7JbSxSsjBBVH6oWi7J+7HU8qJTSCWjU+5jDgK5/swY N/RVTDN52JNT98vCVT8o+OXknq4qc8rN2xYLosvfRe9emDyR6YoR2BMvVBAOhEiebUoFRA gOubB+jCwYL1XaiXSDWLyMZT6dVPzv9MH1shY6kCsQwS84jixkVmU6wktMCjGxzxTrzQPn 70vyxN5gShJRbK45V+JLqonY7QNRhMdPX8H/SqEsNljHoeKjefM7c1dokvDS7ta3vJm4vZ 67El0PvCgs9Hylo01sITqOtCvLyaxfBFpXiLCSt3RWjciaRmK1u8LQBB5GyRkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649740; a=rsa-sha256; cv=none; b=WIy39Pt8wC3UZJH7XlcZDAo2R5aTVKyJSXwg0h/UUz6IxA9iIgNlk0U4CWLaesKAXuGso+ p7ZdRdQeGV7NzLMq78anUGqMSoQvJZ3bGqBAdaxgN4B1aon5/CIRhaGQe+4rL+WIDbzJmV jC5Ya9FEhTUjmSvb4TbmQEMRJc9tuSUdXc+r+9pksZTd2W0AmyRl///7IEaqxOySsZG+za lbhrwF/57B/iSgadbCn32FfsKGAvuTtqwzNnpHwDcCENaSSI2YrXO2AZc5nFgfI3+iICSf WV+7/9m9gD4Va95t9oLcxYtongrV0BH4VCXQ2kn8geuBUcpCnTeKdWVmvjqrVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9m0GdBzwQN; Sun, 3 Nov 2024 16:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2JZ3015448; Sun, 3 Nov 2024 16:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2JSf015445; Sun, 3 Nov 2024 16:02:19 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:19 GMT Message-Id: <202411031602.4A3G2JSf015445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 14887d2c869a - stable/14 - gpiobus(4): Add an acpi variant of gpiobus List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14887d2c869ad47d5921fc9aa07e891a38950121 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=14887d2c869ad47d5921fc9aa07e891a38950121 commit 14887d2c869ad47d5921fc9aa07e891a38950121 Author: Ahmad Khalifa AuthorDate: 2024-07-08 12:22:17 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 gpiobus(4): Add an acpi variant of gpiobus This currently only implements the address space handler and attempts to configure pins with flags obtained from ACPI. Reviewed by: wulf MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1359 (cherry picked from commit 92adaa5862d5ea94318a011e0618622d0fb72521) --- sys/conf/files | 1 + sys/dev/gpio/acpi_gpiobus.c | 311 ++++++++++++++++++++++++++++++++++++++ sys/dev/gpio/gpiobus.c | 6 +- sys/dev/gpio/gpiobusvar.h | 2 + sys/modules/gpio/gpiobus/Makefile | 3 + 5 files changed, 319 insertions(+), 4 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5325e010d970..5239f38d5154 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1741,6 +1741,7 @@ dev/gve/gve_sysctl.c optional gve dev/gve/gve_tx.c optional gve dev/gve/gve_utils.c optional gve dev/goldfish/goldfish_rtc.c optional goldfish_rtc fdt +dev/gpio/acpi_gpiobus.c optional acpi gpio dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c new file mode 100644 index 000000000000..eafa1c07fab1 --- /dev/null +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -0,0 +1,311 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Ahmad Khalifa + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include + +struct acpi_gpiobus_softc { + struct gpiobus_softc super_sc; + ACPI_CONNECTION_INFO handler_info; +}; + +struct acpi_gpiobus_ctx { + struct gpiobus_softc *sc; + ACPI_HANDLE dev_handle; +}; + +static uint32_t +acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) +{ + uint32_t flags = 0; + + /* Figure out pin flags */ +#ifdef NOT_YET + /* These are currently unused. */ + if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_INT) { + switch (gpio_res->Polarity) { + case ACPI_ACTIVE_HIGH: + flags = gpio_res->Triggering == ACPI_LEVEL_SENSITIVE ? + GPIO_INTR_LEVEL_HIGH : GPIO_INTR_EDGE_RISING; + break; + case ACPI_ACTIVE_LOW: + flags = gpio_res->Triggering == ACPI_LEVEL_SENSITIVE ? + GPIO_INTR_LEVEL_LOW : GPIO_INTR_EDGE_FALLING; + break; + case ACPI_ACTIVE_BOTH: + flags = GPIO_INTR_EDGE_BOTH; + break; + } + + if (gpio_res->Shareable == ACPI_SHARED) + flags |= GPIO_INTR_SHAREABLE; + } +#endif + switch (gpio_res->IoRestriction) { + case ACPI_IO_RESTRICT_INPUT: + flags = GPIO_PIN_INPUT; + break; + case ACPI_IO_RESTRICT_OUTPUT: + flags = GPIO_PIN_OUTPUT; + break; + } + + switch (gpio_res->PinConfig) { + case ACPI_PIN_CONFIG_PULLUP: + flags |= GPIO_PIN_PULLUP; + break; + case ACPI_PIN_CONFIG_PULLDOWN: + flags |= GPIO_PIN_PULLDOWN; + break; + } + + return (flags); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate_res(ACPI_RESOURCE *res, void *context) +{ + ACPI_RESOURCE_GPIO *gpio_res = &res->Data.Gpio; + struct acpi_gpiobus_ctx *ctx = context; + struct gpiobus_softc *super_sc = ctx->sc; + ACPI_HANDLE handle; + uint32_t flags, i; + + if (res->Type != ACPI_RESOURCE_TYPE_GPIO) + return (AE_OK); + + if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, + gpio_res->ResourceSource.StringPtr, &handle)) || + handle != ctx->dev_handle) + return (AE_OK); + + if (__predict_false(gpio_res->PinTableLength > super_sc->sc_npins)) { + device_printf(super_sc->sc_busdev, + "invalid pin table length %hu, max: %d (bad ACPI tables?)\n", + gpio_res->PinTableLength, super_sc->sc_npins); + return (AE_LIMIT); + } + + flags = acpi_gpiobus_convflags(gpio_res); + for (i = 0; i < gpio_res->PinTableLength; i++) { + UINT16 pin = gpio_res->PinTable[i]; + + if (__predict_false(pin >= super_sc->sc_npins)) { + device_printf(super_sc->sc_busdev, + "invalid pin 0x%x, max: 0x%x (bad ACPI tables?)\n", + pin, super_sc->sc_npins - 1); + return (AE_LIMIT); + } + + GPIO_PIN_SETFLAGS(super_sc->sc_dev, pin, flags & + ~GPIO_INTR_MASK); + } + + return (AE_OK); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate(ACPI_HANDLE handle, UINT32 depth, void *context, + void **result) +{ + UINT32 sta; + + /* + * If no _STA method or if it failed, then assume that + * the device is present. + */ + if (!ACPI_FAILURE(acpi_GetInteger(handle, "_STA", &sta)) && + !ACPI_DEVICE_PRESENT(sta)) + return (AE_OK); + + if (!acpi_has_hid(handle)) + return (AE_OK); + + /* Look for GPIO resources */ + AcpiWalkResources(handle, "_CRS", acpi_gpiobus_enumerate_res, context); + + return (AE_OK); +} + +static ACPI_STATUS +acpi_gpiobus_space_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, + UINT32 length, UINT64 *value, void *context, void *region_context) +{ + ACPI_CONNECTION_INFO *info = context; + ACPI_RESOURCE_GPIO *gpio_res; + device_t controller; + ACPI_RESOURCE *res; + ACPI_STATUS status; + + status = AcpiBufferToResource(info->Connection, info->Length, &res); + if (ACPI_FAILURE(status) || res->Type != ACPI_RESOURCE_TYPE_GPIO) + goto err; + + gpio_res = &res->Data.Gpio; + controller = __containerof(info, struct acpi_gpiobus_softc, + handler_info)->super_sc.sc_dev; + + switch (function) { + case ACPI_WRITE: + if (__predict_false( + gpio_res->IoRestriction == ACPI_IO_RESTRICT_INPUT)) + goto err; + + for (int i = 0; i < length; i++) + if (GPIO_PIN_SET(controller, + gpio_res->PinTable[address + i], (*value & 1 << i) ? + GPIO_PIN_HIGH : GPIO_PIN_LOW) != 0) + goto err; + break; + case ACPI_READ: + if (__predict_false( + gpio_res->IoRestriction == ACPI_IO_RESTRICT_OUTPUT)) + goto err; + + for (int i = 0; i < length; i++) { + uint32_t v; + + if (GPIO_PIN_GET(controller, + gpio_res->PinTable[address + i], &v) != 0) + goto err; + *value |= v << i; + } + break; + default: + goto err; + } + + ACPI_FREE(res); + return (AE_OK); + +err: + ACPI_FREE(res); + return (AE_BAD_PARAMETER); +} + +static int +acpi_gpiobus_probe(device_t dev) +{ + device_t controller; + + if (acpi_disabled("gpiobus")) + return (ENXIO); + + controller = device_get_parent(dev); + if (controller == NULL) + return (ENXIO); + + if (acpi_get_handle(controller) == NULL) + return (ENXIO); + + device_set_desc(dev, "GPIO bus (ACPI-hinted)"); + return (BUS_PROBE_DEFAULT); +} + +static int +acpi_gpiobus_attach(device_t dev) +{ + struct acpi_gpiobus_softc *sc; + struct acpi_gpiobus_ctx ctx; + ACPI_HANDLE handle; + ACPI_STATUS status; + int err; + + if ((err = gpiobus_attach(dev)) != 0) + return (err); + + sc = device_get_softc(dev); + handle = acpi_get_handle(sc->super_sc.sc_dev); + if (handle == NULL) { + gpiobus_detach(dev); + return (ENXIO); + } + + status = AcpiInstallAddressSpaceHandler(handle, ACPI_ADR_SPACE_GPIO, + acpi_gpiobus_space_handler, NULL, &sc->handler_info); + + if (ACPI_FAILURE(status)) { + device_printf(dev, + "Failed to install GPIO address space handler\n"); + gpiobus_detach(dev); + return (ENXIO); + } + + ctx.dev_handle = handle; + ctx.sc = &sc->super_sc; + + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, acpi_gpiobus_enumerate, NULL, &ctx, NULL); + + if (ACPI_FAILURE(status)) + device_printf(dev, "Failed to enumerate GPIO resources\n"); + + return (0); +} + +static int +acpi_gpiobus_detach(device_t dev) +{ + struct gpiobus_softc *super_sc; + ACPI_STATUS status; + + super_sc = device_get_softc(dev); + status = AcpiRemoveAddressSpaceHandler( + acpi_get_handle(super_sc->sc_dev), ACPI_ADR_SPACE_GPIO, + acpi_gpiobus_space_handler + ); + + if (ACPI_FAILURE(status)) + device_printf(dev, + "Failed to remove GPIO address space handler\n"); + + return (gpiobus_detach(dev)); +} + +static device_method_t acpi_gpiobus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, acpi_gpiobus_probe), + DEVMETHOD(device_attach, acpi_gpiobus_attach), + DEVMETHOD(device_detach, acpi_gpiobus_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gpiobus, acpi_gpiobus_driver, acpi_gpiobus_methods, + sizeof(struct acpi_gpiobus_softc), gpiobus_driver); +EARLY_DRIVER_MODULE(acpi_gpiobus, gpio, acpi_gpiobus_driver, NULL, NULL, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(acpi_gpiobus, 1); +MODULE_DEPEND(acpi_gpiobus, acpi, 1, 1, 1); diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 65e8d1a775fe..7bdb080eb4f1 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -53,8 +53,6 @@ static void gpiobus_print_pins(struct gpiobus_ivar *, struct sbuf *); static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); static int gpiobus_probe(device_t); -static int gpiobus_attach(device_t); -static int gpiobus_detach(device_t); static int gpiobus_suspend(device_t); static int gpiobus_resume(device_t); static void gpiobus_probe_nomatch(device_t, device_t); @@ -551,7 +549,7 @@ gpiobus_probe(device_t dev) return (BUS_PROBE_GENERIC); } -static int +int gpiobus_attach(device_t dev) { int err; @@ -573,7 +571,7 @@ gpiobus_attach(device_t dev) * Since this is not a self-enumerating bus, and since we always add * children in attach, we have to always delete children here. */ -static int +int gpiobus_detach(device_t dev) { struct gpiobus_softc *sc; diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index 521132fbac9d..e3669e82e594 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -174,6 +174,8 @@ struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); +int gpiobus_attach(device_t); +int gpiobus_detach(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); diff --git a/sys/modules/gpio/gpiobus/Makefile b/sys/modules/gpio/gpiobus/Makefile index d9345e00e2be..baaf7faf69e8 100644 --- a/sys/modules/gpio/gpiobus/Makefile +++ b/sys/modules/gpio/gpiobus/Makefile @@ -38,6 +38,9 @@ SRCS+= device_if.h bus_if.h opt_platform.h .if !empty(OPT_FDT) SRCS+= ofw_gpiobus.c .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +SRCS+= acpi_gpiobus.c opt_acpi.h acpi_if.h +.endif CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ From nobody Sun Nov 3 16:02:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9n2xlDz5cMw6; Sun, 03 Nov 2024 16:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9n1Wphz4MnM; Sun, 3 Nov 2024 16:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HwMe8vS9/f+XSDcfB5zGYhTKO17QNjLdM32PenGT7Cg=; b=ILRjr4uXXfb1cEZYzGDs/pdLge4Y/D0mE4tqnIZj8CFsrI7Vv0A6Mcj8cYDit/ZGStxBVa qmdyM3/SRYbGb8nrty2MOsVKI2liLjMK4W+1hvqnqz4o9m8bXFsQiDRptrObuBPviFxbK6 nd/+TpnGw/83uaOVjmEFqIfPlq8EBHgVIPsyQeXx9JPWSuuilboFz0QeZ63cHt8lZwTumf 8kPOr0H6ZjS6UY7rm4E5VUULtyXNxaYCfmuJPN+qVc70T+XyG0KJ2Q/Avhf2ghzRUOZBSy /aU4RX5DkVG7/FZgAVoBfZWBQg+cZUdKurrfdnIj91TCRcIiVO3Kxr16RofNCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HwMe8vS9/f+XSDcfB5zGYhTKO17QNjLdM32PenGT7Cg=; b=GyDILxmbQPvn2rctT/ygK2eK3eRRkrNaVdtIndBd+Nhs82v+Jk1G9Wdfp5rbMGHnF9CuKo x99hG+cyWLezceYvpw3DTYGR/i5BZbJrKX1NxTsRn2x0yMLKWWw/cs7o2HStCdcMjZ8ZNF DpCgr6b9v5Knv+nN7VdRncW2SMOf4Z/QRuxfolWszu2MRwHrs0Fs9KAgvu78gggDfYw2tg W74BFCVN7fkX9WB9hT8gJUOpS4K9Z0Le/Ar9d/vfPgAZXm4Y4aQ1Ot88OsvjExwcCNQiuy /+V9fgsOfb09g5nUp7e1+Wf82y+fnzbIrNBlBz0tzaUjUXCDN3r733lxZj+zGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649741; a=rsa-sha256; cv=none; b=wQEQG3JqpmD2oOKyppch2EiLW0HyQfeONcLynfeP/QKzw30jRPZGLwZrLoIgYWPoB+wx7V EI6LPQWQfG2hGx7Jy4kJE1xkcCcMoBDcfMqYq6h/hoA21uXiT6O6FM5h6iAZCvQ8I9LHun fXUjZrVH1D5I2aW+YXY9uNBzgktjxCl6URrNFE+pWuhfdcPJNHQ64gi9vL2ert50UYLSZ8 VdRRFQ0C2bSk/N6RIta3e9vAVqrhav31yQ71xLt1F/teqqDeDUB3MMmjZIeJ0BpS4+vLd1 VkzSvFQtKTQpmVe+hITb+zzCLUgNi9vn00yW1xT0/vWVNFPGyIqyMqKwrWcwkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9n17JPzwGL; Sun, 3 Nov 2024 16:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2LLc015490; Sun, 3 Nov 2024 16:02:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2L8E015487; Sun, 3 Nov 2024 16:02:21 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:21 GMT Message-Id: <202411031602.4A3G2L8E015487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7c8f273bfba2 - stable/14 - acpi_gpiobus: OR GPIO_PIN_(IN|OUT)PUT into flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7c8f273bfba28d9d55ada94c80feb3ba97c53758 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7c8f273bfba28d9d55ada94c80feb3ba97c53758 commit 7c8f273bfba28d9d55ada94c80feb3ba97c53758 Author: Colin Percival AuthorDate: 2024-10-12 18:12:15 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 acpi_gpiobus: OR GPIO_PIN_(IN|OUT)PUT into flags Right now flags is set to 0 before this "=" -> "|=" change, but it will matter when the NOT_YET section above becomes effective. MFC after: 2 weeks Sponsored by: Amazon (cherry picked from commit c808132731aa999947f4f7810157d7d8d9aaf61e) --- sys/dev/gpio/acpi_gpiobus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index eafa1c07fab1..3b6fc6dde674 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -75,10 +75,10 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) #endif switch (gpio_res->IoRestriction) { case ACPI_IO_RESTRICT_INPUT: - flags = GPIO_PIN_INPUT; + flags |= GPIO_PIN_INPUT; break; case ACPI_IO_RESTRICT_OUTPUT: - flags = GPIO_PIN_OUTPUT; + flags |= GPIO_PIN_OUTPUT; break; } From nobody Sun Nov 3 16:02:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9q04JYz5cMRh; Sun, 03 Nov 2024 16:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9p56cnz4MqC; Sun, 3 Nov 2024 16:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18KE5IYkpWnGTYfUKV9+LTET1nBukFHIDWvv2c/WawY=; b=iClTvurjdg72PS52Qc7U5qJwGqsKPVbzLVBVxP0RpslPtW6iyQMf/jHUKN+4PnlqWYiEg/ qelYKIQGBzRuAtclsiJr8tFcJNlKjVSDbTKjOEVi0yq6ffvrtFp7+X8t/fJlLa2lmgjPCT T7aK7HWj/g9I1I4Q+1uONYluxvX8PzD6CvcUeeBozR7ZG4XRqdEHI9BPR0Lnyius81AmDZ 0T/yMNN6+I4jQjJbv7qjcrlAPRriUL//H4m1WDWl5Rn92fN194A00sPjIn5Q4B+iVUE2vp Nnm84frtpOMX0rbBNd58PXcdjWSdOMXIlKhdS/qnIqNJq0Dlwaisz77yWX8+kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18KE5IYkpWnGTYfUKV9+LTET1nBukFHIDWvv2c/WawY=; b=YD8/gu0gzvIQHGkwo5tUks8bVUSgx0JSWdurtg2gd1rF4aXE4a6cNloT8/X443O0qZWrMk mbEhoSRjqVmLlGXx+MITUcV2vYsbJ1PSWGi5r0im8v2Wf86dPCvZaQ0wZivATTtG44PDeR TDcRLDGnpcndMF6RFrJ5SewjSSf8ILqUfAZkS/7QSISWGEhlEm5jn5q/Qi11FZftAbhYU4 tsdVakBnmfo+PkrDvLXZYaflgxvyyGlFcl5zbtDiDmE19NiQZ+nWOl0mjZqoF81PeyqsMG 6yGNxVuHBQiCh85Od9p+Pq2XwWJHFfIkFvM2lc9xC3JFcWOmwVzrXojaICMD2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649742; a=rsa-sha256; cv=none; b=Kjtl8zkHWZnGWiaul6nA+1gcPFmWmMDoZySPnZ3Dp171w0Vh/sn08a/yHEGkNT3oOStfEy oX+pivTK9tyE2nNF9NJb7wIGFNcKuz0nFlkHPGuiT9aQJpCRyxPNnMbNGatlqCA3i5yEw7 PcrO8Qco/WiFVsOMp2G2dY6VPNqfON/LdRfEw9X5SUIlx3NFmJfp/WOXGsm/9mIvujkxIU ihdF7tutlZP5AzseGTlD2+fjImAVRc01JyU4bNIIpIeGCP1fACy/UHwlUmdHe8ehBk0Mln EybMp7g/VMOTvcKXONwdFBaaW2Ws21XSjG+y92oJYhQCguJ2MFlH9aZE0A7fhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9p40Khzw7L; Sun, 3 Nov 2024 16:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2MXa015544; Sun, 3 Nov 2024 16:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2M5K015541; Sun, 3 Nov 2024 16:02:22 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:22 GMT Message-Id: <202411031602.4A3G2M5K015541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: e177e6429455 - stable/14 - ACPI: Implement power button on !x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e177e64294556bdece642442d6691523a4294b67 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e177e64294556bdece642442d6691523a4294b67 commit e177e64294556bdece642442d6691523a4294b67 Author: Colin Percival AuthorDate: 2024-10-12 17:27:39 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 ACPI: Implement power button on !x86 ACPI sleep states are only implemented on x86 systems, so having the ACPI power button attempt to enter "S5" (or other state as configured via the hw.acpi.power_button_state sysctl) is not useful. On non-x86 systems, implement the power button with a call to shutdown_nice(RB_POWEROFF) to shut down the system. Reviewed by: Andrew Tested on: Graviton 2 MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47094 (cherry picked from commit f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066) --- sys/dev/acpica/acpi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 71b19067707b..c2bfe5f2fa5d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -3858,13 +3858,22 @@ acpi_invoke_wake_eventhandler(void *context) UINT32 acpi_event_power_button_sleep(void *context) { +#if defined(__amd64__) || defined(__i386__) struct acpi_softc *sc = (struct acpi_softc *)context; +#else + (void)context; +#endif ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); +#if defined(__amd64__) || defined(__i386__) if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_invoke_sleep_eventhandler, &sc->acpi_power_button_sx))) return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); +#else + shutdown_nice(RB_POWEROFF); +#endif + return_VALUE (ACPI_INTERRUPT_HANDLED); } From nobody Sun Nov 3 16:02:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9q5Ydwz5cMwM; Sun, 03 Nov 2024 16:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9q3WBYz4NBs; Sun, 3 Nov 2024 16:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d17rKPfa6bWb7FYOgt2jiq9ccvCVpvcVBrhEzp2RsYQ=; b=sOdFnz9814kwFB9vrSMtB//kX/yNrFMIizThebZiCX5Dex5/siu5alH+2xYDF63pawgS2u UzFhfNh6taXuumTGkS48oRl2fr9AD1tRry7M85Jt3lClHiZbTqoNU8eN9jVKaYMrz21BsT UUNqZ7JtIGEM4IjOWUk68uAGb5OyY2UN8RLWHW1H1ewSGmlDRcH7UYgB9rI0xROHweJbCA KY+DqpitoEgrpdigkIf+JBdQhzOM2mQXblB7dkNYOKydJVjd1XwPrwbzybNyNiWXVVgC7X I5rUAtVD1CCWji5DHPBtyA+Xr3o1STy0KGQ+dYBi6GsfpfbyBthLmL12zSCUbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d17rKPfa6bWb7FYOgt2jiq9ccvCVpvcVBrhEzp2RsYQ=; b=pAG7byU7VqWLLzb7clRBMQtAor0f7YxFvXFFMEhbY/59ukZAifreFRuSYWowstvNk+v0uI m7rHXtep8VIVnGYKgXIIo0ygeOWesFN+DWglPkrBNlNTB4VUgU4dFLIRTJrL27jktbq69J 7vjmyPSIG4aghq3FyMBkCDDiOMRI5eE4jCzNox83PBCkmw3/Xsl93FiQcxKxfRvv33pNDv znBsVRC/FgWnPmFevS1OTRMq4w8k4felptGSMf5EgjNH9k2g5aXg2Nc+YCAHFSnizR3gAQ UnBuVp2m1q1PJc22E7bh58+Hoby9B35jteU9wvmNkwmF7Z2BWc1V7DiLuUErAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649743; a=rsa-sha256; cv=none; b=tqRIOyOkLxXb5pFEDkVRtycR9v6mKyPnO6rJCRMHOYKtgXh/Xgua0u8zaHX8js+Gq7IJlC +ZVO4tv9JimGpHGpS8JgpwReKSXRSucftnKNxzrahIit8cc1w3/CvfzRtkAy0cxRMiBV/j 5HwAgesAT/jRLZpA/6BhKBDPKe3o2nUeUcYRUr+ZlOb3OCGOWLax/huRcd4c60pDZfB9RI Nrt8Bfh0qJYgo2cGDBTjEScj3Za+EgnF7t9viliG45BZNM6fOh0Q6XOzmwXSUFYpvTC0y0 o13DjyfDojyQO2Wak0m7FcoUFbDkXMDs5H+0ZLPztTdazEyJ3PzqDFx/EEfwLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9q36jPzw9p; Sun, 3 Nov 2024 16:02:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2NuB015594; Sun, 3 Nov 2024 16:02:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2NVv015591; Sun, 3 Nov 2024 16:02:23 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:23 GMT Message-Id: <202411031602.4A3G2NVv015591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: bebff69739ed - stable/14 - sys: Add GPIO_INTR_EDGE_MASK define List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bebff69739ed5d9c6bbc7796a981da867420f77e Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=bebff69739ed5d9c6bbc7796a981da867420f77e commit bebff69739ed5d9c6bbc7796a981da867420f77e Author: Colin Percival AuthorDate: 2024-10-22 16:06:41 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 sys: Add GPIO_INTR_EDGE_MASK define This is the GPIO_INTR_EDGE_* flags, just as a convenience to let code test flags for interrupt edginess. Sponsored by: Amazon (cherry picked from commit f6197f2bc05b5a8df260cbf55283fddf7c76fec4) --- sys/sys/gpio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/gpio.h b/sys/sys/gpio.h index ba5b362125f8..1a9e998a0e56 100644 --- a/sys/sys/gpio.h +++ b/sys/sys/gpio.h @@ -83,10 +83,10 @@ #define GPIO_INTR_EDGE_FALLING 0x00080000 /* edge trigger, falling */ #define GPIO_INTR_EDGE_BOTH 0x00100000 /* edge trigger, both */ #define GPIO_INTR_ATTACHED 0x00200000 /* interrupt attached to file */ +#define GPIO_INTR_EDGE_MASK (GPIO_INTR_EDGE_RISING | \ + GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH ) #define GPIO_INTR_MASK (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ - GPIO_INTR_EDGE_RISING | \ - GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH | \ - GPIO_INTR_ATTACHED) + GPIO_INTR_EDGE_MASK | GPIO_INTR_ATTACHED) struct gpio_pin { uint32_t gp_pin; /* pin number */ From nobody Sun Nov 3 16:02:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9s0KJzz5cMXZ; Sun, 03 Nov 2024 16:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9r4S2hz4MqW; Sun, 3 Nov 2024 16:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xlONT6R1p9X07a4MtgJvg5S3EO8n0PQSRK2SNbq5o8=; b=sXdzlElEr9v27sRfPf+7Q17xbAnQ+avcx52AKTDyVZ1F6PCzrq845KttSpg7ZuDd6wAnOm C34ATcy+jP5z15QCqnSVxFCr39laHcFiFJ3+gGUkAtQWGC+GhQdrBZ1HUd52JuHrh9Qbeb kaXumRnzIJ+btyEhbynkp2i2OG0WdWA9YiMgiPBpaG0KCcz5vaUvxNNlygu2euuIu6xtDo 8pE2iVk5pncqdhfbH5BygKBH9uTwTWepHdbaZRd6NBUGjicMbzy2q2L3ufxGN1eZKK/yyI 0+iQpjCCJWmItbUCa7IP9t1mv1+6lETfbtiBjx8UwW6chPyH6GdfXUMUGPWHuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xlONT6R1p9X07a4MtgJvg5S3EO8n0PQSRK2SNbq5o8=; b=HZ18AFfFgI+NkbLxOhZEef0KsOzVd30pq14yoEVrh65IDIzX2mYY1vnfwjokbRs9MuNX6m XaBBOuO2U2ZMKEn3FBec0h0U0lJxY3mpSLi9bZaMk4S/ILTgkUFNSY+jUcaqHsU/va6rdN X+WUHjVWvmhv9bcljCnzX9w26kCaJ0Wz1Zap1oVWgxNv6dwgf8DXEI+OKd25cCRZ+m++Xy vgnSwZb5DYMGXLx6R+YbuewLa5Ulctdbrai6D8TuulGH2M8AEBI7uy1SBsMbfw/dLOatko LBw24ECd09J7gPFE3hTGsJ4I98T3Pyx477y5yJ3AMrd+Vp0bM9jxnXrvqh7wKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649744; a=rsa-sha256; cv=none; b=guBiiuiOYiUWAFbTgag7CWqqJZzaL48iX6hhKm/u3m8KfAOedVwDwYN0BQVMrzxe7wIsXq 3lUOrM/P6+A4fI2LFqOPkYION+8ddFcxeRNLSpd/38osTEg1rGj0ORHl/VMuPp4DgPQWRi 8P8oZBTh+wOD4oojUg0oIC4vo8HPuPymP9VR23Yk8NmfUWzKepTh1Q/tOoUqpAmRIAFbgV swZtOSldWpJ39mG+HiT0PzFq0LTiZKykz2XWEQj7zQjNZQn76mT+hEXnUxg3wdaS4BVWvj EOP12kRDnP93RmhhwfFCEJVTIlpRlU4O+9VcFRNEgJbPHsZclbb42Xf0fEcxqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9r43TBzwQQ; Sun, 3 Nov 2024 16:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2Owv015645; Sun, 3 Nov 2024 16:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2Onc015642; Sun, 3 Nov 2024 16:02:24 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:24 GMT Message-Id: <202411031602.4A3G2Onc015642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 5fa51c3653b1 - stable/14 - ACPI: Add ACPI_Q_AEI_NOPULL quirk and use in EC2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5fa51c3653b14b364e26a4cce2733c7be6ee7721 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5fa51c3653b14b364e26a4cce2733c7be6ee7721 commit 5fa51c3653b14b364e26a4cce2733c7be6ee7721 Author: Colin Percival AuthorDate: 2024-10-22 14:47:30 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 ACPI: Add ACPI_Q_AEI_NOPULL quirk and use in EC2 AWS Graviton [1234] systems have a bug in their ACPI where they mark the PL061's GPIO pins as needing to be configured in PullUp mode (in fact the PL061 has no pullup/pulldown resistors); this flag needs to be removed in order for _AEI objects to be handled on these systems. Reviewed by: Ali Saidi MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47239 (cherry picked from commit 2f3f867ac6dd7ff3769366b828b79c44b38828e1) --- release/tools/ec2.conf | 5 +++++ sys/dev/acpica/acpivar.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 522aaa400520..963c6ff4957b 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -63,6 +63,11 @@ ec2_common() { # nodes, but apply the workaround just in case. echo 'hw.broken_txfifo="1"' >> ${DESTDIR}/boot/loader.conf + # Graviton 1 through Graviton 4 have a bug in their ACPI where they + # mark the PL061's pins as needing to be configured in PullUp mode + # (in fact the PL061 has no pullup/pulldown resistors). + echo 'debug.acpi.quirks="8"' >> ${DESTDIR}/boot/loader.conf + # Load the kernel module for the Amazon "Elastic Network Adapter" echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index afb0a6909e1a..eb6022cde159 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -224,12 +224,15 @@ extern struct mtx acpi_mutex; * ACPI_Q_MADT_IRQ0: Specifies that ISA IRQ 0 is wired up to pin 0 of the * first APIC and that the MADT should force that by ignoring the PC-AT * compatible flag and ignoring overrides that redirect IRQ 0 to pin 2. + * ACPI_Q_AEI_NOPULL: Specifies that _AEI objects incorrectly designate pins + * as "PullUp" and they should be treated as "NoPull" instead. */ extern int acpi_quirks; #define ACPI_Q_OK 0 #define ACPI_Q_BROKEN (1 << 0) #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#define ACPI_Q_AEI_NOPULL (1 << 3) #if defined(__amd64__) || defined(__i386__) /* From nobody Sun Nov 3 16:02:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9v2qWQz5cN12; Sun, 03 Nov 2024 16:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9t5glJz4MtK; Sun, 3 Nov 2024 16:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xDGCNAbaP3dgJnQ4ec60qtBaEGiAKNTeTeofWPCfeEM=; b=OlgDLH6Z/w4uGlFFjtcZrgzSieWi5pLVqaJGwKLpDljKg+KVkPD9AR4mrOdMpSbzRT8s4e KMsYuZGtIWH1rENLNqZbMRKmcTR5JEYAMHdZlITD0uaFeAXhMSeR0pLUE5UkKWkNwsl5lP yNCgrD/IoSkszMDdDamORNX/OBlHVFSlYfib/7OEK6Df8xT/h4uPt8xNwJv9gOlR1sI03F jiDj9R/VlVbOgGq738eNkjtwpas6gHcF5Zvp7H8Ao9GbRpsTNA5TK9eqC+HdR5J4xrb6if 9N3w1y37JcW1linTZTPurYzgd5D7dhWlwvapHNFeUhScgvczdabYqQJmrFH9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xDGCNAbaP3dgJnQ4ec60qtBaEGiAKNTeTeofWPCfeEM=; b=HsQsLyNIfT34u54/kYm5OpbLv7O5EvTQITWcDYq/5pKeV7NHSF7rgeb7okDKx43apjw4nD vy1pabQjS89jdsCUoSvHUgVspFbL7a1YMgY2/L2f7895wIFFtmXCH/n3K6SRxuQpVyILM3 /nznD1e92BOiVV8dY9+mN1qu0wnTEWn22uP2wumC7uJPH2UxgeOq02D0d1AOkBGg7Zc15H M+35s/sKPUIFdoUV0N0BTKNc+QwqhVhnHV0n87/66sRz5sHvGxz+nmNkjbLbK3ES7a6aI0 12VL24JE0CNWrZS96xteNzEXrBqO0T8cIzX1amUlqijLToJ4EdscEbTn0Xk3+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649746; a=rsa-sha256; cv=none; b=mJhtT1vqi4LsSxPpjpVmM5AnvWO9j/Uv1Sxj4+A1fOwA7OnKMQOJHRUP+SlaBHNNvwf01Y RBfCx3FJvtBRnW6EsOUKj2zAvydhGd5brX/9g7lZvNQLWqF5rbsT/+rQM8kDl87FHXo7xZ NR5yQ9PJwXadmLg2PYjRSWTxP6H88bsQLdmnD3RHjEgcoZQ3EM9L430nDBtRnceeKuM1cg bqCwowg7z1GtASVmDU4FUbBWwr4e8F3EWCJUiELqkEVov0VksezeOZIcDOQrcl84DuBEys guGvx1Zrsg+gpSZhGEhfcGna3y1ID+YZKST3t/ir5OLbjrBz9D0n65Z7yYzIGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9t5G7VzwSv; Sun, 3 Nov 2024 16:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2Qsf016675; Sun, 3 Nov 2024 16:02:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2QrS016672; Sun, 3 Nov 2024 16:02:26 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:26 GMT Message-Id: <202411031602.4A3G2QrS016672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 1f6941760746 - stable/14 - acpi_gpiobus: Narrow scope of NOT_YET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1f6941760746367704c9f1fa730a00b99d4d46b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1f6941760746367704c9f1fa730a00b99d4d46b2 commit 1f6941760746367704c9f1fa730a00b99d4d46b2 Author: Colin Percival AuthorDate: 2024-10-22 18:25:11 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 acpi_gpiobus: Narrow scope of NOT_YET GPIO interrupts work just fine and will be used shortly. We still do not support GPIO_INTR_SHAREABLE however, so leave that within the NOT_YET scope. Reviwed by: andrew MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47251 (cherry picked from commit 2d4219919a48aa6d67ae62e2b8859ffe3b035bd2) --- sys/dev/gpio/acpi_gpiobus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 3b6fc6dde674..9828170daeca 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -52,8 +52,6 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) uint32_t flags = 0; /* Figure out pin flags */ -#ifdef NOT_YET - /* These are currently unused. */ if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_INT) { switch (gpio_res->Polarity) { case ACPI_ACTIVE_HIGH: @@ -69,10 +67,12 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) break; } +#ifdef NOT_YET + /* This is not currently implemented. */ if (gpio_res->Shareable == ACPI_SHARED) flags |= GPIO_INTR_SHAREABLE; - } #endif + } switch (gpio_res->IoRestriction) { case ACPI_IO_RESTRICT_INPUT: flags |= GPIO_PIN_INPUT; From nobody Sun Nov 3 16:02:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9t0nNNz5cMjp; Sun, 03 Nov 2024 16:02:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9s53Clz4Mt3; Sun, 3 Nov 2024 16:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWXssP08eQ53E8m8PRW1RhhnfA4ePpUhmZZ025YxkOY=; b=Y2HnB1rFvIlDTHf4cQbhMuTA5vL0JsLCDdhgRmJyL2phOF+eVdd3F7TGmyZllunXaC6geY oBBr+9WIt21zkRg1Sb+RfgaYFRnjSVV0EyzxNv1u6EeE1YHMzZGjmtdzAXp3FRJJBJZ3U4 rv3OG35DPLG5P1qQyr2E8CRjgfqv15YKenC+Jnzd5VnoD4PO1nCyFrsG/g+5oX0/nb+8iC tJhQMyz2NR+7Dy1k5p/y7QXsbmyLD6oYkXk4qVG9Hrvhl6tqcHqmu0s986Q36T4uLHo+aj ZR9vEUJC1Wi1bJYA8U4LHBKu24NWt52A0/bb/ra7kd9b7Qw9S8J/NyQ8kK1p9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWXssP08eQ53E8m8PRW1RhhnfA4ePpUhmZZ025YxkOY=; b=bcKfHVkg6Vj7qEp737NiTDDbl4VAqXcA2tQS4DJwOCdTWkY/AV3iE+8ZwY2pIgZhTINZsG PbsbJQRyH+qSW2LFsuWygo5kOa4rKmu+YVdVTFyQ+ru5XDu9BRCoOtSuLZoGFSeRC+QRSg nrMYBT1QLF+cITL9+X//SZWzbPMven8IdVMdwJGkRHsqwIdjI1jdKJ1NefTQoJtaCxXsaM g8R3ulNFcCwXU8Iu5KG9FkDI92HNEadrP/m/K4M/CVFgYlHoS3VciuZ1WjzNxKi7pIu0fb PhOS0iPliwQGDNJQxmooR29p0Y8xRtIcKUi5NmVnym99P2yz+jjbJa1kTE4NFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649745; a=rsa-sha256; cv=none; b=aOjtz6olC20bZGhUaxCRx4b1y0Skk1nIZrR6rtDUm+IQyXM/IlHu0687JK4stfPdeMFjgs aW9T2LyroZlKH8nAWuPHwZ4P1i6Jlc2uymT4pj2gC+5hcjTv/FuRv6miV2E6aejnFuH/HO coAtXLQ5RhljLjfGN3VZ7tpgAGCNDOpAm8WeByipY/P+UME63N5gqRWATj0iXBltCLTCZG mOW49NuDXwNryovVm/KgOf5qKpiRARpGItI6FJfsBaJWRUTGVDTgcgkBKdqc+r4EYCOvlB 43e8y87zu28WZqiw9zLcYXHcRTE76TVuw1IZ1yiliv5e3DZY227jg+oe/YgyWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9s4bvczwGQ; Sun, 3 Nov 2024 16:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2PDw016386; Sun, 3 Nov 2024 16:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2PNT016373; Sun, 3 Nov 2024 16:02:25 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:25 GMT Message-Id: <202411031602.4A3G2PNT016373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: fffdfe2f6770 - stable/14 - gpiobus: Make gpiobus_read_ivar extern List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fffdfe2f6770946bb5d5204df0a97105e1dceccb Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=fffdfe2f6770946bb5d5204df0a97105e1dceccb commit fffdfe2f6770946bb5d5204df0a97105e1dceccb Author: Colin Percival AuthorDate: 2024-10-22 17:51:57 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:27 +0000 gpiobus: Make gpiobus_read_ivar extern This allows acpi_gpiobus to override the method and fall back to the generic gpiobus_read_ivar function if needed. Reviewed by: andrew MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47250 (cherry picked from commit bc0d10d01c3c69004d600e14d53cd0dceffe4b09) --- sys/dev/gpio/gpiobus.c | 2 +- sys/dev/gpio/gpiobusvar.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 7bdb080eb4f1..674a04bc401b 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -753,7 +753,7 @@ gpiobus_hinted_child(device_t bus, const char *dname, int dunit) } } -static int +int gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct gpiobus_ivar *devi; diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index e3669e82e594..74783e112f89 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -179,6 +179,7 @@ int gpiobus_detach(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); +int gpiobus_read_ivar(device_t, device_t, int, uintptr_t *); int gpiobus_acquire_pin(device_t, uint32_t); int gpiobus_release_pin(device_t, uint32_t); From nobody Sun Nov 3 16:02:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9x2fJ9z5cN17; Sun, 03 Nov 2024 16:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9w0nf1z4NBH; Sun, 3 Nov 2024 16:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T5dYrnAKAPcR4T58lyJH8FYt7BdTzttamrL00LmfDyk=; b=xYi8ZcuG2wQinfvW89pz8qyBTbo0TGchzNA5lRYEpenMU0inB6CuML4SFvWNlz30dAMqCZ pW8dEn3eSVnAzuPBknzwRGqvhXerQbyq2jypoiKCZSAvVBXIkUuV/z1/0Jp9iU8McB7qe2 YJ/wrUideN/5xruJ5vZ5VXgiYwJJYDK+yJ7qwMQaND5ICTpokCHtOjPV6ct/Zlx7QvpkQ0 C+dtGdcEtba4/MSCzQaaOBe91pLeRyyHgOkJCCFUdsqdTN65I2E53pnDyMUjUWNz6vEOLC jE/4Csot1+XEQPUV5uQs0mIuVIYhW3R04sekx6TN+EY7YunVDbDaU8/brJIAww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T5dYrnAKAPcR4T58lyJH8FYt7BdTzttamrL00LmfDyk=; b=yLSGJP0urG/uHhtLAkcLtOeuz6rMnnL7/y/G9Px2ka5cLKB8eaApvC3HLxmJbhXxPvPkqA ULg+wMWE06VgyKatVkO9SJgs9y2lEIvRlKUmUUVI9AuxKKOMYR8Jyc9gHZa73EAs0SBY0k J0hEiLuGpE1Kjno2ns1sdT7/EFy5wpgv2eeSG0+JIhLpZ+qdJGkkt8MLm04sVKIKWq658T SS1qe8G0jVRhUAg+FwITPYYp5aRUbNXvw0MOXJ6Oah4ighymDltMLcQaPa/+AndasQ5SYt 9MYlDZijE1V4oRdKyKNWrYbx1Jgpt+5sPJeLdjqoNPTiP5Oie7M0pJvsqzW0FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649748; a=rsa-sha256; cv=none; b=BqqPq+40uScs13/94TQr43xl7/VKcdUjoRcdymXd0N6fCsxkkDDaBlddHY7GulFl9Dfcf+ UR2BPue4iPwGEUt3OLgUuLrV6BK3+ieC6gXh946EKQNzuV/YfQhtqbkZGzKRk6Jolg9DYy ROkrlirZgpzgR01qQL1rBvwofwr/+cJbf14hJ6oIacQH4EUwbOlXkFJpRP1okeH5fjyMvy RQjiE6twuSK4wBJGWPyuZ3gRXGD4Rxad8BqMPvEb/l23V0D5In1FEJjBXQVAsFC6PIWlGf y5AHqmveZILaJF17nQd822Iq2PSf1vJFaVJOmDeXdqV5G6QKei1s0Nhc7UuBJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9v6dSLzwCv; Sun, 3 Nov 2024 16:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2Rtv016734; Sun, 3 Nov 2024 16:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2RAT016731; Sun, 3 Nov 2024 16:02:27 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:27 GMT Message-Id: <202411031602.4A3G2RAT016731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c54bdf84d5fb - stable/14 - bus: Activate INTRNG interrupts in common code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c54bdf84d5fb0b2c1923179fd30812ee68aaf423 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c54bdf84d5fb0b2c1923179fd30812ee68aaf423 commit c54bdf84d5fb0b2c1923179fd30812ee68aaf423 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:45 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:28 +0000 bus: Activate INTRNG interrupts in common code [MFC note: This is not a direct cherry-pick due to API changes in HEAD which are not present in stable/14.] We need to call into INTRNG to activate all interrupts on platforms that use it. Currently, interrupts are only activated in the nexus drivers for INTRNG platforms, but this does not handle other bus devices such as gpiobus that manage their own IRQ space. Reported by: cperciva Reviewed by: cperciva, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47282 (cherry picked from commit c85855a72db9f9d7b4326b676241e1dffabf0fae) --- sys/kern/subr_bus.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f0831b30142b..f55a7210e825 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -53,6 +53,9 @@ #include #include #include +#ifdef INTRNG +#include +#endif #include @@ -4382,17 +4385,26 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); - if (error != 0) { - rman_deactivate_resource(r); - return (error); - } + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); + if (error != 0) + break; - rman_set_mapping(r, &map); + rman_set_mapping(r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + error = intr_activate_irq(child, r); + break; +#endif } - return (0); + if (error != 0) + rman_deactivate_resource(r); + return (error); } /** @@ -4421,10 +4433,19 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - rman_get_mapping(r, &map); - BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + intr_deactivate_irq(child, r); + break; +#endif } return (0); } From nobody Sun Nov 3 16:02:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9y1RPCz5cMdV; Sun, 03 Nov 2024 16:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9x2Y1vz4NG6; Sun, 3 Nov 2024 16:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImbyoBtZSrTl2+ghwaUZ0Ic37rJRC08F5CbJoxh6EYs=; b=ojLgDJ3D3+HVpq7hGsNcsHOGFSd9gU5srB22q8YaiuE+KxeCfJALVexEgQRl+9VfpaoAWi RVZLOBEnNOCAp0CNldjvyLTiN9ioY5SxL7r3jUKOluegca5/cPczi/PIL9jfTGUpLZWFCb THLNaJreIvb4+IFA5kO2kH5/tRHOgZJYCOEIKCchrtne93qW7/BQqJmJZyiZ09nntFVCeO 6PRB/Bulmob6fx0Nr2QzeG4lgNKb7+CU+OS4Ubq3Q4jQKBe9hy7th7iN1nM75w7uQNVGSC lsxVkatuUBKcNESdafr+1MbjAx15KyxT2Y+pFy57Vs0biBrswQd6Pw3PLkNY0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImbyoBtZSrTl2+ghwaUZ0Ic37rJRC08F5CbJoxh6EYs=; b=uV8dvXUT4QdCPxdTyZgBgxhp5FcJkwYspZVyeIcAf0VNYgYzDWeMB2eAwAt/faY7MJpCWk 0gQIFh7lT2kxxfOnLnR2kL1e+ggcAc4mNwC8AadjRVL6CrObIxgSAsYOMIibz6tb7pzBeS fON/tYYR8HueXkVW9Vrn3wp/FZgfn4L/n1zxLJj0oE9EiBwA+3Kw7aIC0uwZf5DsOnr+os bIvpZXHsBtN5m6n6jTcdvfc4TEz49lpHWSTb8rUeRVDKab9bRCisBdS0yWaD/c+vUruXIs BbqfjPWKXOR72EZ2W/EqmEDHhUFmoJpv9/h/CIo3dHnAx4ZXyjZgknYVaUMG3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649749; a=rsa-sha256; cv=none; b=lFB/roA4JjLxrojPP0noDiYbGethLiOH5rz9m064CpNO8mRSwM36pDvGsMXL5PC4iI1b2K 98aHwEBXAy4NlRc0rgZW9UqMZHPe+ih5A1xmUNt+F4cQCnDr/fdVjzLubP7eB6inB9qEQ+ IaGf5LIoi0LzLw4869sn3g3qJuxChDjbZobGomwmuRmGvl0BAUTmS6gmVAztIwZt+aUDnq ZIETUelbZmuVqPPE9bSe9NSSyQPwQNnC846Dse/gDCrVUkgbXWAvNEkYEd/SWdp8zOq/M3 eBYTfetRquvtIWrzWP5FBwpZAVctAKggxYnXeRxJC7kT+Q8rZdkLjQh59uuXZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9x0Sp3zw9s; Sun, 3 Nov 2024 16:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2SBg016794; Sun, 3 Nov 2024 16:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2SQ9016791; Sun, 3 Nov 2024 16:02:28 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:28 GMT Message-Id: <202411031602.4A3G2SQ9016791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c2cd78d9446e - stable/14 - GPIO: Add ACPI _AEI support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c2cd78d9446ebe79accf6c1862230dfbe7276525 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c2cd78d9446ebe79accf6c1862230dfbe7276525 commit c2cd78d9446ebe79accf6c1862230dfbe7276525 Author: Colin Percival AuthorDate: 2024-10-22 18:53:55 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:28 +0000 GPIO: Add ACPI _AEI support Changes to acpi_gpiobus.c handle discovering and parsing the _AEI objects and storing necessary data in device ivars. A new gpioaei.c file implements the device, which simply requests an interrupt when the pin is triggered and invokes the appropriate _Exx or _Lxx ACPI method. This makes the GPIO "power button" work on arm64 Graviton systems, allowing EC2 "Stop"/"Reboot" instance calls to be handled cleanly. (Prior to this change, those requests would time out after 4 minutes and the instance would be forcibly killed.) Reviwed by: imp, andrew, Ahmad Khalifa MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47253 Co-authored-by: Andrew Turner (cherry picked from commit 9709bda03cd0f20eba0ba4276fc3c2e06354a54f) --- sys/conf/files | 1 + sys/dev/gpio/acpi_gpiobus.c | 121 +++++++++++++++++++++++++++++++++++ sys/dev/gpio/acpi_gpiobusvar.h | 49 ++++++++++++++ sys/dev/gpio/gpioaei.c | 131 ++++++++++++++++++++++++++++++++++++++ sys/modules/gpio/Makefile | 2 +- sys/modules/gpio/gpioaei/Makefile | 14 ++++ 6 files changed, 317 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 5239f38d5154..3810032f7094 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1745,6 +1745,7 @@ dev/gpio/acpi_gpiobus.c optional acpi gpio dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt +dev/gpio/gpioaei.c optional acpi gpio dev/gpio/gpiobacklight.c optional gpiobacklight fdt dev/gpio/gpiokeys.c optional gpiokeys fdt dev/gpio/gpiokeys_codes.c optional gpiokeys fdt diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 9828170daeca..14ded4539a5e 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -35,6 +35,9 @@ #include #include +#include + +#include "gpiobus_if.h" struct acpi_gpiobus_softc { struct gpiobus_softc super_sc; @@ -46,6 +49,13 @@ struct acpi_gpiobus_ctx { ACPI_HANDLE dev_handle; }; +struct acpi_gpiobus_ivar +{ + struct gpiobus_ivar gpiobus; /* Must come first */ + ACPI_HANDLE dev_handle; /* ACPI handle for bus */ + uint32_t flags; +}; + static uint32_t acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) { @@ -136,6 +146,74 @@ acpi_gpiobus_enumerate_res(ACPI_RESOURCE *res, void *context) return (AE_OK); } +static struct acpi_gpiobus_ivar * +acpi_gpiobus_setup_devinfo(device_t bus, device_t child, + ACPI_RESOURCE_GPIO *gpio_res) +{ + struct acpi_gpiobus_ivar *devi; + + devi = malloc(sizeof(*devi), M_DEVBUF, M_NOWAIT | M_ZERO); + if (devi == NULL) + return (NULL); + resource_list_init(&devi->gpiobus.rl); + + devi->flags = acpi_gpiobus_convflags(gpio_res); + if (acpi_quirks & ACPI_Q_AEI_NOPULL) + devi->flags &= ~GPIO_PIN_PULLUP; + + devi->gpiobus.npins = 1; + if (gpiobus_alloc_ivars(&devi->gpiobus) != 0) { + free(devi, M_DEVBUF); + return (NULL); + } + + for (int i = 0; i < devi->gpiobus.npins; i++) + devi->gpiobus.pins[i] = gpio_res->PinTable[i]; + + return (devi); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context) +{ + ACPI_RESOURCE_GPIO *gpio_res = &res->Data.Gpio; + struct acpi_gpiobus_ctx *ctx = context; + device_t bus = ctx->sc->sc_busdev; + device_t child; + struct acpi_gpiobus_ivar *devi; + + /* Check that we have a GpioInt object. */ + if (res->Type != ACPI_RESOURCE_TYPE_GPIO) + return (AE_OK); + if (gpio_res->ConnectionType != ACPI_RESOURCE_GPIO_TYPE_INT) + return (AE_OK); + + /* Add a child. */ + child = device_add_child_ordered(bus, 0, "gpio_aei", -1); + if (child == NULL) + return (AE_OK); + devi = acpi_gpiobus_setup_devinfo(bus, child, gpio_res); + if (devi == NULL) { + device_delete_child(bus, child); + return (AE_OK); + } + device_set_ivars(child, devi); + + for (int i = 0; i < devi->gpiobus.npins; i++) { + if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) { + gpiobus_free_ivars(&devi->gpiobus); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return (AE_OK); + } + } + + /* Pass ACPI information to children. */ + devi->dev_handle = ctx->dev_handle; + + return (AE_OK); +} + static ACPI_STATUS acpi_gpiobus_enumerate(ACPI_HANDLE handle, UINT32 depth, void *context, void **result) @@ -272,6 +350,13 @@ acpi_gpiobus_attach(device_t dev) if (ACPI_FAILURE(status)) device_printf(dev, "Failed to enumerate GPIO resources\n"); + /* Look for AEI children */ + status = AcpiWalkResources(handle, "_AEI", acpi_gpiobus_enumerate_aei, + &ctx); + + if (ACPI_FAILURE(status)) + device_printf(dev, "Failed to enumerate GPIO resources\n"); + return (0); } @@ -294,12 +379,48 @@ acpi_gpiobus_detach(device_t dev) return (gpiobus_detach(dev)); } +int +gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin) +{ + struct acpi_gpiobus_ivar *devi; + int rv; + + rv = gpio_pin_get_by_child_index(consumer, idx, out_pin); + if (rv != 0) + return (rv); + + devi = device_get_ivars(consumer); + (*out_pin)->flags = devi->flags; + + return (0); +} + +static int +acpi_gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct acpi_gpiobus_ivar *devi = device_get_ivars(child); + + switch (which) { + case ACPI_GPIOBUS_IVAR_HANDLE: + *result = (uintptr_t)devi->dev_handle; + break; + default: + return (gpiobus_read_ivar(dev, child, which, result)); + } + + return (0); +} + static device_method_t acpi_gpiobus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_gpiobus_probe), DEVMETHOD(device_attach, acpi_gpiobus_attach), DEVMETHOD(device_detach, acpi_gpiobus_detach), + /* Bus interface */ + DEVMETHOD(bus_read_ivar, acpi_gpiobus_read_ivar), + DEVMETHOD_END }; diff --git a/sys/dev/gpio/acpi_gpiobusvar.h b/sys/dev/gpio/acpi_gpiobusvar.h new file mode 100644 index 000000000000..77cb91110cb5 --- /dev/null +++ b/sys/dev/gpio/acpi_gpiobusvar.h @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __ACPI_GPIOBUS_H__ +#define __ACPI_GPIOBUS_H__ + +#include + +#include + +enum acpi_gpiobus_ivars { + ACPI_GPIOBUS_IVAR_HANDLE = 10600, +}; + +#define ACPI_GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(acpi_gpiobus, var, ACPI_GPIOBUS, ivar, type) + +ACPI_GPIOBUS_ACCESSOR(handle, HANDLE, ACPI_HANDLE) + +#undef ACPI_GPIOBUS_ACCESSOR + +int gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin); + +#endif /* __ACPI_GPIOBUS_H__ */ diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c new file mode 100644 index 000000000000..050f259a2127 --- /dev/null +++ b/sys/dev/gpio/gpioaei.c @@ -0,0 +1,131 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "gpiobus_if.h" + +#include +#include + +#include +#include + +struct gpio_aei_softc { + ACPI_HANDLE handle; + char objname[5]; /* "_EXX" or "_LXX" */ + struct resource * intr_res; + int intr_rid; + void * intr_cookie; +}; + +static int +gpio_aei_probe(device_t dev) +{ + + /* We only match when gpiobus explicitly requested gpio_aei. */ + return (BUS_PROBE_NOWILDCARD); +} + +static void +gpio_aei_intr(void * arg) +{ + struct gpio_aei_softc * sc = arg; + + /* Ask ACPI to run the appropriate _Exx or _Lxx method. */ + AcpiEvaluateObject(sc->handle, sc->objname, NULL, NULL); +} + +static int +gpio_aei_attach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + gpio_pin_t pin; + int err; + + /* This is us. */ + device_set_desc(dev, "ACPI Event Information Device"); + + /* Store parameters needed by gpio_aei_intr. */ + sc->handle = acpi_gpiobus_get_handle(dev); + if (gpio_pin_get_by_acpi_index(dev, 0, &pin) != 0) { + device_printf(dev, "Unable to get the input pin\n"); + return (ENXIO); + } + sprintf(sc->objname, "_%c%02X", + (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); + + /* Support for GPIO pins > 255 is not implemented. */ + if (pin->pin > 255) { + device_printf(dev, "ACPI Event Information Device does not support pins > 255"); + return (ENOTSUP); + } + + /* Set up the interrupt. */ + if ((sc->intr_res = gpio_alloc_intr_resource(dev, &sc->intr_rid, + RF_ACTIVE, pin, pin->flags & GPIO_INTR_MASK)) == NULL) { + device_printf(dev, "Cannot allocate an IRQ\n"); + return (ENOTSUP); + } + err = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, gpio_aei_intr, sc, &sc->intr_cookie); + if (err != 0) { + device_printf(dev, "Cannot set up IRQ\n"); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, + sc->intr_res); + return (err); + } + + return (0); +} + +static int +gpio_aei_detach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->intr_res, sc->intr_cookie); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, sc->intr_res); + return (0); +} + +static device_method_t gpio_aei_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, gpio_aei_probe), + DEVMETHOD(device_attach, gpio_aei_attach), + DEVMETHOD(device_detach, gpio_aei_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(gpio_aei, gpio_aei_driver, gpio_aei_methods, sizeof(struct gpio_aei_softc)); +DRIVER_MODULE(gpio_aei, gpiobus, gpio_aei_driver, NULL, NULL); +MODULE_DEPEND(gpio_aei, acpi_gpiobus, 1, 1, 1); diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index ffb3581d1f01..1d7f69f1836d 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,7 +24,7 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile new file mode 100644 index 000000000000..514dcd80a35e --- /dev/null +++ b/sys/modules/gpio/gpioaei/Makefile @@ -0,0 +1,14 @@ +.PATH: ${SRCTOP}/sys/dev/gpio/ + +KMOD= gpioaei +SRCS= gpioaei.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + gpio_if.h \ + gpiobus_if.h + +CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ + +.include From nobody Sun Nov 3 16:02:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9z22ygz5cMZh; Sun, 03 Nov 2024 16:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9y2Wvpz4NDB; Sun, 3 Nov 2024 16:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=klRVy2xmA7cxMHpSfLZ1Fcd27TfdB0C0idox7QDe3i8=; b=JtGAaLpWERfMTg+AEXlEAOoplAxxp8ciGKoDcjJckdtNoPW2t4lx1Cr/3ZEs52PQWLCoaA Qxx3geFQYKDJQYxmm+YSRekK4Rso13C3ijwPjIo8Tp8P7JoHoQntMCaxsSrx4OkpTuCaYs UM8nbB/V1vdxq9G3Ip4YCwWHOhCXmzpiof6TienC0xDZYQqYz/LoPsgLcvmfLS9H7NQtjM Eck6VsOxJf94lcHaPeI4VHtdNP2eVVEXtjGDzajEJGiElv82CNxukEYPGFu4FlfPgBGzo5 /NYnYaw3GDdKlJjGDCqqtHuDfmdthR8ph5KHTKYV5Y87d+Gtn3noJRzwzbIYgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=klRVy2xmA7cxMHpSfLZ1Fcd27TfdB0C0idox7QDe3i8=; b=gsfwXhRyKg4LpAsh0wc4t5cbakB6ftjGkIGApKeWT5Rku6FHciTsjFStVjJF8S9G6/33Ge 3afH+4n7Xa6f6ZutVRW++6Gu7yHr9QyCkFxOXD/gh9k2eMrFbfHatMiMY6/1n/wAjb1NRo MheJKhxJPxBxnSNm02/Q7XXlzhQHOUyAIicxVUg2yDBCCx23AOoBusPK0DZY+8HhSnQknR Tr8wzO8FRusK3tedfZImQsyDc1YEVVlHk3RC3lh1TXITlTbr5Cpp3qSJaqebuM3w8sjVxp WOy8Ff7ksIL3mTHuVNKXyWXTx377S9hHpAKz2c0h2sEq0znt+KEhWbb5fqXbZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649750; a=rsa-sha256; cv=none; b=IKnA7cWFUbZDcoVqTzZdCcPEnrqjIHxoiEuSaeNcIzuA4P5ACfEcDDZM5rL1Q+3185cUu6 yoCDD501muZfha+o2BvpNViB3QldRO7tV9NWJEvi96gjcUZDzMhZZ0nPgh/xrARahFPX+4 WmxCnuUjxksCZz4kZL1ciwD9coRq+BZWI68QJK+Zv9J8nAwdOZ+HUrvRqqDb+UZVYYvdQ3 mst6E4Lbmg+Epk3oUIw37ltEGEfSh7IAJzdbRHLi5DYQLKwfMJA4HmiAhkXxt4HC/AUDiY NrkP5+ck6SigST9So3rAoL2owIJlnpE+Jhf3vwdtHpTsF5a2XNIg65pfYW2W2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9y1SZGzwQV; Sun, 3 Nov 2024 16:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2U66016853; Sun, 3 Nov 2024 16:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2Uph016850; Sun, 3 Nov 2024 16:02:30 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:30 GMT Message-Id: <202411031602.4A3G2Uph016850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 5a53843aef49 - stable/14 - modules: gpioaei only on ACPI-supporting archs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a53843aef490bda32397e80b3fb600e802b461c Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5a53843aef490bda32397e80b3fb600e802b461c commit 5a53843aef490bda32397e80b3fb600e802b461c Author: Colin Percival AuthorDate: 2024-10-31 22:45:03 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:28 +0000 modules: gpioaei only on ACPI-supporting archs Fixes: 9709bda03cd0 ("GPIO: Add ACPI _AEI support") Pointy-hat to: cperciva Sponsored by: Amazon (cherry picked from commit 6540ac118473dde29cb02f786c79c64f73834ca1) --- sys/modules/gpio/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index 1d7f69f1836d..66090b1393bf 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,10 +24,14 @@ # SUCH DAMAGE. # -SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps .endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SUBDIR += gpioaei +.endif + .include From nobody Sun Nov 3 16:02:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhK9z5NxWz5cN3f; Sun, 03 Nov 2024 16:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhK9z3b18z4NVN; Sun, 3 Nov 2024 16:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GbGHGa9Jle4LA7m7KST51xSrdM423bVF/nranHQd1s=; b=GN1w38EFP/+GucFcdCbQu57kkhcn7m0Fukryl1p9fGmUHEFQzeUp3gzRKYpPExCXoP1z1n AIg7TRkHBl6V28BjsEFYiYnRcmM6n2WjNnPvZ1BDoEFkrJijWextjCQvF9AdVGsiuo3Wqm qPgrM1oYt9zN9M1xbkrpSsF41vsVFwSla9MNarGq9T0pwQQZzWMLRy/nu5SY8PztkIkNYr 9EASmiypPNcId7DYj0/2gCoXKDzn1+wdDBsrt9LkIGkyE1mkTJPAa2vrKI0BYg7wU8KEVe jVVW72PE8DTAeIPgXOvP4v3F8uudHpx1F2rAlDwXoU4DZafH09RpfbqnXBLpSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730649751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GbGHGa9Jle4LA7m7KST51xSrdM423bVF/nranHQd1s=; b=HDQgNBu54bvOchT+lrRzRbYp3Ehb+ypyEHtU+lfUorfXEUV2Tfmu3miMg9GCViPjhF/gaE uBwVorptHu5YmOiEEIZl+H4yOJm76xC7iP2YbwSdhqOyBtjQ01PXkE+FX66UGRMfdpkKXx PDknpKKo66tAy0DxI/OvSPYcur/j1dXBDqdJ/7bc+4vvZFzKrOpgMRAGuPS4HkUfSwETGb 5BKlHjYjziuCYp1BlYA/Q9ySKK+ofO7dAEAKv+9Fpxz4m2sRv2LLVrvBd7q4LJkDw0Ysad RWrGmUbQoKnKr6L2kFtg+KXrguCeJwObIa4D5aeoDycxaASRSUg9rh+ADFlFaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730649751; a=rsa-sha256; cv=none; b=Uu3MEIwAmXyyZapIHqKU4si426BB4Zael3/oW1/A++NHBl0pLuTh/pfCAyi2IKqvKqkt2A dk5BdVZH6CD5TElqn4hQqL6baxBTo4PSU0XJjj6BTgv9o6F8X7DkU6BA2Y4Z3dgTdIsHvA fbt1JK9R2f8lTYibPtX3+p69V/fttt97gnh034Y0jvEEnH1kVfsT4jKJ3IbbmeqNBO6PZ3 RIFVJGswUoC4SUgJZMUSBRPE/fjM38x5yqU1GpyHyZn5YUjxs0g/BZc2N5gBWLtX+KYTYM Gbj72DxbfUONP7Ahlt9Y6oNFriXCqyb0oVGTQvNaYwNOk3WxsfULZllK+rX1mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhK9z1vkczwSw; Sun, 3 Nov 2024 16:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3G2VvV016915; Sun, 3 Nov 2024 16:02:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3G2VEt016912; Sun, 3 Nov 2024 16:02:31 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:02:31 GMT Message-Id: <202411031602.4A3G2VEt016912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 393bbd23b344 - stable/14 - modules: gpioaei: Fix arm64.LINT-FDT breakage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 393bbd23b3446bb4ac4924f7e1c98bbdcff4455d Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=393bbd23b3446bb4ac4924f7e1c98bbdcff4455d commit 393bbd23b3446bb4ac4924f7e1c98bbdcff4455d Author: Ravi Pokala AuthorDate: 2024-11-02 05:08:11 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:01:28 +0000 modules: gpioaei: Fix arm64.LINT-FDT breakage 'acpi_if.h' was accidentally omitted from the module Makefile; add it. Fixes: 9709bda03cd0 (cherry picked from commit bb8b3b1741188ab284e8b48ec367961a480421cb) --- sys/modules/gpio/gpioaei/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile index 514dcd80a35e..8f856af48eb7 100644 --- a/sys/modules/gpio/gpioaei/Makefile +++ b/sys/modules/gpio/gpioaei/Makefile @@ -4,6 +4,7 @@ KMOD= gpioaei SRCS= gpioaei.c SRCS+= \ + acpi_if.h \ bus_if.h \ device_if.h \ gpio_if.h \ From nobody Sun Nov 3 16:02:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKBR0mmKz5cMmT; Sun, 03 Nov 2024 16:02:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKBQ35wxz4PBM; Sun, 3 Nov 2024 16:02:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) 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 4A3G2cL5044435; Sun, 3 Nov 2024 18:02:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 4A3G2cL5044435 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 4A3G2cUT044434; Sun, 3 Nov 2024 18:02:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Nov 2024 18:02:38 +0200 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0f5116d7efe3 - main - AMD IOMMU driver Message-ID: References: <202411022346.4A2NkeBT097606@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4XhKBQ35wxz4PBM X-Spamd-Bar: ---- On Sun, Nov 03, 2024 at 10:39:50AM -0500, Mark Johnston wrote: > On Sat, Nov 02, 2024 at 11:46:40PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=0f5116d7efe33c81f0b24b56eec78af37898f500 > > > > commit 0f5116d7efe33c81f0b24b56eec78af37898f500 > > Author: Konstantin Belousov > > AuthorDate: 2024-05-12 10:20:11 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-11-02 23:45:40 +0000 > > > > AMD IOMMU driver > > > > This driver is functionally equivalent to the in-tree Intel DMAR code. > > It handles busdma and interrupt remapping from the host OS. There is no > > integration with bhyve, and the stub iommu drivers in bhyve code cannot > > coexist with this driver (planned). > > > > The biggest architectural problem with the code is that the AMD IOMMU > > units are enumerated as PCIe-attached security devices, which is much > > later after HPET and IOAPIC drivers attached and actived interrupts. > > Because of this, HPET FSB interrupts and IOAPIC interrupts are always > > identity-mapped. > > > > The code is of late alpha quality. By default the driver is disabled. > > To enable for testing, set in loader.conf: > > hw.amdiommu.enable=1 > > hw.iommu.dma=1 <- to enable iommu busdma > > hw.iommu.ir=1 <- to enable interrupt remapping > > > > Discussed with: emaste > > Sponsored by: Advanced Micro Devices (AMD) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D47256 > > This appears to break loading of vmm.ko, as sys/amd64/vmm/amd/amdiommu.c > already defines a driver called "amdiommu". Perhaps the module in vmm > should be renamed to amdviiommu or so? Perhaps. Will you commit this yourself? From nobody Sun Nov 3 16:16:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVR5xCZz5cNnc; Sun, 03 Nov 2024 16:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVR5Dlzz4RcZ; Sun, 3 Nov 2024 16:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sk33JqtNbcJ/jRcrkia6/ZbNjWPx1o3l5Yv6aFopzT4=; b=fmnEbVs+CHBmpDSF8syuMN5gYsYgsSsiRyLKnvHCJ2aXaIm9Ko/AURH825xxEbIjTYmp9j bAlgyJytcFcvXRmzCuLlP+LArwnMaBgoqf+grnw/b3pIKhfvQgkvZUBsBwfZEgo/u3Sb79 Wo4rh7vsgKDs+0qusQMl+87xWTY1p/dx/XGZxYEB82b3ho3bhyE6ymagbksRO4NlLi9uAK 8d57JNzdCA7QVRC0OuliioRYBCo/RNEoqqPKqwKWwrxQzTimM05oDEPRGlAvcn46FCZbyu oCI6RHEb+wX4itSes/TC5ETWU6SzgShVPoHN+7o3+DsdvkSjDusWARB3/uB3pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sk33JqtNbcJ/jRcrkia6/ZbNjWPx1o3l5Yv6aFopzT4=; b=OsEuSd5MEiBvo45iQkbSt9SgHUxRneufLGjsTvixPuWvNlXCKzsWp0RrNnaG/VnFIbdFXs 7S9rsvn3LzlUTPQg7Y0b9yNnlNBbNG2x+5Jzp74TfFEo7x3t9Hf54q4V2JheOOa/CUW2ct iDIiTzmCcgMdJNkBuYNwORA3zPz+6pPEwDNLo3+zcRscY+j7SxspzIY3Hj82a17zZm64iS U/JScu++hN4FU7xDmebTKbHUqV81O+hFGYMXq05IvY4yu8auURpqFW6kEFDyxXPZc06VSv Zg+I1TVORP780CsJnvnpSkWNC6R7s2lyRt4+zXdSoKY3gaOMw63XggOc4P1F7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650607; a=rsa-sha256; cv=none; b=Epe1O+eHIiva/TQpeanxEm/zK+Mk6LpURZU54vV2r93Q6vDYBcHlY5JtJrpxYAUy4lfp3C MN08JKkKSrHnJIy0lXb/9rQhLVeMD0ZI1zP2ksytReuzFbgX1N8+25umYZSWydvfUF+AmS uBe5TAo8sRzEBUue3IE5qgONiy3JSU6t1+0p9b54HSebO9Z1amlylrq2Fyr6JtE/TiXIEO fUtcatQ1rzGVtcY8Aas+eFxW33+tjosNQWuAEefLRn6XzvDGbZHjgEEOHwa4P0KWFhsxWe Y4/mv1sjn5+Nl7BmRX1/lWVlnNHhBMIPTbNDF3krmoEK/pDuAsr9Ose5sOIp7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVR4j1Xzw7r; Sun, 3 Nov 2024 16:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGl87036243; Sun, 3 Nov 2024 16:16:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGln2036240; Sun, 3 Nov 2024 16:16:47 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:47 GMT Message-Id: <202411031616.4A3GGln2036240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: ce99ca69676e - releng/14.2 - gpiobus(4): Add an acpi variant of gpiobus List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: ce99ca69676e7be94cc36f9a126276f5602a472e Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=ce99ca69676e7be94cc36f9a126276f5602a472e commit ce99ca69676e7be94cc36f9a126276f5602a472e Author: Ahmad Khalifa AuthorDate: 2024-07-08 12:22:17 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:14:33 +0000 gpiobus(4): Add an acpi variant of gpiobus This currently only implements the address space handler and attempts to configure pins with flags obtained from ACPI. Reviewed by: wulf Approved by: re (kib) MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1359 (cherry picked from commit 92adaa5862d5ea94318a011e0618622d0fb72521) (cherry picked from commit 14887d2c869ad47d5921fc9aa07e891a38950121) --- sys/conf/files | 1 + sys/dev/gpio/acpi_gpiobus.c | 311 ++++++++++++++++++++++++++++++++++++++ sys/dev/gpio/gpiobus.c | 6 +- sys/dev/gpio/gpiobusvar.h | 2 + sys/modules/gpio/gpiobus/Makefile | 3 + 5 files changed, 319 insertions(+), 4 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5325e010d970..5239f38d5154 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1741,6 +1741,7 @@ dev/gve/gve_sysctl.c optional gve dev/gve/gve_tx.c optional gve dev/gve/gve_utils.c optional gve dev/goldfish/goldfish_rtc.c optional goldfish_rtc fdt +dev/gpio/acpi_gpiobus.c optional acpi gpio dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c new file mode 100644 index 000000000000..eafa1c07fab1 --- /dev/null +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -0,0 +1,311 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Ahmad Khalifa + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include + +struct acpi_gpiobus_softc { + struct gpiobus_softc super_sc; + ACPI_CONNECTION_INFO handler_info; +}; + +struct acpi_gpiobus_ctx { + struct gpiobus_softc *sc; + ACPI_HANDLE dev_handle; +}; + +static uint32_t +acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) +{ + uint32_t flags = 0; + + /* Figure out pin flags */ +#ifdef NOT_YET + /* These are currently unused. */ + if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_INT) { + switch (gpio_res->Polarity) { + case ACPI_ACTIVE_HIGH: + flags = gpio_res->Triggering == ACPI_LEVEL_SENSITIVE ? + GPIO_INTR_LEVEL_HIGH : GPIO_INTR_EDGE_RISING; + break; + case ACPI_ACTIVE_LOW: + flags = gpio_res->Triggering == ACPI_LEVEL_SENSITIVE ? + GPIO_INTR_LEVEL_LOW : GPIO_INTR_EDGE_FALLING; + break; + case ACPI_ACTIVE_BOTH: + flags = GPIO_INTR_EDGE_BOTH; + break; + } + + if (gpio_res->Shareable == ACPI_SHARED) + flags |= GPIO_INTR_SHAREABLE; + } +#endif + switch (gpio_res->IoRestriction) { + case ACPI_IO_RESTRICT_INPUT: + flags = GPIO_PIN_INPUT; + break; + case ACPI_IO_RESTRICT_OUTPUT: + flags = GPIO_PIN_OUTPUT; + break; + } + + switch (gpio_res->PinConfig) { + case ACPI_PIN_CONFIG_PULLUP: + flags |= GPIO_PIN_PULLUP; + break; + case ACPI_PIN_CONFIG_PULLDOWN: + flags |= GPIO_PIN_PULLDOWN; + break; + } + + return (flags); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate_res(ACPI_RESOURCE *res, void *context) +{ + ACPI_RESOURCE_GPIO *gpio_res = &res->Data.Gpio; + struct acpi_gpiobus_ctx *ctx = context; + struct gpiobus_softc *super_sc = ctx->sc; + ACPI_HANDLE handle; + uint32_t flags, i; + + if (res->Type != ACPI_RESOURCE_TYPE_GPIO) + return (AE_OK); + + if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, + gpio_res->ResourceSource.StringPtr, &handle)) || + handle != ctx->dev_handle) + return (AE_OK); + + if (__predict_false(gpio_res->PinTableLength > super_sc->sc_npins)) { + device_printf(super_sc->sc_busdev, + "invalid pin table length %hu, max: %d (bad ACPI tables?)\n", + gpio_res->PinTableLength, super_sc->sc_npins); + return (AE_LIMIT); + } + + flags = acpi_gpiobus_convflags(gpio_res); + for (i = 0; i < gpio_res->PinTableLength; i++) { + UINT16 pin = gpio_res->PinTable[i]; + + if (__predict_false(pin >= super_sc->sc_npins)) { + device_printf(super_sc->sc_busdev, + "invalid pin 0x%x, max: 0x%x (bad ACPI tables?)\n", + pin, super_sc->sc_npins - 1); + return (AE_LIMIT); + } + + GPIO_PIN_SETFLAGS(super_sc->sc_dev, pin, flags & + ~GPIO_INTR_MASK); + } + + return (AE_OK); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate(ACPI_HANDLE handle, UINT32 depth, void *context, + void **result) +{ + UINT32 sta; + + /* + * If no _STA method or if it failed, then assume that + * the device is present. + */ + if (!ACPI_FAILURE(acpi_GetInteger(handle, "_STA", &sta)) && + !ACPI_DEVICE_PRESENT(sta)) + return (AE_OK); + + if (!acpi_has_hid(handle)) + return (AE_OK); + + /* Look for GPIO resources */ + AcpiWalkResources(handle, "_CRS", acpi_gpiobus_enumerate_res, context); + + return (AE_OK); +} + +static ACPI_STATUS +acpi_gpiobus_space_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, + UINT32 length, UINT64 *value, void *context, void *region_context) +{ + ACPI_CONNECTION_INFO *info = context; + ACPI_RESOURCE_GPIO *gpio_res; + device_t controller; + ACPI_RESOURCE *res; + ACPI_STATUS status; + + status = AcpiBufferToResource(info->Connection, info->Length, &res); + if (ACPI_FAILURE(status) || res->Type != ACPI_RESOURCE_TYPE_GPIO) + goto err; + + gpio_res = &res->Data.Gpio; + controller = __containerof(info, struct acpi_gpiobus_softc, + handler_info)->super_sc.sc_dev; + + switch (function) { + case ACPI_WRITE: + if (__predict_false( + gpio_res->IoRestriction == ACPI_IO_RESTRICT_INPUT)) + goto err; + + for (int i = 0; i < length; i++) + if (GPIO_PIN_SET(controller, + gpio_res->PinTable[address + i], (*value & 1 << i) ? + GPIO_PIN_HIGH : GPIO_PIN_LOW) != 0) + goto err; + break; + case ACPI_READ: + if (__predict_false( + gpio_res->IoRestriction == ACPI_IO_RESTRICT_OUTPUT)) + goto err; + + for (int i = 0; i < length; i++) { + uint32_t v; + + if (GPIO_PIN_GET(controller, + gpio_res->PinTable[address + i], &v) != 0) + goto err; + *value |= v << i; + } + break; + default: + goto err; + } + + ACPI_FREE(res); + return (AE_OK); + +err: + ACPI_FREE(res); + return (AE_BAD_PARAMETER); +} + +static int +acpi_gpiobus_probe(device_t dev) +{ + device_t controller; + + if (acpi_disabled("gpiobus")) + return (ENXIO); + + controller = device_get_parent(dev); + if (controller == NULL) + return (ENXIO); + + if (acpi_get_handle(controller) == NULL) + return (ENXIO); + + device_set_desc(dev, "GPIO bus (ACPI-hinted)"); + return (BUS_PROBE_DEFAULT); +} + +static int +acpi_gpiobus_attach(device_t dev) +{ + struct acpi_gpiobus_softc *sc; + struct acpi_gpiobus_ctx ctx; + ACPI_HANDLE handle; + ACPI_STATUS status; + int err; + + if ((err = gpiobus_attach(dev)) != 0) + return (err); + + sc = device_get_softc(dev); + handle = acpi_get_handle(sc->super_sc.sc_dev); + if (handle == NULL) { + gpiobus_detach(dev); + return (ENXIO); + } + + status = AcpiInstallAddressSpaceHandler(handle, ACPI_ADR_SPACE_GPIO, + acpi_gpiobus_space_handler, NULL, &sc->handler_info); + + if (ACPI_FAILURE(status)) { + device_printf(dev, + "Failed to install GPIO address space handler\n"); + gpiobus_detach(dev); + return (ENXIO); + } + + ctx.dev_handle = handle; + ctx.sc = &sc->super_sc; + + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, acpi_gpiobus_enumerate, NULL, &ctx, NULL); + + if (ACPI_FAILURE(status)) + device_printf(dev, "Failed to enumerate GPIO resources\n"); + + return (0); +} + +static int +acpi_gpiobus_detach(device_t dev) +{ + struct gpiobus_softc *super_sc; + ACPI_STATUS status; + + super_sc = device_get_softc(dev); + status = AcpiRemoveAddressSpaceHandler( + acpi_get_handle(super_sc->sc_dev), ACPI_ADR_SPACE_GPIO, + acpi_gpiobus_space_handler + ); + + if (ACPI_FAILURE(status)) + device_printf(dev, + "Failed to remove GPIO address space handler\n"); + + return (gpiobus_detach(dev)); +} + +static device_method_t acpi_gpiobus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, acpi_gpiobus_probe), + DEVMETHOD(device_attach, acpi_gpiobus_attach), + DEVMETHOD(device_detach, acpi_gpiobus_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gpiobus, acpi_gpiobus_driver, acpi_gpiobus_methods, + sizeof(struct acpi_gpiobus_softc), gpiobus_driver); +EARLY_DRIVER_MODULE(acpi_gpiobus, gpio, acpi_gpiobus_driver, NULL, NULL, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(acpi_gpiobus, 1); +MODULE_DEPEND(acpi_gpiobus, acpi, 1, 1, 1); diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 65e8d1a775fe..7bdb080eb4f1 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -53,8 +53,6 @@ static void gpiobus_print_pins(struct gpiobus_ivar *, struct sbuf *); static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); static int gpiobus_probe(device_t); -static int gpiobus_attach(device_t); -static int gpiobus_detach(device_t); static int gpiobus_suspend(device_t); static int gpiobus_resume(device_t); static void gpiobus_probe_nomatch(device_t, device_t); @@ -551,7 +549,7 @@ gpiobus_probe(device_t dev) return (BUS_PROBE_GENERIC); } -static int +int gpiobus_attach(device_t dev) { int err; @@ -573,7 +571,7 @@ gpiobus_attach(device_t dev) * Since this is not a self-enumerating bus, and since we always add * children in attach, we have to always delete children here. */ -static int +int gpiobus_detach(device_t dev) { struct gpiobus_softc *sc; diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index 521132fbac9d..e3669e82e594 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -174,6 +174,8 @@ struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); +int gpiobus_attach(device_t); +int gpiobus_detach(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); diff --git a/sys/modules/gpio/gpiobus/Makefile b/sys/modules/gpio/gpiobus/Makefile index d9345e00e2be..baaf7faf69e8 100644 --- a/sys/modules/gpio/gpiobus/Makefile +++ b/sys/modules/gpio/gpiobus/Makefile @@ -38,6 +38,9 @@ SRCS+= device_if.h bus_if.h opt_platform.h .if !empty(OPT_FDT) SRCS+= ofw_gpiobus.c .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +SRCS+= acpi_gpiobus.c opt_acpi.h acpi_if.h +.endif CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ From nobody Sun Nov 3 16:16:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVT1Dlrz5cNtS; Sun, 03 Nov 2024 16:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVS5rXYz4S0P; Sun, 3 Nov 2024 16:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5TqASZ6dzm37ja/WjWNtdPC8zhJvbbDeI7X5OhSiERs=; b=N08F8ayoM/+RIxXyfmjyG6groKMeK6KSpmu5H320moW09I6aOixZvh80CvpnOhDU01B7zs 0MAEOQACA+dwsIzXDNFhwzULm9VdVfJ5Pe3tl4rhXi1Er9SvhaNFWEyhGhVjMUwV3at9da TDp2d6p942Ah4g32r5ZkrPpcbbv4ZNu84eVCadg4UpaXyIgKXQdLBNWAOlzgJ9kxmfsQrk 2pYlCifdnDudploo521U2OHZmObLU6bwGp0/+TiVxc0RUz3Lz6JU5OMj5lBF0gm8xRoSvI pTwXaHaEtAx2pTFQm11tj7tGrzFjTGILE/HaY2kOQ0a6eG3ZvnpNHyj9P54joQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5TqASZ6dzm37ja/WjWNtdPC8zhJvbbDeI7X5OhSiERs=; b=GAEykdi4Tzhg5k2s1Q7lK8tyY+FWZv+olAR8O9PhIDEkML7vMN0Pw73KpSCQF7NZd9Oymn 2I98I3sA7+kRxr/rrFHg5p+Mih3brNBQiSnuhbCdfZ4SVHjrE35CuUSr+KFN4J/I5+H86U 44Vtnmn7lSFMsLhz6dvpWikAAPhBQhIgHGfoPTfhXLbRlV0qOoqCZWF3rcY1V0o5cfTmPu E7zNCdj+DXrsxvXnb4gje1ymKs09aFC2ongZv4EB98E6dfpyypLzwkMI+kJbwjcIrE9ZqJ XhNvycvwWpMqzdAdGBbMiGpGhGPYlY9jnKuIaJ7Qivoeek7daz6UsGyGMSaiVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650608; a=rsa-sha256; cv=none; b=fwHFWhqWTNjwAOmVkkfu86ycbZtU/vbcGNbAvicYd6mO1GDHJAvy1TTR54E1hdh/i7TLgX jhWyijqkuHiyxEvGe82MCYfHN5uJPEN7I2y2yfzCbN9yZmp01IZS5tlQ4ypsGkpBloYu93 vi1vyh8lYkS2VKFfiEjTAWpjsZwI9rKD//8Tm8O0dL/jjr/UBsHE1VM0UFbP2eJRsMuQty LL1s+GWn4RIMeZhB9kXXgBtsnBMlyLuDYRopjwz5T2gFKyP4ZqInX6n69V1uBH7d/06vRS NgvaX9nD0CuexSem1lrv1Hk9vrrOy9b0fu1mfZU8uhaT/WD0H62Q1ybLnPhmNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVS511DzwFC; Sun, 3 Nov 2024 16:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGmpL036291; Sun, 3 Nov 2024 16:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGmKk036288; Sun, 3 Nov 2024 16:16:48 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:48 GMT Message-Id: <202411031616.4A3GGmKk036288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 574e7bad4a14 - releng/14.2 - acpi_gpiobus: OR GPIO_PIN_(IN|OUT)PUT into flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 574e7bad4a14bdc6316fa7a36cd1393c3137e11c Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=574e7bad4a14bdc6316fa7a36cd1393c3137e11c commit 574e7bad4a14bdc6316fa7a36cd1393c3137e11c Author: Colin Percival AuthorDate: 2024-10-12 18:12:15 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:07 +0000 acpi_gpiobus: OR GPIO_PIN_(IN|OUT)PUT into flags Right now flags is set to 0 before this "=" -> "|=" change, but it will matter when the NOT_YET section above becomes effective. Approved by: re (kib) MFC after: 2 weeks Sponsored by: Amazon (cherry picked from commit c808132731aa999947f4f7810157d7d8d9aaf61e) (cherry picked from commit 7c8f273bfba28d9d55ada94c80feb3ba97c53758) --- sys/dev/gpio/acpi_gpiobus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index eafa1c07fab1..3b6fc6dde674 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -75,10 +75,10 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) #endif switch (gpio_res->IoRestriction) { case ACPI_IO_RESTRICT_INPUT: - flags = GPIO_PIN_INPUT; + flags |= GPIO_PIN_INPUT; break; case ACPI_IO_RESTRICT_OUTPUT: - flags = GPIO_PIN_OUTPUT; + flags |= GPIO_PIN_OUTPUT; break; } From nobody Sun Nov 3 16:16:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVV17Znz5cNWS; Sun, 03 Nov 2024 16:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVT6QZwz4Rcb; Sun, 3 Nov 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMRbB6ehyP90mqhkTtMEnMj1l/pymNco8H4cgbaoI3w=; b=DXmD2v2kNpzwL/GcBLXXF2opjRvIaux/QVhc4BPQHew+3jv+T/r9kcd0ICzUie9PJvOa3c 1P0Rk/avgIWTf+ILoKjE41t6bcDc2728ARAhMxRmqyjL8/N1y1iyUy25uzshV6z3ZJtZ1Z v062McK1h/57S2oh4Sg1qxhK9yGbAPmvs+IWwXqlnNPvn2nb9SKWqFaRNxZn4YwDr5LigA HPCI3qY1lMcCDPHlPglknFSjsbJw0H1Vq4OFvVa1IBZIuFZHmCkKowHahTQeNBgQ6SZG3u OJAlfMPLyI/8QaPX4uSKFM9CqSsC6U1T5PBnWAiF4WzaYiN/SxJZssr+0Sk1Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMRbB6ehyP90mqhkTtMEnMj1l/pymNco8H4cgbaoI3w=; b=lELy6sPy6vmqG6NmXb5c4rZmZ88XqZgN4ec9Sjj2shZq006LrRYADq+jDKs3JANnFFGQuR JPVLAtVub/Vni+f4M3WHX4wO7qbwGqtEmmj48qJA1jSlu6tsgBD6bKxf1gwUBsN6crieok 6T+yUYo4Ug9DSEvQchtuluODmiJb1/ksWMruraQN6Iazv0Q7OuLFsDUvunsaSuv6c3i+jY VkfrAZRwyNGmTcNnBBliFCd38FxsxoTj0fRaiRcMnku/s1vC3vXpMXtwzFN+TBQmStMSop 8rZgcod67EKX2SPyTLB4krycKJnEHmwAHl88LZjCL9TYM2jaBx6WH4tSR4YIhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650609; a=rsa-sha256; cv=none; b=KJFjSLslb79B8X3+tDacEZRLyQipLQ0Zyky8jGfrXFtZIhzp+/SIw1bxZbxjrFIS0QwvDr zHfohJqTPgdWZ0Ohc26T0yxgW+0uyr/OTWQFq0HyVU2B+16tN1Esyl+trvf4CCe7VAAXSi JhwTFP9Q6bfL/GeD4LetYyEUtFqrqiSdCh+zi/KUXHE+zciiDAb6q5Ze3uEOqXdCksn1wP pH6wF99OWfptO8iUZIFZo5lSr/1iuRlbGSKEbqYAA0TlKHSHKcz3VXqUrx1IRdR5w+LmhD VaRj1TUEeQulPB5bkdaAOPichTRFO8tTeeNA7eJ68uxjDmhStvNzBl0w2HfuVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVT61p3zvwv; Sun, 3 Nov 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGnP0036336; Sun, 3 Nov 2024 16:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGnbw036333; Sun, 3 Nov 2024 16:16:49 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:49 GMT Message-Id: <202411031616.4A3GGnbw036333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c90ebd3fa356 - releng/14.2 - ACPI: Implement power button on !x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: c90ebd3fa356406e152fff4475431c9fd66ea84e Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c90ebd3fa356406e152fff4475431c9fd66ea84e commit c90ebd3fa356406e152fff4475431c9fd66ea84e Author: Colin Percival AuthorDate: 2024-10-12 17:27:39 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:12 +0000 ACPI: Implement power button on !x86 ACPI sleep states are only implemented on x86 systems, so having the ACPI power button attempt to enter "S5" (or other state as configured via the hw.acpi.power_button_state sysctl) is not useful. On non-x86 systems, implement the power button with a call to shutdown_nice(RB_POWEROFF) to shut down the system. Reviewed by: Andrew Tested on: Graviton 2 Approved by: re (kib) MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47094 (cherry picked from commit f41ef9d80b3d272e08dd9e2ea3c1d8d3f2818066) (cherry picked from commit e177e64294556bdece642442d6691523a4294b67) --- sys/dev/acpica/acpi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 71b19067707b..c2bfe5f2fa5d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -3858,13 +3858,22 @@ acpi_invoke_wake_eventhandler(void *context) UINT32 acpi_event_power_button_sleep(void *context) { +#if defined(__amd64__) || defined(__i386__) struct acpi_softc *sc = (struct acpi_softc *)context; +#else + (void)context; +#endif ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); +#if defined(__amd64__) || defined(__i386__) if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_invoke_sleep_eventhandler, &sc->acpi_power_button_sx))) return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); +#else + shutdown_nice(RB_POWEROFF); +#endif + return_VALUE (ACPI_INTERRUPT_HANDLED); } From nobody Sun Nov 3 16:16:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVW508rz5cNTV; Sun, 03 Nov 2024 16:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVW1jTWz4RpC; Sun, 3 Nov 2024 16:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5k4oOgaAYfo+dPGdo9Cej8tg9sBOdmcF9bkeBQ+SaqU=; b=gBr8ecmdUpS32Kx4wMHpDWqdQZXc8H1Ma+72iRtx7FCE2EAve9vwUe+dQSX8dVMeLnLFE/ Mwdg9sog9O/gZMBEdFloruJV9O6j9PFbtsn0fytW11TD3a+RM1Bt6eTKVPViFnBkB/zOGD gQdBfzpxJofyzB2PTw9y1jap8SGrq1wAFX47eGaooalZhmTFkS6ZCTNwPicIHX6oeNzfyj 92Vuq9BoQKk2A3Q9XTw9p5IL/8OnL8suB0+VJzoMQUc/zT+8UOtgqikfRD61WTrYKfCD3g U+g7bdtyy1cysOog06i30C332fABlb3/dsjELmrewL2ctZf8/jN7N1ggEZkxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5k4oOgaAYfo+dPGdo9Cej8tg9sBOdmcF9bkeBQ+SaqU=; b=w2dHGwRotxQezxZcSUacwDBXAaAtN0dfot3r85FQGL0HGsUN8k3AzoGeMMw73sOtw5vkog vIgoUM7aR34HzcOtOOrsuYqRMazdRxlLvN+IVknP5EaKxGeABwyL3S319ku40gYu54BGqI 86vgu8eoXCqBk5hx/F0KHjh13+4x6CGfdNTcp3+w1EtWQr56R0aePslHRitYQxGapg9KCa fK4id20SPbZmA9IuXxUL1CzggQzAfTrkkeU63oCWch92WCuYreI59qExulKvCF9N0g0KCP +lanyvE2OCRlXlMZPfilzxPpIXjj1G0afhiOQPqIJu0sYF7IlQXAPYo+wP1oHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650611; a=rsa-sha256; cv=none; b=RH0Wj2ak24TkL3dutbLaHXBSzx6g2pXJ08D96JaxGyMt1kpIOk++rRE1Lj7+d4BKSjfHR2 Vw5HEd1UdB4fBKWlcfSlVX5NyIBgsvZh7+pubEBw55czn9cmpiI+iI11iMH2mg8BI5fb6L aW9tn0MbyerhPL6cUqmUGw9HiWjokjHxVBRZcpclTJ97yOWxkX1hxZvG5kWrStohMLpMgs X9MXV0MSkvU6lB5PqJYonPWqLsNcMvZu/hWZQqns9dB5hkwDgj6hQZZLfbBJx6+Y/CIqk0 6vzynXOqGsyz3IvBwfW7e3/8m1cdBVtoDRMhjwXlFl4uFpeUVPvOpXRIpf/SrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVW0FRyzwTM; Sun, 3 Nov 2024 16:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGoWL036375; Sun, 3 Nov 2024 16:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGok5036372; Sun, 3 Nov 2024 16:16:50 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:50 GMT Message-Id: <202411031616.4A3GGok5036372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 98ed0edd1a26 - releng/14.2 - sys: Add GPIO_INTR_EDGE_MASK define List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 98ed0edd1a267824e3465360cb222d77743528ed Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=98ed0edd1a267824e3465360cb222d77743528ed commit 98ed0edd1a267824e3465360cb222d77743528ed Author: Colin Percival AuthorDate: 2024-10-22 16:06:41 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:19 +0000 sys: Add GPIO_INTR_EDGE_MASK define This is the GPIO_INTR_EDGE_* flags, just as a convenience to let code test flags for interrupt edginess. Approved by: re (kib) Sponsored by: Amazon (cherry picked from commit f6197f2bc05b5a8df260cbf55283fddf7c76fec4) (cherry picked from commit bebff69739ed5d9c6bbc7796a981da867420f77e) --- sys/sys/gpio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/gpio.h b/sys/sys/gpio.h index ba5b362125f8..1a9e998a0e56 100644 --- a/sys/sys/gpio.h +++ b/sys/sys/gpio.h @@ -83,10 +83,10 @@ #define GPIO_INTR_EDGE_FALLING 0x00080000 /* edge trigger, falling */ #define GPIO_INTR_EDGE_BOTH 0x00100000 /* edge trigger, both */ #define GPIO_INTR_ATTACHED 0x00200000 /* interrupt attached to file */ +#define GPIO_INTR_EDGE_MASK (GPIO_INTR_EDGE_RISING | \ + GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH ) #define GPIO_INTR_MASK (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ - GPIO_INTR_EDGE_RISING | \ - GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH | \ - GPIO_INTR_ATTACHED) + GPIO_INTR_EDGE_MASK | GPIO_INTR_ATTACHED) struct gpio_pin { uint32_t gp_pin; /* pin number */ From nobody Sun Nov 3 16:16:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVX4DtCz5cP08; Sun, 03 Nov 2024 16:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVX23yhz4S0q; Sun, 3 Nov 2024 16:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=km6TJ8A2GkXIzEzF2JLcabthYBU5AUIV1crC1qOUL9g=; b=rJWYNgxsss0GjKaR2RpzyJ0cEustCOVpvqCuvkdghsO6b4mAcLksIDyrwqIVu1TvJP9yxP Mu18eTkEkHAwQJrEtgUSjL5DihHK6x4PAtrhuamYKMiKNDwbBIQrr/8V47UABsU3S8r9M+ RH4Oj3jUhdCkYO+JvyNVzl9mVFkbVR5/+J4QyJ4fqGUElAGd9O6gNb7GsClOF5gELY9zTz ZketZ6OZ568IeJYMu6J2QzcTSWCUWyCBf+NhFl4i8KvdJWHsi9pk5LhtvdEA3qrhckKaH8 c8lOIpkELduv+TMdpF6cesqKgbhCt9hhRYEI5Pm4HRewR4W2po6bnl84jg5Y2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=km6TJ8A2GkXIzEzF2JLcabthYBU5AUIV1crC1qOUL9g=; b=NCsrk7tElYtEt47xconHeQodzKrTspht6nFugDNb8mKpgkYaC915OnoZj4T1ieTc3bfSEE 5lEFH/FCibmqBmpQQf11rAq3Le6BF6IYEmccaOnKNLswhBEadvPOwn8gK90mAAqCZ/cjSA C6ZJ6JIghmEKIJxEw/MlNXop4V1W53fCrTpVudXQ3N9MlThAKHbYMD8P/tDRDTXYjxTQ+K Xc/BXJRS9aKld8Ln8kMEG/sUvOYF2N4yRkp4G0PWuKYxB6DiJpI35Vrap05RUaJD0DuQ1S FIUdi6cdilIYllUAwcLgQIS5OBmXP4ztKWrl02EaV/1rcOuaFZQiD3mthmBg3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650612; a=rsa-sha256; cv=none; b=FlFpDcaox5geNBNkuTo8hffYLdQCU0zBCtUtpsHLkf8sLmIgof9Rqvhh6/kdkx4A5ktFlU fUhrAXBs+zwcXpWBeWSLNSoqRgcFkETkoVN8HlrF/C5mlNxCqLbDVaxu0VeU34Qn8A03Ef m6ps3u0ZPSEXoaJH/27drD9HcmUpMqlW2sHx0zm1SJ7VqLKbFg0wrRq2057364jijNMYr9 Uo7QFvnXu2nWY9v22lNCdefSdn/d7GDC0W/W7wDl8+ygz65YIwQa9CU3jQCPf9MfD2o9j4 RF8MPpTM152iMMlnmGkGfs7feZ84QZW0J6ECbN34z4P8YHrs8ztflQ+JWEO8zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVX10BnzwC0; Sun, 3 Nov 2024 16:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGqot036433; Sun, 3 Nov 2024 16:16:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGqx8036430; Sun, 3 Nov 2024 16:16:52 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:52 GMT Message-Id: <202411031616.4A3GGqx8036430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 28b881840df7 - releng/14.2 - ACPI: Add ACPI_Q_AEI_NOPULL quirk and use in EC2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 28b881840df7cbf9c01ddec86f45a080619efaa7 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=28b881840df7cbf9c01ddec86f45a080619efaa7 commit 28b881840df7cbf9c01ddec86f45a080619efaa7 Author: Colin Percival AuthorDate: 2024-10-22 14:47:30 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:22 +0000 ACPI: Add ACPI_Q_AEI_NOPULL quirk and use in EC2 AWS Graviton [1234] systems have a bug in their ACPI where they mark the PL061's GPIO pins as needing to be configured in PullUp mode (in fact the PL061 has no pullup/pulldown resistors); this flag needs to be removed in order for _AEI objects to be handled on these systems. Reviewed by: Ali Saidi Approved by: re (kib) MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47239 (cherry picked from commit 2f3f867ac6dd7ff3769366b828b79c44b38828e1) (cherry picked from commit 5fa51c3653b14b364e26a4cce2733c7be6ee7721) --- release/tools/ec2.conf | 5 +++++ sys/dev/acpica/acpivar.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 522aaa400520..963c6ff4957b 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -63,6 +63,11 @@ ec2_common() { # nodes, but apply the workaround just in case. echo 'hw.broken_txfifo="1"' >> ${DESTDIR}/boot/loader.conf + # Graviton 1 through Graviton 4 have a bug in their ACPI where they + # mark the PL061's pins as needing to be configured in PullUp mode + # (in fact the PL061 has no pullup/pulldown resistors). + echo 'debug.acpi.quirks="8"' >> ${DESTDIR}/boot/loader.conf + # Load the kernel module for the Amazon "Elastic Network Adapter" echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index afb0a6909e1a..eb6022cde159 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -224,12 +224,15 @@ extern struct mtx acpi_mutex; * ACPI_Q_MADT_IRQ0: Specifies that ISA IRQ 0 is wired up to pin 0 of the * first APIC and that the MADT should force that by ignoring the PC-AT * compatible flag and ignoring overrides that redirect IRQ 0 to pin 2. + * ACPI_Q_AEI_NOPULL: Specifies that _AEI objects incorrectly designate pins + * as "PullUp" and they should be treated as "NoPull" instead. */ extern int acpi_quirks; #define ACPI_Q_OK 0 #define ACPI_Q_BROKEN (1 << 0) #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#define ACPI_Q_AEI_NOPULL (1 << 3) #if defined(__amd64__) || defined(__i386__) /* From nobody Sun Nov 3 16:16:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVY5m5vz5cNnh; Sun, 03 Nov 2024 16:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVY2hRWz4S12; Sun, 3 Nov 2024 16:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0jqGsZbdC/Sn7mIlXz7qvahsyNM15luC3ZVULX3I07Q=; b=mnpJUg1igYa+g0G8wvoNFNS3oU54It9LXwxlvDSwQFxqKbW1bC7859OemyhAW6i+21fJdz iFDzTGc4ldkrCKA+s3E1ITJfc53Lbad+GOWj1yuYhvQXbm/OcPyZfveXQzouGzh85HBqxc uQtPn7Zb3VypYHfWin6vRqGDq3tObmu9gOSz6SF1iFZ+2IvVxrRRUURvBQhC7NJ1vbGMzn YUtqmHETRHRyAkrEbpgr4jBhDRkBNPQPD4ZDHwj8KqJ6JgMhLtRc+HaHNfi6PYCNsCXX0n UZONfOhw/VZ132DJMtyoqm06lBytIpUt48yrb1DCkAMNAXqIzqUi9egMtzfn5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0jqGsZbdC/Sn7mIlXz7qvahsyNM15luC3ZVULX3I07Q=; b=QLevADkfcsGxeNveO5JvxiQT4CadqVYGnRGikffTaU8N77lZhxpx/LvpAKeV6X0eWc6sM+ 3PXYq3+Cgw6lF8KVQbx76DxREFdzQzP03rMCrBZfsv8SZVbKZxW8VITLnShS6vfiPakI/m U7QfWiJ+USfasIWzOO6W+X6XgjiGZzyJ9gNHLskN/U1yeMm7jnagA4eXCZtXqUA+Rke+M1 nc2knUDbT3OfBu9y09IQQ6gDDG+2QQn51YO0otn0uGr2QaiplTrdxFUF3X+dgl2ydGMxNw C7VVjfyeHO6rfmtroIW/93M0GLkr/fJc3RqF1/NPoculcUNAfxhLBOCcfHTHiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650613; a=rsa-sha256; cv=none; b=V23+3BZg1job9HYkfmZVpRS9WIKuIEHBW3O0wrzVyhvXoQjUihfzcXyL7GhJbb6x5mMvZ5 5VDr6Exc2zm5s4Knvr6TLHmplxYYp8G3wyyDrgG/r2+g+XFWH1ST8/Y25oovYyGMHqNcXl /UFaUuB5RTy6DTxg9iGWdLghBGTT9qK1zY3DF1YHgdS0FqZe7Qs/uQor0qfs5Rh7TE7SNf Kq2Ovw+ZFMCnwNCgg+DxqtgEPyjNMuI1pY2PCU77Z+irCIP1Yg8OBJ1wqqQ3fqAfqRaK2X OFnNn5Tk/b0c7ykiZr8+j2Vwds4JSWKSmLNHkOE89hHnI/xtbFHp7uvqQiXRtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVY2GLXzwTN; Sun, 3 Nov 2024 16:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGrih036472; Sun, 3 Nov 2024 16:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGrOH036469; Sun, 3 Nov 2024 16:16:53 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:53 GMT Message-Id: <202411031616.4A3GGrOH036469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 193a9943ba09 - releng/14.2 - gpiobus: Make gpiobus_read_ivar extern List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 193a9943ba0905cae2c828131b27ad36541ca061 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=193a9943ba0905cae2c828131b27ad36541ca061 commit 193a9943ba0905cae2c828131b27ad36541ca061 Author: Colin Percival AuthorDate: 2024-10-22 17:51:57 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:27 +0000 gpiobus: Make gpiobus_read_ivar extern This allows acpi_gpiobus to override the method and fall back to the generic gpiobus_read_ivar function if needed. Reviewed by: andrew Approved by: re (kib) MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47250 (cherry picked from commit bc0d10d01c3c69004d600e14d53cd0dceffe4b09) (cherry picked from commit fffdfe2f6770946bb5d5204df0a97105e1dceccb) --- sys/dev/gpio/gpiobus.c | 2 +- sys/dev/gpio/gpiobusvar.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 7bdb080eb4f1..674a04bc401b 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -753,7 +753,7 @@ gpiobus_hinted_child(device_t bus, const char *dname, int dunit) } } -static int +int gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct gpiobus_ivar *devi; diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index e3669e82e594..74783e112f89 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -179,6 +179,7 @@ int gpiobus_detach(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); +int gpiobus_read_ivar(device_t, device_t, int, uintptr_t *); int gpiobus_acquire_pin(device_t, uint32_t); int gpiobus_release_pin(device_t, uint32_t); From nobody Sun Nov 3 16:16:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVZ5GkYz5cNlS; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVZ3BD5z4RsK; Sun, 3 Nov 2024 16: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=1730650614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oVFEQHPDxa+11aiaf5UfRMRrHqQ2CyV7ILbA0tr/Ibs=; b=U0Flh1k7ace5a7edtCt25B3h5wMjwJf/GIRkcXDTQHfftUxKcWBibyDW6q1V/YfKevtsSo zsLMda9wp2gAgdlGnFoqaoM0OTdBrnFyMvuzFBzRX2BUcD9iiIS/u8E+dRHzLVqfwiGYTL TA7Tq1drcAYt1V6rzVRemlmBB/lmlNdIcs9GBkZ6RWiSGVLWOzlWqIf9xHXd8yA/PYu10p +jA4IgaenVDkWOP8zqd7fmJlbW79HqDfgyZAPRZbcdTVH3ttxB4vII+p+LOhrf6p2wzlOY c/CVE+0OhotnK7xXQfZTyx4jUuXgQpGnnwXmg6I/1ZobvGsrWhbMGaXscPIDGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oVFEQHPDxa+11aiaf5UfRMRrHqQ2CyV7ILbA0tr/Ibs=; b=Ej/KhjeX9QVq4KIWEQpMhoac4j+woPNyBi4ab87OUhXBYG2n3q4MuKamTGutDPAzVAIqk+ lmtxXk8hIR17P42tYf6RkakWdfoKtK2uzBPv3oCvhCS0xm+5zlRFI6oPnk6+dTgOOnE8nm tj44ccyR/HgEFxpHcWB99ab3zaEAy22oopIDTk2KbEgmAkb/wa2nhc4v+iVWFuxvlt4ahM Mu5DX98D0rYixwLU7c+fiVKmdCTb/b9K4PrEe6+FP6lcQfbW6OdujzMBd2prncYkHFCpL5 QbXLMG/8td4Xr1d4P/7S6mhqqCeG+m9l4XV8ta1Eyxza3ECxvlW1q0ZuA+1Jcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650614; a=rsa-sha256; cv=none; b=KmPXLWQeGDBSRW85z3cuzRXZjVdURDA4CyvzUe+7ojJUl0ndlbGrXeLoArf5HldK8aTyJ3 72tckweBa7INMHdj8h+RvGzhkB/ly24lpB0q9cy0YhDyIwfGcDEfakX8HL9IwDkzavezFS hf7UJ9RJ1pm0orVLNh/9HsMOMMTFCNupo46NV0G2hpEVU2Cv9iB8Xhh8RYpyRCQSaXkAT5 L/p7iPqcL9rntECnhWs2Mjy+mL271tDFZvOzfG/3hsKKLez6W70oeGh7wAuye1D3J/BrXI Iy1Qo5DP1NmLSRGd1ReEVCmy4tYqcCeIb/aZEAX9vgevPPm+ceWnLhcOITMtaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVZ2p0GzwHJ; Sun, 3 Nov 2024 16:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGsB2036516; Sun, 3 Nov 2024 16:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGsDe036513; Sun, 3 Nov 2024 16:16:54 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:54 GMT Message-Id: <202411031616.4A3GGsDe036513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: aeba4bd10f08 - releng/14.2 - acpi_gpiobus: Narrow scope of NOT_YET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: aeba4bd10f08559c599b08e4c2e9ef899e758740 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=aeba4bd10f08559c599b08e4c2e9ef899e758740 commit aeba4bd10f08559c599b08e4c2e9ef899e758740 Author: Colin Percival AuthorDate: 2024-10-22 18:25:11 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:30 +0000 acpi_gpiobus: Narrow scope of NOT_YET GPIO interrupts work just fine and will be used shortly. We still do not support GPIO_INTR_SHAREABLE however, so leave that within the NOT_YET scope. Reviwed by: andrew Approved by: re (kib) MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47251 (cherry picked from commit 2d4219919a48aa6d67ae62e2b8859ffe3b035bd2) (cherry picked from commit 1f6941760746367704c9f1fa730a00b99d4d46b2) --- sys/dev/gpio/acpi_gpiobus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 3b6fc6dde674..9828170daeca 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -52,8 +52,6 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) uint32_t flags = 0; /* Figure out pin flags */ -#ifdef NOT_YET - /* These are currently unused. */ if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_INT) { switch (gpio_res->Polarity) { case ACPI_ACTIVE_HIGH: @@ -69,10 +67,12 @@ acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) break; } +#ifdef NOT_YET + /* This is not currently implemented. */ if (gpio_res->Shareable == ACPI_SHARED) flags |= GPIO_INTR_SHAREABLE; - } #endif + } switch (gpio_res->IoRestriction) { case ACPI_IO_RESTRICT_INPUT: flags |= GPIO_PIN_INPUT; From nobody Sun Nov 3 16:16:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVc0KdCz5cNr5; Sun, 03 Nov 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVb4Td4z4SB1; Sun, 3 Nov 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlTb+rtfxWBXPxLcyE5ff4zl+v3ph/HDteje6QqQtOk=; b=iv2CoObS2rO6mMjzlVjwKXtsN6JZLmZ/6VFjeIUFIfyEp940F/RBI70SN8B5KcL4rAGRy3 aRQ63E6x+A/axsBDQBRwsm75/w1M17gbnAG4u2OjuBbxIFq8/1DbqNhDv/8Ckv9sNvSLJ+ WeYUg+9l12SfpgYmKrhfkmpR63GMBIOnbiuCD68KHWtakT2xxbKcSO95ibs7T1fm8cEegi huPtH9Pkf1OAV+3ZWkUfLgFHD/0ZYX5gYc396zH/QxSLSyfl0F0fPvyriYHyJiz4ygPFVp bXaCOtml/ZONANacBI61QYqJIFkKCkYTjEUYUlcICTMjyOtaL+7krhty/74eJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlTb+rtfxWBXPxLcyE5ff4zl+v3ph/HDteje6QqQtOk=; b=PjRoRQ0oXPM/p6FwGnYi2M+I8VTRm0FcJL9NL/ILr4eLXPv5Q6ZZ779QF8sWtl3bf+lVBO ReCNqzINSapnk0ODBDjk3kjnCXDU/BZsH9g0ATt+w/hXM++NfMbuykT/fAryofZ6iA6c91 +I0ko2gATqmCHBsUWnIYtF47J/RsX+DRMrjC2CggkRjXBxhHKX5/8SQPmwoOXdOxPgrbmn zGKSFr8jTFTZMf8BGoeBNQ7aeW59+bDPDFwhDZZGkRirTIMRNRonW/GmmB5G2yZT05H5fN tC5SEz1Fv23ITazleCGG3b9XG/su1fdw5qqsqSZE9JHKjApefSH0BwRfUUbNlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650615; a=rsa-sha256; cv=none; b=LpR8Qu8s7Jo8RTi9AYS7IebbMc9AQLp+ndxNaX54adyGliOFCpZ7nFJA6vjWnoijpuh+LR J/F9nCdozE9TFa7YWhpqnrfbRU4hXSLd4PBukAbO2E50yOr4DIOOnyJaqXdwE6lEO0pk7R yjbYpkhfdYU+s3yKUu9IyQ+r4TETyeOeDUTG4LK4eXryxlhj42blifLQ+J2iKGB0DJyBW6 yN1at4GPTxDSMg6FwLtp5ryEkWKAqRbUiXLyzx8WgYHEUO5mo1H22ytaRww0lHLi/51PFD sjuT2Em4Dplh+46JM7luI8ACy2j7hIKWTZ5BWG3LOPU0S9hvVpvxn9cXiYojKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVb41m0zvvS; Sun, 3 Nov 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGte5036569; Sun, 3 Nov 2024 16:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGt0T036564; Sun, 3 Nov 2024 16:16:55 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:55 GMT Message-Id: <202411031616.4A3GGt0T036564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4b4c7b192400 - releng/14.2 - bus: Activate INTRNG interrupts in common code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 4b4c7b1924004e53f501612c7ad97b860644e583 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4b4c7b1924004e53f501612c7ad97b860644e583 commit 4b4c7b1924004e53f501612c7ad97b860644e583 Author: Andrew Turner AuthorDate: 2024-10-29 10:19:45 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:34 +0000 bus: Activate INTRNG interrupts in common code [MFC note: This is not a direct cherry-pick due to API changes in HEAD which are not present in stable/14.] We need to call into INTRNG to activate all interrupts on platforms that use it. Currently, interrupts are only activated in the nexus drivers for INTRNG platforms, but this does not handle other bus devices such as gpiobus that manage their own IRQ space. Reported by: cperciva Reviewed by: cperciva, jhb Approved by: re (kib) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47282 (cherry picked from commit c85855a72db9f9d7b4326b676241e1dffabf0fae) (cherry picked from commit c54bdf84d5fb0b2c1923179fd30812ee68aaf423) --- sys/kern/subr_bus.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f0831b30142b..f55a7210e825 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -53,6 +53,9 @@ #include #include #include +#ifdef INTRNG +#include +#endif #include @@ -4382,17 +4385,26 @@ bus_generic_rman_activate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); - if (error != 0) { - rman_deactivate_resource(r); - return (error); - } + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + error = BUS_MAP_RESOURCE(dev, child, type, r, NULL, &map); + if (error != 0) + break; - rman_set_mapping(r, &map); + rman_set_mapping(r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + error = intr_activate_irq(child, r); + break; +#endif } - return (0); + if (error != 0) + rman_deactivate_resource(r); + return (error); } /** @@ -4421,10 +4433,19 @@ bus_generic_rman_deactivate_resource(device_t dev, device_t child, int type, if (error != 0) return (error); - if ((rman_get_flags(r) & RF_UNMAPPED) == 0 && - (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { - rman_get_mapping(r, &map); - BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + rman_get_mapping(r, &map); + BUS_UNMAP_RESOURCE(dev, child, type, r, &map); + } + break; +#ifdef INTRNG + case SYS_RES_IRQ: + intr_deactivate_irq(child, r); + break; +#endif } return (0); } From nobody Sun Nov 3 16:16:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVc6rSrz5cNtb; Sun, 03 Nov 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVc52ryz4RyB; Sun, 3 Nov 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LR1lrfBrdfP10BcAZVl2/2o9v3tMkJOm/Usl1zNQqMo=; b=KzeFk5mLXO/FiaT4/G3I5Zr0lJ0/N74k0fe6YH5Tfy+uuJALsYqfyaUSy4mTsTRpPdON2m N+Fy7ZVpO3dHJOVuVKiaCvRI4iOTJMmSke2ZFpeNbR0MacWkjrP3WiXw4nMtN/h3kiDOJb lrqH7FWKW3nCWWH9PNOXOhM5pvESYPAFEo3JQ8kf78YHfcxuh84jUpi8Mr255aDohgHEEk KP8hTx57X0q/ue6/bizb07PKBSurLNQJyj9Y5cIVrG2aX3nS78WNsGaufLqPdkpHd+MLoT DPUU4gDyI0Wf5Ext9RYMGBzz7QtyksTnEAQxJnhSUHFG5AkqqMyR+WoFQE1j5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LR1lrfBrdfP10BcAZVl2/2o9v3tMkJOm/Usl1zNQqMo=; b=A0lUD8CGjmkyEpTfW48bvFZ7N66mbmO4nzbaXOsbfhce4kGwRLjdVxhe09jXEKozdA0e78 EgS3n6kh+tKjA5/GmHx1L7pYcg1QTGtBXdn6U4u3zBzsrjgzCCj5U73j1dOLsSNkwd0le7 jrnvqx8TT4mxWonWz8c63kTh8wAf+bdG9iqi3jq+ua8cxBuMm74rkWcnBr08AzSf0EmSI0 jMExr8wcZbsbgghy6hxn6zDtor1thH+QjC/c0PDrCEjnwQIEKCW8qSKFbi0m/+aDFaaLdK trfipF2oIbQTYz624Ho/US2OrBBrQ5HdHdvLVfxI9mzxbCmAsv7mepHJf2zE9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650616; a=rsa-sha256; cv=none; b=u/A6pnpdi9vWWgAjXG6Bdfi9MUA8nahO/tOKyrp3S0acVx6tG6fabQaIbCqsdl6ZUowH14 gpQAncWikF8dBA79RoS7h2/rBjj6YFbRIZNPZCVqfJGcq6j8Y/H9tHEXeUGxFlqgj3BsAm /A/3q0IjrYVE9szGsQynpHrI3dRhsb5lpOMqN52/4WOG2uLBOTHi+N4md7fhmM65KP3rIi IjMSr3HU6DGvzGINQ6ve9kkfRu59hzwRJp1fPRN3ex7aahJ8V6bdQDg6Tf7lIjxq/GLsjR D7mSevn1baHsyUFx3S+JFwcvrvtxL84Kc1YBlZKCAyLmGIBJj6p7d/FeCcucxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVc4fXxzw7s; Sun, 3 Nov 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGugr036623; Sun, 3 Nov 2024 16:16:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGunL036619; Sun, 3 Nov 2024 16:16:56 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:56 GMT Message-Id: <202411031616.4A3GGunL036619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 1db6ffb2a482 - releng/14.2 - GPIO: Add ACPI _AEI support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 1db6ffb2a482dee109bbb596f31e9d8d035153c4 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1db6ffb2a482dee109bbb596f31e9d8d035153c4 commit 1db6ffb2a482dee109bbb596f31e9d8d035153c4 Author: Colin Percival AuthorDate: 2024-10-22 18:53:55 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:39 +0000 GPIO: Add ACPI _AEI support Changes to acpi_gpiobus.c handle discovering and parsing the _AEI objects and storing necessary data in device ivars. A new gpioaei.c file implements the device, which simply requests an interrupt when the pin is triggered and invokes the appropriate _Exx or _Lxx ACPI method. This makes the GPIO "power button" work on arm64 Graviton systems, allowing EC2 "Stop"/"Reboot" instance calls to be handled cleanly. (Prior to this change, those requests would time out after 4 minutes and the instance would be forcibly killed.) Reviewed by: imp, andrew, Ahmad Khalifa Approved by: re (kib) MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D47253 Co-authored-by: Andrew Turner (cherry picked from commit 9709bda03cd0f20eba0ba4276fc3c2e06354a54f) (cherry picked from commit c2cd78d9446ebe79accf6c1862230dfbe7276525) --- sys/conf/files | 1 + sys/dev/gpio/acpi_gpiobus.c | 121 +++++++++++++++++++++++++++++++++++ sys/dev/gpio/acpi_gpiobusvar.h | 49 ++++++++++++++ sys/dev/gpio/gpioaei.c | 131 ++++++++++++++++++++++++++++++++++++++ sys/modules/gpio/Makefile | 2 +- sys/modules/gpio/gpioaei/Makefile | 14 ++++ 6 files changed, 317 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 5239f38d5154..3810032f7094 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1745,6 +1745,7 @@ dev/gpio/acpi_gpiobus.c optional acpi gpio dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt +dev/gpio/gpioaei.c optional acpi gpio dev/gpio/gpiobacklight.c optional gpiobacklight fdt dev/gpio/gpiokeys.c optional gpiokeys fdt dev/gpio/gpiokeys_codes.c optional gpiokeys fdt diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 9828170daeca..14ded4539a5e 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -35,6 +35,9 @@ #include #include +#include + +#include "gpiobus_if.h" struct acpi_gpiobus_softc { struct gpiobus_softc super_sc; @@ -46,6 +49,13 @@ struct acpi_gpiobus_ctx { ACPI_HANDLE dev_handle; }; +struct acpi_gpiobus_ivar +{ + struct gpiobus_ivar gpiobus; /* Must come first */ + ACPI_HANDLE dev_handle; /* ACPI handle for bus */ + uint32_t flags; +}; + static uint32_t acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *gpio_res) { @@ -136,6 +146,74 @@ acpi_gpiobus_enumerate_res(ACPI_RESOURCE *res, void *context) return (AE_OK); } +static struct acpi_gpiobus_ivar * +acpi_gpiobus_setup_devinfo(device_t bus, device_t child, + ACPI_RESOURCE_GPIO *gpio_res) +{ + struct acpi_gpiobus_ivar *devi; + + devi = malloc(sizeof(*devi), M_DEVBUF, M_NOWAIT | M_ZERO); + if (devi == NULL) + return (NULL); + resource_list_init(&devi->gpiobus.rl); + + devi->flags = acpi_gpiobus_convflags(gpio_res); + if (acpi_quirks & ACPI_Q_AEI_NOPULL) + devi->flags &= ~GPIO_PIN_PULLUP; + + devi->gpiobus.npins = 1; + if (gpiobus_alloc_ivars(&devi->gpiobus) != 0) { + free(devi, M_DEVBUF); + return (NULL); + } + + for (int i = 0; i < devi->gpiobus.npins; i++) + devi->gpiobus.pins[i] = gpio_res->PinTable[i]; + + return (devi); +} + +static ACPI_STATUS +acpi_gpiobus_enumerate_aei(ACPI_RESOURCE *res, void *context) +{ + ACPI_RESOURCE_GPIO *gpio_res = &res->Data.Gpio; + struct acpi_gpiobus_ctx *ctx = context; + device_t bus = ctx->sc->sc_busdev; + device_t child; + struct acpi_gpiobus_ivar *devi; + + /* Check that we have a GpioInt object. */ + if (res->Type != ACPI_RESOURCE_TYPE_GPIO) + return (AE_OK); + if (gpio_res->ConnectionType != ACPI_RESOURCE_GPIO_TYPE_INT) + return (AE_OK); + + /* Add a child. */ + child = device_add_child_ordered(bus, 0, "gpio_aei", -1); + if (child == NULL) + return (AE_OK); + devi = acpi_gpiobus_setup_devinfo(bus, child, gpio_res); + if (devi == NULL) { + device_delete_child(bus, child); + return (AE_OK); + } + device_set_ivars(child, devi); + + for (int i = 0; i < devi->gpiobus.npins; i++) { + if (GPIOBUS_PIN_SETFLAGS(bus, child, 0, devi->flags)) { + gpiobus_free_ivars(&devi->gpiobus); + free(devi, M_DEVBUF); + device_delete_child(bus, child); + return (AE_OK); + } + } + + /* Pass ACPI information to children. */ + devi->dev_handle = ctx->dev_handle; + + return (AE_OK); +} + static ACPI_STATUS acpi_gpiobus_enumerate(ACPI_HANDLE handle, UINT32 depth, void *context, void **result) @@ -272,6 +350,13 @@ acpi_gpiobus_attach(device_t dev) if (ACPI_FAILURE(status)) device_printf(dev, "Failed to enumerate GPIO resources\n"); + /* Look for AEI children */ + status = AcpiWalkResources(handle, "_AEI", acpi_gpiobus_enumerate_aei, + &ctx); + + if (ACPI_FAILURE(status)) + device_printf(dev, "Failed to enumerate GPIO resources\n"); + return (0); } @@ -294,12 +379,48 @@ acpi_gpiobus_detach(device_t dev) return (gpiobus_detach(dev)); } +int +gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin) +{ + struct acpi_gpiobus_ivar *devi; + int rv; + + rv = gpio_pin_get_by_child_index(consumer, idx, out_pin); + if (rv != 0) + return (rv); + + devi = device_get_ivars(consumer); + (*out_pin)->flags = devi->flags; + + return (0); +} + +static int +acpi_gpiobus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct acpi_gpiobus_ivar *devi = device_get_ivars(child); + + switch (which) { + case ACPI_GPIOBUS_IVAR_HANDLE: + *result = (uintptr_t)devi->dev_handle; + break; + default: + return (gpiobus_read_ivar(dev, child, which, result)); + } + + return (0); +} + static device_method_t acpi_gpiobus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_gpiobus_probe), DEVMETHOD(device_attach, acpi_gpiobus_attach), DEVMETHOD(device_detach, acpi_gpiobus_detach), + /* Bus interface */ + DEVMETHOD(bus_read_ivar, acpi_gpiobus_read_ivar), + DEVMETHOD_END }; diff --git a/sys/dev/gpio/acpi_gpiobusvar.h b/sys/dev/gpio/acpi_gpiobusvar.h new file mode 100644 index 000000000000..77cb91110cb5 --- /dev/null +++ b/sys/dev/gpio/acpi_gpiobusvar.h @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __ACPI_GPIOBUS_H__ +#define __ACPI_GPIOBUS_H__ + +#include + +#include + +enum acpi_gpiobus_ivars { + ACPI_GPIOBUS_IVAR_HANDLE = 10600, +}; + +#define ACPI_GPIOBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(acpi_gpiobus, var, ACPI_GPIOBUS, ivar, type) + +ACPI_GPIOBUS_ACCESSOR(handle, HANDLE, ACPI_HANDLE) + +#undef ACPI_GPIOBUS_ACCESSOR + +int gpio_pin_get_by_acpi_index(device_t consumer, uint32_t idx, + gpio_pin_t *out_pin); + +#endif /* __ACPI_GPIOBUS_H__ */ diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c new file mode 100644 index 000000000000..050f259a2127 --- /dev/null +++ b/sys/dev/gpio/gpioaei.c @@ -0,0 +1,131 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Colin Percival + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "gpiobus_if.h" + +#include +#include + +#include +#include + +struct gpio_aei_softc { + ACPI_HANDLE handle; + char objname[5]; /* "_EXX" or "_LXX" */ + struct resource * intr_res; + int intr_rid; + void * intr_cookie; +}; + +static int +gpio_aei_probe(device_t dev) +{ + + /* We only match when gpiobus explicitly requested gpio_aei. */ + return (BUS_PROBE_NOWILDCARD); +} + +static void +gpio_aei_intr(void * arg) +{ + struct gpio_aei_softc * sc = arg; + + /* Ask ACPI to run the appropriate _Exx or _Lxx method. */ + AcpiEvaluateObject(sc->handle, sc->objname, NULL, NULL); +} + +static int +gpio_aei_attach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + gpio_pin_t pin; + int err; + + /* This is us. */ + device_set_desc(dev, "ACPI Event Information Device"); + + /* Store parameters needed by gpio_aei_intr. */ + sc->handle = acpi_gpiobus_get_handle(dev); + if (gpio_pin_get_by_acpi_index(dev, 0, &pin) != 0) { + device_printf(dev, "Unable to get the input pin\n"); + return (ENXIO); + } + sprintf(sc->objname, "_%c%02X", + (pin->flags & GPIO_INTR_EDGE_MASK) ? 'E' : 'L', pin->pin); + + /* Support for GPIO pins > 255 is not implemented. */ + if (pin->pin > 255) { + device_printf(dev, "ACPI Event Information Device does not support pins > 255"); + return (ENOTSUP); + } + + /* Set up the interrupt. */ + if ((sc->intr_res = gpio_alloc_intr_resource(dev, &sc->intr_rid, + RF_ACTIVE, pin, pin->flags & GPIO_INTR_MASK)) == NULL) { + device_printf(dev, "Cannot allocate an IRQ\n"); + return (ENOTSUP); + } + err = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, gpio_aei_intr, sc, &sc->intr_cookie); + if (err != 0) { + device_printf(dev, "Cannot set up IRQ\n"); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, + sc->intr_res); + return (err); + } + + return (0); +} + +static int +gpio_aei_detach(device_t dev) +{ + struct gpio_aei_softc * sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->intr_res, sc->intr_cookie); + bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, sc->intr_res); + return (0); +} + +static device_method_t gpio_aei_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, gpio_aei_probe), + DEVMETHOD(device_attach, gpio_aei_attach), + DEVMETHOD(device_detach, gpio_aei_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(gpio_aei, gpio_aei_driver, gpio_aei_methods, sizeof(struct gpio_aei_softc)); +DRIVER_MODULE(gpio_aei, gpiobus, gpio_aei_driver, NULL, NULL); +MODULE_DEPEND(gpio_aei, acpi_gpiobus, 1, 1, 1); diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index ffb3581d1f01..1d7f69f1836d 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,7 +24,7 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile new file mode 100644 index 000000000000..514dcd80a35e --- /dev/null +++ b/sys/modules/gpio/gpioaei/Makefile @@ -0,0 +1,14 @@ +.PATH: ${SRCTOP}/sys/dev/gpio/ + +KMOD= gpioaei +SRCS= gpioaei.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + gpio_if.h \ + gpiobus_if.h + +CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/ + +.include From nobody Sun Nov 3 16:16:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVf0vrdz5cP0M; Sun, 03 Nov 2024 16:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVd5yp6z4SDr; Sun, 3 Nov 2024 16:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pk5BGfDxfCOL4c2jgJRwxIdWiTPo3ckH7j7RpYc8MqA=; b=sXpfU4ws/ODEZaXjPRN3eaFNWovvpAPE34vmHz+QvE1gXX9e5TSC+9bQ9kRMEwZ5eHmmDt PbPlaHWqCBzR6F4hQDd2/FEvYRJFbqcm7395v4+pnEvaOZtOYyMS1KaOW616Oq9uEXdHjD h/1F1qNsjC3V9M4hj9o2Ou0tWQ4KxOEM0JH2vhjA9+8h5Y/KpquX/LTcvYD5YCW1FjvvbR vV4rehlqo14rgoqdwWFAldeETpWGP5YTc9ilGE4emcM48AQ7/g2QJHGFKWKQYw6a0KLpJM raQ1tHpsgvgfhMNWn/4/jIi+9BLIlvEWU1tPVqa32pjSoX11DEVA0PhEV51jkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pk5BGfDxfCOL4c2jgJRwxIdWiTPo3ckH7j7RpYc8MqA=; b=TkAIm3du3fTeYDnWkeM7qa/XfhfRIDOxyvaGAFXPgR904t74bUxWW1kZfBDLILJ2FvwVqY ZBzom+1F4Kv/kU+mbCdSBjivILvKP9qls7OeGZlbznqQdmjSaGkNTONBbcvx85VVDBOJnv yYw3VkxD10INJvxzPajbMuQgaKPYybGkqqgDVSKBdIyykspRvGje1jRguAXImSJgnpVFzv sS3VBAbN9/F48pei5eRj6a0HHptxV4lS5VgLo7R371cUCPgGK2emyLvcG3nTg36oZP3C9b ijcF/OwWQRX4lGa6wD109vJFqOcXypgQSme4Ib95lIknDaPwNsoRgiGEWkLvQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650617; a=rsa-sha256; cv=none; b=UZFa/0AvXXnLHSAlvazP1u/NG19WnuI2AJYhcfSytOBPG2Lksy4pomKJ3zkgw+syml4Jk6 3cYfFbzKRwZC7mkpYN3CJ94k9/Lhb6BZM589cm0YmkbzORk7r7wE83o5tya1eBeL6HzGp/ MZ8GBXHoVCFkN6qhtb7FSHI/dgEOC9HzraZWWKsZ286O6Mr3n50Z6oql6HlBfhFPTYz3GW HX6uMGem/aD/+wmIqCFP+MKhhHWe9qG65B214c9a0mx1WkWFJrdsgEn+nitQEb4CcImdaM sWdmn0xL/+xsXObvkeWI1mJlqUI6qATOEc82QEhiLrseG0fQOnvETsk3IIH7sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVd5b3Zzw7t; Sun, 3 Nov 2024 16:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGvbl036674; Sun, 3 Nov 2024 16:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGvIQ036671; Sun, 3 Nov 2024 16:16:57 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:57 GMT Message-Id: <202411031616.4A3GGvIQ036671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3166167784b9 - releng/14.2 - modules: gpioaei only on ACPI-supporting archs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 3166167784b93f6faaf4fe07f3154c76a6321d47 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3166167784b93f6faaf4fe07f3154c76a6321d47 commit 3166167784b93f6faaf4fe07f3154c76a6321d47 Author: Colin Percival AuthorDate: 2024-10-31 22:45:03 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:45 +0000 modules: gpioaei only on ACPI-supporting archs Approved by: re (kib) Fixes: 9709bda03cd0 ("GPIO: Add ACPI _AEI support") Pointy-hat to: cperciva Sponsored by: Amazon (cherry picked from commit 6540ac118473dde29cb02f786c79c64f73834ca1) (cherry picked from commit 5a53843aef490bda32397e80b3fb600e802b461c) --- sys/modules/gpio/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile index 1d7f69f1836d..66090b1393bf 100644 --- a/sys/modules/gpio/Makefile +++ b/sys/modules/gpio/Makefile @@ -24,10 +24,14 @@ # SUCH DAMAGE. # -SUBDIR = gpioaei gpiobus gpioiic gpioled gpiospi gpioths +SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths .if !empty(OPT_FDT) SUBDIR += gpiokeys gpiopps .endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SUBDIR += gpioaei +.endif + .include From nobody Sun Nov 3 16:16:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhKVg3QFlz5cP2W; Sun, 03 Nov 2024 16:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhKVg0b02z4SF3; Sun, 3 Nov 2024 16:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fys7+GSNFfc+jh3LsU68/SCvhz/f72wxltd5amYNRSI=; b=czMppdo0L0ZjkMLo0I2uIMaXyIRPuBKTfxuhA6cQCMFVkEj6mPnnaEj+acYWT7GFPCmKGE YcSNIj1ZxUf45k8BGueZzRFfgX3N1hZ7FosI9D84jahibSO0r5fiv96usPrz9pTfiA4pij mdW9vBZTQdagbBw5vingGS9G6viaumOeMNJpw1Dg+FK8jK6JmltB0eKIhvSUmjqVd6+6Rc eZ5gaC6xEnRafeH7d5JBt1gnYeG24t2yldmF4+S5EocNxkR26CbxYs+0KkfgKTtTGcxo7D 5wLCDRGVJZIksxM8KI0IECm6RsimbASINdCQ9P0elMTI9J6xLabFL3AgCMXQPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730650619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fys7+GSNFfc+jh3LsU68/SCvhz/f72wxltd5amYNRSI=; b=i4mtWTRBjIx3RG/EgmZ/5+nf4RLktNOrHfVXTC/dPIepD6uewk+VVgkf0rWfpu7v4ikDrA gzT85N0SOYrBJdfV9fMm8E7Qw6PpA7jgkC4WjyjhKhh0iOK3zNMQoqjPwyvMjTPedXpn1v IAp2brxKA7ChkCW13KKxVbb8FzM+rkzZakml5sUGBMdol00BJ2Wn/Y/FFsJwvXY/zk/bi/ JbeoT0AgIEE6rlwMs7uZ3Z/BfBjHfR2kbxkMCru9LgI/qDzXBjyr0NuuRAu0g4LSCoAsJT 9BLqTcVX/ibQOa3ED2AJKKjPMznTQuSAgxgi5EpWPzhB1nRX0YGads/eaH9v1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730650619; a=rsa-sha256; cv=none; b=y4DagMSFQFMIPRCOAqksaEZgMLd9s1xv7Cm984lIGd3wyEgnLgpw7yrI2tbXlS8B/vUKW8 i800lHp9RxAsQ/SqXhpV1M32BZZ7IZRAXQWQVQoIc5KVbdy0m0bzA/oYPYy/gyfLexbFDY P0KR4UBvmfV2L5jnkGUmZxO2LPbLfGRbSsJnpU0DY88Xzj4jTOFvjTGrD3n4qAVciuKHCT EZjXsGM/Dz+tCOt6QuwuLu3ISWm10HPXuG3rbPXrZAXgezj+e86qbkphDYO5qIQbZBKSgB pPjfbS6LgXXlW2wTuTAa/7+Y/9c4ckj0aBw35M7W9jjw0G6ha1hBOYiqm3IljQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhKVf6PfgzwTP; Sun, 3 Nov 2024 16:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GGwK5036716; Sun, 3 Nov 2024 16:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GGwBX036713; Sun, 3 Nov 2024 16:16:58 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:16:58 GMT Message-Id: <202411031616.4A3GGwBX036713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: ac2e98ed5707 - releng/14.2 - modules: gpioaei: Fix arm64.LINT-FDT breakage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: ac2e98ed570792041eefbb3d46423d97843b1523 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2e98ed570792041eefbb3d46423d97843b1523 commit ac2e98ed570792041eefbb3d46423d97843b1523 Author: Ravi Pokala AuthorDate: 2024-11-02 05:08:11 +0000 Commit: Colin Percival CommitDate: 2024-11-03 16:15:52 +0000 modules: gpioaei: Fix arm64.LINT-FDT breakage 'acpi_if.h' was accidentally omitted from the module Makefile; add it. Approved by: re (kib) Fixes: 9709bda03cd0 (cherry picked from commit bb8b3b1741188ab284e8b48ec367961a480421cb) (cherry picked from commit 393bbd23b3446bb4ac4924f7e1c98bbdcff4455d) --- sys/modules/gpio/gpioaei/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/gpio/gpioaei/Makefile b/sys/modules/gpio/gpioaei/Makefile index 514dcd80a35e..8f856af48eb7 100644 --- a/sys/modules/gpio/gpioaei/Makefile +++ b/sys/modules/gpio/gpioaei/Makefile @@ -4,6 +4,7 @@ KMOD= gpioaei SRCS= gpioaei.c SRCS+= \ + acpi_if.h \ bus_if.h \ device_if.h \ gpio_if.h \ From nobody Sun Nov 3 16:48:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLBc28GLz5cRGJ; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLBc07T5z4XLm; Sun, 3 Nov 2024 16: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=1730652488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rAOPIVBGkldNaKmGEXkl9B18gsd2z6pe1xRabX7U8jk=; b=lAvgzF7r46eclldiPrOyL3Utl1f7B3gdCwbvEjwNeTNeZcVH6OQ0eOXV5yuCfv44KpyRn9 T65wz2PJNFrHn0zHOimUZQR3sEYi/h0zVf3jr2Mel4IxZFdj4PQUBe7DSvBHBQKSj4PYqk ZrgDNa2osbFzNJjYpIdGtI3Fance44lwTKjC5Ys3DlIT/2uQMtpnaA3gh6SzLEB8GSl0+Q FnXJosQQstPvwu/TmGYc2E8WAlR86rGVM6bOwKdfzjUheQ4Yq7MDNdHdV3mkjNAHJysf1N 3km8TjbQLOg8SclFn4H7EPvoprpa0PSNUhGg9ov/ZCggWAQ3ypZDv4+p5zcfPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730652488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rAOPIVBGkldNaKmGEXkl9B18gsd2z6pe1xRabX7U8jk=; b=safth+Iab0/tBPqMC/UbDEKAJGyUfHAvJzP6QyxaIqCQOTj7sxm+UDi7PSs4pCvvD7RMSs bW/zgndct67yhNbEUdUB5A2BkQnpH6UCr8cSRbuoX4O6UdRy3BbDCAY6zqcTqWiEiY3c61 X88aXWnmsie9h8x0yVS4HHGlYD37pM68Ekyz7wASuz7+dVDbkLv1G7vz8MycYmuFQ6oER3 rf/xH8JzZ0La+rA4oPuckzshwpPcD8iUFjkFKjdBsUcsXgy8+Cmcla5c/VEaNI+aGlbKql epUUxW4eMGgYh4MP6buumTiA90Klo+IEJla6YWXr5UPmPpTHL1WLVLz5clS4uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730652488; a=rsa-sha256; cv=none; b=wTMMQqqOYdrAnsZQJbw3FZjmNxagfNx+UL2+1PrhEuHP6G/EvDBHBRptaRrIbH94f8rs1k uMrUYR+iKZZ4pvPuX+jxVdXo8LpIEUqdD4DIQxRrnNfzzOCkUElqYyhx9zjtnL1PPy5muu jaQpHFI+HYoaLAXSZyY9GummbwJfcbx2TI1PBpJzhhFkAXoLqGZAo6P9a3lF6AZyxKFDHd JZ4vBODiopEhrCvv0uF/l7ISw9k33oKvLVX2qyUF3LAKGzP/vRyL/clU8Xk5y1Li8DaPje t98jlxnsOCQTu/SFqCiBx0EqxohcvxGlDpuR489+HAncisAj4yrlgfepovrwJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLBb6jthzwgy; Sun, 3 Nov 2024 16:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3Gm72C092190; Sun, 3 Nov 2024 16:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Gm7mk092186; Sun, 3 Nov 2024 16:48:07 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:48:07 GMT Message-Id: <202411031648.4A3Gm7mk092186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4ee6a830d6c1 - main - pf: Fix a use of an uninitialized variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ee6a830d6c191c1c420b6764a4d388f756168d3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ee6a830d6c191c1c420b6764a4d388f756168d3 commit 4ee6a830d6c191c1c420b6764a4d388f756168d3 Author: Mark Johnston AuthorDate: 2024-11-03 14:36:39 +0000 Commit: Mark Johnston CommitDate: 2024-11-03 16:46:53 +0000 pf: Fix a use of an uninitialized variable pf_find_state_all() expects the caller to initialize "*more" if it is non-NULL, but pf_handle_natlook() didn't obey this protocol. Follow the pattern from OpenBSD and initialize it in the caller. Also make pf_find_state_all() unconditionally initialize "*more" for good measure. Fixes: 71d3c7041d70 ("pf: convert DIOCNATLOOK to netlink") Reported by: KMSAN Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D47405 --- sys/netpfil/pf/pf.c | 3 +++ sys/netpfil/pf/pf_nl.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a98baeb4bdec..17614e1a9995 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1798,6 +1798,9 @@ pf_find_state_all(const struct pf_state_key_cmp *key, u_int dir, int *more) struct pf_kstate *s, *ret = NULL; int idx, inout = 0; + if (more != NULL) + *more = 0; + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); kh = &V_pf_keyhash[pf_hashkey((const struct pf_state_key *)key)]; diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 67047a319fb8..1da9bead394b 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1264,7 +1264,7 @@ pf_handle_natlook(struct nlmsghdr *hdr, struct nl_pstate *npt) struct pf_state_key *sk; struct pf_kstate *state; struct genlmsghdr *ghdr_new; - int error, m; + int error, m = 0; int sidx, didx; error = nl_parse_nlmsg(hdr, &natlook_parser, npt, &attrs); From nobody Sun Nov 3 16:48:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLBd1Vrjz5cRHg; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLBd0kjLz4XRN; Sun, 3 Nov 2024 16: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=1730652489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jA9fWMWEXtV4jh5Qgt1ZF/aL5ZpZcPm6VPvsDwXarY=; b=HZl/6oYGwsO0ZfGTeIBu/PUaHBS77Vsfepsd1z2yLWLr2pcsHtyvJ2JErGLOvAaNqo5lA/ lIDfD4CAnxb/SjUyQfdYBuXspoHXTAH3xM3A6nBp8+aNnAn31Rs9017Jc0h8NHRXnjK0MJ QOxW84VQwvmJVeX+MVtide2sqyNl3XlRSeK1cNKyCtrWMNCMGcEWWVTK2J15VCVwtfNgyQ XiECTAFdGcv3NrJ0AgbI2yrYapD3gftoPIdwnZpZ7ejxlGCrud2KN+VQPu9CnSfhhv1qEh ysXarz+VcB8S6+qLMPkotaoHPO8Fi71R+Pqe24Kj0qW1b37bPGej/vINYO7hYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730652489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jA9fWMWEXtV4jh5Qgt1ZF/aL5ZpZcPm6VPvsDwXarY=; b=P1kwOr53dF74lwxAO4ZnVfnj4SnB5pYoKHhJl/ckKHArX/jUQJai12qXdCSlrEXbMh2opW uJqvdV53wvTjxUcHgRWvobhR6Q3IgJJ0T4EOuHRC7Phhk+0zhc40elwS5XTtdI10GzF61n 6PMGmgA8jkUkW2OfVhE6RLmR0WI8ruOHORCnIc96uUKJNTLAxjku6lRSomNWwksr329KAw VFAmOFx2hhk63M7DYzDAaBrjPIQn2QZI6UzvVUhazKAcs145aE/pW2Do+v4ATMMAv5QcBy Gol7qGmxhiDEn6YvVIjEwDTzHI84n5nxGOgFraGMB1WyGVKoa1w4i3aTeuJpeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730652489; a=rsa-sha256; cv=none; b=kHqKHW7tBeU8FyK+/2XkuExj9QRvAyEUCDzR1IKTbeWdVdU8VKueOKNjklKNPePGOO+9qY K7hVjtPA6+EAkq782kP/9p6Ohh7wRYqAjPeLdIrB9QmSu6pHFn1RuL5HVosjtaFNglz63n U1rd8Bb+CCo1rx0kC5uF2XPjS4/UZMnPed7kqyioav/co1RhI0Mx5PWu/MLvWd5qOlaJnr cWiN3ub7BxjibdTu5yI6tFs0zjyJjvlZW2pcht7pKL9s+Qupm4eiI9PFTzZVZiVfDwNtcc arzhbfk+XkxmO6SkLIh3rbfwxoG2EOx9OPAFXtPguJ/7GTvpnzowD4Fbg0wQNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLBd0K7xzwh0; Sun, 3 Nov 2024 16:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3Gm8t4092249; Sun, 3 Nov 2024 16:48:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Gm8Ap092246; Sun, 3 Nov 2024 16:48:08 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:48:08 GMT Message-Id: <202411031648.4A3Gm8Ap092246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bfd03046d187 - main - unix: Add support for atomically setting the socket mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfd03046d18776ea70785ca1ef36dfc60822de3b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bfd03046d18776ea70785ca1ef36dfc60822de3b commit bfd03046d18776ea70785ca1ef36dfc60822de3b Author: Mark Johnston AuthorDate: 2024-11-03 14:39:32 +0000 Commit: Mark Johnston CommitDate: 2024-11-03 16:46:53 +0000 unix: Add support for atomically setting the socket mode With this patch, it is possible to call fchmod() on a unix socket prior to binding it to the filesystem namespace, so that the mode is set atomically. Without this, one has to call chmod() after bind(), leaving a window where threads can connect to the socket with the default mode. After bind(), fchmod() reverts to failing with EINVAL. This interface is copied from Linux. The behaviour of fstat() is unmodified, i.e., it continues to return the mode as set by soo_stat(). PR: 282393 Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47361 --- lib/libsys/chmod.2 | 9 ++++++++- share/man/man4/unix.4 | 12 +++++++++++- sys/kern/sys_socket.c | 17 ++++++++++++++++- sys/kern/uipc_usrreq.c | 29 ++++++++++++++++++++++++++++- sys/sys/protosw.h | 5 +++++ sys/sys/unpcb.h | 1 + tests/sys/kern/unix_dgram.c | 41 ++++++++++++++++++++++++++++++++++++++++- 7 files changed, 109 insertions(+), 5 deletions(-) diff --git a/lib/libsys/chmod.2 b/lib/libsys/chmod.2 index e496b773ddf8..2db182a95fcc 100644 --- a/lib/libsys/chmod.2 +++ b/lib/libsys/chmod.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 30, 2021 +.Dd October 31, 2024 .Dt CHMOD 2 .Os .Sh NAME @@ -214,6 +214,13 @@ This makes the system somewhat more secure by protecting set-user-id (set-group-id) files from remaining set-user-id (set-group-id) if they are modified, at the expense of a degree of compatibility. +.Pp +While it is normally an error to invoke +.Fn fchmod +on a socket, it is possible to do so on +.Dv AF_LOCAL +sockets before they are bound to a file name; see +.Xr unix 4 . .Sh RETURN VALUES .Rv -std .Sh ERRORS diff --git a/share/man/man4/unix.4 b/share/man/man4/unix.4 index 5ac9ccd5514f..2fdfde225b14 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 February 1, 2022 +.Dd October 31, 2024 .Dt UNIX 4 .Os .Sh NAME @@ -77,6 +77,15 @@ removed when the socket is closed \(em .Xr unlink 2 must be used to remove the file. .Pp +Prior to binding a socket, +.Xr fchmod 2 +can be used to set the permissions of the socket file. +This avoids the race that would otherwise occur between creation of the file +and a subsequent call to +.Xr chmod 2 . +Once the socket is bound to a file name, the permissions of the file can not be +changed this way. +.Pp The length of .Ux Ns -domain address, required by @@ -441,6 +450,7 @@ The order is preserved for writes coming through a particular connection. .Sh SEE ALSO .Xr connect 2 , .Xr dup 2 , +.Xr fchmod 2 , .Xr fcntl 2 , .Xr getsockopt 2 , .Xr listen 2 , diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 55837e4cb6ce..65d864e4f9f4 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -90,6 +90,7 @@ static fo_poll_t soo_poll; extern fo_kqfilter_t soo_kqfilter; static fo_stat_t soo_stat; static fo_close_t soo_close; +static fo_chmod_t soo_chmod; static fo_fill_kinfo_t soo_fill_kinfo; static fo_aio_queue_t soo_aio_queue; @@ -104,7 +105,7 @@ struct fileops socketops = { .fo_kqfilter = soo_kqfilter, .fo_stat = soo_stat, .fo_close = soo_close, - .fo_chmod = invfo_chmod, + .fo_chmod = soo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = soo_fill_kinfo, @@ -353,6 +354,20 @@ soo_close(struct file *fp, struct thread *td) return (error); } +static int +soo_chmod(struct file *fp, mode_t mode, struct ucred *cred, struct thread *td) +{ + struct socket *so; + int error; + + so = fp->f_data; + if (so->so_proto->pr_chmod != NULL) + error = so->so_proto->pr_chmod(so, mode, cred, td); + else + error = EINVAL; + return (error); +} + static int soo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index fc1559fb1fb1..7af73a1d344b 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -484,6 +484,7 @@ uipc_attach(struct socket *so, int proto, struct thread *td) unp->unp_socket = so; so->so_pcb = unp; refcount_init(&unp->unp_refcount, 1); + unp->unp_mode = ACCESSPERMS; if ((locked = UNP_LINK_WOWNED()) == false) UNP_LINK_WLOCK(); @@ -526,6 +527,7 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) struct mount *mp; cap_rights_t rights; char *buf; + mode_t mode; if (nam->sa_family != AF_UNIX) return (EAFNOSUPPORT); @@ -558,6 +560,7 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) return (EALREADY); } unp->unp_flags |= UNP_BINDING; + mode = unp->unp_mode & ~td->td_proc->p_pd->pd_cmask; UNP_PCB_UNLOCK(unp); buf = malloc(namelen + 1, M_TEMP, M_WAITOK); @@ -590,7 +593,7 @@ restart: } VATTR_NULL(&vattr); vattr.va_type = VSOCK; - vattr.va_mode = (ACCESSPERMS & ~td->td_proc->p_pd->pd_cmask); + vattr.va_mode = mode; #ifdef MAC error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd, &vattr); @@ -702,6 +705,27 @@ uipc_close(struct socket *so) } } +static int +uipc_chmod(struct socket *so, mode_t mode, struct ucred *cred __unused, + struct thread *td __unused) +{ + struct unpcb *unp; + int error; + + if ((mode & ~ACCESSPERMS) != 0) + return (EINVAL); + + error = 0; + unp = sotounpcb(so); + UNP_PCB_LOCK(unp); + if (unp->unp_vnode != NULL || (unp->unp_flags & UNP_BINDING) != 0) + error = EINVAL; + else + unp->unp_mode = mode; + UNP_PCB_UNLOCK(unp); + return (error); +} + static int uipc_connect2(struct socket *so1, struct socket *so2) { @@ -3357,6 +3381,7 @@ static struct protosw streamproto = { .pr_sockaddr = uipc_sockaddr, .pr_soreceive = soreceive_generic, .pr_close = uipc_close, + .pr_chmod = uipc_chmod, }; static struct protosw dgramproto = { @@ -3380,6 +3405,7 @@ static struct protosw dgramproto = { .pr_sockaddr = uipc_sockaddr, .pr_soreceive = uipc_soreceive_dgram, .pr_close = uipc_close, + .pr_chmod = uipc_chmod, }; static struct protosw seqpacketproto = { @@ -3411,6 +3437,7 @@ static struct protosw seqpacketproto = { .pr_sockaddr = uipc_sockaddr, .pr_soreceive = soreceive_generic, /* XXX: or...? */ .pr_close = uipc_close, + .pr_chmod = uipc_chmod, }; static struct domain localdomain = { diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 1d691166929f..f9d7e1c4bb69 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -32,6 +32,8 @@ #ifndef _SYS_PROTOSW_H_ #define _SYS_PROTOSW_H_ +#include + /* Forward declare these structures referenced from prototypes below. */ struct kaiocb; struct mbuf; @@ -100,6 +102,8 @@ typedef int pr_bindat_t(int, struct socket *, struct sockaddr *, typedef int pr_connectat_t(int, struct socket *, struct sockaddr *, struct thread *); typedef int pr_aio_queue_t(struct socket *, struct kaiocb *); +typedef int pr_chmod_t(struct socket *, __mode_t, struct ucred *, + struct thread *); struct protosw { short pr_type; /* socket type used for */ @@ -139,6 +143,7 @@ struct protosw { pr_sense_t *pr_sense; /* stat(2) */ pr_sosetlabel_t *pr_sosetlabel; /* MAC, XXXGL: remove */ pr_setsbopt_t *pr_setsbopt; /* Socket buffer ioctls */ + pr_chmod_t *pr_chmod; /* fchmod(2) */ }; /*#endif*/ diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h index d22662fe83e5..87611fd9aee4 100644 --- a/sys/sys/unpcb.h +++ b/sys/sys/unpcb.h @@ -93,6 +93,7 @@ struct unpcb { u_int unp_msgcount; /* (g) references from message queue */ u_int unp_gcrefs; /* (g) garbage collector refcount */ ino_t unp_ino; /* (g) fake inode number */ + mode_t unp_mode; /* (g) initial pre-bind() mode */ LIST_ENTRY(unpcb) unp_dead; /* (g) link in dead list */ } __aligned(CACHE_LINE_SIZE); diff --git a/tests/sys/kern/unix_dgram.c b/tests/sys/kern/unix_dgram.c index 9df0d4ca7168..7464cdf197cd 100644 --- a/tests/sys/kern/unix_dgram.c +++ b/tests/sys/kern/unix_dgram.c @@ -25,13 +25,15 @@ * SUCH DAMAGE. */ -#include #include #include #include #include +#include #include +#include #include + #include #include #include @@ -391,12 +393,49 @@ ATF_TC_BODY(selfgetpeername, tc) ATF_REQUIRE(close(sd) == 0); } +ATF_TC_WITHOUT_HEAD(fchmod); +ATF_TC_BODY(fchmod, tc) +{ + struct stat sb; + struct sockaddr_un sun; + int error, sd; + + memset(&sun, 0, sizeof(sun)); + sun.sun_len = sizeof(sun); + sun.sun_family = AF_UNIX; + strlcpy(sun.sun_path, "sock", sizeof(sun.sun_path)); + + sd = socket(PF_UNIX, SOCK_DGRAM, 0); + ATF_REQUIRE(sd != -1); + + error = fchmod(sd, 0600 | S_ISUID); + ATF_REQUIRE_ERRNO(EINVAL, error == -1); + + umask(0022); + error = fchmod(sd, 0766); + ATF_REQUIRE(error == 0); + + error = bind(sd, (struct sockaddr *)&sun, sizeof(sun)); + ATF_REQUIRE(error == 0); + + error = stat(sun.sun_path, &sb); + ATF_REQUIRE(error == 0); + ATF_REQUIRE_MSG((sb.st_mode & 0777) == 0744, + "sb.st_mode = %o", sb.st_mode); + + error = fchmod(sd, 0666); + ATF_REQUIRE_ERRNO(EINVAL, error == -1); + + ATF_REQUIRE(close(sd) == 0); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, one2many); ATF_TP_ADD_TC(tp, event); ATF_TP_ADD_TC(tp, selfgetpeername); + ATF_TP_ADD_TC(tp, fchmod); return (atf_no_error()); } From nobody Sun Nov 3 16:48:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLBf4TjYz5cRGQ; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLBf1QWRz4XTt; Sun, 3 Nov 2024 16: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=1730652490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TWGDpvWmfNH7NbXe6rI0ikJvLil5rwh6Cd+qnAI1sVk=; b=rVqHWE3rJnVTUGJ6U+z/eMJcsBo/+eviZcqMFP+9XYxXfz0p3xNSzE7WLnUG5kWtzQEQ8E OameIucOLLKIGBidJU7pbdNtskdG0m5OKAfZ/wAfOwYrW4QZM5KmfVohG/O+RByDlhN4Q0 WJH3RjAGFMB40+mLqw0hMgE26EHdGbEG2OFF29Ig6GpLH413cdBjQbMJ1CFShIYWkwJJsz WvIZCNrCsHKvI8Y7GzSkxPE7PYPUbSFXTEYI8F+DXfX07lP2j3zX1ZPsvBjuL0c6t0CoEa 03+2zI6Twlq1g6t9Mp+gzMPsZeM0k2sVisn+uBfZIVI43rfsTf9fPRa6EQ4pmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730652490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TWGDpvWmfNH7NbXe6rI0ikJvLil5rwh6Cd+qnAI1sVk=; b=mgDVgXwu/0y6ARpoB44KOJnX7YcHluREhtQbtObGWq4+z0OyzJZZa8lKge6EJMzGUGn09o 7OfdZwIMDsQVrW6fvkXAVM/M7KLJ6MlavYGKWV81SGDAVccZfnCPNnWMml182u4nwu5/2S iASPWvHXd5Mj+tdqNv/Y9r97gpdJ3dt0YRwQpnnbJyOpdVJq7N+kXlmqOJqkkUIs1NIKck gJMAKBRsJVhsyzbT6xXof9Epa0EetGjVQ8c8/nKQNXHgSQvglEh8S7G8DEzCK8Fz5qbhFS rq6+CJUPouZczyT6iqd/bJbRqpvXkK/BnqB7qLut4nPLIL7sZF62ubjxFoBTqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730652490; a=rsa-sha256; cv=none; b=A4nAyu5lRFt+cqdFhIa7nxgHKjOTMXN8EXKuZJ09hTtVIQ63s1N4Iuql0gsSahOlrXDGjM y5F/kH/fBKdpEh/WiJfYXAR3mgDhZz2LfNpD37+qFlxx7on/AYqgUMOVcprXxi3PJOFD3/ J4vzqBXsmALBB/u8Opqf74eYDzgOd9xmyVceY3QczkCa8mZUQ/PTAb4Lek4J6I25Vc0jIh wq0XXh68rPNgdeMKqMgVqDa9MJAWQlccuxRmXdbZaaa4mNsAdc4O8woa9H2JoQOlO3G32Q S/V5eRHneEj6UKPLJJ2069x2FN9SI6QDFq444HvCYX6yvwxjsWTUsOMdYzUqVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLBf11yFzwt4; Sun, 3 Nov 2024 16:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GmAC9092302; Sun, 3 Nov 2024 16:48:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GmAfJ092299; Sun, 3 Nov 2024 16:48:10 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:48:10 GMT Message-Id: <202411031648.4A3GmAfJ092299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2b8c3a05e0a6 - main - syslogd: Set unix socket modes atomically List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b8c3a05e0a63f3ffd6ba0eeca08a97578ec3a38 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b8c3a05e0a63f3ffd6ba0eeca08a97578ec3a38 commit 2b8c3a05e0a63f3ffd6ba0eeca08a97578ec3a38 Author: Mark Johnston AuthorDate: 2024-11-03 14:41:15 +0000 Commit: Mark Johnston CommitDate: 2024-11-03 16:46:53 +0000 syslogd: Set unix socket modes atomically Take advantage of the ability to atomically set unix socket modes to ensure that /var/run/logpriv always has mode 0600. MFC after: 1 month --- usr.sbin/syslogd/syslogd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 12fa61b01bad..98ddb5d9158f 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -3721,6 +3721,11 @@ socksetup(struct addrinfo *ai, const char *name, mode_t mode) if (ai->ai_family == AF_LOCAL) unlink(name); if (ai->ai_family == AF_LOCAL || NoBind == 0 || name != NULL) { + if (ai->ai_family == AF_LOCAL && fchmod(s, mode) < 0) { + dprintf("fchmod %s: %s\n", name, strerror(errno)); + close(s); + return (NULL); + } if (bind(s, ai->ai_addr, ai->ai_addrlen) < 0) { logerror("bind"); close(s); @@ -3729,11 +3734,6 @@ socksetup(struct addrinfo *ai, const char *name, mode_t mode) if (ai->ai_family == AF_LOCAL || SecureMode == 0) increase_rcvbuf(s); } - if (ai->ai_family == AF_LOCAL && chmod(name, mode) < 0) { - dprintf("chmod %s: %s\n", name, strerror(errno)); - close(s); - return (NULL); - } dprintf("new socket fd is %d\n", s); sl_recv = socklist_recv_sock; #if defined(INET) || defined(INET6) From nobody Sun Nov 3 16:48:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLBg5dWjz5cRHt; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLBg2b5Jz4Xjg; Sun, 3 Nov 2024 16:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730652491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DuJHXX9CMB1raoIQF5hBMJisBWNGVHtGWOjRIDf9gq4=; b=QgnophK01/3vf19FzSF8+bjf66WTPnJozvFnT1UlY9wxtqrPSXvaCWg24PpYU9QaEKv1Fb 47ADvAyGcepwWccwBr7J+c+Z7PakuPzrxN7TwOa4X9wCKoDQnfCutrvrn5P3iU1lvF8Ccv 15ZrfnIEDQkJGqz/Kw8D+PNVcHRQ47NGD2iYGRLJZ54TyZvJ39b81/eOJVpQwARB9B//h3 wGyAXT0nre2rMAXvH87pUxtQgxs/fvHLBXcVChPg0PguMWndVcTkOkwXX9awuP2Bc6y4ej KqN+kCi1mJrSIL0VcBMpEWOSSHBRCf98CWcCrPnrUC8OQE9BHjWd8qXpqbObIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730652491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DuJHXX9CMB1raoIQF5hBMJisBWNGVHtGWOjRIDf9gq4=; b=cSpDZvQHU+Set9YYlR47ZqU86bIMhEALWWdZ3fQBuKClWRj1Em1A+7IRvYq1w/VPNXCbQR 5qXqg+PuOeoOysPmps+bZc0VaqmqO/Nvuel7TtGNLp4BStduFaQeNXdu04rgcudTjKYAKu 1AnAJ+zU5j6XF4GjZLzmv4XTe6PfJAAJwD7lopW4wAV85Ih/MNwV+4+wvg2GiphQbVZceQ R5BTobylk90zeD6rlnsv/VZrdEhZL9cpVi7r1gUhJ0ot+TmmcIW7yCfDlLIowdIE1fQodp EoFrgHrGFuK1T+rXBITfjQGjNc6/gwdLXNTxE89WfyiTdcTsm7D1RBoZ6I2UTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730652491; a=rsa-sha256; cv=none; b=hGnuQMbMvbUSBoQcckqJiZvgRYbzvj55ojXY7mni9HGSBvsmbBtHg+HfiMMt06vFZgV03H Z/56UguztutY/sRjQOjwFSQnH26CORGVF26AHeJklTsU/ECJo4r6rlDPB1Tf7bHFojaw8G g4ZTzr4rZEMiQppjLT+dl+B0pRBkgaIlZGGzXXPFG9VcH3J64/N4EuFxyVuZP7j2eGvBqb +KXQnjSOMMH21rFLBKIOfTV8Y9zN6mXBAwRWLuWf8vFQ3m9PMX4aBvdy4r74XKSWGfBoU3 MBDoeSCSMytklQStEkxAesqr6Hay+fvJpsZc7AQe81eUGoV6xrd5zF42BDAXbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLBg25SDzx6G; Sun, 3 Nov 2024 16:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GmB9g092351; Sun, 3 Nov 2024 16:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GmBab092348; Sun, 3 Nov 2024 16:48:11 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:48:11 GMT Message-Id: <202411031648.4A3GmBab092348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 79c342aaf86f - main - tftpd: Address flaky tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79c342aaf86feb4efbd15383f54e4fe7bdc9da7b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=79c342aaf86feb4efbd15383f54e4fe7bdc9da7b commit 79c342aaf86feb4efbd15383f54e4fe7bdc9da7b Author: Mark Johnston AuthorDate: 2024-11-03 14:43:38 +0000 Commit: Mark Johnston CommitDate: 2024-11-03 16:47:38 +0000 tftpd: Address flaky tests The tftpd tests all follow the same pattern: 1. open a UDP socket, 2. fork a child to exec tftpd, which subsequently handles requests on the socket, 3. use a client socket to send some message to the tftpd daemon. However, tftpd's first action is to mark its socket as non-blocking and then read a request from it. If no data is present in the socket, tftpd exits immediately with an error. So, there is a race; we often see tftpd test timeouts when running tests in parallel. These timeouts also arise periodically in CI runs. One solution is to restructure each test to create the server socket, then write the request to the client socket, then fork tftpd. This closes the race. However, this involves a lot of churn. This patch fixes the problem a different way, by adding a new -b flag to tftpd which makes it block to read the initial request. Each test is modified to use -b, closing the race. Reviewed by: imp, asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47404 --- libexec/tftpd/tests/functional.c | 2 ++ libexec/tftpd/tftpd.8 | 14 ++++++++++++-- libexec/tftpd/tftpd.c | 19 +++++++++++-------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/libexec/tftpd/tests/functional.c b/libexec/tftpd/tests/functional.c index 54ace29d718c..791aa9190a2f 100644 --- a/libexec/tftpd/tests/functional.c +++ b/libexec/tftpd/tests/functional.c @@ -323,6 +323,7 @@ setup(struct sockaddr_storage *to, uint16_t idx) { int client_s, server_s, pid, argv_idx; char execname[] = "/usr/libexec/tftpd"; + char b_flag_str[] = "-b"; char s_flag_str[] = "-s"; char w_flag_str[] = "-w"; char pwd[MAXPATHLEN]; @@ -382,6 +383,7 @@ setup(struct sockaddr_storage *to, uint16_t idx) bzero(argv, sizeof(argv)); argv[0] = execname; argv_idx = 1; + argv[argv_idx++] = b_flag_str; if (w_flag) argv[argv_idx++] = w_flag_str; if (s_flag) diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index 558f7bdf809a..0118198da53d 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 8, 2024 +.Dd November 3, 2024 .Dt TFTPD 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd Internet Trivial File Transfer Protocol server .Sh SYNOPSIS .Nm tftpd -.Op Fl CcdlnoSw +.Op Fl bCcdlnoSw .Op Fl F Ar strftime-format .Op Fl s Ar directory .Op Fl U Ar umask @@ -119,6 +119,16 @@ option is specified. .Pp The options are: .Bl -tag -width Ds +.It Fl b +By default, +.Nm +expects an initial message to be available on its input socket. +If no data is available, the server exits immediately. +If +.Fl b +is specified, +.Nm +will block waiting for the initial message. .It Fl c Changes the default root directory of a connecting host via .Xr chroot 2 diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index a51fb4742985..f8f9bd549a2e 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -121,15 +121,18 @@ main(int argc, char *argv[]) struct passwd *nobody; const char *chuser = "nobody"; char recvbuffer[MAXPKTSIZE]; - int allow_ro = 1, allow_wo = 1, on = 1; + int allow_ro = 1, allow_wo = 1, block = 0, on = 1; pid_t pid; tzset(); /* syslog in localtime */ acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "bcCd::F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { + case 'b': + block = 1; + break; case 'c': ipchroot = 1; break; @@ -213,14 +216,9 @@ main(int argc, char *argv[]) umask(mask); - if (ioctl(0, FIONBIO, &on) < 0) { - tftp_log(LOG_ERR, "ioctl(FIONBIO): %s", strerror(errno)); - exit(1); - } - /* Find out who we are talking to and what we are going to do */ peerlen = sizeof(peer_sock); - n = recvfrom(0, recvbuffer, MAXPKTSIZE, 0, + n = recvfrom(0, recvbuffer, MAXPKTSIZE, block ? 0 : MSG_DONTWAIT, (struct sockaddr *)&peer_sock, &peerlen); if (n < 0) { tftp_log(LOG_ERR, "recvfrom: %s", strerror(errno)); @@ -234,6 +232,11 @@ main(int argc, char *argv[]) exit(1); } + if (ioctl(0, FIONBIO, &on) < 0) { + tftp_log(LOG_ERR, "ioctl(FIONBIO): %s", strerror(errno)); + exit(1); + } + /* * Now that we have read the message out of the UDP * socket, we fork and exit. Thus, inetd will go back From nobody Sun Nov 3 16:57:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLPg0Lwvz5cRn7; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLPf5pDVz4Zym; Sun, 3 Nov 2024 16: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=1730653062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqOgiahDj8kfXjMOdQC4eiWAER+yPvTElhlnFQzxCIE=; b=jqf2eOglhNTPLJcRJIgjvtAt6ek4kTXJsImDZbwEngkc5n+SpVoamQLGNnW8N8ku1idZln sy1gq/VSUxNKqZCwYDnavO1TTTVI1DwRcvWwDbGSG+nJZ24CkPRGp9ze8e0ubM5ITZm+Ts /3Xytba4xnbh1P5Uelh5QSKeV6TcDqYELBGWClMkwKejXpwAJqQlj6mxql3fsrvggEzt4+ B9cRG8Ukpf+07QqNZv8XGSMoUoJi2hOU+DelpYalien+NjEIFdQuIhiDHfvP3ysKfsV6rQ JqUscDsgnuh5H5jGDF30GhuAsdgkS82pWbGRi5fG6cTHfftTKBecjpKdLFAi9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CqOgiahDj8kfXjMOdQC4eiWAER+yPvTElhlnFQzxCIE=; b=MbYMYFQFMkYDIpxAsNEMXs0UO7/6AD7r0PFtfOB8ZhYV01VxeFXvchlszLW7O5eDPqy+j6 5TbIR+toUkEcNJK2YoazaTiS3HUp+MPkCbB3Q30lT/L3FcP9KVsFfsHUorlTYH9+89D+2l Kbr0yEzdC1vJd+aLYL/5wg2luenARxJcW85O8WnsagryWL0MEmhBTaS2zhqPC87D5/PBz7 CPbR/KxXjB07qvZFq8gGwqcf6kgXDBjWu/dCV37Q6X/FKFLZYNW+Z+i4A3b3ikHMK+G74q wOTasTL8sk5GHazSs/Lo0DQOiGo+QYda7FRo2spSAS9QxWVFLTIyfFgKmbps9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653062; a=rsa-sha256; cv=none; b=voMLXvBBA+KYPdXdJ0026L7XXUZ2g119ZYIA5EAnv8rxw5kVRGHO0OiISttykT1UI+QHeP +Qo196mC7fc0lJHCrPRPstYQSXgwchuElh4W3AUrHNstejyoeXkpazzoyjsziVdvxh+zDJ r8oOzssJ9HKzeXGlZLwsv2V2eE0usdHwppl/i/uZQPzG/YUGLIjDpvfhAKgUuzRD8X0lHw lzcwdEsG3+3J41ScxJcsMEJNHv1cS4p1osDmdHg/0hWfW/tfWTLcNAdvRx3MatLyRBVybO hUOR48JGQIA3hqRUd1o6DNiEbFDIJrfkvRzdWy/XbI94VetWyQS15+bM8JmXKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLPf540NzxJl; Sun, 3 Nov 2024 16:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GvgoT010675; Sun, 3 Nov 2024 16:57:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GvgR2010672; Sun, 3 Nov 2024 16:57:42 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:57:42 GMT Message-Id: <202411031657.4A3GvgR2010672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 27050c801227 - stable/14 - ipsec.4: cross-reference typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 27050c801227654e59f838decbb26223256e240c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=27050c801227654e59f838decbb26223256e240c commit 27050c801227654e59f838decbb26223256e240c Author: Quentin Thébault AuthorDate: 2024-10-28 06:55:39 +0000 Commit: Ed Maste CommitDate: 2024-11-03 16:57:18 +0000 ipsec.4: cross-reference typo MFC after: 3 days Reviewed by: Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1502 (cherry picked from commit e63d5726b4ff96c87db05391464cbe195438d747) --- share/man/man4/ipsec.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ipsec.4 b/share/man/man4/ipsec.4 index c5c9ed863385..952d7b925388 100644 --- a/share/man/man4/ipsec.4 +++ b/share/man/man4/ipsec.4 @@ -182,7 +182,7 @@ is synonymous with which requires that a security association must exist for the packets to move, and not be dropped. These terms are defined in -.Xr ipsec_set_policy 8 . +.Xr ipsec_set_policy 3 . .Bl -column net.inet6.ipsec6.esp_trans_deflev integerxxx .It Sy "Name Type Changeable" .It "net.inet.ipsec.esp_trans_deflev integer yes" From nobody Sun Nov 3 16:57:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLPg6t9Xz5cRtM; Sun, 03 Nov 2024 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLPg58KJz4Zg7; Sun, 3 Nov 2024 16: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=1730653063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8R6Y4RSF4DEjV70upCDW65mBY1Lf5JLc4lk/BBXq/Kc=; b=STW+GYHc7I3Rcnonb5xGV3Ntn4j6dz35nFN1Fc40xMeMNShzeyytJzmImpiAJf4bfvcPsH 4A2WhNu4B9TP8eyVkwRdba9192LnCkyopPCi2QhgxVU6ggFxcaMN38NZ1VL/y6HdQcI0vU gsiV/Gsx1853DlSKvSIk0gXeZAwuZ+wDnfmf9pDWVFI1SKbvnda6SkJ9ozkHkgkviW+DlW BRY5vdEGMVnpPOsV0xpLU+a4V5QLUj3X+NfhY+2jJCflQQvt1T7TE7a8RxUirdueJDWsJp AzzxaEsmNRc4kFTTT5zmLFpdhIiuHNDE5Cz0HIvnk8shIlrPntZaNN8JrfqO/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8R6Y4RSF4DEjV70upCDW65mBY1Lf5JLc4lk/BBXq/Kc=; b=X0LhXoAHyddvarsCuZwZShWu3u+0Xb9/OGKPCx+/hYaRVbRAu+F1BVqZWGiuyyxfrKI/CA wNQMk42Y+dAJiEACKpMyn3cbd1YiGZb4f3MFYlSpydCyNezeow7mzxRWFtflVgwHHKSrvS TmOZTZuHVt36+VJeaHR+DRn9t+LJ1sFfN05r9vx3ghEY1sfWsEKnMeUJYoRhZCFOhh/81o UOYjU13qY7GjgNRhfAKUXAn7tLv3p57mP36z2e+j+mNG2DR/V+wHLrGJ0sgcZAcJMD69cD uVNlJwV1nYImlDK5V9eVxX8sKZ375gswJbhlns+Ab655Vs7TE3dE5KHKxePRtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653063; a=rsa-sha256; cv=none; b=P+nwzc4qqVn57Pz8yWnd8lv1h7Q5Q8NDWWiO5Jhqfv7hsVFaNK8MLrmcKNuKqb/nTAULyw EFJLksrG3HtACg8npPsIoJTct814E2wkCDUDE+1iThCIJ8UCS8PEgTloxz+J/8jjlU91iq enngMgPf0IZBJFc732QzU4JWSbPry/Jw2zNeo58vMmKovup8rINICMsaC+pkhOXJJDs6n0 WgbeURysk0nNG5p06LobeVH9SYe3h7+ATwggaGym2OyB5NSFhYXm5UClE9iudXymfK4xdu gXenSo+HXV18v+DBadrlqKm4C7vNlMl2+2vhuyPITI+Ap+Sihn8AbLuQOO+FFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLPg4mCDzxD2; Sun, 3 Nov 2024 16:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3GvheC010720; Sun, 3 Nov 2024 16:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3GvhDO010717; Sun, 3 Nov 2024 16:57:43 GMT (envelope-from git) Date: Sun, 3 Nov 2024 16:57:43 GMT Message-Id: <202411031657.4A3GvhDO010717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a1883e20bc78 - stable/14 - Cirrus-CI: switch to FreeBSD 13.3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a1883e20bc784b8055d4349e4c3ff1e690efe17c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a1883e20bc784b8055d4349e4c3ff1e690efe17c commit a1883e20bc784b8055d4349e4c3ff1e690efe17c Author: Ed Maste AuthorDate: 2024-10-26 15:03:15 +0000 Commit: Ed Maste CommitDate: 2024-11-03 16:57:18 +0000 Cirrus-CI: switch to FreeBSD 13.3 Sponsored by: The FreeBSD Foundation (cherry picked from commit b15889d6d22a36333dec4362aea426521281c72c) --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 13719a3e2058..45c31c9f07b2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-2-release-amd64 + image: freebsd-13-3-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Sun Nov 3 17:00:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLSP1qpKz5cRyL; Sun, 03 Nov 2024 17:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLSP0wTgz4bJg; Sun, 3 Nov 2024 17:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EETQFa04H7iew2a9zkKeaJYUIvqn+Wki+ndEE9VCWa0=; b=kyOdvwoNsgG/bWALr1oerBRwdOHplYFsuRgmVZw72Ok4hG8ZbPWur1ruoBC75ctHCKpsdp yx0IonRbHDxHPPHjV213TFCRJngtMlPaUZi273XUubw2SOKqAZZY93JwBOZCajtw2jCBf+ K94LKEbe0Y4e9Mb+oiRkvdV2vPOm23uZqlviDsa+19ZHaQ3slqjrfQFJQOncwPi3yXYdrN xLueGxt9M8L0+LO5j2o7XDRbL5wZXQh6YcS+X6vS8yuAl2b6akGkthGz6J15IrRx8U0RS6 BeRoYMC1uNEkfwVfmxhf0+Om0l9mt2tbqH1dAlftOQQ8tb3UAWwTmbDiLoMlvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EETQFa04H7iew2a9zkKeaJYUIvqn+Wki+ndEE9VCWa0=; b=eBJ3EleP2AaIXBMUBRpEkiu2pgPafZRrDlHNtn/WTqim5N7ujykGL89H8d5sReXN1HyuRo s+9qjDr2giOpumajErY4kJLNmr82QBpjeVAmcpM2YF6N6eImfluXuKEMQ7KDiQJPWL7CVO GM8IzlqPt4LGzbdwojXECCkZ7Xrxm8cuIVa6T1at/QGme/gNDchJUUtFQ0/IZaUc8RkkS4 y8Eb9uk+JAa2g3bRw1s5onDLagwoNUa8gylPGwaazNx7i4oTLpE2Jc7XmOJmWUmhBhq61W hp6UB66zL8+Q8JfNE5LqcmXMDuegEDZF7WqqtsL96DDdSdYFQWZu2RsAdb2Dug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653205; a=rsa-sha256; cv=none; b=VNYSrAszuo9WddTS+/UGq/oaI20cp2iEqUl3vwm2Qv97wcVtBwvhB9TR4J8H3lbgjq/rrs kBONFBIbh/p6sfdyovmM8PFk1ELJq9Fsc7RaOSXgVCODwui+8poCpopYW5/vI3Lq3nK1tm mFICm+oHE+PM28GZ5XbQM6zFcKCjAoSYbr6R48PVvD1zRa4/MNSHduBcc73TWZwX3hr6Hv HiM1ChzftHVS5j4OpMKuqhLKjsBKP3oBC2sfbdJE0uo2fPKqlyQC9GF9rz9SEC52C5AVhZ cS3LRL1OdKjjJifupbJ9ITYzrh9y4H5wmbdzmLrjSuHQ/IOf+mSZh/4HApJhTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLSP0WRRzxGB; Sun, 3 Nov 2024 17:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3H05ep015102; Sun, 3 Nov 2024 17:00:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3H05ca015097; Sun, 3 Nov 2024 17:00:05 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:00:05 GMT Message-Id: <202411031700.4A3H05ca015097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f6ed4f776fa9 - stable/13 - Cirrus-CI: switch to FreeBSD 13.3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f6ed4f776fa95a9e40b18404a6de2be29c2e0092 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f6ed4f776fa95a9e40b18404a6de2be29c2e0092 commit f6ed4f776fa95a9e40b18404a6de2be29c2e0092 Author: Ed Maste AuthorDate: 2024-10-26 15:03:15 +0000 Commit: Ed Maste CommitDate: 2024-11-03 16:59:52 +0000 Cirrus-CI: switch to FreeBSD 13.3 Sponsored by: The FreeBSD Foundation (cherry picked from commit b15889d6d22a36333dec4362aea426521281c72c) (cherry picked from commit a1883e20bc784b8055d4349e4c3ff1e690efe17c) --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 2f2b76537968..bd4e7316a3d6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-2-release-amd64 + image: freebsd-13-3-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Sun Nov 3 17:00:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLSq36Lzz5cRsM; Sun, 03 Nov 2024 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLSq2gqPz4bgv; Sun, 3 Nov 2024 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ro3wxsgihfay5sgxVw7ldcC3mHNqwzOofH8iRbOiCdA=; b=qnN12l6cI5Hyc2WTojCQP07hIEujuKGDjl/FjP9EhUfoU8xFAY4LOUu+cc2vekc++9Rast hbEiVVyLvrMlZBiiaFlgfkIa1U033Q70S1/gAeUBixqLdsP/AYYJa7dWPxYQfpgif/txe9 sbzjzWu5LeDEZZpqswpdfwmRB3AfujW/NLZBhxn0tG1TmeljECE/yooQ3Pnds8FPUNBYQV 0LQ1A94AVEtUFo/e2h61HVnxHLPliwNcSajuY92nxhBTBhdEBBD1hWXQFrKWJm/TWasy5K l0/ElvBdu3T+qdvXNCg0H5rDeJiVgmhPF1nASRNwn0/RgujRVC+VOjRDjULSmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ro3wxsgihfay5sgxVw7ldcC3mHNqwzOofH8iRbOiCdA=; b=CTJHze2Nqd1qG9Ila+iVWo2OTay39QCadgn98ia9s4e5bSHzIk1Wq8UhsBI7OMnjbdrLRY FRtQ5XbROlgwp+14GWSV8Jvt4z/4vlLKIkfcKl9NCXhQ9WalGQf68LoMyAH5m2HIgApEY2 0ZScEq64KPUnWcU0QJfDZ9ZyfOKUZFaa+xMrNE5Co56Qiye9kFEz7kuGiMumgW4P4SADk0 nfK/Gp4faLsDdhd7xaOcnkI1sXlgyHDvsbMc6Oqna4/xJozdMj2bd7m23FSyOEdPxdzRzt PlI/c93sdYh6aTNuKFn3I3s1ZcwpSO7iNOIst9WRWrUJYiVdYkABP09bAUd6Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653227; a=rsa-sha256; cv=none; b=TrtVIu9zRzbnZFLkCQZ3VXM9FqUxgIalU5GEKNov4a3GRN7XEejl6qFYRcuN63+oxgNu3x ACoOIC6YB9v07bUeoFs89GFmYZak9Q6ZB8nP4k75tQqA73LgaTD7jj/qvFk+WktohhhriF mbQuARu3zStruwMJ4htyue7gVhef6giFv4nb0YRJakXUnZHNocMQKeaU49SRWuztxys1MT VvrWvIx0Dc1uLMhR25PYIuT8WO/h/XF7zG8huJHcXyjURSVdR4l671bJ0yrM02Qzeywnxs qY/RFnVotoXx+8oKCGYKveSlJUjLOy9JqM53DnXoy0q64rRrv7UFprLMNWkN7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLSq2HC8zxJp; Sun, 3 Nov 2024 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3H0RXq021401; Sun, 3 Nov 2024 17:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3H0RGw021398; Sun, 3 Nov 2024 17:00:27 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:00:27 GMT Message-Id: <202411031700.4A3H0RGw021398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1176390d2d2b - main - catopen(3): align returned errors with IEEE Std =?utf-8?Q?1003.1=E2=84=A2-2024?= List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1176390d2d2bbb1e207c840d1f7a66a6ac1096ff Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1176390d2d2bbb1e207c840d1f7a66a6ac1096ff commit 1176390d2d2bbb1e207c840d1f7a66a6ac1096ff Author: Konstantin Belousov AuthorDate: 2024-11-03 12:50:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 16:59:15 +0000 catopen(3): align returned errors with IEEE Std 1003.1™-2024 - Invalid/non-existent/unable to use message catalog file should result in ENOENT, and not in EFTYPE. - Added detection of several cases of wrong file format due to length [*]. - Update man page. * Based on the original patch from PR. PR: 172805 Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47413 --- lib/libc/nls/catopen.3 | 13 +++++++------ lib/libc/nls/msgcat.c | 30 +++++++++++++++++++----------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/lib/libc/nls/catopen.3 b/lib/libc/nls/catopen.3 index 6fd50956be1f..6fb2e2522e85 100644 --- a/lib/libc/nls/catopen.3 +++ b/lib/libc/nls/catopen.3 @@ -130,16 +130,17 @@ Otherwise, (nl_catd) -1 is returned and is set to indicate the error. .Sh ERRORS .Bl -tag -width Er -.It Bq Er EINVAL -Argument -.Fa name -does not point to a valid message catalog, or catalog is corrupt. .It Bq Er ENAMETOOLONG An entire path to the message catalog exceeded 1024 characters. .It Bq Er ENOENT -The named message catalog does not exists, or the +Argument .Fa name -argument points to an empty string. +does not point to a valid message catalog name, +or it points to an empty string. +.It Bq Er ENOENT +The named message catalog does not exist. +.It Bq Er ENOENT +The named message catalog file is in wrong format. .It Bq Er ENOMEM Insufficient memory is available. .El diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index 32fa191c4c67..61c09b65f434 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -136,7 +136,7 @@ __catopen_l(const char *name, int type, locale_t locale) /* sanity checking */ if (name == NULL || *name == '\0') - NLRETERR(EINVAL); + NLRETERR(ENOENT); if (strchr(name, '/') != NULL) /* have a pathname */ @@ -390,7 +390,7 @@ load_msgcat(const char *path, const char *name, const char *lang) struct catentry *np; void *data; char *copy_path, *copy_name, *copy_lang; - int fd; + int fd, saved_errno; /* path/name will never be NULL here */ @@ -414,9 +414,17 @@ load_msgcat(const char *path, const char *name, const char *lang) } if (_fstat(fd, &st) != 0) { + saved_errno = errno; _close(fd); - SAVEFAIL(name, lang, EFTYPE); - NLRETERR(EFTYPE); + SAVEFAIL(name, lang, saved_errno); + NLRETERR(saved_errno); + } + + /* The file is too small to contain a _NLS_MAGIC. */ + if (st.st_size < sizeof(u_int32_t)) { + _close(fd); + SAVEFAIL(name, lang, ENOENT); + NLRETERR(ENOENT); } /* @@ -426,13 +434,13 @@ load_msgcat(const char *path, const char *name, const char *lang) */ if (st.st_size > SIZE_T_MAX) { _close(fd); - SAVEFAIL(name, lang, EFBIG); - NLRETERR(EFBIG); + SAVEFAIL(name, lang, ENOENT); + NLRETERR(ENOENT); } - if ((data = mmap(0, (size_t)st.st_size, PROT_READ, - MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED) { - int saved_errno = errno; + data = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); + if (data == MAP_FAILED) { + saved_errno = errno; _close(fd); SAVEFAIL(name, lang, saved_errno); NLRETERR(saved_errno); @@ -442,8 +450,8 @@ load_msgcat(const char *path, const char *name, const char *lang) if (ntohl((u_int32_t)((struct _nls_cat_hdr *)data)->__magic) != _NLS_MAGIC) { munmap(data, (size_t)st.st_size); - SAVEFAIL(name, lang, EFTYPE); - NLRETERR(EFTYPE); + SAVEFAIL(name, lang, ENOENT); + NLRETERR(ENOENT); } copy_name = strdup(name); From nobody Sun Nov 3 17:00:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLSr3syxz5cRyY; Sun, 03 Nov 2024 17:00: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLSr3BWJz4bvH; Sun, 3 Nov 2024 17:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ia+uDXQstU5yMwUEoUgqF/2du2c7jE2CYGYYyI30KR4=; b=hKPx3CcHKVSpmwokwOBSAJa+uSlmngB5ZfOf26hhHSHSKGPpHaSU6px0RA+REpSICZ7C5x rPp2gHn/HAA5uPZZTVQztWpXQzkQDvQKViigB3ib23KeZb+V5/BcerkR3A7kyHA4812Bov bj1zS1h3uC/wZfiLt3OqSw96r+qr8KYKUW+OcLYpCyHBIJFY6kZ5rYTDwXCYq2nGYij6uv MceUD0tOTq3gx3PMltpuSY5XTKZlfp4bBgsKNajRcJmHSPyJ6ZIFROeWdPYqFGMvGiSE8X MHRmIcvCmH0zhQ9rXU/tr6LWuOfxZodJj2c1CTqae5rfxPeUYkE5E9uZJ1Xgrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ia+uDXQstU5yMwUEoUgqF/2du2c7jE2CYGYYyI30KR4=; b=R4lEoNBkJVTPqrNKHi4nkmDrFQscuyKYNI09+beYVViyaYBi5cA4/Wmv+EEZqh/WUmE0J+ CJPqr4g8u/xA76hrq8rHbZ7yJQ+oUTZMfdkxLTlqjFCI5w01uB1IxN05OGfviCNqIrn331 PZ9JWQpzE3wcxuTaGU/IajL0gz2JFHPz6RmghfceP/+ySEvlyN3Yf03QUk13ah2UsAbvfC 4kho8+2ZOKp9WuDFS9kxf449e+YJTVi9LTkhlsZ+P0uiu/Tsy8vdGzfXW4Rwtxw/97bbq7 J9LXmuK/2uCv0+vklECEZTGSYmWZPo03wIBEZJf4I8mj47p6WoHeQ3Cd8ONzzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653228; a=rsa-sha256; cv=none; b=UsR8NPRYKAYxOsfgmO72tYGqABlk1ARidZL2kNSzSIBNMhEiI5wPKnw2SL+SxoiCpJmoMQ fC0UFfwszZk5Azng6rJcDgNffn4Yd752nt1QpAMSzcQ39Y79xw7ovrzsCpmV5nlE5dxN/Q L+f3cRNTJTx/I/pBqf6rQ6bycz37U3jIqKu+UpkoB5yayNm4lq+YbWODoxgYO4WQlwygRA j8wtV3Agk1nluoAlmup8lmGagrjdfDfyH0YVAMYMr85cnhEVRPL4oXwgE5UPo0hmhMHuJe Lk7kVaynqGabgjY5W2EjHhnjG/DLDciwlpW727ozzjaLIGszLzXx+mAKQlRwNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLSr2pLfzxJq; Sun, 3 Nov 2024 17:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3H0SCe021464; Sun, 3 Nov 2024 17:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3H0SiO021461; Sun, 3 Nov 2024 17:00:28 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:00:28 GMT Message-Id: <202411031700.4A3H0SiO021461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e2864e718978 - main - libc: mechanically convert ru_RU msg catalog from KOI8-R to UTF-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2864e7189781d742b6899d110b565c9744bb948 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2864e7189781d742b6899d110b565c9744bb948 commit e2864e7189781d742b6899d110b565c9744bb948 Author: Konstantin Belousov AuthorDate: 2024-11-03 14:12:13 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 16:59:15 +0000 libc: mechanically convert ru_RU msg catalog from KOI8-R to UTF-8 Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47414 --- lib/libc/nls/Makefile.inc | 1 + lib/libc/nls/ru_RU.UTF-8.msg | 265 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 266 insertions(+) diff --git a/lib/libc/nls/Makefile.inc b/lib/libc/nls/Makefile.inc index 0d4c245c6911..f26e04c187a5 100644 --- a/lib/libc/nls/Makefile.inc +++ b/lib/libc/nls/Makefile.inc @@ -32,6 +32,7 @@ NLS+= no_NO.ISO8859-1 NLS+= pl_PL.ISO8859-2 NLS+= pt_BR.ISO8859-1 NLS+= ru_RU.KOI8-R +NLS+= ru_RU.UTF-8 NLS+= sk_SK.ISO8859-2 NLS+= sv_SE.ISO8859-1 NLS+= uk_UA.UTF-8 diff --git a/lib/libc/nls/ru_RU.UTF-8.msg b/lib/libc/nls/ru_RU.UTF-8.msg new file mode 100644 index 000000000000..cda0909aa76c --- /dev/null +++ b/lib/libc/nls/ru_RU.UTF-8.msg @@ -0,0 +1,265 @@ +$ +$ Message catalog for ru_RU.KOI8-R locale +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 Операция не разрешена +$ ENOENT +2 Нет такого файла или каталога +$ ESRCH +3 Нет такого процесса +$ EINTR +4 Прерванный системный вызов +$ EIO +5 Ошибка ввода/вывода +$ ENXIO +6 Устройство не сконфигурировано +$ E2BIG +7 Слишком длинный список аргументов +$ ENOEXEC +8 Ошибка формата выполняемого файла +$ EBADF +9 Некорректный дескриптор файла +$ ECHILD +10 Нет порожденных процессов +$ EDEADLK +11 Предотвращена взаимная блокировка при доступе к ресурсу +$ ENOMEM +12 Невозможно выделить память +$ EACCES +13 Недостаточно привилегий +$ EFAULT +14 Некорректный адрес +$ ENOTBLK +15 Необходимо указать блочное устройство +$ EBUSY +16 Устройство занято +$ EEXIST +17 Файл существует +$ EXDEV +18 Ссылка на другое устройство +$ ENODEV +19 Операция не поддерживается устройством +$ ENOTDIR +20 Указанный файл не является каталогом +$ EISDIR +21 Указанный файл является каталогом +$ EINVAL +22 Недопустимый аргумент +$ ENFILE +23 Слишком много открытых файлов в системе +$ EMFILE +24 Слишком много открытых файлов +$ ENOTTY +25 Вызов ioctl не поддерживается устройством +$ ETXTBSY +26 Текстовый файл занят +$ EFBIG +27 Слишком большой файл +$ ENOSPC +28 На устройстве не осталось места +$ ESPIPE +29 Недопустимое смещение +$ EROFS +30 Файловая система только для чтения +$ EMLINK +31 Слишком много ссылок +$ EPIPE +$ XXX??? +32 Канал разрушен +$ EDOM +33 Недопустимое значение числового аргумента +$ ERANGE +34 Слишком большой результат +$ EAGAIN, EWOULDBLOCK +35 Ресурс временно недоступен +$ EINPROGRESS +36 Операция в процессе выполнения +$ EALREADY +$ XXX??? +37 Операция уже выполняется +$ ENOTSOCK +38 Операция с сокетом применена не к сокету +$ EDESTADDRREQ +39 Требуется целевой адрес +$ EMSGSIZE +40 Слишком длинное сообщение +$ EPROTOTYPE +41 Неверный тип протокола для сокета +$ ENOPROTOOPT +42 Протокол недоступен +$ EPROTONOSUPPORT +43 Протокол не поддерживается +$ ESOCKTNOSUPPORT +44 Этот тип сокета не поддерживается +$ EOPNOTSUPP +45 Операция не поддерживается +$ EPFNOSUPPORT +46 Семейство протоколов не поддерживается +$ EAFNOSUPPORT +47 Семейство адресов не поддерживается семейством протоколов +$ EADDRINUSE +48 Адрес уже используется +$ EADDRNOTAVAIL +49 Не могу назначить указанный адрес +$ ENETDOWN +50 Сеть не работает +$ ENETUNREACH +51 Сеть недостижима +$ ENETRESET +52 Сеть закрыла подключение при сбросе +$ ECONNABORTED +53 Программа вызвала аварийное прекращение подключения +$ ECONNRESET +54 Подключение сброшено противоположной стороной +$ ENOBUFS +55 Не осталось места под буфер +$ EISCONN +56 Сокет уже подключен +$ ENOTCONN +57 Сокет не подключен +$ ESHUTDOWN +58 Не могу послать после закрытия сокета +$ ETOOMANYREFS +59 Слишком много ссылок: не могу соединить +$ ETIMEDOUT +60 Операция превысила лимит времени +$ ECONNREFUSED +61 Подключение отвергнуто +$ ELOOP +62 Слишком много уровней символьных ссылок +$ ENAMETOOLONG +63 Слишком длинное имя файла +$ EHOSTDOWN +64 Хост не работает +$ EHOSTUNREACH +65 Нет маршрута к хосту +$ ENOTEMPTY +66 Каталог не пуст +$ EPROCLIM +67 Слишком много процессов +$ EUSERS +68 Слишком много пользователей +$ EDQUOT +69 Превзойдена дисковая квота +$ ESTALE +70 Устаревший дескриптор файла NFS +$ EREMOTE +71 Слишком много дистанционных переходов в пути +$ EBADRPC +72 Некорректная структура RPC +$ ERPCMISMATCH +73 Неверная версия RPC +$ EPROGUNAVAIL +74 Программа RPC недоступна +$ EPROGMISMATCH +75 Неверная версия программы +$ EPROCUNAVAIL +76 Некорректная процедура для программы +$ ENOLCK +77 Блокировки недоступны +$ ENOSYS +78 Функция не реализована +$ EFTYPE +79 Неподходящий тип или формат файла +$ EAUTH +80 Ошибка аутентификации +$ ENEEDAUTH +81 Необходимо удостоверение +$ EIDRM +82 Идентификатор удален +$ ENOMSG +83 Нет сообщения требуемого типа +$ EOVERFLOW +84 Слишком большое значение для хранения в указанном типе данных +$ ECANCELED +85 Операция отменена +$ EILSEQ +86 Недопустимая последовательность байтов +$ ENOATTR +87 Атрибут не найден +$ EDOOFUS +88 Ошибка программирования +$ EBADMSG +89 Плохой формат сообщения +$ EMULTIHOP +90 Попытка мультихопа +$ ENOLINK +91 Канал разорван +$ EPROTO +92 Ошибка протокола +$ ENOTCAPABLE +93 Недостаточно возможностей +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +$ XXX: Отключение? +1 Разрыв связи +$ SIGINT +2 Прерывание по сигналу +$ SIGQUIT +3 Выход +$ SIGILL +4 Недопустимая инструкция +$ SIGTRAP +5 Ловушка трассировки/точки останова +$ SIGABRT +$ XXX: Аварийное завершение +6 Ловушка аварийного прекращения +$ SIGEMT +7 Ловушка EMT +$ SIGFPE +$ XXX: Ошибка операции с плавающей точкой? +8 Ошибка при работе с вещественным числом +$ SIGKILL +$ XXX: Убит +9 Принудительно прекращен +$ SIGBUS +$ XXX: Ошибка адресации на шине +10 Ошибка шины +$ SIGSEGV +11 Ошибка сегментации +$ SIGSYS +12 Недопустимый системный вызов +$ SIGPIPE +13 Канал разрушен +$ SIGALRM +14 Сработал таймер +$ SIGTERM +15 Завершен +$ SIGURG +16 Необходим срочный ввод-вывод +$ SIGSTOP +17 Приостановка (сигнал) +$ SIGTSTP +18 Приостановка +$ SIGCONT +19 Продолжение работы +$ SIGCHLD +20 Завершена работа порожденного процесса +$ SIGTTIN +21 Остановлен (ввод с терминала) +$ SIGTTOU +22 Остановлен (вывод на терминал) +$ SIGIO +23 Ввод-вывод возможен +$ SIGXCPU +24 Превышено ограничение процессорного времени +$ SIGXFSZ +25 Превышен максимальный размер файла +$ SIGVTALRM +26 Истек виртуальный таймер +$ SIGPROF +27 Истек таймер профилирования +$ SIGWINCH +28 Изменение размера окна +$ SIGINFO +29 Запрос информации +$ SIGUSR1 +30 Пользовательский сигнал 1 +$ SIGUSR2 +31 Пользовательский сигнал 2 From nobody Sun Nov 3 17:00:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLSt0bhdz5cRsR; Sun, 03 Nov 2024 17:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLSs4CMJz4bsN; Sun, 3 Nov 2024 17:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZoJThByJ/AztJIImDzUGBloSdCi5RkSZmhJBWLUlCnA=; b=pDpjvbEhnU7s1mpgVJih6nOpF8VAnOTKLqMSL1QzFUQ5cSuwQ4ujESHJEVfkJVnwflAbxT 9xnqf9b51w4zvN3uKzhNgkKyJrbh2BE4Y80IYxH67AuL8kFnAm/RGFugOAV1iVApfOt7lk rIS28xca2g+/+kP+pSfaI5E+agOsZMz+E6/yvxznqfno+WqxONv/oRmUJJ8EQsulHiJPja 95UE9y6llKV7WV3vB7g+BhVrT+pT0Megoceqt4miaCoRF8EposHQGYZoAYSRswsJaV3ULc QUAGxl9/r9kXeXVe3uvIlidFpLZGvT/kw/9FzIVzp1kuDZueij9KsuKo3ml0/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730653229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZoJThByJ/AztJIImDzUGBloSdCi5RkSZmhJBWLUlCnA=; b=FI0Us/euPzctsmY83naWd+3fBngzb+w8/27p7bLypuXt+8LdaOuVqltU/lm0tssHjtEAwR DWoDSWn3n5sNkrIkVikyjufkBCMWN7nCFlh3ta6xHgRzCuRdKirzbDmXT/Gt5BFZHfQ6We zapFrM1CPd+HdVQXk2G3sJ+egN6FgW2xqp42AN5juascbVd9yLz/YH0gcwUw58aO6WOiLk Kk7rD0c3IJJOarJOuWSBc2IRSOFdubnjN77PitYw6Ft/nvHFgkRLtoioY7ebYjjsfzd6uT YRHprhGs0WLmf9l2fc35EZUZAGsZk7fxXhnEhc2XP0/Dya7WIxVtUa/BA471eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730653229; a=rsa-sha256; cv=none; b=iLpN2e1ksT6cjb1KlCVi0u4Ao91+KsOOWJ4ktK96/UCg7irrYwk337t6KAibTXqq2AVLEP xIAzvTdSKxC3HPKT8Kw3tLrsBQN9gkLjTrF4Wl5G6nNumsFf6L9HqctfqYwqwj3Zq0pdjo 5kh+RSs2gvGQ2JcIsh2RPEncIHGPPMS3Ay/iCHXWuyfDC2N3mmrxWI0tqXW1F6Joon04kp xo3oltLK5ON8qhUKfWJke4dsHJoPmADFVO6CvFgIBxCyex56kqJZToa5QMBoCP1CREkNAd xzKSYWK/izGboIB37W0BjCUbEGtD533DwO7p5lUfuQ5/Kb8XS9FgU3zhuG6ysw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhLSs3qZQzwww; Sun, 3 Nov 2024 17:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3H0Tu6021522; Sun, 3 Nov 2024 17:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3H0TQ3021519; Sun, 3 Nov 2024 17:00:29 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:00:29 GMT Message-Id: <202411031700.4A3H0TQ3021519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3b65da5b65a6 - main - libc: remove some XXX for russian translations of errnos List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b65da5b65a6bfaf1150075e1dab3c627cb32f92 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3b65da5b65a6bfaf1150075e1dab3c627cb32f92 commit 3b65da5b65a6bfaf1150075e1dab3c627cb32f92 Author: Konstantin Belousov AuthorDate: 2024-11-03 16:44:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 16:59:16 +0000 libc: remove some XXX for russian translations of errnos The alternative, more concise, translations for signal names, are left intact under XXX in comments. Noted by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libc/nls/ru_RU.KOI8-R.msg | 2 -- lib/libc/nls/ru_RU.UTF-8.msg | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/libc/nls/ru_RU.KOI8-R.msg b/lib/libc/nls/ru_RU.KOI8-R.msg index 0fcd0e9b1225..7b5cd288ed60 100644 --- a/lib/libc/nls/ru_RU.KOI8-R.msg +++ b/lib/libc/nls/ru_RU.KOI8-R.msg @@ -67,7 +67,6 @@ $ EROFS $ EMLINK 31 $ EPIPE -$ XXX??? 32 $ EDOM 33 @@ -78,7 +77,6 @@ $ EAGAIN, EWOULDBLOCK $ EINPROGRESS 36 $ EALREADY -$ XXX??? 37 $ ENOTSOCK 38 diff --git a/lib/libc/nls/ru_RU.UTF-8.msg b/lib/libc/nls/ru_RU.UTF-8.msg index cda0909aa76c..1bd2179dfe81 100644 --- a/lib/libc/nls/ru_RU.UTF-8.msg +++ b/lib/libc/nls/ru_RU.UTF-8.msg @@ -67,7 +67,6 @@ $ EROFS $ EMLINK 31 Слишком много ссылок $ EPIPE -$ XXX??? 32 Канал разрушен $ EDOM 33 Недопустимое значение числового аргумента @@ -78,7 +77,6 @@ $ EAGAIN, EWOULDBLOCK $ EINPROGRESS 36 Операция в процессе выполнения $ EALREADY -$ XXX??? 37 Операция уже выполняется $ ENOTSOCK 38 Операция с сокетом применена не к сокету From nobody Sun Nov 3 17:10:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhLj00kvDz5cT6t; Sun, 03 Nov 2024 17:11:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhLhz73R9z4dNT; Sun, 3 Nov 2024 17:10:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id 7ZH8taxeqAHbZ7e7vt3pap; Sun, 03 Nov 2024 17:10:59 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7e7tt30mg2M9q7e7utiHao; Sun, 03 Nov 2024 17:10:59 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=6727aea3 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=CVhlOurhuU4ermr05xAA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 2EBC4AB; Sun, 03 Nov 2024 09:10:57 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id E8299280; Sun, 03 Nov 2024 09:10:56 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Olivier Certner cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups In-reply-to: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> References: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> Comments: In-reply-to Olivier Certner message dated "Sun, 03 Nov 2024 15:47:00 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Nov 2024 09:10:56 -0800 Message-Id: <20241103171056.E8299280@slippy.cwsent.com> X-CMAE-Envelope: MS4xfG32EBtH72C0oEub1J7RsZMS0xw8bl0P5HcSnbL+1f5eUCF3Z+J9CRWSKLww7A+G4zhGgo0O2G59b0s9GzySQ74IzCDA7lGdmUxsQAat2EeSI7HNYe7j B9r6WaRpkj6CLgFt/gmigkr/jnx5sE60RxF9thDWSa6IVCT1bhmF+/DE0u7x5MC2EMCsLIGT2ps+hUoMjhfiRl2Fhfb/Z9Ad5/3smi3XaLd0iS17KWrAZEO/ +IxEenA81S06s/r9YFwoz925d/JNuXfTEul0bBBoAhSRbfKptsPs1gVVs3dHZbjCoW63/hM+STxny81OwQJZy69EqG46PmM5cBMMqLBaO0k= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XhLhz73R9z4dNT X-Spamd-Bar: ---- In message <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org>, Olivier Certner w rites: > The branch main has been updated by olce: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5169d4307eb9c8b7bb0bd46d600012bc > c12cbdae > > commit 5169d4307eb9c8b7bb0bd46d600012bcc12cbdae > Author: Olivier Certner > AuthorDate: 2024-11-03 10:26:37 +0000 > Commit: Olivier Certner > CommitDate: 2024-11-03 15:45:43 +0000 > > nfs: Fallback to GID_NOGROUP on no groups > > We cannot unconditionally access nfsd's VNET variables in > 'sys/kern/vfs_export.c' nor 'sys/fs/nfsserver/nfs_nfsdsubs.c', as they > may not have been compiled in depending on build options. > > So, forget about the extra mile of using the configured default group > and use the hardcoded GID_NOGROUP (which differs only on systems running > nfsuserd(8) and with a non-default GID for their "nogroup" group). > > Reported by: rpokala, bapt (MINIMAL compile breakup) > Reported by: cy, David Wolfskill (panics caused by mountd(8)) > Approved by: markj (mentor) > Fixes: cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have a > t least one group") > --- > sys/fs/nfs/nfs_commonport.c | 3 +-- > sys/fs/nfs/nfs_commonsubs.c | 2 +- > sys/kern/vfs_export.c | 9 +++------ > 3 files changed, 5 insertions(+), 9 deletions(-) > > diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c > index 11f31d1a0e9f..0c94f4e7dc52 100644 > --- a/sys/fs/nfs/nfs_commonport.c > +++ b/sys/fs/nfs/nfs_commonport.c > @@ -75,7 +75,6 @@ NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); > > NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); > NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); > -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > > int nfs_pnfsio(task_fn_t *, void *); > > @@ -260,7 +259,7 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) > ("newnfs_copycred: negative nfsc_ngroups")); > cr->cr_uid = nfscr->nfsc_uid; > crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, > - NFSD_VNET(nfsrv_defaultgid)); > + GID_NOGROUP); > } > > /* > diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c > index ce4b0052714e..81c558d768ea 100644 > --- a/sys/fs/nfs/nfs_commonsubs.c > +++ b/sys/fs/nfs/nfs_commonsubs.c > @@ -4052,7 +4052,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) > cr = crget(); > cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid > ; > crsetgroups_fallback(cr, nidp->nid_ngroup, grps, > - NFSD_VNET(nfsrv_defaultgid)); > + GID_NOGROUP); > cr->cr_rgid = cr->cr_svgid = cr->cr_gid; > cr->cr_prison = curthread->td_ucred->cr_prison; > prison_hold(cr->cr_prison); > diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c > index c0337b1fe858..a314bda164de 100644 > --- a/sys/kern/vfs_export.c > +++ b/sys/kern/vfs_export.c > @@ -40,6 +40,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -61,10 +62,6 @@ > #include > #include > > -#include > - > -NFSD_VNET_DECLARE(gid_t, nfsrv_defaultgid); > - > static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structur > e"); > > #if defined(INET) || defined(INET6) > @@ -138,7 +135,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep > , > np->netc_anon = crget(); > np->netc_anon->cr_uid = argp->ex_uid; > crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, > - argp->ex_groups, NFSD_VNET(nfsrv_defaultgid)); > + argp->ex_groups, GID_NOGROUP); > np->netc_anon->cr_prison = &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors = argp->ex_numsecflavors; > @@ -217,7 +214,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep > , > np->netc_anon = crget(); > np->netc_anon->cr_uid = argp->ex_uid; > crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, > - NFSD_VNET(nfsrv_defaultgid)); > + GID_NOGROUP); > np->netc_anon->cr_prison = &prison0; > prison_hold(np->netc_anon->cr_prison); > np->netc_numsecflavors = argp->ex_numsecflavors; > I'm getting a different panic this time. panic: Assertion groups on 'cr' already set! failed at /opt/src/git-src/sys/kern /kern_prot.c:2364^M cpuid = 3^M time = 1730653662^M KDB: stack backtrace:^M db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe008e9a2fb0^M vpanic() at vpanic+0x136/frame 0xfffffe008e9a30e0^M panic() at panic+0x43/frame 0xfffffe008e9a3140^M crextend() at crextend+0x115/frame 0xfffffe008e9a3160^M crsetgroups() at crsetgroups+0x29/frame 0xfffffe008e9a3190^M nfsd_excred() at nfsd_excred+0xb3/frame 0xfffffe008e9a31c0^M nfsrvd_dorpc() at nfsrvd_dorpc+0x128c/frame 0xfffffe008e9a33d0^M nfssvc_program() at nfssvc_program+0x808/frame 0xfffffe008e9a35d0^M svc_run_internal() at svc_run_internal+0xaea/frame 0xfffffe008e9a3700^M svc_run() at svc_run+0x280/frame 0xfffffe008e9a3760^M nfsrvd_nfsd() at nfsrvd_nfsd+0x3d3/frame 0xfffffe008e9a38c0^M nfssvc_nfsd() at nfssvc_nfsd+0x535/frame 0xfffffe008e9a3de0^M sys_nfssvc() at sys_nfssvc+0xcc/frame 0xfffffe008e9a3e00^M amd64_syscall() at amd64_syscall+0x158/frame 0xfffffe008e9a3f30^M fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe008e9a3f30^M --- syscall (155, FreeBSD ELF64, nfssvc), rip = 0x159c44daf14a, rsp = 0x159c4238 b428, rbp = 0x159c4238b6c0 ---^M Uptime: 14m7s^M Dumping 1050 out of 8122 MB:..2%..11%..22%..31%..42%..51%..61%..71%..81%..92 %^M -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Sun Nov 3 17:42:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhMPS0p7Pz5cW3v; Sun, 03 Nov 2024 17:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhMPS04r0z4gZY; Sun, 3 Nov 2024 17:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZLhyOgRtL1VOGqiKzhQR8yogNMvBfbHd2FdGLXfFEl8=; b=kUrY7zLgNS9cYfBSb+leXKSaqddIG5uprmXPfF3rAwmj4FAjXTvd+rb9hG6gcGl1NwTnIj UzcFlrzQ3KT22yxAO+RMwAhA4educUk/qvmTKlttmxiBzPoYbC7TanICR1L3UEtGzqU5kV 6VLlEhA7NaC4w5GwPpyWAt33kMnLTg/SXINVmPd5yqAbPrTLZw8qTUN6luuJXQCx40td43 iHnv07Vzvw2OWBKctJqPPbAh0bcE8rCmkD99H24dBywXctVXnnCumhamRMrB9zJCu8XUPl F3x+6BDisWXS05ZqaVfSCpu2cS7c9FN8raS/cqIpOtRQlLWOrjOPHwzsKG4D7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZLhyOgRtL1VOGqiKzhQR8yogNMvBfbHd2FdGLXfFEl8=; b=oezfp6gn23e5OVQrirnh+9fSEavDTOMD4jRQpqyVugVx6FhwzuA3dL9xsW/+AdtRATTAq1 97jwm8u8qg1Vv4jwho5GFYiyKEavXg7smbKnGZnYCEfWDyhauX/XSft8KlfJVT5gDFQ0tR oK2YsI9iU8FgRPqWxxvCU0BQMFmz5SJmmN93PXZvh2S4kJ8/CdXrFQwo2snH9nyDa8j2Y/ P5x6vq+4BfxzlptLuW/q7W5/NuXCniXe29FOLRttKQOVluAwHwTL/X9nDuJkrgszfvgDpB TzfsMwPtJ+CA41R+PbjbzrcY+xkA9UfwM1dWHZI83hU6aGdf8l3ZxvHIf54Fbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730655756; a=rsa-sha256; cv=none; b=B1kW1vIlcmB7k55wzc9dTbJVbLEL+Q86CzeDqKMsR8TcKjIc9LptMEEZXsi2HarDyg79Ak qt/jvaqIwWd8D+LVRNixq9lW4TkTzkf9cigiuEl7kv79V5Eo066YlVA1UUcCUHY8XkiqOy Kqijo7eq947pud4QUH7K7d7Y+66NacJWW/kEAQjEGNaab9qYFu9BWKtjU/D8dzOFGQVoax IYklxRMSjruk/MlVu9Ro82pm2zZVduYD/twY4YmXAkJRlGRQdTj83g9MwRqWFipzNXCj6o J9nKQ2YRTub8BxgRDHhxnj/4xR2gXyi3XhrEY7L5IH1YauTKTcCBfW5vbNtPDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhMPR6p0yzySB; Sun, 3 Nov 2024 17:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3HgZq6003147; Sun, 3 Nov 2024 17:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3HgZKF003144; Sun, 3 Nov 2024 17:42:35 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:42:35 GMT Message-Id: <202411031742.4A3HgZKF003144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 223436278085 - stable/14 - kbdcontrol: correct bell frequency for vt(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2234362780854c426395a35403ed3dce42ccacc9 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2234362780854c426395a35403ed3dce42ccacc9 commit 2234362780854c426395a35403ed3dce42ccacc9 Author: Ed Maste AuthorDate: 2024-09-26 23:55:33 +0000 Commit: Ed Maste CommitDate: 2024-11-03 16:57:18 +0000 kbdcontrol: correct bell frequency for vt(4) Do the `1193182 / pitch` hack only for sc(4). PR: 281713 Reported by: Rudolf Polzer Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46803 (cherry picked from commit f65c19a242de322930f6a1cd7d5e6bf3ce19ce42) --- usr.sbin/kbdcontrol/kbdcontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index e55165fd0888..9f8593990542 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -1038,8 +1038,10 @@ badopt: warnx("argument to -b must be duration.pitch or [quiet.]visual|normal|off"); return; } - if (pitch != 0) - pitch = 1193182 / pitch; /* in Hz */ + if (!is_vt4()) { + if (pitch != 0) + pitch = 1193182 / pitch; /* in Hz */ + } duration /= 10; /* in 10 m sec */ } From nobody Sun Nov 3 17:42:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhMPT1nldz5cWC1; Sun, 03 Nov 2024 17:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhMPT161tz4gtQ; Sun, 3 Nov 2024 17:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24xoVvWJQGPvvLwiFDtlZiaUs/yQnkoSinMg5P0b1lE=; b=Bwvbsx7lq2M4v9zBp6QbJ8w4B3qW6NCIfJr9IdhRbgshsONaRn3KM7jP1HWm/p1VOxIWpa d+SISMtZEeFax5JToBrg1bVbRZc+GuaAmIx/ryusgwDFMbvttLevA85C8AOI9nBBe87WXR 51lLdoZjpTFrmUYUQ6k5ZDiFIGvtAvauzXQmXP4j6WNu6DmN7ma8hgTduzwdiQyt2Wmbds gw4sgdBsHZ77ENyqzGB6BJ0PuOL/zmCRGGcJd1ZM8LGCK+TysZqlt5NGSBPRDBnPSogTjE 8QKFMWOknPO2Ob9TWNhN9bnRCLCeKoIdlmuF2AY/OC48v2aZbrr7yMVQF6XSVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24xoVvWJQGPvvLwiFDtlZiaUs/yQnkoSinMg5P0b1lE=; b=f2VTHZVBulNFtRS3GzcIz4P0TzYW5h0CpCCtC8q3u6DOmWzUPdBGRIdhPN0+FTT9TYNled pp1+Ux+NFOeAZPQ/yxmnk/BJLHyeWcG0cHkKWL258ew+lMkZ3PiecsqiDgasnOINaKS8/4 9qOd1Dl02DWXRsReUi5lSdcWQYu33FfyYe2GPB9vxHJClzgc8dpAue7nvg1E4cR61GyiCp tMURpGAl1Ug5rD17duQM6j+NzWsz5XhGPcJf66TrHBMAn4pqCK5VyuRbIobnUdvhMfLe0o HeV4dNuB86bUGpqh/FeSNyBQ7UoyLkSdcJ+zU/RvgGTc0fFcRembDNN+uTE6zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730655757; a=rsa-sha256; cv=none; b=jIo9mBqoZQUsc0KBjOL5iQKbdEb491jvSh3cG9ntsPzgQuqXsi1HxXyfNa5NDS1KbrKryy 8qRuMn3goye4pIFYnmXFQE8ptLn2j4QoieevQKel+FuDQ05+ujusg3lcamtGQP35fx4ITS ZY9H+7l7DE09cxA69bT8Dk9IB+e0Q8UiVc/LIObeGSBOx9J6/wwB+vw1l2kWyHdKA8bnIh Fny4OQs6TJ5iAnvkOXeVXihF/TbWJbzAR86zIHL0CpadzyFRGUuAXqhBus6nC6Fh0k4RbG CSHjPm40+BPpeoPnd1yP5Cq/umDfB1aboEOyF1r5KvLGZyUv/d+h2pEiDmiEfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhMPT0jPbzysr; Sun, 3 Nov 2024 17:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3HgbRn003196; Sun, 3 Nov 2024 17:42:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3HgaTn003193; Sun, 3 Nov 2024 17:42:36 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:42:36 GMT Message-Id: <202411031742.4A3HgaTn003193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1c9f1cb4f0a7 - stable/14 - vt: Fix frequency calcuation for bell List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c9f1cb4f0a71bef37796a8ba139b86cc716ee88 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c9f1cb4f0a71bef37796a8ba139b86cc716ee88 commit 1c9f1cb4f0a71bef37796a8ba139b86cc716ee88 Author: Warner Losh AuthorDate: 2021-11-03 21:55:55 +0000 Commit: Ed Maste CommitDate: 2024-11-03 16:57:19 +0000 vt: Fix frequency calcuation for bell 386BSD provided a MD function sysbeep. This took two arguments (pitch and period). Pitch was jammed into the PIT's divisor directly (which means the argument was expected to sound a tone at '1193182 / pitch' Hz). FreeBSD inherited this interface. In commit e46598588587 (svn 177642, Mar 26 2008), phk changed this function to take a tone to sound in hz. He converted all in-tree instances of 1193182 / hz to just hz (and kept the few misguided folks that passed hz directly unchanged -- this was part of what motivated the change). He converted the places where we pre-computed the 8254 divisor from being pitch to 1193182 / pitch (since that converts the divisor to the frequency and the interfaces that were exposed to userland exposed it in these units in places, continuing the tradition inherited from SCO System V/386 Unix in spots). In 2009, Ed Shouten was contracted by the FreeBSD Foundation to write / finish newcons. This work was done in perforce and was imported into subversion in user/ed/newcons in revision 199072 (https://svnweb.freebsd.org/base?view=revision&revision=199072) which was later imported into FreeBSD by ray@ (Aleksandr Rybalko). From that earliest import into svn import to this date, we ring the bell with: sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); where VT_BELLPITCH was defined to be 800. This results in a bell frequency of 1491Hz, more or less today. This is similar to the frequency that syscons and pcvt used (1493Hz and 1500Hz respectively). This in turn was inherited from 386BSD, it seems, which used the hard coded value 0x31b which is 795 -> 1500Hz. This '800' was intended to be the bell tone (eg 800Hz) and this interface was one that wasn't converted. The most common terminal prior to the rise of PCs was the VT100, which had an approximately 800Hz bell. Ed Shouten has confirmed that the original intent was 800Hz and changing this was overlooked after the change to -current was made. This restors that original intent and makes the bell less obnoxious in the process. Reviewed by: des, adrian Differential Revision: https://reviews.freebsd.org/D32594 Sponsored by: Netflix (cherry picked from commit ba48d52ca6c867559156dd916631f9ac47abe80f) This change was accidentally reverted in 80f21bb039ce. (cherry picked from commit 2416be588ea113cc06b924ed85861ed3bc391fe0) --- sys/dev/vt/vt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index e27f74b03a0f..f3cc4e29cf07 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -120,7 +120,7 @@ static const struct terminal_class vt_termclass = { /* Bell pitch/duration. */ #define VT_BELLDURATION (SBT_1S / 20) -#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ +#define VT_BELLPITCH 800 #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) From nobody Sun Nov 3 17:45:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhMSR4MtBz5cWk2; Sun, 03 Nov 2024 17:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhMSR3cjCz4hWV; Sun, 3 Nov 2024 17:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kwxcj4bv3rQKo3QGqDojbr2fbHxw495unetIv5jS1Qs=; b=U4ApVTQpejfy4U+ETUUF24zrsga3UwkfJq/54s/wAjZGQYcDB2y9dKqvOC0W1zX9UJtwbT WU6t7FUxKx6+KmabnWmFy3w2ztdYuafUEx96FeAe9YSS7NzBgU7xTObFcomncWRlal39jb 24IejlSY2Rx7q0QtwTsBIbhLVDoOTc2klvkuPf7jhVDarz/xVLxgUujJ1q3lHWYBQ33cLu 7E1728O4qHnUTzgi2ioXhUAfOU9omp80+SrJbEOS3jD1vZnkz+ajTwqvXTUvaJy8szcSph vZJIlvdJ6UjMoAEgfS1ACa7Eic3zMNHjhwLGQ6sw5mc9T9ZAarBaOfiHanTQjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kwxcj4bv3rQKo3QGqDojbr2fbHxw495unetIv5jS1Qs=; b=P18g2MoxhyqVC1zrnimYMS1EAAvimJNL40x0uJalc6OKJ4TZsiIheFXbVN7XX/39GJ5Ic9 KQv01iYFq4/3Sopx/vfLn7xxp8uhpKN8HCHXOHZVpZeWB0gRDbmVTUz/wJWGpEC1lVJ9WQ eK7tUCf8epfK/cnCtnH02PZbhcS18i+vl0R1c6ghiR6k7teoHVL6MTbdpR9m4LSbHY14rG 37wqua7SrizOiHQ6uOnxndl+lMq+tD/NLQbZnZUTxJ/NQUFzvS4jYZgUMvDbD9no2Rdqzs UHxXv5pibkMbly0Rmjbd33XWb4wdcmagKNxzzCutZIlmQPFb8qOuyFcmp69ALQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730655911; a=rsa-sha256; cv=none; b=ZWyQjMJ8jOLQVhRS5Y2CnX5TeSnXF5byx5v+czMJsgQrUciUvFT75GonpQ5wgJANAIjUPY uRKEato1MprwAXupLB7eFPOHlbDslk/TY1gsGT78crHbllNuFEn0TnGuWDwF9QszVOHhx1 gjqjM/iDL4Nxjw4WizzO9kkwvnBKhDOOcl/+7QF8NRJ9y5X5I8mD6Zg1q5oWiVKoOkyBLU t+4j201rSg7ekxm9hVOJkCMYsnFD9jNu7+tfRdcnuk0VeRpIBMXhBsI/e/mQgfK1XkhX/g rLkzh424jRLyiPiWqRwIz5723SnDGOxOel+2BTIsUKwx8C0afaeI7wVQYFPc1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhMSR35cPzyss; Sun, 3 Nov 2024 17:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3HjBET004107; Sun, 3 Nov 2024 17:45:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3HjBLu004104; Sun, 3 Nov 2024 17:45:11 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:45:11 GMT Message-Id: <202411031745.4A3HjBLu004104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 761088364c96 - stable/13 - kbdcontrol: correct bell frequency for vt(4) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 761088364c96ba9af8e6417336c677f98f90b2b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=761088364c96ba9af8e6417336c677f98f90b2b1 commit 761088364c96ba9af8e6417336c677f98f90b2b1 Author: Ed Maste AuthorDate: 2024-09-26 23:55:33 +0000 Commit: Ed Maste CommitDate: 2024-11-03 17:44:49 +0000 kbdcontrol: correct bell frequency for vt(4) Do the `1193182 / pitch` hack only for sc(4). PR: 281713 Reported by: Rudolf Polzer Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46803 (cherry picked from commit f65c19a242de322930f6a1cd7d5e6bf3ce19ce42) (cherry picked from commit 2234362780854c426395a35403ed3dce42ccacc9) --- usr.sbin/kbdcontrol/kbdcontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index b08705481a5d..2d2110ef5c9c 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -1037,8 +1037,10 @@ badopt: warnx("argument to -b must be duration.pitch or [quiet.]visual|normal|off"); return; } - if (pitch != 0) - pitch = 1193182 / pitch; /* in Hz */ + if (!is_vt4()) { + if (pitch != 0) + pitch = 1193182 / pitch; /* in Hz */ + } duration /= 10; /* in 10 m sec */ } From nobody Sun Nov 3 17:45:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhMSS4d8Gz5cWdC; Sun, 03 Nov 2024 17:45: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhMSS3z6lz4hgR; Sun, 3 Nov 2024 17:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x6Q0GuBMlmOLQ4DqBJas2wyDuy7cqzB3qwZDyzmm+Og=; b=NOxqRXJ4YBXH5e2sNU0gMXU4PRQzZiqotX8aMS/fB/Q7QWF14U/swFzKqrO0C2iIJn4v5I PDL7v+RSJKPOGIrliUUuQFOK9mMrJ9iFRYCyR07Zng/2ciAw66U2I0NflTKEfSgI8Ap/jS S7FD7WQQNiPHG1gDWMMXJwTORzdjwVvDHHKbwIDryScwuSxLWfTSa69S4adzT0bFgWXnVK QizSiv+9982zxEFpmmru3sViZYZHDokBspwRa3BxnNi9W/M+hRNvq5l1fRM1g282IZ8l/q 7HpPrZnGHHCtq/80rPrE7aFa2CvLhtz7rQ0Vp/cRGWi2mOAZAw/7E4sit2u61g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730655912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x6Q0GuBMlmOLQ4DqBJas2wyDuy7cqzB3qwZDyzmm+Og=; b=ONWfkGJozY8lJGgCo69FHr1U85vd/aHq/Uqha+Ife+WfpY00KIyuHv2/DVS3WcyjTmqTPZ 9Rw4X4a6Nh/LZdNt+UUvKVVjE3WSK7i3Nk0/JfRzYbF4OudgJiEwM2OML2N1ROZr3wIvoh ijmgw7w8/gaY80hNwJQaLfFDczdxZ4uGP+WvV2mwqxTaM7PFcv8HF0+nItM3Dg6A3vIELT tp+otX2U/Nhp5PwiOGMNM+Tf1hmteBPCGRNXe1GiFk5YBD8bkLdwL47HtmMJ/jizJoy69J sCIVJb4lhqsEQlS+jEH/BtQBjkImDKq51N1TOjvhZX91NgW16jLdQxxzszdq7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730655912; a=rsa-sha256; cv=none; b=h94z5Xhp7zfL6ERY5nyLnn8VD3pw/0ltnyA91xBPaNzfbatlXYDf+nHwD6YCYOPf3/GHv8 4JB7Mo1t0KBAiD+icATPdG2/R2pPcqBtK9Dfo7s2ICS5vQcfXtiq5Jo+CBWIUrb4CL2ZkX Bm6P+smdQTc8px3Z1s0E3gw4P8VKkx89d1T6GGhxxGdG8aUVb1aBzPIJ5ColEYjzV+54lN diuCSi5UkjqtOMKv5XObEQ5bMs3tWmNZ27g9pzg+Crz4nngrn2vMn983PAoui9YCjBJFGO k8fDB9LBttWwO0Jai0lz9873poQRKcQQ1wGKFlvVTM/Ao151hoUgKKoqClQPDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhMSS3ZLhzyst; Sun, 3 Nov 2024 17:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3HjCQW004152; Sun, 3 Nov 2024 17:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3HjC4S004149; Sun, 3 Nov 2024 17:45:12 GMT (envelope-from git) Date: Sun, 3 Nov 2024 17:45:12 GMT Message-Id: <202411031745.4A3HjC4S004149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: da797702b0fd - stable/13 - vt: Fix frequency calcuation for bell List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da797702b0fdd255efc4a87934e0b9df5d2b07ed Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=da797702b0fdd255efc4a87934e0b9df5d2b07ed commit da797702b0fdd255efc4a87934e0b9df5d2b07ed Author: Warner Losh AuthorDate: 2021-11-03 21:55:55 +0000 Commit: Ed Maste CommitDate: 2024-11-03 17:44:50 +0000 vt: Fix frequency calcuation for bell 386BSD provided a MD function sysbeep. This took two arguments (pitch and period). Pitch was jammed into the PIT's divisor directly (which means the argument was expected to sound a tone at '1193182 / pitch' Hz). FreeBSD inherited this interface. In commit e46598588587 (svn 177642, Mar 26 2008), phk changed this function to take a tone to sound in hz. He converted all in-tree instances of 1193182 / hz to just hz (and kept the few misguided folks that passed hz directly unchanged -- this was part of what motivated the change). He converted the places where we pre-computed the 8254 divisor from being pitch to 1193182 / pitch (since that converts the divisor to the frequency and the interfaces that were exposed to userland exposed it in these units in places, continuing the tradition inherited from SCO System V/386 Unix in spots). In 2009, Ed Shouten was contracted by the FreeBSD Foundation to write / finish newcons. This work was done in perforce and was imported into subversion in user/ed/newcons in revision 199072 (https://svnweb.freebsd.org/base?view=revision&revision=199072) which was later imported into FreeBSD by ray@ (Aleksandr Rybalko). From that earliest import into svn import to this date, we ring the bell with: sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); where VT_BELLPITCH was defined to be 800. This results in a bell frequency of 1491Hz, more or less today. This is similar to the frequency that syscons and pcvt used (1493Hz and 1500Hz respectively). This in turn was inherited from 386BSD, it seems, which used the hard coded value 0x31b which is 795 -> 1500Hz. This '800' was intended to be the bell tone (eg 800Hz) and this interface was one that wasn't converted. The most common terminal prior to the rise of PCs was the VT100, which had an approximately 800Hz bell. Ed Shouten has confirmed that the original intent was 800Hz and changing this was overlooked after the change to -current was made. This restors that original intent and makes the bell less obnoxious in the process. Reviewed by: des, adrian Differential Revision: https://reviews.freebsd.org/D32594 Sponsored by: Netflix (cherry picked from commit ba48d52ca6c867559156dd916631f9ac47abe80f) This change was accidentally reverted in 80f21bb039ce. (cherry picked from commit 2416be588ea113cc06b924ed85861ed3bc391fe0) (cherry picked from commit 1c9f1cb4f0a71bef37796a8ba139b86cc716ee88) --- sys/dev/vt/vt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index b27628d17732..80d9ae1f22c2 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -119,7 +119,7 @@ static const struct terminal_class vt_termclass = { /* Bell pitch/duration. */ #define VT_BELLDURATION (SBT_1S / 20) -#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ +#define VT_BELLPITCH 800 #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) From nobody Sun Nov 3 18:16:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhN8g2ZWHz5cZ31; Sun, 03 Nov 2024 18:16:35 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhN8g0hHzz4ltn; Sun, 3 Nov 2024 18:16:35 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730657795; 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=0Cs2vp7GzsLFj0fS+DJi2/xU9H7w9dPZ2pReW0073qE=; b=iwAoPVbOHoDMK4o2xBWnB6Jt5E4HBSC4JolBKOdlxYKzz/l0fDfauAehLM7hSfhCFjEdzn udNt34E3M87RzDP3xz4rbKdSTBclySqpvaNexnDhIps0ejenaYQM1Lq+DREVTBiWt3yEGe jN7kVRqkIE89MLw4UI2yK1ySfecgq3/z7fbfKlo6Xb1ZKhMKOVwLJCXs+BYnQNYadjbVlX Rou+rpXMD2RqZj6rLHnnY4jPHuOF2ClMt9TQBBnsqAtpZpPADZLvOzh6hbGiiz9gfYRD/N F2dqUSQSvoQk40+SRXvEt6J8S7K/1VpN0M6/hewhxs2+JRlB51yw818pGNERlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730657795; 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=0Cs2vp7GzsLFj0fS+DJi2/xU9H7w9dPZ2pReW0073qE=; b=gNdExL9o4ZQjNz/LtVmNlebYKVFlt3uw1+uZR40tU/bcun6yLF3lna300eg2UiudSIDy3G PUGJYfRdfh7JOzZuWbAGqmpslCy6RhDXuK9ssP4aJ9rroQE3wN1A0XtVh8mUrx1v2jp0Cn 3ckundBCC2y/FwKXPwxIRAJ33cggMQ9fBJid5M970COM5pTxlhwydRCjjIBPsFn3kIeReL Z3eeSSCRHorrGEBrzuUTEiRys8fjUiKwhd0BMbWTNQE83rjtfL6CZOfWuG3+JJsJImlFCn SXntNOgGt26uzGOz+YLqZMkFCaUBUjvAIXlo9YKAKIjdceIGmmF7vqs4qXMYlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730657795; a=rsa-sha256; cv=none; b=FcdoobIlaycBzid1f3SDSZyiUss2zWH9jjNUEjRq7BooizQ6rZR6iAwV+015PSooInMRRi utnlmd9Cx0Ra8udZXAfPWzw6nDuvq6BpuNXIvLdkNbP3STMf3NlnUZPC9fE+raZPPD6vqh Ch8kzXutUEAC7qnU55ZI0q2gaWvoxZuQuDNi8mPMu4B24V6ruWMQem649eejpI7lKUeq+r 7/sRfJ7Ykmb1QVpvXQ5E1J1ciw137kqb920Q3hQ6sGX79knquKfISD2UM2ZbVazmhzKmUv gDZT/7aY/q/FVpnnaRBsTKHn1oEGIl7N7zc6d1kuTjZiNvdF7nFpZgpnZ5+jgA== Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XhN8f3gKgz1NsJ; Sun, 3 Nov 2024 18:16:34 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups Date: Sun, 03 Nov 2024 19:16:27 +0100 Message-ID: <2094473.mIT35NG9lc@ravel> In-Reply-To: <20241103171056.E8299280@slippy.cwsent.com> References: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> <20241103171056.E8299280@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1863566.1AojA6SiXe"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart1863566.1AojA6SiXe Content-Type: multipart/mixed; boundary="nextPart17542189.7ycxSsYEdt"; protected-headers="v1" Content-Transfer-Encoding: 7Bit From: Olivier Certner To: Cy Schubert Date: Sun, 03 Nov 2024 19:16:27 +0100 Message-ID: <2094473.mIT35NG9lc@ravel> In-Reply-To: <20241103171056.E8299280@slippy.cwsent.com> MIME-Version: 1.0 This is a multi-part message in MIME format. --nextPart17542189.7ycxSsYEdt Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" > I'm getting a different panic this time. Sigh... I see why, and it seems straightforward to fix. Could you please try the attached patch? It is also available at: https://people.freebsd.org/~olce/0001-cred-crsetgroups-Throw-away-old-groups-before-crexte.patch . Hopefully, this was the last problem to solve. All patches in the series, except the "nfs, rpc: *" one, have been tested and actually used on my machines for weeks. I however don't use NFS on a daily basis, and it is now pretty clear that I have a big problem in my NFS testing setup, or messed up the related tests (am still not sure). If you can't test this patch or if you still have a problem after this one, then I'll just revert the series pending my re-testing in a correctly setup NFS environment. Sorry to have dragged you in this debugging session, and thanks for your efforts and feedback. -- Olivier Certner --nextPart17542189.7ycxSsYEdt Content-Disposition: attachment; filename="0001-cred-crsetgroups-Throw-away-old-groups-before-crexte.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-cred-crsetgroups-Throw-away-old-groups-before-crexte.patch" >From 02bd66dd2b7b9143b0801d232c52aa23df23136b Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Sun, 3 Nov 2024 19:04:02 +0100 Subject: [PATCH] cred: crsetgroups(): Throw away old groups before crextend() Now that crextend() asserts that groups are not set (rightfully so, since it may change the backing storage without copying the content of the old one), have crsetgroups() throw away the old groups before calling it, as it will set the groups to an entirely new set anyway. This allows to reuse not shared credentials by resetting the group sets on them, which is necessary for certain kind of NFS exports. Fixes: ea26c0e79752 ("cred: crextend(): Harden, simplify") --- sys/kern/kern_prot.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index b522edbf4e69..fb5e973b812f 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2215,20 +2215,18 @@ crfree_final(struct ucred *cr) */ void crcopy(struct ucred *dest, struct ucred *src) { + /* + * Ideally, 'cr_ngroups' should be moved out of 'struct ucred''s bcopied + * area, but this would break the ABI, so is deferred until there is + * a compelling need to change the ABI. + */ bcopy(&src->cr_startcopy, &dest->cr_startcopy, (unsigned)((caddr_t)&src->cr_endcopy - (caddr_t)&src->cr_startcopy)); - /* - * Avoids an assertion in crsetgroups() -> crextend(). Ideally, - * 'cr_ngroups' should be moved out of 'struct ucred''s bcopied area, - * but this would break the ABI, so is deferred until there is a real - * need to change the ABI. - */ - dest->cr_ngroups = 0; dest->cr_flags = src->cr_flags; crsetgroups(dest, src->cr_ngroups, src->cr_groups); uihold(dest->cr_uidinfo); uihold(dest->cr_ruidinfo); prison_hold(dest->cr_prison); @@ -2473,10 +2471,17 @@ void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) { if (ngrp > ngroups_max + 1) ngrp = ngroups_max + 1; + /* + * crextend() expects that groups are not set, as it may allocate a new + * backing storage without copying the content of the old one. Since we + * are going to set them to a completely new list below, signal that we + * have thrown away the old ones. + */ + cr->cr_ngroups = 0; crextend(cr, ngrp); crsetgroups_internal(cr, ngrp, groups); groups_normalize(&cr->cr_ngroups, cr->cr_groups); } --nextPart17542189.7ycxSsYEdt-- --nextPart1863566.1AojA6SiXe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmcnvfsACgkQjKEwQJce JicDTxAAgF7lvjTNdtDLxyWuwzWJd1L6Xii6eT+iS7+fAkxJGwdkTZY8rPhFLRim 1NNXJ0K4ksfDAAB7CSFmFIwFt4UngLckhdGOGDAtvKmx1skF+vd/Fqe70IaUN2jj Cz788wjhISPmJoY9dxHdfEwVzrxZwe9TZJmoqDkxV3C2fLs0B7ssOFpx8AJTh9EL 5EkNORo91XjZrH64MxvKcsrxzQrBqOYRwPG3pdQEJ8R5WF1Rw1tfkov9a8ndmPfA Epxi4bHetinb2EWVmKLl0S+lh0mmMk1WXWs/Cvf8AlYJzYc8LWDoq3a0G0SDGHQ2 KGq6diWtciu4NukwzOO8SIYZ6zqoaoLtDrrzQxOdX4IO83OBel0JSpiXFJGzNJw9 lKxMEHbBatWamwUqzSdU/+OUSQr8n2OgrT2Z3aJ/gsqEn4pNrli9O59DNP3j7sy2 ovMTTMgjIw/uAMQDi28Aw9nWXxIFyt8c6VACc2V/m0O7L/cz+Q6S2qBEcVn9vwVr bwEG1x6TZSNSIuwAUprlf2Dl6jKwgXbvXfRq4bLJoG8dU1NRPvYJDxG4TbJa/5N0 /y98u4R41vKzMYWcDQMdB0Pzu1VMNsOQDKBMVXhmBwjjpYfGER2TZ0tVYNy7OGYV PkEtSNvvMv+LSwqRwX7J35nd8xZ9071OF/YoUJ+9rkvqepbvWX0= =fN4W -----END PGP SIGNATURE----- --nextPart1863566.1AojA6SiXe-- From nobody Sun Nov 3 18:37:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhNd61ryxz5cbLP; Sun, 03 Nov 2024 18:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhNd61DxXz4p3R; Sun, 3 Nov 2024 18:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730659066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t+CNwZGK1UjlC0LfOqN05aNmIi+qPhXcN4BDli0LDZg=; b=L096KZTbGnhNUiOPMAn6J7Wd0F0rTS5OAj0OioyGPTA+V3THTx9RTyfl4QIiZZmfakY0HS wCksD+/TsIFuT8delDROWaMZ9cYkJAe2gPavY0J5EgK3/lVaGD/eXgPikim/fHwTGn8CHt U1+AUf2LGEJMMovNYeTiK/mmtZY+N+LGIOVVuwNP8aIAnlci4AOaG8DAg58C+NSKEcRjFn 9l6u/y4XOUHyNwOmHEaqAP3GFwRzuya2ZaSG5mnwvKhinClnrpoov/lCXCuy36un3C63g8 ZmnUwmyTOjAusm08f/OKhd4hL0yiq82Rpcjhi+4KkcmdFqRrZwiwaWEmlxHOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730659066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t+CNwZGK1UjlC0LfOqN05aNmIi+qPhXcN4BDli0LDZg=; b=CNuZ99KYeulBuNiqjttniDfQ0GWYdqzDn7kXmezndb9I6wdBrggx/X5vZZ2Y6pKety/hzr psjXLcmdOJuE8CCma3txHP51WpOW6R1FRolY6+e6NX7VkmrHIBFqRoZLiZGc4lhO72kgUM 2HR5irmQgorfCUC1aS3i5Y1j5llcQ7l8kvNUfq7ALri/ReqX9mPJKOBdRvvM8Im+8jV232 5tUNk4BgpgIbh+yMc11A9BaObIkh3glM2E97X6FfqRYELgiPGUli6Kn/83n1cYhjTJ3QFf kTR0etZhis9p4d9ArvlAnBxePqqUSTIHJhvBsLjWT3izRISKwxIjJov5JyuVhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730659066; a=rsa-sha256; cv=none; b=WK3nEFFtOn+qO/lpais4bjnWt88jmtLQ93++9u/zBrLMRYigJkONHOvSNcpGAbfJbwU8iZ DMr+dh6dj9z5JC0SrYFCEcTHceJe0D9le3zUaysiQqmp0l7kaEnG/RIeJdkYW4hFqR6mB8 rgmDzFzx3jtYDJmOSvNnr1TdJXdl0CkKsQnsr8gCnKypZ9DdjqbWaR6lR1QUxBo7PmiXvN nMmtf0xwYludxVPU61LOcyzQy9GHwlVBMkA7uepaxzkDfQxYuVBOXwceVBYahbvrVH+ZhZ JG4kFRKTKdfjDiBBPFxH/nR9/ZQ7ViMOM+r0FQgCMP1DX4kPCHi0hxCD/yg66A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhNd60kzBz10yS; Sun, 3 Nov 2024 18:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3IbjNg097463; Sun, 3 Nov 2024 18:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Ibjge097460; Sun, 3 Nov 2024 18:37:45 GMT (envelope-from git) Date: Sun, 3 Nov 2024 18:37:45 GMT Message-Id: <202411031837.4A3Ibjge097460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ba10bfe509dc - main - libbsm: honour AU_OFLAG_NORESOLVE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba10bfe509dcb5d408de89c886527035068b8f17 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ba10bfe509dcb5d408de89c886527035068b8f17 commit ba10bfe509dcb5d408de89c886527035068b8f17 Author: Ed Maste AuthorDate: 2024-10-23 12:25:29 +0000 Commit: Ed Maste CommitDate: 2024-11-03 18:37:24 +0000 libbsm: honour AU_OFLAG_NORESOLVE AU_OFLAG_NORESOLVE is documented as "Leave user and group IDs in their numeric form" but it was not actually tested. OpenBSM pull request at https://github.com/openbsm/openbsm/pull/85 PR: 282271 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47263 --- contrib/openbsm/libbsm/bsm_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/openbsm/libbsm/bsm_io.c b/contrib/openbsm/libbsm/bsm_io.c index 4b89ccb8b59c..f0b3e4a1a2df 100644 --- a/contrib/openbsm/libbsm/bsm_io.c +++ b/contrib/openbsm/libbsm/bsm_io.c @@ -644,7 +644,7 @@ print_user(FILE *fp, u_int32_t usr, int oflags) { struct passwd *pwent; - if (oflags & AU_OFLAG_RAW) + if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE)) fprintf(fp, "%d", usr); else { pwent = getpwuid(usr); @@ -663,7 +663,7 @@ print_group(FILE *fp, u_int32_t grp, int oflags) { struct group *grpent; - if (oflags & AU_OFLAG_RAW) + if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE)) fprintf(fp, "%d", grp); else { grpent = getgrgid(grp); From nobody Sun Nov 3 19:04:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCW1N7kz5cd6S; Sun, 03 Nov 2024 19:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCW0h6yz4rgM; Sun, 3 Nov 2024 19:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WdJcgjHOdg/2z2FYm5AuTckO8pe4/BSGmWizY42QSNE=; b=QGun1Gmh1/AR1gKyG2ZITq39/Mb/PP9NRtpTJTRTp6zkT5Ql00HLQimiZ5zSEYkLcelDPX NcWi3IA1bR7TovHjB/Ccix7DMCLNJ12PqJPA1PN8fmCCRbp0oa9cx/q89/m2w10AXhsESv 9g3lfinkFlp5Zki+hMbkiJtlIgBbO+7P4AUmul2/vgZbpFkd2vxKR5q7e4Fuz9x2N+f27N CgC84eH/YL2c69V5AYpSCzpBWTHOtho+Y5agYw6IWM+RnwWpRuazg04ZVr0DXs8atL4y/F Is9ilhwwEv6GLpwr6OoMuZeOAUlgeH03Dshph8fLMKsU0UeKncgfrqPyQJ1nXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WdJcgjHOdg/2z2FYm5AuTckO8pe4/BSGmWizY42QSNE=; b=QtX42ckWNgee94oIXKFw9NcIbQEuHYhBsa4zuQYdbdbNf3AGKVY/euv1hWoX75vLI3gsdE A6fAfMHZwLq1kqhvhjjDfh4S2J0eD7rA9dayUw0SfRPtEmSvapLwIWnR8O9Djrboxc+Qmd rPRaMC0IFpxls1q2nXhxuLKgGO6imbV1Sbj6cvGgk3pFfd2EEidkWlpFBk6vUA/GOelNxA NCR1FMOewPiQkClxRSIUiak9wCpAraeJ4zjq1CacBve7BeUdd4QouELvG94zJ76IDYBVPm nwHrx2plFcjjLGL5VIGLIiEhSZgLkY1xbhPxx8guIM/PqXKX87g37go9bQnGWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660647; a=rsa-sha256; cv=none; b=qsNsoTavbuJYdQ1k3qH9mSvtnT4WZp9fG+UtPriUvhntLzDofhAMbXvurrMlEZycGH3E3g hBG51uG11QmdLxi/LAaR1KcnxUoJzWyOtg7oXPbV0ngu+vAABbxA3G31ZW3HQs7W0coDub AWPU+Ql6WjlCe/1aNDLi1vY9CysitLpDnW8f2GzyTELpNiNz0zIyRDn/4MVKctbhoOGGPQ 32lbaI3sju0WC7J5l4tfPMEKjotnvLaRut6eVLUWt6PLR2NHsBRN1e6R4DXfaFi7j8TPoK 1vBWFON6sLg5Pn0J7MXo6dJqGVCJu2k3MIqe8puTtcN0xyN5AeiL1HxtU6CJVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCW0HQKz121X; Sun, 3 Nov 2024 19:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J469M052721; Sun, 3 Nov 2024 19:04:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J46D3052718; Sun, 3 Nov 2024 19:04:06 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:06 GMT Message-Id: <202411031904.4A3J46D3052718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 98cd27c8e134 - main - sound: Retire pcm_veto_load List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 98cd27c8e13418fa517a02844641f390f9389987 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=98cd27c8e13418fa517a02844641f390f9389987 commit 98cd27c8e13418fa517a02844641f390f9389987 Author: Christos Margiolis AuthorDate: 2024-11-03 19:02:17 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:02:17 +0000 sound: Retire pcm_veto_load pcm_veto_load is used to prevent pcm_register() from running if the root feeder has not been registered yet. However, feeder_register_root() is a SYSINIT. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D47280 --- sys/dev/sound/pcm/feeder.c | 7 ++++--- sys/dev/sound/pcm/sound.c | 8 -------- sys/dev/sound/pcm/sound.h | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 2b9599859102..6a6d8c80a34a 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -68,9 +68,6 @@ feeder_register_root(void *p) fte->idx = feedercnt; SLIST_INSERT_HEAD(&feedertab, fte, link); feedercnt++; - - /* we've got our root feeder so don't veto pcm loading anymore */ - pcm_veto_load = 0; } void @@ -465,6 +462,10 @@ static struct feeder_class feeder_root_class = { .desc = NULL, .data = NULL, }; +/* + * Register the root feeder first so that pcm_addchan() and subsequent + * functions can use it. + */ SYSINIT(feeder_root, SI_SUB_DRIVERS, SI_ORDER_FIRST, feeder_register_root, &feeder_root_class); SYSUNINIT(feeder_root, SI_SUB_DRIVERS, SI_ORDER_FIRST, feeder_unregisterall, NULL); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index e25cb359f793..948cbd0b8fb9 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -48,8 +48,6 @@ devclass_t pcm_devclass; -int pcm_veto_load = 1; - int snd_unit = -1; static int snd_unit_auto = -1; @@ -462,12 +460,6 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) struct snddev_info *d; int i; - if (pcm_veto_load) { - device_printf(dev, "disabled due to an error while initialising: %d\n", pcm_veto_load); - - return EINVAL; - } - d = device_get_softc(dev); d->dev = dev; d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 126b3411b035..c5013e76034a 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -229,7 +229,6 @@ enum { #define DSP_DEFAULT_SPEED 8000 -extern int pcm_veto_load; extern int snd_unit; extern int snd_verbose; extern devclass_t pcm_devclass; From nobody Sun Nov 3 19:04:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCX2fJ3z5ccyL; Sun, 03 Nov 2024 19:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCX203Lz4rm6; Sun, 3 Nov 2024 19:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9ocgrV0N/CX1a+ftbzUzbiwjZ0Rke6oocqbAyGczNI=; b=J8Nki/rGtrj1nGROS6e/k/eKRqYEWTLuTokpoV/FAGhHCmcv8hMFdh6mFZTY9U8qMzUhnw UO5HPPqlLzwBFpEo3dqKc5SUVOoJgC/XwlYkNFRG/sBXw3tmdMw3Q7OS6IT5/5IlWRUJko ZdS3j2kwepJ8au0OsGDWpikvlYBJsnRX+eRpFWrPDvzz8IJbtSjQJOWN6PVvJbFE7PMQLS LcvXT0Uh8nU/fo0qaTnxQ0wuvFORaj/Kla1bFnX9RUyGpIc6O1ePkCUa5iEw5ybWo0m8lk /od2rCSNovPphXTsCJkNOn7IrZQAUyXeU+3z2jo5hoOfA49vgVxOK4HozapxwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9ocgrV0N/CX1a+ftbzUzbiwjZ0Rke6oocqbAyGczNI=; b=ZTxgkvp+42OZ8MvU0qt/D1fKKrrqoYs3KmLHwxoKil3NHTgAPT1Sogq5oj9/NTQOJ1K14g l00VRPd6K1IJNYc8/z+k/lRfg7TKmcknXLRMqe4z1sVtEB06m7tvJtYpdcYLR4eEAgmAKY xAHni37pxBmz0RI2+Vx5kOhQta+WWhktrGS5ItcwyJPsCdy8v5aYCcveenfc2zwHAYG+xC 4aoh76qs1DZc3n+Vwd1Yx4lPltDE9qpZvOi5JuGNapDQ9yjuD8aCiWQqFtFziMYnFirBP2 sZjIKanHzGRCNdMHxS9VKTv2ynGe0zukizj4a4G5pdwW1KG5tz7JbLyUZ/CafQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660648; a=rsa-sha256; cv=none; b=dB5Bf42Tcf3sG2pgGs9XS4g3ZOo/IAlZY+EfgiabzKK1mjQC03MWtuv/SKE4/N8hpFwvy6 jnIa5t1NTYfP+/yKR8R+uBgKI9zO0Jx0Vj6lFECApI2UWoSRsIEPcPzZmH+B+ahydCAp+c pMVBbxmn1A3UlJ407UeLuQ7rIK16Eh3tdUASlB9E1GZbX4iZ4phGiVTognwlqrnJrJ/n6V wZeTIrhnXC6wS3x4w0ZFahl49Xq4nddDUbVj4At8cVc1ejALhwtVocsGxd9mdPUd7qi35B w25T6XjjG2ESltrwhPYq8Edl2WTsaWq3esBVTTjQ1X19i3HORNPg1H8Ipn+cyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCX1J23z11cQ; Sun, 3 Nov 2024 19:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J48r4052772; Sun, 3 Nov 2024 19:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J48Kn052769; Sun, 3 Nov 2024 19:04:08 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:08 GMT Message-Id: <202411031904.4A3J48Kn052769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 66f3eb14e955 - main - sound: Move sysctl and /dev/dspX creation to pcm_setstatus() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 66f3eb14e955d3917f817ff346d33d839679c2cf Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=66f3eb14e955d3917f817ff346d33d839679c2cf commit 66f3eb14e955d3917f817ff346d33d839679c2cf Author: Christos Margiolis AuthorDate: 2024-11-03 19:02:31 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:02:31 +0000 sound: Move sysctl and /dev/dspX creation to pcm_setstatus() Create the sysctl and /dev/dsp* nodes in pcm_setstatus(), which is responsible for finalizing the device initialization, instead of doing this in the middle of the initialization. For the sysctl creation specifically, move them into pcm_sysinit(), since this is where we create the rest of the sysctl nodes anyway. A side effect of this change is, that we avoid the possibility of racing in between pcm_register() and pcm_setstatus() by accessing /dev/dspX or the sysctls within that window. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D47322 --- sys/dev/sound/pcm/sound.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 948cbd0b8fb9..5ca38ca622c9 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -316,7 +316,7 @@ pcm_setstatus(device_t dev, char *str) else if (snd_unit_auto == 1) snd_unit = pcm_best_unit(snd_unit); - return (0); + return (dsp_make_dev(dev)); } uint32_t @@ -433,6 +433,15 @@ pcm_sysinit(device_t dev) mode = pcm_mode_init(d); + sysctl_ctx_init(&d->play_sysctl_ctx); + d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "play", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "playback channels node"); + sysctl_ctx_init(&d->rec_sysctl_ctx); + d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node"); + /* XXX: a user should be able to set this with a control tool, the sysadmin then needs min+max sysctls for this */ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -497,21 +506,12 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) if ((numplay == 0 || numrec == 0) && numplay != numrec) d->flags |= SD_F_SIMPLEX; - sysctl_ctx_init(&d->play_sysctl_ctx); - d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "play", - CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "playback channels node"); - sysctl_ctx_init(&d->rec_sysctl_ctx); - d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", - CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node"); - if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; sndstat_register(dev, d->status); - return (dsp_make_dev(dev)); + return (0); } int From nobody Sun Nov 3 19:04:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCY3Kf9z5cd1t; Sun, 03 Nov 2024 19:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCY2Rfxz4rtx; Sun, 3 Nov 2024 19:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqxUSDy+Lp/VgEsGFL2n6Ga/+TagsWstWcgIYcgdk5Y=; b=s4fZ/t9+V8zg7M5bQuhtVbnYoaEZku2F+IaxqiIqAiv/K1HpSj5yOvMuxJ68phWyRqmHkH 5IK9XKhYpx6LUxRoneaDAUtuer7+txE3pbeFMf2ljYfr7M4jnUfqq2hAEq1m2/a10KX12M ZselKAH5bwN1P9LIbepHX98aW6a7HrgLV+n3YEcDXE+QF1xluC9VVvECpD3D9xFHa5AmBH KZ3OF6ufiKUNpwyBSH+lrlHEW4fGw1uVYCxJ82UEkRYDLgSkfblFOJ4uhZC8mT2eE5xLVW pU2/MpHWuAJwDv+8fH0EhiDff+AbqIYI4CeUqalBWgpMEZr2YSJqT6abePbIXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqxUSDy+Lp/VgEsGFL2n6Ga/+TagsWstWcgIYcgdk5Y=; b=PsbQmAJ9RJ3VrEpUWoAIW0zavsCR7n+vfSKFCufFtyszt/7qq26eKXtU0UfOt0YpSHaIL4 rkgFraY9zEtD2UbaCBA6zqEO6zirkz6SQZTHYgWFbL4ME/9kYlWu3RSpAOPaPxPm4+Encl 1PpBD5nIBJACdk/4SEoCPstPyzSmV8OVQ6sNK11ODjh+IczTSkVcgkE2PXBx86F2nfwHFJ pS6wP4byjaOhszNhoSprrog9lU9NGI2/aDjMsmM+nJwRe/dyWSvBwjqmJwlbIi9Ca3Thed O66HuC1GwsPQ899hsfwjRxzy2MAVB/B52ySScIw+bquqWr14Zlfdsv9QcyTq1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660649; a=rsa-sha256; cv=none; b=wubwkPy5xMGp4SNAZ8gVZyjf1qy99crmiR2jNnNbW4LVyc+rKv7elN8yom6WGDJbuEj899 iwkSeW3UGr8DYQQ8AsTPUx+pVLwziGk8Y53pzkXLd9zOCECqYOaHVgzx/0qcuzs2LhF7bv VbOG6+DFGHX7KtmMn4G5nJxgNJVTLtEJYupjVQvwV9X5qC9zNp4aPGm3gEfX/zKxDoQsph AtScZNTt5iPpyB1Qtk6p/gEfue3e+VBBKvhebbt3JqU8UP1GzHH+a6ejHNd9MhiON0tXlQ gCKBlI+8LDcM6wrWH1mD4U9LFxEh9KKs1EvPq4YcA478jWPSnlz+r1bDxXI2qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCY21Rxz11rG; Sun, 3 Nov 2024 19:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J49wm052817; Sun, 3 Nov 2024 19:04:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J49b1052814; Sun, 3 Nov 2024 19:04:09 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:09 GMT Message-Id: <202411031904.4A3J49b1052814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 181a31d83490 - main - sound: Move sndstat_register() call to pcm_setstatus() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 181a31d8349088cbcead8dcbff8d62ee8af6c913 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=181a31d8349088cbcead8dcbff8d62ee8af6c913 commit 181a31d8349088cbcead8dcbff8d62ee8af6c913 Author: Christos Margiolis AuthorDate: 2024-11-03 19:02:37 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:02:37 +0000 sound: Move sndstat_register() call to pcm_setstatus() The d->status string is populated in pcm_setstatus() anyway, so call sndstat_register() after we populate it, and are closer to finalizing the device creation. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D47323 --- sys/dev/sound/pcm/sound.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 5ca38ca622c9..3c4fb38fa4f5 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -293,6 +293,7 @@ pcm_setstatus(device_t dev, char *str) vchan_setmaxauto(d, snd_maxautovchans); strlcpy(d->status, str, SND_STATUSLEN); + sndstat_register(dev, d->status); PCM_LOCK(d); @@ -509,8 +510,6 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; - sndstat_register(dev, d->status); - return (0); } From nobody Sun Nov 3 19:04:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCb0hkcz5cd6Z; Sun, 03 Nov 2024 19:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCZ3kTNz4rgf; Sun, 3 Nov 2024 19:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qeises+x6rCn8ZEnJ/mFVmumfK0nGKxDLH14fA2Tve8=; b=mFhbn5Jh2c78TiM2pWs4oQ643/FN3TGm78c/iZTIfHFF6gCBxXStFoZCN+3S/h/vvaCSn3 zd8e9VFTQcNBz5/O9PFCCFwwxo/HffMVeKUIBXlnJUMzyPPVQ+I5wY8zYppfh/AWanuNG6 Bln6N1zkdS/pO+cymdu+s06A72+VFfHG2c8RzGpVeCcXAJ+9BFZnOpPC1JumlrvCUgZsNX JEOKV9SPWP/3l5WAJ6UVgp5P27L8mzQI1QLjJ4s73YIqOSM42mhqnVrh3J1vnm9OLqfmQ+ Qrqpvdkdjj+DnWWac7McxHlosCmAFpoY9xjJisDdicCEzol5/8yCN5mHa9BSfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qeises+x6rCn8ZEnJ/mFVmumfK0nGKxDLH14fA2Tve8=; b=eoaoY2gGNBMNpj/9MesuW0vs3GTtovj/vtSQNvzCE4IP82xVac1NQ5i4Yf8HCmkiUAHvYj v/bBcENrb3akjzqzph0qaqiahhntLj3lJBj8oZMPbWtaTMyogW76qxB6lg5No0DKCG/Pxx BOHcjjlNQ8CJlACAU8Szo6yHDHGaitzhTlGcnXiNDnShV4es2xEkGlSFZEUumvA5LqpoSE TfI0Rqq1N5Y4aS6qVrerhkOkCGIzhBm47dStckT8iaEk+gNUZGzcIC8cblnwD6rKMrc+9n kjeJKbtIWSaj+eVip2fUuH+eJyzc7dmIv6hMNnBN7zSRepX5F6TepGT4fCMIew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660650; a=rsa-sha256; cv=none; b=P7Ar8sFptUhu4J0dBQloBKDEk0d2+zoP4OmgBAqZWvQzpbv4hRXrHRacAsgyegou9bW9Tx 1pnhyv1fX2DPoN5bQgiOAHo6DmGkmRVr1M2nTXCTpY5Y4qREo/iFXU8NQN3spoTDogt2Nh EMzTOe6Q7clz+hKV7pvR+TwIa0HuZbYQ/G0afB4miLGY/dXId43ugUOjZMuU1RO5afI/Uw nckVv9ClISEymmbdrVTiHuuUXSc6F4iGISzqd/bEXxR2Km4AtHa7CcnQK85JwtmLd6/XWF Mpz6+nvvq4sXJNdc1YB3D61BNWRO3clHchDJM3UoLvqNXgzINY3uZY4AMT6Ymg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCZ3KT4z11rH; Sun, 3 Nov 2024 19:04:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J4ADW052865; Sun, 3 Nov 2024 19:04:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J4AO0052862; Sun, 3 Nov 2024 19:04:10 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:10 GMT Message-Id: <202411031904.4A3J4AO0052862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3a7d40c69262 - main - sound: Remove early SD_F_SIMPLEX and SD_F_AUTOVCHAN assignments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3a7d40c692622cc614a3839491c345d945f474fe Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3a7d40c692622cc614a3839491c345d945f474fe commit 3a7d40c692622cc614a3839491c345d945f474fe Author: Christos Margiolis AuthorDate: 2024-11-03 19:02:43 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:02:43 +0000 sound: Remove early SD_F_SIMPLEX and SD_F_AUTOVCHAN assignments These flags are properly set in pcm_setstatus(), once the primary channels have been created. The existing comment already states that this is wrong. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D47324 --- sys/dev/sound/pcm/sound.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 3c4fb38fa4f5..e03bcab6d8fc 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -465,7 +465,8 @@ pcm_sysinit(device_t dev) } int -pcm_register(device_t dev, void *devinfo, int numplay, int numrec) +pcm_register(device_t dev, void *devinfo, int numplay __unused, + int numrec __unused) { struct snddev_info *d; int i; @@ -503,13 +504,6 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) CHN_INIT(d, channels.pcm.busy); CHN_INIT(d, channels.pcm.opened); - /* XXX This is incorrect, but lets play along for now. */ - if ((numplay == 0 || numrec == 0) && numplay != numrec) - d->flags |= SD_F_SIMPLEX; - - if (numplay > 0 || numrec > 0) - d->flags |= SD_F_AUTOVCHAN; - return (0); } From nobody Sun Nov 3 19:04:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCb5mh8z5cd8X; Sun, 03 Nov 2024 19:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCb4PF9z4rs3; Sun, 3 Nov 2024 19:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RHtiSgLIHYhIpKwisgw/qLxOE/42ZDMfXPDWSOIFOO0=; b=BwV3JCGV67qKx8N+nKKN9JaatfT71OEIT3FImTxcla5qF6QpYZL+gTyiBk1EGbaN2iU5iS CzXWy36Zg5ayGnWGRtPWnPfxIFxKprWSPhXwFZ4HKZdp5cFMLD/neA01ABEhgU3HblezKa Mq54VsxxWzWoq7Jt03acGfEMGSUoVwhPuawmth0BHDSUVnjPRupEudkVbB1gpbQF7YZGzH HuIZG1s2OUGDN6YauiI8SX5bi5OJeAisWzX9JZooTBVEICvJk3ZG+ciAMN+pr8RPwTMMUB 5Lw5XtvpKxeKVyYOeY1WqFg3Z9HOakotfWdyoQeZcr/+c1sBHRIYvyfxrKjnNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RHtiSgLIHYhIpKwisgw/qLxOE/42ZDMfXPDWSOIFOO0=; b=lciGq0qttNgUxJM+AKplK0rD/wYwluNiS+oQipU3E8uRSxgAMh1DFLqWYWfIaR2apQGryh zbBu/FkN7ro8tuiNwX9q/M4h0kBFTzKYYbnAmrXo8F7t53zns9tArOMvFW+ZUyWUjusBxs m7rsaPZC+rL3QJd31q+/m4l7PmZfLNlhOrJP5m/4tbf/y6sPNb2WDzKdburE9dEd6sX8La naVev6s/2qbFs/bMkvWL5SCLL98q2IHJg8EnDLxML072d69jwylu+Q574TdAS6rPJ9ad4E F7WXhOtAE3CieVe0XUGKThweCDWlzi20F7+1edUM8671ZTc2Hyr2Y2kx/QA20g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660651; a=rsa-sha256; cv=none; b=eMeNYY1Mb1o26ylEoJYcXcgZ6OJ+YsH+GfFt+MFnAXIQtipxvWnH16w0AhU4bmoMmpYM9o cShF/tvAdmQ3u9dfqKhiAUMa+irK//o/BT5zlPAJcIFyPsymBfcoKbrb0Driy/zvgzGHbH FbTMk+Zb+WTXq3y5QQJ1KeiPWUngAcJaeslXcci9xMXCkJf0buD//7NeyQn5UsiFzXoEDo r/A8pg89BrbpFaa+JShfYlCXDkDj4UJEmiFLdfoFhG/QaOehXmkV3Jv5DCKSxV/t1LRlnM p14uw2fiOoQ4ND8YdJf8c/cjqQ52+5vOt+IHb1cbbIk17Z4P5roF+NuCcQj1nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCb413Yz11np; Sun, 3 Nov 2024 19:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J4BhG052911; Sun, 3 Nov 2024 19:04:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J4B4B052907; Sun, 3 Nov 2024 19:04:11 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:11 GMT Message-Id: <202411031904.4A3J4B4B052907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 516a9c0212b0 - main - sound: Make device registration more intuitive List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 516a9c0212b003e1da0c6f4476dbe4f3f431606c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=516a9c0212b003e1da0c6f4476dbe4f3f431606c commit 516a9c0212b003e1da0c6f4476dbe4f3f431606c Author: Christos Margiolis AuthorDate: 2024-11-03 19:02:49 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:02:49 +0000 sound: Make device registration more intuitive The way a sound driver currently registers to sound(4) is using the following sequence of function calls: 1. pcm_register() to initialize snddev_info. 2. pcm_addchan() calls to create the device's primary channels. 3. pcm_setstatus() to do the final setup. While using 3 different functions in a specific order might not be very elegant, this pattern cannot be easily avoided. However, pcm_register() and pcm_setstatus() are especially confusing, since one would intuitively expect: 1. pcm_register() to actually do the registration, as opposed to a basic initialization. 2. pcm_setstatus() to, as the name suggests, set some kind of status, as opposed to finalizing the registration. This patch renames pcm_register() to pcm_init(), and pcm_setstatus() to pcm_register(). Drivers are modified accordingly. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47325 --- sys/arm/allwinner/a10_codec.c | 10 +-- sys/arm/broadcom/bcm2835/bcm2835_audio.c | 10 +-- sys/arm/freescale/imx/imx6_ssi.c | 12 ++-- sys/arm/freescale/vybrid/vf_sai.c | 12 ++-- sys/dev/sound/dummy.c | 6 +- sys/dev/sound/fdt/audio_soc.c | 10 +-- sys/dev/sound/macio/aoa.c | 6 +- sys/dev/sound/pci/als4000.c | 11 ++-- sys/dev/sound/pci/atiixp.c | 6 +- sys/dev/sound/pci/cmi.c | 6 +- sys/dev/sound/pci/cs4281.c | 6 +- sys/dev/sound/pci/csapcm.c | 8 +-- sys/dev/sound/pci/emu10k1.c | 5 +- sys/dev/sound/pci/emu10kx-pcm.c | 8 +-- sys/dev/sound/pci/envy24.c | 7 +-- sys/dev/sound/pci/envy24ht.c | 8 +-- sys/dev/sound/pci/es137x.c | 6 +- sys/dev/sound/pci/fm801.c | 5 +- sys/dev/sound/pci/hda/hdaa.c | 7 +-- sys/dev/sound/pci/hdsp-pcm.c | 13 ++-- sys/dev/sound/pci/hdspe-pcm.c | 13 ++-- sys/dev/sound/pci/ich.c | 5 +- sys/dev/sound/pci/maestro3.c | 9 +-- sys/dev/sound/pci/neomagic.c | 5 +- sys/dev/sound/pci/solo.c | 6 +- sys/dev/sound/pci/t4dwave.c | 6 +- sys/dev/sound/pci/via8233.c | 6 +- sys/dev/sound/pci/via82c686.c | 5 +- sys/dev/sound/pci/vibes.c | 11 ++-- sys/dev/sound/pcm/sound.c | 103 ++++++++++++++++--------------- sys/dev/sound/pcm/sound.h | 4 +- sys/dev/sound/usb/uaudio.c | 11 ++-- 32 files changed, 168 insertions(+), 178 deletions(-) diff --git a/sys/arm/allwinner/a10_codec.c b/sys/arm/allwinner/a10_codec.c index 9294c1e5290c..12d389d24243 100644 --- a/sys/arm/allwinner/a10_codec.c +++ b/sys/arm/allwinner/a10_codec.c @@ -1165,16 +1165,16 @@ a10codec_attach(device_t dev) pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - if (pcm_register(dev, sc, 1, 1)) { - device_printf(dev, "pcm_register failed\n"); - goto fail; - } + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_PLAY, &a10codec_chan_class, sc); pcm_addchan(dev, PCMDIR_REC, &a10codec_chan_class, sc); snprintf(status, SND_STATUSLEN, "at %s", ofw_bus_get_name(dev)); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) { + device_printf(dev, "pcm_register failed\n"); + goto fail; + } return (0); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_audio.c b/sys/arm/broadcom/bcm2835/bcm2835_audio.c index 75a0c81f29a1..13f309dd3f11 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_audio.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_audio.c @@ -867,14 +867,14 @@ bcm2835_audio_delayed_init(void *xsc) goto no; } - if (pcm_register(sc->dev, sc, 1, 0)) { - device_printf(sc->dev, "pcm_register failed\n"); - goto no; - } + pcm_init(sc->dev, sc); pcm_addchan(sc->dev, PCMDIR_PLAY, &bcmchan_class, sc); snprintf(status, SND_STATUSLEN, "at VCHIQ"); - pcm_setstatus(sc->dev, status); + if (pcm_register(sc->dev, status)) { + device_printf(sc->dev, "pcm_register failed\n"); + goto no; + } bcm2835_audio_reset_channel(&sc->pch); bcm2835_audio_create_worker(sc); diff --git a/sys/arm/freescale/imx/imx6_ssi.c b/sys/arm/freescale/imx/imx6_ssi.c index 273957f64b21..cb77f1454e63 100644 --- a/sys/arm/freescale/imx/imx6_ssi.c +++ b/sys/arm/freescale/imx/imx6_ssi.c @@ -810,18 +810,18 @@ ssi_attach(device_t dev) pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - err = pcm_register(dev, scp, 1, 0); - if (err) { - device_printf(dev, "Can't register pcm.\n"); - return (ENXIO); - } + pcm_init(dev, scp); scp->chnum = 0; pcm_addchan(dev, PCMDIR_PLAY, &ssichan_class, scp); scp->chnum++; snprintf(status, SND_STATUSLEN, "at simplebus"); - pcm_setstatus(dev, status); + err = pcm_register(dev, status); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return (ENXIO); + } mixer_init(dev, &ssimixer_class, scp); setup_ssi(sc); diff --git a/sys/arm/freescale/vybrid/vf_sai.c b/sys/arm/freescale/vybrid/vf_sai.c index 696ecfb980f4..e895529c4810 100644 --- a/sys/arm/freescale/vybrid/vf_sai.c +++ b/sys/arm/freescale/vybrid/vf_sai.c @@ -762,18 +762,18 @@ sai_attach(device_t dev) pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - err = pcm_register(dev, scp, 1, 0); - if (err) { - device_printf(dev, "Can't register pcm.\n"); - return (ENXIO); - } + pcm_init(dev, scp); scp->chnum = 0; pcm_addchan(dev, PCMDIR_PLAY, &saichan_class, scp); scp->chnum++; snprintf(status, SND_STATUSLEN, "at simplebus"); - pcm_setstatus(dev, status); + err = pcm_register(dev, status); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return (ENXIO); + } mixer_init(dev, &saimixer_class, scp); diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index c1cd4dff15f9..9013fd023a7e 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -305,8 +305,7 @@ dummy_attach(device_t dev) }; pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - if (pcm_register(dev, sc, DUMMY_NPCHAN, DUMMY_NRCHAN)) - return (ENXIO); + pcm_init(dev, sc); for (i = 0; i < DUMMY_NPCHAN; i++) pcm_addchan(dev, PCMDIR_PLAY, &dummy_chan_class, sc); for (i = 0; i < DUMMY_NRCHAN; i++) @@ -314,7 +313,8 @@ dummy_attach(device_t dev) snprintf(status, SND_STATUSLEN, "on %s", device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + return (ENXIO); mixer_init(dev, &dummy_mixer_class, sc); callout_init(&sc->callout, 1); diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index 92813a3079d8..c2bdea399364 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -397,10 +397,7 @@ audio_soc_init(void *arg) } } - if (pcm_register(sc->dev, sc, 1, 1)) { - device_printf(sc->dev, "failed to register PCM\n"); - return; - } + pcm_init(sc->dev, sc); sc->play_channel.sc = sc; sc->rec_channel.sc = sc; @@ -408,7 +405,10 @@ audio_soc_init(void *arg) pcm_addchan(sc->dev, PCMDIR_PLAY, &audio_soc_chan_class, &sc->play_channel); pcm_addchan(sc->dev, PCMDIR_REC, &audio_soc_chan_class, &sc->rec_channel); - pcm_setstatus(sc->dev, "at simplebus"); + if (pcm_register(sc->dev, "at simplebus")) { + device_printf(sc->dev, "failed to register PCM\n"); + return; + } AUDIO_DAI_SETUP_INTR(sc->cpu_dev, audio_soc_intr, sc); AUDIO_DAI_SETUP_MIXER(sc->codec_dev, sc->dev); diff --git a/sys/dev/sound/macio/aoa.c b/sys/dev/sound/macio/aoa.c index 27626b3d570a..9861bbd92a0c 100644 --- a/sys/dev/sound/macio/aoa.c +++ b/sys/dev/sound/macio/aoa.c @@ -372,8 +372,7 @@ aoa_attach(void *xsc) sc = xsc; self = sc->sc_dev; - if (pcm_register(self, sc, 1, 0)) - return (ENXIO); + pcm_init(self, sc); err = pcm_getbuffersize(self, AOA_BUFFER_SIZE, AOA_BUFFER_SIZE, AOA_BUFFER_SIZE); @@ -382,7 +381,6 @@ aoa_attach(void *xsc) pcm_addchan(self, PCMDIR_PLAY, &aoa_chan_class, sc); snprintf(status, sizeof(status), "at %s", ofw_bus_get_name(self)); - pcm_setstatus(self, status); - return (0); + return (pcm_register(self, status)); } diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index b1376d2b6e5a..9d86713b379e 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -839,10 +839,7 @@ als_pci_attach(device_t dev) goto bad_attach; } - if (pcm_register(dev, sc, 1, 1)) { - device_printf(dev, "failed to register pcm entries\n"); - goto bad_attach; - } + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc); @@ -850,7 +847,11 @@ als_pci_attach(device_t dev) snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) { + device_printf(dev, "failed to register pcm entries\n"); + goto bad_attach; + } + return 0; bad_attach: diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index eeb28bb08276..90e5742e6523 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -1084,8 +1084,7 @@ atiixp_chip_post_init(void *arg) mixer_init(sc->dev, ac97_getmixerclass(), sc->codec); - if (pcm_register(sc->dev, sc, ATI_IXP_NPCHAN, ATI_IXP_NRCHAN)) - goto postinitbad; + pcm_init(sc->dev, sc); for (i = 0; i < ATI_IXP_NPCHAN; i++) pcm_addchan(sc->dev, PCMDIR_PLAY, &atiixp_chan_class, sc); @@ -1101,7 +1100,8 @@ atiixp_chip_post_init(void *arg) rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(sc->dev))); - pcm_setstatus(sc->dev, status); + if (pcm_register(sc->dev, status)) + goto postinitbad; atiixp_lock(sc); if (sc->polling == 0) diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 9a92066c51a4..22f1e76a4d1f 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -982,8 +982,7 @@ cmi_attach(device_t dev) if (mixer_init(dev, &cmi_mixer_class, sc)) goto bad; - if (pcm_register(dev, sc, 1, 1)) - goto bad; + pcm_init(dev, sc); cmi_initsys(sc); @@ -993,7 +992,8 @@ cmi_attach(device_t dev) snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; DEB(printf("cmi_attach: succeeded\n")); return 0; diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 972b83efff8f..7a25f7f4c08d 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -839,8 +839,7 @@ cs4281_pci_attach(device_t dev) mixer_init(dev, ac97_getmixerclass(), codec); - if (pcm_register(dev, sc, 1, 1)) - goto bad; + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc); @@ -849,7 +848,8 @@ cs4281_pci_attach(device_t dev) (sc->regtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index c8424dd3e433..a966a2e66402 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -832,14 +832,14 @@ pcmcsa_attach(device_t dev) csa_writemem(resp, BA1_CIE, (csa_readmem(resp, BA1_CIE) & ~0x0000003f) | 0x00000001); csa_active(csa, -1); - if (pcm_register(dev, csa, 1, 1)) { + pcm_init(dev, csa); + pcm_addchan(dev, PCMDIR_REC, &csachan_class, csa); + pcm_addchan(dev, PCMDIR_PLAY, &csachan_class, csa); + if (pcm_register(dev, status)) { ac97_destroy(codec); csa_releaseres(csa, dev); return (ENXIO); } - pcm_addchan(dev, PCMDIR_REC, &csachan_class, csa); - pcm_addchan(dev, PCMDIR_PLAY, &csachan_class, csa); - pcm_setstatus(dev, status); return (0); } diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index 0813f89c87b8..e4b2c22f4f07 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -2130,13 +2130,14 @@ emu_pci_attach(device_t dev) rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, sc, sc->nchans, gotmic ? 3 : 2)) goto bad; + pcm_init(dev, sc); for (i = 0; i < sc->nchans; i++) pcm_addchan(dev, PCMDIR_PLAY, &emupchan_class, sc); for (i = 0; i < (gotmic ? 3 : 2); i++) pcm_addchan(dev, PCMDIR_REC, &emurchan_class, sc); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c index bef6b596646e..c280b64892f6 100644 --- a/sys/dev/sound/pci/emu10kx-pcm.c +++ b/sys/dev/sound/pci/emu10kx-pcm.c @@ -1459,10 +1459,7 @@ emu_pcm_attach(device_t dev) pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); /* XXX we should better get number of available channels from parent */ - if (pcm_register(dev, sc, (route == RT_FRONT) ? MAX_CHANNELS : 1, (route == RT_FRONT) ? 1 : 0)) { - device_printf(dev, "can't register PCM channels!\n"); - goto bad; - } + pcm_init(dev, sc); sc->pnum = 0; if (route != RT_MCHRECORD) pcm_addchan(dev, PCMDIR_PLAY, &emupchan_class, sc); @@ -1476,7 +1473,8 @@ emu_pcm_attach(device_t dev) snprintf(status, SND_STATUSLEN, "on %s", device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return (0); diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c index f7cc7ff5724d..51842bfdb480 100644 --- a/sys/dev/sound/pci/envy24.c +++ b/sys/dev/sound/pci/envy24.c @@ -2575,9 +2575,7 @@ envy24_pci_attach(device_t dev) mixer_init(dev, &envy24mixer_class, sc); /* set channel information */ - err = pcm_register(dev, sc, 5, 2 + sc->adcn); - if (err) - goto bad; + pcm_init(dev, sc); sc->chnum = 0; for (i = 0; i < 5; i++) { pcm_addchan(dev, PCMDIR_PLAY, &envy24chan_class, sc); @@ -2601,7 +2599,8 @@ envy24_pci_attach(device_t dev) rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c index 65c67b84ce53..b8202a9fa7cd 100644 --- a/sys/dev/sound/pci/envy24ht.c +++ b/sys/dev/sound/pci/envy24ht.c @@ -2480,10 +2480,7 @@ envy24ht_pci_attach(device_t dev) mixer_init(dev, &envy24htmixer_class, sc); /* set channel information */ - /* err = pcm_register(dev, sc, 5, 2 + sc->adcn); */ - err = pcm_register(dev, sc, 1, 2 + sc->adcn); - if (err) - goto bad; + pcm_init(dev, sc); sc->chnum = 0; /* for (i = 0; i < 5; i++) { */ pcm_addchan(dev, PCMDIR_PLAY, &envy24htchan_class, sc); @@ -2503,7 +2500,8 @@ envy24ht_pci_attach(device_t dev) rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 8f832d899dd3..3c1bea09b5d1 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1861,13 +1861,13 @@ es_pci_attach(device_t dev) rman_get_start(es->reg), rman_get_start(es->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, es, numplay, 1)) - goto bad; + pcm_init(dev, es); for (i = 0; i < numplay; i++) pcm_addchan(dev, PCMDIR_PLAY, ct, es); pcm_addchan(dev, PCMDIR_REC, ct, es); es_init_sysctls(dev); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; es->escfg = ES_SET_GP(es->escfg, 0); if (numplay == 1) device_printf(dev, "\n", diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index ab36ff8f453c..ea043e87a59c 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -642,10 +642,11 @@ fm801_pci_attach(device_t dev) device_get_nameunit(device_get_parent(dev))); #define FM801_MAXPLAYCH 1 - if (pcm_register(dev, fm801, FM801_MAXPLAYCH, 1)) goto oops; + pcm_init(dev, fm801); pcm_addchan(dev, PCMDIR_PLAY, &fm801ch_class, fm801); pcm_addchan(dev, PCMDIR_REC, &fm801ch_class, fm801); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto oops; fm801->radio = device_add_child(dev, "radio", DEVICE_UNIT_ANY); bus_generic_attach(dev); diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index bf38e6a97483..ee8464a550df 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -7053,9 +7053,7 @@ hdaa_pcm_attach(device_t dev) HDA_BOOTHVERBOSE( device_printf(dev, "Registering PCM channels...\n"); ); - if (pcm_register(dev, pdevinfo, (pdevinfo->playas >= 0)?1:0, - (pdevinfo->recas >= 0)?1:0) != 0) - device_printf(dev, "Can't register PCM\n"); + pcm_init(dev, pdevinfo); pdevinfo->registered++; @@ -7108,9 +7106,8 @@ hdaa_pcm_attach(device_t dev) snprintf(status, SND_STATUSLEN, "on %s", device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); - return (0); + return (pcm_register(dev, status)); } static int diff --git a/sys/dev/sound/pci/hdsp-pcm.c b/sys/dev/sound/pci/hdsp-pcm.c index a50fc2b52fc0..5ac571e64fde 100644 --- a/sys/dev/sound/pci/hdsp-pcm.c +++ b/sys/dev/sound/pci/hdsp-pcm.c @@ -1073,13 +1073,10 @@ hdsp_pcm_attach(device_t dev) pcm_flags |= SD_F_BITPERFECT; pcm_setflags(dev, pcm_flags); + pcm_init(dev, scp); + play = (hdsp_channel_play_ports(scp->hc)) ? 1 : 0; rec = (hdsp_channel_rec_ports(scp->hc)) ? 1 : 0; - err = pcm_register(dev, scp, play, rec); - if (err) { - device_printf(dev, "Can't register pcm.\n"); - return (ENXIO); - } scp->chnum = 0; if (play) { @@ -1096,7 +1093,11 @@ hdsp_pcm_attach(device_t dev) rman_get_start(scp->sc->cs), rman_get_start(scp->sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + err = pcm_register(dev, status); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return (ENXIO); + } mixer_init(dev, &hdspmixer_class, scp); diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index 1f8fbbcef078..09bbbe22dacf 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -1064,13 +1064,10 @@ hdspe_pcm_attach(device_t dev) pcm_flags |= SD_F_BITPERFECT; pcm_setflags(dev, pcm_flags); + pcm_init(dev, scp); + play = (hdspe_channel_play_ports(scp->hc)) ? 1 : 0; rec = (hdspe_channel_rec_ports(scp->hc)) ? 1 : 0; - err = pcm_register(dev, scp, play, rec); - if (err) { - device_printf(dev, "Can't register pcm.\n"); - return (ENXIO); - } scp->chnum = 0; if (play) { @@ -1087,7 +1084,11 @@ hdspe_pcm_attach(device_t dev) rman_get_start(scp->sc->cs), rman_get_start(scp->sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + err = pcm_register(dev, status); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return (ENXIO); + } mixer_init(dev, &hdspemixer_class, scp); diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 910a371c6653..500d6d95daac 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -695,7 +695,7 @@ ich_setstatus(struct sc_info *sc) device_printf(sc->dev, "PCI Master abort workaround enabled\n"); - pcm_setstatus(sc->dev, status); + pcm_register(sc->dev, status); } /* -------------------------------------------------------------------- */ @@ -1066,8 +1066,7 @@ ich_pci_attach(device_t dev) ich_setmap, sc, 0)) goto bad; - if (pcm_register(dev, sc, 1, (sc->hasmic) ? 2 : 1)) - goto bad; + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_PLAY, &ichchan_class, sc); /* play */ pcm_addchan(dev, PCMDIR_REC, &ichchan_class, sc); /* record */ diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index f922aa5cec3f..2d102fcd6dbe 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -1423,10 +1423,7 @@ m3_pci_attach(device_t dev) m3_enable_ints(sc); - if (pcm_register(dev, sc, dacn, adcn)) { - device_printf(dev, "pcm_register error\n"); - goto bad; - } + pcm_init(dev, sc); for (i=0 ; iregtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(sc->reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_setstatus(dev, status)) { - device_printf(dev, "attach: pcm_setstatus error\n"); + if (pcm_register(dev, status)) { + device_printf(dev, "pcm_register error\n"); goto bad; } diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index 25273633ff18..d7824c990a52 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -707,10 +707,11 @@ nm_pci_attach(device_t dev) rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, sc, 1, 1)) goto bad; + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_REC, &nmchan_class, sc); pcm_addchan(dev, PCMDIR_PLAY, &nmchan_class, sc); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index 82eabf3a4884..90dd2e26ad41 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -1026,11 +1026,11 @@ ess_attach(device_t dev) rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, sc, 1, 1)) - goto no; + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_REC, &esschan_class, sc); pcm_addchan(dev, PCMDIR_PLAY, &esschan_class, sc); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto no; return 0; diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index 653e610febbe..07b9e1004573 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -921,12 +921,12 @@ tr_pci_attach(device_t dev) rman_get_start(tr->reg), rman_get_start(tr->irq), device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, tr, dacn, 1)) - goto bad; + pcm_init(dev, tr); pcm_addchan(dev, PCMDIR_REC, &trrchan_class, tr); for (i = 0; i < dacn; i++) pcm_addchan(dev, PCMDIR_PLAY, &trpchan_class, tr); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 9f3b312e4365..243353805b94 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -1352,8 +1352,7 @@ via_attach(device_t dev) device_get_nameunit(device_get_parent(dev))); /* Register */ - if (pcm_register(dev, via, via_dxs_chnum + via_sgd_chnum, NWRCHANS)) - goto bad; + pcm_init(dev, via); for (i = 0; i < via_dxs_chnum; i++) pcm_addchan(dev, PCMDIR_PLAY, &via8233dxs_class, via); for (i = 0; i < via_sgd_chnum; i++) @@ -1366,7 +1365,8 @@ via_attach(device_t dev) (via_dxs_chnum > 0) ? "En" : "Dis", (via->dxs_src) ? "(SRC)" : "", via_dxs_chnum, via_sgd_chnum, NWRCHANS); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return (0); bad: diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index 44f846b684d7..40f3521a57a2 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -585,10 +585,11 @@ via_attach(device_t dev) device_get_nameunit(device_get_parent(dev))); /* Register */ - if (pcm_register(dev, via, 1, 1)) goto bad; + pcm_init(dev, via); pcm_addchan(dev, PCMDIR_PLAY, &viachan_class, via); pcm_addchan(dev, PCMDIR_REC, &viachan_class, via); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto bad; return 0; bad: if (via->codec) ac97_destroy(via->codec); diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c index e587f0113b5d..7e908f188614 100644 --- a/sys/dev/sound/pci/vibes.c +++ b/sys/dev/sound/pci/vibes.c @@ -866,18 +866,17 @@ sv_attach(device_t dev) { if (bootverbose) printf("Sonicvibes: revision %d.\n", sc->rev); - if (pcm_register(dev, sc, 1, 1)) { - device_printf(dev, "sv_attach: pcm_register fail\n"); - goto fail; - } - + pcm_init(dev, sc); pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(sc->enh_reg), rman_get_start(sc->irq), device_get_nameunit(device_get_parent(dev))); - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) { + device_printf(dev, "sv_attach: pcm_register fail\n"); + goto fail; + } DEB(printf("sv_attach: succeeded\n")); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index e03bcab6d8fc..fc9d13593b9e 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -273,53 +273,6 @@ pcm_best_unit(int old) return (best); } -int -pcm_setstatus(device_t dev, char *str) -{ - struct snddev_info *d = device_get_softc(dev); - - /* should only be called once */ - if (d->flags & SD_F_REGISTERED) - return (EINVAL); - - PCM_BUSYASSERT(d); - - if (d->playcount == 0 || d->reccount == 0) - d->flags |= SD_F_SIMPLEX; - - if (d->playcount > 0 || d->reccount > 0) - d->flags |= SD_F_AUTOVCHAN; - - vchan_setmaxauto(d, snd_maxautovchans); - - strlcpy(d->status, str, SND_STATUSLEN); - sndstat_register(dev, d->status); - - PCM_LOCK(d); - - /* Done, we're ready.. */ - d->flags |= SD_F_REGISTERED; - - PCM_RELEASE(d); - - PCM_UNLOCK(d); - - /* - * Create all sysctls once SD_F_REGISTERED is set else - * tunable sysctls won't work: - */ - pcm_sysinit(dev); - - if (snd_unit_auto < 0) - snd_unit_auto = (snd_unit < 0) ? 1 : 0; - if (snd_unit < 0 || snd_unit_auto > 1) - snd_unit = device_get_unit(dev); - else if (snd_unit_auto == 1) - snd_unit = pcm_best_unit(snd_unit); - - return (dsp_make_dev(dev)); -} - uint32_t pcm_getflags(device_t dev) { @@ -464,9 +417,12 @@ pcm_sysinit(device_t dev) feeder_eq_initsys(dev); } -int -pcm_register(device_t dev, void *devinfo, int numplay __unused, - int numrec __unused) +/* + * Basic initialization so that drivers can use pcm_addchan() before + * pcm_register(). + */ +void +pcm_init(device_t dev, void *devinfo) { struct snddev_info *d; int i; @@ -503,8 +459,53 @@ pcm_register(device_t dev, void *devinfo, int numplay __unused, CHN_INIT(d, channels.pcm); CHN_INIT(d, channels.pcm.busy); CHN_INIT(d, channels.pcm.opened); +} - return (0); +int +pcm_register(device_t dev, char *str) +{ + struct snddev_info *d = device_get_softc(dev); + + /* should only be called once */ + if (d->flags & SD_F_REGISTERED) + return (EINVAL); + + PCM_BUSYASSERT(d); + + if (d->playcount == 0 || d->reccount == 0) + d->flags |= SD_F_SIMPLEX; + + if (d->playcount > 0 || d->reccount > 0) + d->flags |= SD_F_AUTOVCHAN; + + vchan_setmaxauto(d, snd_maxautovchans); + + strlcpy(d->status, str, SND_STATUSLEN); + sndstat_register(dev, d->status); + + PCM_LOCK(d); + + /* Done, we're ready.. */ + d->flags |= SD_F_REGISTERED; + + PCM_RELEASE(d); + + PCM_UNLOCK(d); + + /* + * Create all sysctls once SD_F_REGISTERED is set else + * tunable sysctls won't work: + */ + pcm_sysinit(dev); + + if (snd_unit_auto < 0) + snd_unit_auto = (snd_unit < 0) ? 1 : 0; + if (snd_unit < 0 || snd_unit_auto > 1) + snd_unit = device_get_unit(dev); + else if (snd_unit_auto == 1) + snd_unit = pcm_best_unit(snd_unit); + + return (dsp_make_dev(dev)); } int diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index c5013e76034a..1d09c48fc06b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -245,9 +245,9 @@ int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); unsigned int pcm_getbuffersize(device_t dev, unsigned int minbufsz, unsigned int deflt, unsigned int maxbufsz); -int pcm_register(device_t dev, void *devinfo, int numplay, int numrec); +void pcm_init(device_t dev, void *devinfo); +int pcm_register(device_t dev, char *str); int pcm_unregister(device_t dev); -int pcm_setstatus(device_t dev, char *str); u_int32_t pcm_getflags(device_t dev); void pcm_setflags(device_t dev, u_int32_t val); void *pcm_getdevinfo(device_t dev); diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 0a8878c072d2..1f927bcb49de 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1209,14 +1209,9 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas snprintf(status, sizeof(status), "on %s", device_get_nameunit(device_get_parent(dev))); - if (pcm_register(dev, sc, - (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, - (sc->sc_rec_chan[i].num_alt > 0) ? 1 : 0)) { - goto detach; - } + pcm_init(dev, sc); uaudio_pcm_setflags(dev, SD_F_MPSAFE); - sc->sc_child[i].pcm_registered = 1; if (sc->sc_play_chan[i].num_alt > 0) { sc->sc_play_chan[i].priv_sc = sc; @@ -1229,7 +1224,9 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas pcm_addchan(dev, PCMDIR_REC, chan_class, &sc->sc_rec_chan[i]); } - pcm_setstatus(dev, status); + if (pcm_register(dev, status)) + goto detach; + sc->sc_child[i].pcm_registered = 1; uaudio_mixer_register_sysctl(sc, dev, i); From nobody Sun Nov 3 19:04:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhPCc74tHz5cd6d; Sun, 03 Nov 2024 19:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhPCc5NXdz4rmn; Sun, 3 Nov 2024 19:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GJFCHNahu18t9nxGP1M6icpKoArCLqXoxZ50/FWOJEE=; b=h1r1jmryrE9opMitc2bX90zXSQqt4ysGA9Sawi94VUyg/BoIvRPs2lu6nkZznkfc77XMBw au6HqTUc8L8vCcmccKWDjJIxfmiHPEl3ieAqoxscW82t2cYOZiAFnZpXXfQFPA7O1CNk/X R6mvOKxELNV7Un826e9sX1uUrlN3LS45igGnJfozA/zg6R7/VDMbN5JIhs1NRKMQQ92Kop pNu5MtD+rp+l4DOApUW67B20i/mc8yKs6aC2Rhx0fFyQ3prZvN9cluoiCcamsXSq7IAE6/ 70NsTcCW6LWCZQ68cYb3AGtH2v/4NHI/R7M2412pvGvYre0VLSAzC/Lqud/PvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730660652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GJFCHNahu18t9nxGP1M6icpKoArCLqXoxZ50/FWOJEE=; b=b2A34XrqDgJDX+q4wQfYoT9hg9+kmkLOcAvD5yb/oLnRG6AniOYE5VXiu1cTqYrNpbsXhP y0I+Y0AFhUfQJYqxGkVoOBa8h+KqZzvbfT+CZS/oeIfQ4+q0S6IXgHryuQk0NnDCUzcqnK Q89DrGik6/YVLa65tbYXUoEy6C+uCSMrmwwlyiM6HJT4cot2+14CIHawmiSPIBHWD76yTZ R5I01FZ8y79M73J76AHE2ckavKOi7O8m0tMHSrowBXm8e0MrMMeQUaOBgm4B5eAYlu0Tx8 6Hzvhv2MLnLeka/eHat3Wul0dOqf/+iQibwsedt+OsJM/p/tmGPsYdJegzV8lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730660652; a=rsa-sha256; cv=none; b=DVQLtM/nXgjqrS9UKAjupQ4372P1ISLwAFGgJoDuWjmbUm5ffmpOtX9FvycJiMXT3E1QTZ CTPmXIo9xMeRdMl7CYuL61phDJNTyRgJdjidlFBu9zl4saARmY6NKBe4bqXuXN26qj5Wdz z46Qeg/kN5iKKBJjaM8qQwic7xVfEPwOpVYrDIdm1V1kBaxhJISJVqTy8dZ2wqcRcBV0Lu js96za5UW7v8a4/iKyHfcPb1qbAnl/fTUBWZ+w5xAV+qqpSFv8X338G2SmOf4Fo9mXBv87 sLygODz0atmuH8IR5C7frrvolLbapFOMmEgk+D5/hFlgb/OCUjfSL3OgYnfoIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhPCc50cCz11tv; Sun, 3 Nov 2024 19:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3J4Cak052959; Sun, 3 Nov 2024 19:04:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3J4C6r052956; Sun, 3 Nov 2024 19:04:12 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:04:12 GMT Message-Id: <202411031904.4A3J4C6r052956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 829951f857b7 - main - sound: Remove unused pcm_channel->data fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 829951f857b73faaf28cbfcf09e861668692d8a1 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=829951f857b73faaf28cbfcf09e861668692d8a1 commit 829951f857b73faaf28cbfcf09e861668692d8a1 Author: Christos Margiolis AuthorDate: 2024-11-03 19:03:53 +0000 Commit: Christos Margiolis CommitDate: 2024-11-03 19:03:53 +0000 sound: Remove unused pcm_channel->data fields No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47360 --- sys/dev/sound/pcm/channel.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 0788fbe42a5a..79a8d35b22f7 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -166,8 +166,6 @@ struct pcm_channel { int16_t volume[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; int8_t muted[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]; - - void *data1, *data2; }; #define CHN_HEAD(x, y) &(x)->y.head From nobody Sun Nov 3 19:47:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhQ9s3Nxqz5cjB3; Sun, 03 Nov 2024 19:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhQ9s2rszz5013; Sun, 3 Nov 2024 19:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZLQg+qaS3UdakM/OwS1b0rtXMyE18ZRUBz+ATy2NIM=; b=Xt3heWMzkfb+c8Bq7ouuw2flcNrqOllbbaHD6wRUYfbTnqik1d415q1ya5Wi7PSMPSNodm 92Kq75MsQlwl/iaU7EDInZ6zibvYxQZtKFK6vrnZJpNsIBgtgBkC73PvDA6LXLZw1Xy/56 rN7PTIPBxAL7Xywzg6wqrmzoKjs9vMicDTLApcXcFhN156BpOU6KQZR79UDP3JwMgYE75W toz6la8YSmJ245OgHpL7ryyt+gWfqEZNY5px9FnLLDIrb+jarrhhZpwuGlIDkYj2Y5b0Ce mBPKxbNAz/DlIDfO+O4eTxIdYEeWzLpGPufpZm98ysyk2kShIeHo+lm9Z8S90Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZLQg+qaS3UdakM/OwS1b0rtXMyE18ZRUBz+ATy2NIM=; b=qXdUvphtAxJRFLYGzBpMWdJ54Z6RJTcVyKfnvqrKZHPEcLd8PJtHzdGczH4ausnKwb0ite ac20OJCS+k3O5ruFcRDfk+WLKSBeEmR+/uDJzAxItFz9qaOjwqYTa1IcM6IFu2dBeAHp6W ID11A/EUGMO+DxK72pbMxfs2g5A5IQrz4j5OCX83jd63/HAN2kblxUH0tzyx5/6RftHTYw JXFpW6M66lrLLoW5smshh1/0UgcTZPiXNsisSV4Crcb7rZEjkKi0Fl+h5MfnWQO3OtNZSf 0KzIeyeQ7fIEUNnp5VPDKDl/KBhmx8X6w270iqNDe0mpTIMuGtsjq6jPRpKI6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730663265; a=rsa-sha256; cv=none; b=qpWWuh8M9aWC5zkXz5Sx4zKkLe/zWwW49rJXbxbDlgP3XBhGoD8njTSLbxb9iAFjmOcxzT siaHQReZVH+Zdny3X2nG0jzVj0UTfw8/KwBq/QlQT/8XucwjDzCnB9XchxhirqAi37FLKw qlD/icVZqQOuHdRt0AtEflkJwofBGYAEG+mPftz4ITiAgpvVMoAgutAw3Ew0K+sTyrakb1 uZgNn1cxIfhRjcdvx98/uDrjPIIU0TY8btCTyClDbiuNBKIv5Gl2uZDNLuKYGnqQqVlNad Pdgto+FaHVmkcNu/lO8flyqv9Gj7Lk2mSkzfKXByhDeniivWOKJLL+LShe6TCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhQ9s2LW3z12PY; Sun, 3 Nov 2024 19:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3JljUM027773; Sun, 3 Nov 2024 19:47:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Jlj1X027770; Sun, 3 Nov 2024 19:47:45 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:47:45 GMT Message-Id: <202411031947.4A3Jlj1X027770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 57aebec4f767 - main - x86/iommu/amd_reg.h: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57aebec4f767db3b3b8c7af813e5f1080d0e08ec Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=57aebec4f767db3b3b8c7af813e5f1080d0e08ec commit 57aebec4f767db3b3b8c7af813e5f1080d0e08ec Author: Konstantin Belousov AuthorDate: 2024-11-03 00:19:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 19:38:19 +0000 x86/iommu/amd_reg.h: fix typo in comment Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/amd_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/iommu/amd_reg.h b/sys/x86/iommu/amd_reg.h index 33f744c65cc6..37375b3fa7b5 100644 --- a/sys/x86/iommu/amd_reg.h +++ b/sys/x86/iommu/amd_reg.h @@ -342,7 +342,7 @@ _Static_assert(sizeof(struct amdiommu_dte) == 8 * sizeof(uint32_t), "DTE"); #define AMDIOMMU_DTE_SYSMGT_T 0x0 /* Translated */ #define AMDIOMMU_DTE_GPM_4LV 0x0 /* 4 Level */ -#define AMDIOMMU_DTE_GPM_5LV 0x1 /* 4 Level */ +#define AMDIOMMU_DTE_GPM_5LV 0x1 /* 5 Level */ #define AMDIOMMU_DTE_GPM_RSRV1 0x2 #define AMDIOMMU_DTE_GPM_RSRV2 0x3 From nobody Sun Nov 3 19:47:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhQ9t5Xqkz5cjDH; Sun, 03 Nov 2024 19:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhQ9t431Tz4yxh; Sun, 3 Nov 2024 19:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1JoRzX9GMEpDCevUHCEbLKk1c5dE9VKI9HDlHiZ3OY8=; b=nJDWeUUSx0N6nLSvetiswMSwTXP79g2NfsfpuEDfdcgkyPzFynYF0n0KmFVFsPDYF7pU0Z h5dth9M4sbFbgyRUPPikN4+DiP0+zZQ86Cltryd15QndEuhSZITIzMS6RJLDv027tPFwnB 9AHw44r1bVCV4LSa84Fus0b3x/4xdWHJS9xytRiAagiufipQjxKb0WQ+YH3dPC+m+LqLsI znyoL9doAbEwYcBBRRAh4XF4FMDLfYJkv33hg/w4kolC3hmXbfiYByt2KPPkJf/IqdP60x FrRnGutDOxQiJXl4r89Daxz4W9hmHRDM8f52KdmW0F0JKU9mFlSK3WJY8vO3Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1JoRzX9GMEpDCevUHCEbLKk1c5dE9VKI9HDlHiZ3OY8=; b=QmfkD16cHUnSzUm2PPB28oVJjGJkJonVPmvJ0xco5YuNn2AfkkEL8I2lZXdaq2sHlGS56N /GkBMFriAneQTVtebfI9/BI2W2Z+vAWI8WMVQozLFEjgVst0hdaxdca1XV+ps1PfmQVBla JiKPBZNe+9gfKxgrt7lmPdxF5JKEmzX5U/gSjezZt58n7DWbSkskGd8VI63N7ykXOA0VTH kzMC7aZL6GGIk/n70Lm9bRU+McfvNt7eUDGM2pDfdGrxxppgaly6V28cfr433SalrJMrSP 43PPc3wKYUWTh68yJNalaCMDwD7D6dmvyya3x/vPijaXsMVh4LVS2wwBPNPqpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730663266; a=rsa-sha256; cv=none; b=a5D5Tjl3b52X39x+ll3NCqJcxOmBXnKq65OrzTYFEEtb+Jx9Ch7J92W469CZ/LnTU4vej6 qKw17GGkOXllhY85UXyi935euhF8ZWHxdyhk313pIxEHlOTFumcCeb6jMGr08MqprUp8eO MoEafRMzHgPCgVsfPvtm8LwxMpAhL1vg9m/VTWjOLJOhzGaXXS4BBuSobz7+3zzgz+46Gj Z65qgJRCshNazXiEHPu2ZdcJSzLUhm05cSVM8k80Qf1pcdlZRmQ2b09cdEAaOQsagFHIby Hh5Ty+IlKvz4lySQ198nVsNY12dkC88gG+NirdNHWUN00YefLbLCjl/s7SfARw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhQ9t3K03z12PZ; Sun, 3 Nov 2024 19:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3JlkbQ027819; Sun, 3 Nov 2024 19:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3Jlk1W027813; Sun, 3 Nov 2024 19:47:46 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:47:46 GMT Message-Id: <202411031947.4A3Jlk1W027813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d97838b7c2a6 - main - iommu: eliminate iommu_free_ctx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d97838b7c2a605932b6edf36f87abe7ccce74314 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d97838b7c2a605932b6edf36f87abe7ccce74314 commit d97838b7c2a605932b6edf36f87abe7ccce74314 Author: Konstantin Belousov AuthorDate: 2024-11-03 14:50:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 19:38:19 +0000 iommu: eliminate iommu_free_ctx() iommu_free_ctx_locked() alone is enough Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/arm64/iommu/iommu.c | 19 +++---------------- sys/dev/iommu/busdma_iommu.c | 10 ++++++++-- sys/x86/iommu/amd_ctx.c | 19 ------------------- sys/x86/iommu/amd_drv.c | 1 - sys/x86/iommu/amd_iommu.h | 1 - sys/x86/iommu/intel_ctx.c | 19 ------------------- sys/x86/iommu/intel_dmar.h | 1 - sys/x86/iommu/intel_drv.c | 1 - sys/x86/iommu/iommu_utils.c | 6 ------ sys/x86/iommu/x86_iommu.h | 1 - 10 files changed, 11 insertions(+), 67 deletions(-) diff --git a/sys/arm64/iommu/iommu.c b/sys/arm64/iommu/iommu.c index 0fe59c5d10b6..5db48b3bc276 100644 --- a/sys/arm64/iommu/iommu.c +++ b/sys/arm64/iommu/iommu.c @@ -373,32 +373,19 @@ void iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *ioctx) { struct bus_dma_tag_iommu *tag; + int error; IOMMU_ASSERT_LOCKED(iommu); tag = ioctx->tag; IOMMU_CTX_FREE(iommu->dev, ioctx); + IOMMU_UNLOCK(iommu); free(tag, M_IOMMU); -} - -void -iommu_free_ctx(struct iommu_ctx *ioctx) -{ - struct iommu_unit *iommu; - struct iommu_domain *iodom; - int error; - - iodom = ioctx->domain; - iommu = iodom->iommu; - - IOMMU_LOCK(iommu); - iommu_free_ctx_locked(iommu, ioctx); - IOMMU_UNLOCK(iommu); /* Since we have a domain per each ctx, remove the domain too. */ - error = iommu_domain_free(iodom); + error = iommu_domain_free(ioctx->domain); if (error) device_printf(iommu->dev, "Could not free a domain\n"); } diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 4d295ed7c6b2..6856b0551dde 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -397,6 +397,8 @@ static int iommu_bus_dma_tag_destroy(bus_dma_tag_t dmat1) { struct bus_dma_tag_iommu *dmat; + struct iommu_unit *iommu; + struct iommu_ctx *ctx; int error; error = 0; @@ -407,8 +409,12 @@ iommu_bus_dma_tag_destroy(bus_dma_tag_t dmat1) error = EBUSY; goto out; } - if (dmat == dmat->ctx->tag) - iommu_free_ctx(dmat->ctx); + ctx = dmat->ctx; + if (dmat == ctx->tag) { + iommu = ctx->domain->iommu; + IOMMU_LOCK(iommu); + iommu_free_ctx_locked(iommu, dmat->ctx); + } free(dmat->segments, M_IOMMU_DMAMAP); free(dmat, M_DEVBUF); } diff --git a/sys/x86/iommu/amd_ctx.c b/sys/x86/iommu/amd_ctx.c index b3e85350a995..7e41ecf2dc04 100644 --- a/sys/x86/iommu/amd_ctx.c +++ b/sys/x86/iommu/amd_ctx.c @@ -398,16 +398,6 @@ amdiommu_free_ctx_locked(struct amdiommu_unit *unit, struct amdiommu_ctx *ctx) amdiommu_unref_domain_locked(unit, domain); } -static void -amdiommu_free_ctx(struct amdiommu_ctx *ctx) -{ - struct amdiommu_unit *unit; - - unit = CTX2AMD(ctx); - AMDIOMMU_LOCK(unit); - amdiommu_free_ctx_locked(unit, ctx); -} - static void amdiommu_unref_domain_locked(struct amdiommu_unit *unit, struct amdiommu_domain *domain) @@ -628,12 +618,3 @@ amdiommu_free_ctx_locked_method(struct iommu_unit *iommu, ctx = IOCTX2CTX(context); amdiommu_free_ctx_locked(unit, ctx); } - -void -amdiommu_free_ctx_method(struct iommu_ctx *context) -{ - struct amdiommu_ctx *ctx; - - ctx = IOCTX2CTX(context); - amdiommu_free_ctx(ctx); -} diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index 395cefc65caa..62315902fcd9 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -1072,7 +1072,6 @@ static struct x86_iommu amd_x86_iommu = { .domain_unload = amdiommu_domain_unload, .get_ctx = amdiommu_get_ctx, .free_ctx_locked = amdiommu_free_ctx_locked_method, - .free_ctx = amdiommu_free_ctx_method, .alloc_msi_intr = amdiommu_alloc_msi_intr, .map_msi_intr = amdiommu_map_msi_intr, .unmap_msi_intr = amdiommu_unmap_msi_intr, diff --git a/sys/x86/iommu/amd_iommu.h b/sys/x86/iommu/amd_iommu.h index 2b0db4f8fe6d..64dd13db9745 100644 --- a/sys/x86/iommu/amd_iommu.h +++ b/sys/x86/iommu/amd_iommu.h @@ -222,7 +222,6 @@ struct amdiommu_ctx *amdiommu_find_ctx_locked(struct amdiommu_unit *unit, uint16_t rid); void amdiommu_free_ctx_locked_method(struct iommu_unit *iommu, struct iommu_ctx *context); -void amdiommu_free_ctx_method(struct iommu_ctx *context); struct amdiommu_domain *amdiommu_find_domain(struct amdiommu_unit *unit, uint16_t rid); diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index c2371d4d9c4f..2bc5f8a9d361 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -803,16 +803,6 @@ dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx) TD_PINNED_ASSERT; } -static void -dmar_free_ctx(struct dmar_ctx *ctx) -{ - struct dmar_unit *dmar; - - dmar = CTX2DMAR(ctx); - DMAR_LOCK(dmar); - dmar_free_ctx_locked(dmar, ctx); -} - /* * Returns with the domain locked. */ @@ -941,12 +931,3 @@ dmar_free_ctx_locked_method(struct iommu_unit *iommu, ctx = IOCTX2CTX(context); dmar_free_ctx_locked(dmar, ctx); } - -void -dmar_free_ctx_method(struct iommu_ctx *context) -{ - struct dmar_ctx *ctx; - - ctx = IOCTX2CTX(context); - dmar_free_ctx(ctx); -} diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 1a9b5041975c..57a66aae69b2 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -237,7 +237,6 @@ struct dmar_ctx *dmar_get_ctx_for_devpath(struct dmar_unit *dmar, uint16_t rid, int dmar_move_ctx_to_domain(struct dmar_domain *domain, struct dmar_ctx *ctx); void dmar_free_ctx_locked_method(struct iommu_unit *dmar, struct iommu_ctx *ctx); -void dmar_free_ctx_method(struct iommu_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); struct iommu_ctx *dmar_get_ctx(struct iommu_unit *iommu, device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 22d04029f9ae..b21c8460e830 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -1317,7 +1317,6 @@ static struct x86_iommu dmar_x86_iommu = { .domain_unload = dmar_domain_unload, .get_ctx = dmar_get_ctx, .free_ctx_locked = dmar_free_ctx_locked_method, - .free_ctx = dmar_free_ctx_method, .find = dmar_find_method, .alloc_msi_intr = dmar_alloc_msi_intr, .map_msi_intr = dmar_map_msi_intr, diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 479e8637ee8e..2db02a98ca91 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -288,12 +288,6 @@ iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *context) x86_iommu->free_ctx_locked(iommu, context); } -void -iommu_free_ctx(struct iommu_ctx *context) -{ - x86_iommu->free_ctx(context); -} - struct iommu_unit * iommu_find(device_t dev, bool verbose) { diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index eb4a9907a5d6..431228512fd8 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -81,7 +81,6 @@ struct x86_iommu { device_t dev, uint16_t rid, bool id_mapped, bool rmrr_init); void (*free_ctx_locked)(struct iommu_unit *iommu, struct iommu_ctx *context); - void (*free_ctx)(struct iommu_ctx *context); struct iommu_unit *(*find)(device_t dev, bool verbose); int (*alloc_msi_intr)(device_t src, u_int *cookies, u_int count); int (*map_msi_intr)(device_t src, u_int cpu, u_int vector, From nobody Sun Nov 3 19:47:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhQ9w0R3tz5cj1R; Sun, 03 Nov 2024 19:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhQ9v4qgPz505p; Sun, 3 Nov 2024 19:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HMoqhmV6hGzBqX7O832tm3NBBv8Vee/MOp6d6VMJQsk=; b=gx7fJdDGzYxrpdA5H/inf7uQRcXdr9anppb9odNQ6u4Hwbn0egLYlX5v20gk0zjZwm/LiM BqMCnOkY0y83LCIFqVEGDWlsH3EsS+H//Qlom5N4PHUh29FVStZVmj7BDTcwBN9J6rxaQg GXTAo1ogWl3h5KuJoJb5TFATXcwE21fvPLGvwfXzhapWLHrNChmHQeKKSLUt5w7w8xXto+ 3c1dQgEfhQPHsWrd6wR6mTyYaVcNeIHZJPH+w11oA1MAxJWvdTgFPyzsatMwEgFRCQRfBJ HzzAsmYpc/9prVMXE0h31TuhwVzDsj+8rRJz/H3IsBKrTnCDhWwWIEbWaPzHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730663267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HMoqhmV6hGzBqX7O832tm3NBBv8Vee/MOp6d6VMJQsk=; b=wTIJMYZVFOyEfPvi6XvBbH3NeM1je8iYTdvMjIOSYxVvEhErCX4mJRjTV8XIuGdiVaLAap Jnt3Izp72rnONdMNUUOvuarhCdbOT2N5rCoKq37OUN5XRnq9C72G4p98JWoSFtqE5Gbn2z ENmFjy299RayAHEQjACsSEdI3ky2cqsTmB/6N6+cDkl/X/501hwud1OZrsjuZ905ZJEN5q 8yl/+Y9UVAVdWww6883cvETl/ZljruLJ8cT6w70QOv764Xm9G2Y76nx1/J0ehuLbwYx3sn b4bEBilP5dkXkjZ2dsXlV8Z5VgNvUtlS4roDlnD8bLBm+fQy0X4UW/6fDEpAiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730663267; a=rsa-sha256; cv=none; b=ehuFhhXErZpnE1rhlekhHzawzbMsYXfmwPH9ACxssT5qWepB0I5D1hVZFyYGTnLfYolYa6 pvkvCpE3TgNlWxZjo9ZBP7z3BQiUlDkfLfBjJXAU3J/cEK7xDTaHDpcFPQW3wBJAoa4fFM DAqxhaOPdNdVo+otVMm/AfPm3G/3eTlopy4vVCZImxIs0Fsrmx7jjZ3lfBUBAVj/+jssdC soxHtqNaJnFu3ygJQBj+msmFQjEvmE5iDHY/0IG71mWSAO4CrqdjNh+4k4FgaC54ZTe7RW eXmOe/gt1F7lzoI98cbT2eZPKSRzoMUeSwX7lrY03BhX7qOfCGxBP3AXu0wd1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhQ9v4L87z12Vw; Sun, 3 Nov 2024 19:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3Jll7E027891; Sun, 3 Nov 2024 19:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3JllVq027888; Sun, 3 Nov 2024 19:47:47 GMT (envelope-from git) Date: Sun, 3 Nov 2024 19:47:47 GMT Message-Id: <202411031947.4A3JllVq027888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43bfb4e71483 - main - amdiommu: print more domain information from ddb show List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43bfb4e71483ecb5666e5142b5108999ca888b22 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43bfb4e71483ecb5666e5142b5108999ca888b22 commit 43bfb4e71483ecb5666e5142b5108999ca888b22 Author: Konstantin Belousov AuthorDate: 2024-11-03 15:14:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-03 19:38:19 +0000 amdiommu: print more domain information from ddb show Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/amd_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index 62315902fcd9..257de73baab5 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -1099,14 +1099,12 @@ amdiommu_print_domain(struct amdiommu_domain *domain, bool show_mappings) iodom = DOM2IODOM(domain); -#if 0 db_printf( - " @%p dom %d mgaw %d agaw %d pglvl %d end %jx refs %d\n" + " @%p dom %d pglvl %d end %jx refs %d\n" " ctx_cnt %d flags %x pgobj %p map_ents %u\n", - domain, domain->domain, domain->mgaw, domain->agaw, domain->pglvl, + domain, domain->domain, domain->pglvl, (uintmax_t)domain->iodom.end, domain->refs, domain->ctx_cnt, domain->iodom.flags, domain->pgtbl_obj, domain->iodom.entries_cnt); -#endif iommu_db_domain_print_contexts(iodom); From nobody Sun Nov 3 20:20:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhQvb1lqZz5clLy; Sun, 03 Nov 2024 20:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhQvb15XDz54nD; Sun, 3 Nov 2024 20:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730665227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mHbkMKUK1M0qqlmS/U0lc10yR6FweTI3vafV6Z7HYgw=; b=D9kR5JfNPoEGjkR27RuYD7h4/hU/oGW5hqTfhhFksmqg1q8cmu3WnJiUF/WNcfZL1fa12c 65FmDtcRN5rUi+OOXFWh52P1Ygt6wrvNZq0/hpQzOXZGTmOiSe0tjwHehrh3Z9av6J+7mR T/Tn+OzOMr1ynZD5L1VIrEXyfO60xtS9nbGxqkCov42yr4pmvU/Jsp4jVau36uL6yzHlgD evYavtJhpdPfRHTVscy4D+gJxV2Vm4Vn3e2WF18dJJx1SvUl3TY4zvG95xUpfrnUKWb9Rr iukQrTPLfCb9+8RYqz1yVVjm11dGAbimcTpw6g/yGt+OlWTvUSUvirTT5IaJCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730665227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mHbkMKUK1M0qqlmS/U0lc10yR6FweTI3vafV6Z7HYgw=; b=xbKkkBfY6ougkbJKu3DVE3WC7d/biOUj1F09vik0b+Zslkwj5OaiCiGVKjIeBeDUHNxwgC zPSRp7KpqPBe8FQ2zgxSymOV4pInnEPoY7naNCL7FknDOJCp6v+CRDtsnBH+AI0p5Ms2ou OAWI8e3CzyKpKHfFYaUefAQyilX+3OD4370aMF28NYX2RpCl0/ZRx0q9Qe7TZKYfPri2W3 sTURG0/YWTAu16e6SCxzncuFlrDtYbm/TR88HP890Cpg3PF7iqKwVxeKnV6d2JR+zH5L05 xSXgrANVYlra8+Y3JHE7D5Ro+8N/QYSrejSQyP8g9vK16I0pd6pC3gjWrXGYCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730665227; a=rsa-sha256; cv=none; b=VxFF6w+4BUSX3cDjulSvqFn1a+kHyop/CaWyrXQIULB4FYXwbTk7HL8OkxjeFCubllhv3S CgYKD5pPUa6Z5pTOa7+OhOb8cXIDGdVLcwSSmIcvcQN/+7R/SLufp77wufQvaSxBQfOqUg YubXt39+oxTaST2v2uuE1YcfqJUdocyPpZdWnVrvARC6VCjXUd/80ara37hVLSzrPM6OkD OgPV1F4FJIxAACs4qKCkNGD1EJEAo10eXpRe5ZG6XoGTPx1HLNXZ1yy7WsqUK8xz2RsdR6 KmmQxRHL8aHwLqmhkjaXb/duf9K2bNHnoLFJyFcmqfmF58/hK3TRZqdpze50Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhQvb0hNcz133F; Sun, 3 Nov 2024 20:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3KKQcW094705; Sun, 3 Nov 2024 20:20:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3KKQQr094702; Sun, 3 Nov 2024 20:20:26 GMT (envelope-from git) Date: Sun, 3 Nov 2024 20:20:26 GMT Message-Id: <202411032020.4A3KKQQr094702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 75d11bfbc6d4 - main - dconschat: Increase WARNS to 2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75d11bfbc6d4289e4b3d91414e46a3af51f4402a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=75d11bfbc6d4289e4b3d91414e46a3af51f4402a commit 75d11bfbc6d4289e4b3d91414e46a3af51f4402a Author: Ed Maste AuthorDate: 2024-11-03 20:04:08 +0000 Commit: Ed Maste CommitDate: 2024-11-03 20:18:39 +0000 dconschat: Increase WARNS to 2 Follow the existing pattern of fflush() in verbose mode. PR: 71665 Sponsored by: The FreeBSD Foundation --- usr.sbin/dconschat/Makefile | 2 +- usr.sbin/dconschat/dconschat.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.sbin/dconschat/Makefile b/usr.sbin/dconschat/Makefile index 70f59d7a5d34..c57522c57119 100644 --- a/usr.sbin/dconschat/Makefile +++ b/usr.sbin/dconschat/Makefile @@ -5,6 +5,6 @@ CFLAGS+= -I${SRCTOP}/sys LIBADD= kvm -WARNS?= 1 +WARNS?= 2 .include diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index 72d1aa276bd3..d18477c51522 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -519,8 +519,10 @@ ok: rlen = len; #if 1 - if (verbose == 1) - printf("[%d]", rlen); fflush(stdout); + if (verbose == 1) { + printf("[%d]", rlen); + fflush(stdout); + } #endif again: From nobody Sun Nov 3 21:28:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhSQW4FvQz5crTl; Sun, 03 Nov 2024 21:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhSQW3lhxz42HW; Sun, 3 Nov 2024 21:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730669331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NqT88PCu8R4e1U2W8JEuh0hY7gIL0ysf0oGpYXTgQE=; b=U2UJ+5bUxUF6eVxtXYfWhCTY0vBZ7QDbtFrGomoeR6q7M10a+5vyQOtFJu6Wyce56f14Sk yONFk4nGs47MW2aziaQ6QOWa+NwRINMGxi75bDZKPYUAKKY/0aX+GDiZKXKLK4xYQZxSdP AtfHrSxb9cSS0yL/C0kDI/B8PFtECmzoRJ2ITrSYYR+ZijfoeU6jI34X+qlQ0caj2P0Z8c c5ZRBlbm16MhfzEiRPP21OjUUSICTo+c3lD1l9GCdFDP1RbZ0Bo24Mj8U2mmIDDOi5MgGl UVERRQ1XnLVX0dzyfzJsdHI11vlG/Zek7aos02NnRvMs00zWqDgHSbmkAHMBvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730669331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NqT88PCu8R4e1U2W8JEuh0hY7gIL0ysf0oGpYXTgQE=; b=ZXQl6PxvFauByybOvUWEcNVGucByBjMm69ufPZIZU7pjm+1sch+vXHsS5dtyCNkbvH7ocH LoNKYi1N3y79Sb5VXs3NQo/1GB40wxuhvStYhzp0t92jL4DQ0uuJT2gKDNO86dgB0KjqHD vwL0jVVFWK/6B87CWynSOG93MoHObD+1DdRkrTEEroZAS9EP3VaWTKQqDNSgit72olRuzb T/mFJNslPIeaC+ayZjqQrnnJ13B7YCFHOlP6WhxmG2KaVeq6/rBAH6lLCoHbIdBTiZzWwS lEn+qpEQzfqZkoL/+yVyESxmkvwWvRN3z3kD9Jb2YWW5aYZHcjw4y/f2Eln7sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730669331; a=rsa-sha256; cv=none; b=DuXzJozf6DhQlAb/Z9V5a/6qfDws9bMNVju385JYYR5nk+u99YBvtcYaIasWqgbCxSPVnU pt8h/mnYrBlKL4uFdTvfzu7UCqWfezhD0tC7AwBqOiAqYYuI3zIhg8bs21wD3tQf9rwfTS clh24aLmwRBuT4QcjfRJWpqgn920dzoEspm2tq1jAlxPcnVcto7HD11m5NUKwp+DmqEJ18 F+ugYtUUnrMs4xVHsba+GIZPTro4OY5wn7hV2sM8qUGt9GaTSPZ+VYQrJWUOkMQKoXYToX E5JyC2zY4sRgIvUCMBfhvUeLOHMQhNCgV9LNt4Bunc8aVjhyOjvSjh474gT9QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhSQW3LkYz156p; Sun, 3 Nov 2024 21:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A3LSpb6015427; Sun, 3 Nov 2024 21:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A3LSpEd015424; Sun, 3 Nov 2024 21:28:51 GMT (envelope-from git) Date: Sun, 3 Nov 2024 21:28:51 GMT Message-Id: <202411032128.4A3LSpEd015424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a5f7047f2865 - main - gvinum: Postpone removal to FreeBSD 15 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5f7047f28654aa297c57a9d24f6d1408641b975 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a5f7047f28654aa297c57a9d24f6d1408641b975 commit a5f7047f28654aa297c57a9d24f6d1408641b975 Author: Ed Maste AuthorDate: 2022-12-12 16:57:12 +0000 Commit: Ed Maste CommitDate: 2024-11-03 21:28:16 +0000 gvinum: Postpone removal to FreeBSD 15 It was not removed for FreeBSD 14. Sponsored by: The FreeBSD Foundation --- sbin/gvinum/gvinum.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index ea0eb08c640a..28e4cd7d76db 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -37,7 +37,7 @@ and associated .Xr geom 4 kernel support is deprecated, and may not be available in -.Fx 14.0 +.Fx 15.0 and later. Users are advised to migrate to .Xr gconcat 8 ,