From nobody Mon Jun 16 08:53:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1X0bCNz5Vq0N; Mon, 16 Jun 2025 08:53: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1W6v0Jz3wDX; Mon, 16 Jun 2025 08:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/AlJM9QLl7PP9BMgc6R28Hz4udJhDxcyBhI5ALO4CuA=; b=JsXXix9zUJ9M7PDOHBgKUogVhbvSVOyongoMrMAD6FH42WzN98Cpmfcxa7oC4niOWPUn4B urJzDf+hReAVA9vRhUCsX9DH9sk5Sy+tdleCt65okbObw/tBD6q5pFoei6kkILclxv7xGL xlgLvzcZN1JQa3LwKCwg5luz7I8SuBpdd0bILxySebIBekbtw2c4hhSjwufHZ1d3nqlYfs Zf3iYxw2Ku2SLtCA5fh5xPp6WXVp2zDq7O7Qffnr4VWWX/6vfTmYP75+tdcFkI5w4UTGwJ tayGJyc3qrNgM1DbwEXv4dK+bLhKRDlZ1R8GO/JqJ2B2KqrCO1mA36wFbQcwMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/AlJM9QLl7PP9BMgc6R28Hz4udJhDxcyBhI5ALO4CuA=; b=pMBmeNsgFNC1E4NrZssfCa6wl1NdDGzMzStMZERbQwKAx8TYI1Hhhcf+zaJaT3zVt8UAIZ wxSJ/1vvQkwGhS4XSdzkeeNdpBFY9MxiD6CMFk+RNQxKXA83BEbR80yhqkpEsPkjo5iKGL FCGCD98kgoyzswgsKVBocVnA1y22/bVfYUlv6rnhX9kLJkMNjUXIO8HblOOZhXrTdcoYRE V72SkLd4brF62p/1SSY5t+R2hXpTlapp22H4bJ3iVhwGwCZv7vO3Xi7h/jU+1R+fzTg8SM +5ekLjiVkkcKlURjKLOWWhw/EQnuGqS77Y4ZR9QolCi3M8ux19p/zw8oPpmFYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064032; a=rsa-sha256; cv=none; b=DYpscmS2z3e9Lb/nPL9EGGbwtId+WiZtvFE+CtgKAjLTlonvwbIQRLwd6sAPmjr8K2NjFH QLsIsbMeossYOmXpyiiQX2z/PXYAWJR+yCW7Qm93nG/KJfCkC3WuWSQYv9t4UkPkKOHwHY fohOooFb0kICD1b2pg4svbdORYifB7SLCQ2sh82puOIJrIOxVJ6ADy0e7kIBmd1Jb0UP3E xfY/MFxtt9+h7i0Yx5TiSBTbqSfaiomsB3XqyiD9ePLOxGsG9LX/mFCidiBfmMumsT3KeX NqohLB4A16af8E0uMLz5NrYZDao6GWMRfoyCEhtylnI9AlQjn2sDJCnBfn4XUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1W6RlqzrJ1; Mon, 16 Jun 2025 08:53: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 55G8rpCH042906; Mon, 16 Jun 2025 08:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rpQQ042903; Mon, 16 Jun 2025 08:53:51 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:51 GMT Message-Id: <202506160853.55G8rpQQ042903@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: b748dd9ab46b - stable/14 - timeout_test.sh: Fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b748dd9ab46bf604ac79debef94c5e690a480317 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b748dd9ab46bf604ac79debef94c5e690a480317 commit b748dd9ab46bf604ac79debef94c5e690a480317 Author: Elyes Haouas AuthorDate: 2023-12-26 23:39:25 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:51 +0000 timeout_test.sh: Fix typo (cherry picked from commit fd4fafa8732203a3e20f5404a65de83d37687e3a) --- bin/timeout/tests/timeout_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh index df497d4f3350..2a8e0112b97c 100644 --- a/bin/timeout/tests/timeout_test.sh +++ b/bin/timeout/tests/timeout_test.sh @@ -82,7 +82,7 @@ exit_numbers_body() -s exit:124 \ timeout .1 sleep 1 - # With preserv status exit should be 128 + TERM aka 143 + # With preserve status exit should be 128 + TERM aka 143 atf_check \ -o empty \ -e empty \ From nobody Mon Jun 16 08:53:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1Y2Z08z5Vpnd; Mon, 16 Jun 2025 08:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1Y0JkJz3wJq; Mon, 16 Jun 2025 08:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064033; h=from:from:reply-to:subject:subject: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+7G79RLsL1xmeIJOfyqQAUFt26cwdPnFudXGMAliDw=; b=BdNg5BvReOQBgLnhZCijIlILyWkQ4lcIZGD4wWH5+FKvHG66BXczEeRv/uGLiSUT5a17eV eAU1HZ02g8a5awrZMRYss+jFyDfaCywdIwImKqqv6Hm4yI54mLrNAvrTrQqjHiD6jqE3B1 IP8NSdII5J1gMhoh/Xwq/Z8EaSV42yCy5mVxOvqqmVb6S9YMWlISCSbk+q1zv12gaHg/S0 iGgmofKWoWsLAVYh4J3reh0aF+H+zMc58K9MFRelw47sSicNPHjlf6UCXqCthCyEfZHOlB zobpyuTjdTaeoYkQcWFQhwqA1EDnXO62SrGiF6TiMSj8Y3Dmfij6t+4oaxMZKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064033; h=from:from:reply-to:subject:subject: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+7G79RLsL1xmeIJOfyqQAUFt26cwdPnFudXGMAliDw=; b=lr9sP8jLuluU0cvb1RlsAnazxbYr2HloRIjuBwRBY1weLT3I+NJMqC54K4TZHAYqyesxRl MngxTtpPwMBFrlKOeh/UDRAR3XYWFbMpMv5/FQcRzfoTUGt/ro8wqkGxh90WqxWVaoMjZ1 lBpKVF22VnqRBE2fPsStYCagNFc0WofWcJF9LrMGr4VS91G5v6g9BACrww2GbsVIGKAHLp 4XpWxfvU8mx58rq/bEV93CJax4CoJpJ5qOqUNgKQbD0+V8JVniQ+26mnHqtys12fDDcIFf RjU11lVOp6Ggz5T/IgZkOyuIS1RxaVooyklMp/wbl2Xa6RYj/FyTLaWvFRULCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064033; a=rsa-sha256; cv=none; b=U/cyGKIexiUfGgUQ6RwF3ZZn8RrP+RxC24dVG3f4rXEZQF32usDiXBH2hjMTEv7OpN9a7N GtUQpJsCR9TlOCMiqdOsHIC/i7LPUetycc+QodfIEWpo8m7f5KKDt3Ysc8/Cdr3OM2fznl HcVF+1Ak6yKuYJqiLsnCdiJx1TS4p/pRaIDlfrWZewbVg1+6+ARj6aCQ3Gel7tpDnNlgt7 8Kh9oswjHHFSs0LjxTMnmRIXJbAr8URpiJ9JMNDwdjJT1bcrzspTgyo5h0kbiviIMDnw5e YC9nS8n1KRwB65K8/fN+NZYp1W9I3UZ4sOWDDI1iUd6yxAA8Lmx2QCOjdCPFiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1X6lvCzrkJ; Mon, 16 Jun 2025 08:53: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 55G8rq1U042952; Mon, 16 Jun 2025 08:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rquW042948; Mon, 16 Jun 2025 08:53:52 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:52 GMT Message-Id: <202506160853.55G8rquW042948@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: 52b047555dec - stable/14 - bin/timeout: remove unreachable break after usage() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 52b047555dec4f1ac7ff603ca86378bf522d8138 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=52b047555dec4f1ac7ff603ca86378bf522d8138 commit 52b047555dec4f1ac7ff603ca86378bf522d8138 Author: rilysh AuthorDate: 2024-01-03 19:03:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:51 +0000 bin/timeout: remove unreachable break after usage() (cherry picked from commit 4d8d9111a4bf79c6d5b41340b47cf768f2c6d080) --- bin/timeout/timeout.c | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 68abb28e2c50..429ca64349e3 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -230,7 +230,6 @@ main(int argc, char **argv) case 'h': default: usage(); - break; } } From nobody Mon Jun 16 08:53:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1Z3kY2z5Vpnf; Mon, 16 Jun 2025 08:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1Z12L9z3wH7; Mon, 16 Jun 2025 08:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uiqPJhIUjzFIkLi9aFuBGAeeBbYzovMONCDTTL3yV6s=; b=Vnb72vIbLUPSr2SCTtdj48rIwIpWH/Y1/frFE1pMeWrhHjJYxID1RN8IjPQo9c6AdAUSE6 vzj15DMK+tX7gN/xW/PVsoQz0DSfbCqhYXREy1fg0vIQqn4DzxDthHxa78ol5/X/eK8qQZ 6XFij9dhkityV3ULeLHgPBrR13e2bn8X6TsITl39+3ydQOt8G00x6PgNNAoNlqd+GqokuB 21tGYeThIolKqSX6YGp71Jdqsbj4MEg0LIdJXAldjE2TtOuiY2j3XVaZSzjBmN9FcEHpEh w1K495ro2NUhuBRpMAwUmi22b0ioGOVUwdK8DWjihU+k7gC1Mw1ctoQZ3KKpjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uiqPJhIUjzFIkLi9aFuBGAeeBbYzovMONCDTTL3yV6s=; b=Kyr7AshAwlNUswYi3PzjfdtuvzS+5W88AsTQKzHNUQhQF0tuqpE7jYLY7xLAWDl+pvH+yQ UKHKbcosBPmHFq3uItWuiCMlMXgQhT/2BOn/ga6Mx4SR97vJmm3KRsEsP+1X1W4OBhCZD+ Yz9ojW/q3ZAbEieIAmJUUKG3cRdmYSKiAl6QxM1tWd/nlpM9uvMcAYQ6K0ZAtJZMGuu+W/ va/pJF3Ga8r4ZvOogzHM9iSAOLeTlAq1pgsvXA8o6Mqh8MI/Xqzsn2IIjI/xS+5jt5yiXi a1VEZ2QjXkZnZYF2NLvffdY6WmskJa9QXhztm2q1Hr6l4CLULGH9vJB9Bo7PuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064034; a=rsa-sha256; cv=none; b=XlfVnx4TD53b52BsFPd0DHO6vvhDvfdxRyDm9VB1D1LNYuDu2BNMjcZcPH5NLAaHMkT3G7 eKrNcoF800Zz3kRRutPhWqlM3kYbHTsr5fa1H9QPtevHmWlHo2hcdx62n56o57wew4TrWv cW9MXg4K2Z/v4j3QsxLN7biScOZDddZQE0ojZeSSWvLgo6JJXps+iWOkXkUW37C2AtUSS+ FMdTgCVqrHo9YdUu+kh9AETckg2Ar+vv926btlpG/lVvkuuGPH22pz0D8ctgvVWUP/iBkc xpFrBWtr5P4H6gh7TFNVJZVOEDHTLFkt8d/gdJ/+xANu0DacsXrwjefZKJWPkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1Z0X9mzqy9; Mon, 16 Jun 2025 08:53: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 55G8rrL6042988; Mon, 16 Jun 2025 08:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rr9A042984; Mon, 16 Jun 2025 08:53:53 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:53 GMT Message-Id: <202506160853.55G8rr9A042984@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: b57a0597fc1a - stable/14 - timeout(1): Improve duration parsing and error messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b57a0597fc1adc207cd5c4298288916c65699908 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b57a0597fc1adc207cd5c4298288916c65699908 commit b57a0597fc1adc207cd5c4298288916c65699908 Author: Aaron LI AuthorDate: 2025-04-02 11:20:02 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:51 +0000 timeout(1): Improve duration parsing and error messages (cherry picked from commit e7bf1e5f1d62c2e735d343c462275e7e2aaf0286) --- bin/timeout/timeout.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 429ca64349e3..83893ba0a601 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -68,19 +68,19 @@ static double parse_duration(const char *duration) { double ret; - char *end; + char *suffix; - ret = strtod(duration, &end); - if (ret == 0 && end == duration) - errx(EXIT_INVALID, "invalid duration"); + ret = strtod(duration, &suffix); + if (suffix == duration) + errx(EXIT_INVALID, "duration is not a number"); - if (end == NULL || *end == '\0') + if (*suffix == '\0') return (ret); - if (end != NULL && *(end + 1) != '\0') - errx(EXIT_INVALID, "invalid duration"); + if (suffix[1] != '\0') + errx(EXIT_INVALID, "duration unit suffix too long"); - switch (*end) { + switch (*suffix) { case 's': break; case 'm': @@ -93,11 +93,11 @@ parse_duration(const char *duration) ret *= 60 * 60 * 24; break; default: - errx(EXIT_INVALID, "invalid duration"); + errx(EXIT_INVALID, "duration unit suffix invalid"); } if (ret < 0 || ret >= 100000000UL) - errx(EXIT_INVALID, "invalid duration"); + errx(EXIT_INVALID, "duration out of range"); return (ret); } From nobody Mon Jun 16 08:53:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1b37nmz5Vq6S; Mon, 16 Jun 2025 08:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1b1mZHz3wMX; Mon, 16 Jun 2025 08:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LiTvZLyUOUkqjL77rBvG6CgZH4yFcUUgYpDApZWXeWs=; b=PpPhLmoDtWSbYmUdoJioUtq3jRNsXaViQJoigGtKXsXEQMVrjtG/GnOyowTZMHXQXXdzbK gZMlI4X5gXPWF17NEOwSai12mvvI/5mwz4UAtN3TCi8IveS2EvGb7XdpmnEATAC6nDA0bM 4lqd7RHIMcuRVCvBBrLYZJPDOEzin5ncpfvzdjs+idmrQ0kCJyy6rJE15FWv7ar4TYuX1r pNuaO+ceTIpg+i5fnmaXhmdBfo0ZtHotwwGt2tJ588/L4Pssw2rn0c9zfLFPZeM7HHl5az 7qOiHB4vgtB8EhYJoOrx3UN6BqJ2sHsoVR6YuH8MUz9b3lSUEMRHTOR8ESA3Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LiTvZLyUOUkqjL77rBvG6CgZH4yFcUUgYpDApZWXeWs=; b=l2y1uDMep935ACpcl41o6ACalw7mHTQDYbMChOaKbhM3Aqx9hdFvVRrQSccSeOihbFhA9z I17bpifjvTu8powhnBFMlztckZbpCXHaF5vt6b3b27L8A2V4Nj/HJBm2XvyDH0rqpbq/Eg Pl/9X5Fpa8RGNJQo6IrE95CdhsrUvS+i7hcIxT/M0giEoIed0FEjUie9RpxMym53LlYOha PVJTsGuikcbom2R8ca1ej/OI7IHLUzFQsqulVWhAjo2mMOImdw64y3HrmII0TOJpak0ji4 WNkksJX0JLjHL/Mcio0iTE0UiHlwKxsmGFrmT3W4MAi25LG0SrSYQdX2lxF2bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064035; a=rsa-sha256; cv=none; b=hfacZ3TMl9On/qbjEI9tq9Fh0ij5zCJk8owuc52xBhVOGVGtMrgUBaIkEnSEdcsO91U35/ u/2MtPHqyfqvVYJ2G8s0gpQIW9Kk3Scss99xpWg+tXvEKcz0z7zr4tk5rDohm77yVjXFMH V/4E9x/RLiagdqtZ6x4A5VSzFjVbegEvXD/u4drPbLlRcBT1gneYuMvCUhAhnerppWp+am EdgsdRAiiRJ2qkHqWqKScCWMcs+Iet0F0essJX356lOKjaEW4l9yzbRuhuwDIa5nxAtVGh 9qivPcSO2l9NUYLb5rKCnbHOHu8JcCBImEwouaAKsHoWDrOY2b+Tpt8hgkOoIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1b0lvxzrvc; Mon, 16 Jun 2025 08:53: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 55G8rtv3043027; Mon, 16 Jun 2025 08:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rtl7043024; Mon, 16 Jun 2025 08:53:55 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:55 GMT Message-Id: <202506160853.55G8rtl7043024@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: a073aed45e9d - stable/14 - timeout(1): fix test after improvement of error messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: a073aed45e9d5f5b955e33301286874111df7add Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a073aed45e9d5f5b955e33301286874111df7add commit a073aed45e9d5f5b955e33301286874111df7add Author: Baptiste Daroussin AuthorDate: 2025-04-16 19:26:00 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:51 +0000 timeout(1): fix test after improvement of error messages (cherry picked from commit 672ee7eb800c43a9e29c6e38e7e9927c40cb2477) --- bin/timeout/tests/timeout_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh index 2a8e0112b97c..d08f6c01e067 100644 --- a/bin/timeout/tests/timeout_test.sh +++ b/bin/timeout/tests/timeout_test.sh @@ -126,31 +126,31 @@ invalid_timeout_body() { atf_check \ -o empty \ - -e inline:"timeout: invalid duration\n" \ + -e inline:"timeout: duration is not a number\n" \ -s exit:125 \ timeout invalid sleep 0 atf_check \ -o empty \ - -e inline:"timeout: invalid duration\n" \ + -e inline:"timeout: duration is not a number\n" \ -s exit:125 \ timeout --kill-after=invalid 1 sleep 0 atf_check \ -o empty \ - -e inline:"timeout: invalid duration\n" \ + -e inline:"timeout: duration unit suffix invalid\n" \ -s exit:125 \ timeout 42D sleep 0 atf_check \ -o empty \ - -e inline:"timeout: invalid duration\n" \ + -e inline:"timeout: duration out of range\n" \ -s exit:125 \ timeout 999999999999999999999999999999999999999999999999999999999999d sleep 0 atf_check \ -o empty \ - -e inline:"timeout: invalid duration\n" \ + -e inline:"timeout: duration out of range\n" \ -s exit:125 \ timeout 2.34e+5d sleep 0 } From nobody Mon Jun 16 08:53:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1c5jphz5Vpnr; Mon, 16 Jun 2025 08:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1c2CD2z3wDw; Mon, 16 Jun 2025 08:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R3aNtp5qQMmYWIrZHaytHUzl1PGS/tRnfztkds8h1WQ=; b=aq9zfQJ7ScC4H0mgbCIv92U/NSLS8N5xyJijDnUE4HRKqgz4fY3q88LgWmSbtOuaekCzb0 pgSwt/57KNh1bFwaNUBKdfQ8y0MasanqmQDBPJ78XahU0S+egG9bEvtAmyt58mGXgalXHY A3z7J5cOFVyCWK0/eLLIcCsxu/1R87yvoz8lRD5J4j0pQ3CwRMM6aryzp/bxbTP1jwVQno 3PM8RfTkE44cVHqFmPbNfSy/qvb4umzwr7IfgCkZsgCuQWC+t70iPyxiILoVQ8F7fFXPtk oUQRFctoPjeux9NAeONBqsRGPo8U94DxpxDgZw8VTY7ItTEYfoNY/oATZoqpmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R3aNtp5qQMmYWIrZHaytHUzl1PGS/tRnfztkds8h1WQ=; b=JORQmUuHg/YIfvoRTTXd5B6aWjvFNwq71HsRTV/t7HAhAP3vpGZaihDhs/TEeOBpoeWNJ8 y0F07ufkQFc1C0KCuFbM627fBb9gQ3bwJY954yR7Gt47Y8VqiD4FU2nQvN6tAf/0gsV7bl pzhW5RQ7R/gNiQNrOS8kQ9nDzif1Kl6ZsS1/ktQDIgHcWK8dhjqyJn+q9UpJ2wYYe61U4H l3mD9Hg0htxx3Q9RvO133Qzrhxq21e0FHJRbtnuK/ljj/gIt1U60Y+drCxGadmbyPjY2N2 MIFwa2QBHURSGkU4k5PS6DKTa+EOhPT6QLBGJASc/q3tfgCBCyDYab6EgVWhsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064036; a=rsa-sha256; cv=none; b=x6PVjUsm95wYgGwIIFGuUC6Pxk4QNX0PiISiZN3kpY4MfvikMhZK5EKwN569yW2NXiIQbr /brcfjLtFYys5RbpqLReVOvt/phmyZ0IPCnoBzot+ieOc0fBWbx1VPmndew5ITTKBLpxGx i/3Brshl27EZoYUR/BVkUPZNq9PerqXcG2p94gbhLNWU39um/LT3VrDFPBvDMIYylC3XrK ykAQecyAsGLlziiZQU6Np1QZRhLsZIsHPgrpgeFV6bfrLmITdmtTSO3/X+pN4UB1QdXemp KD5z7Y8Wx8NI8AYshTPoxft+1Iup7gmW3KeaLT83Upyfi1z84XrByiD2NquhNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1c1bl2zrqj; Mon, 16 Jun 2025 08:53: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 55G8ruCq043062; Mon, 16 Jun 2025 08:53:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8ruS1043059; Mon, 16 Jun 2025 08:53:56 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:56 GMT Message-Id: <202506160853.55G8ruS1043059@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: d9e4b110fe91 - stable/14 - timeout(1): Use _exit(2) instead of err() in child if exec failed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: d9e4b110fe919c1e96ba3bd5fdba177f03d365c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9e4b110fe919c1e96ba3bd5fdba177f03d365c5 commit d9e4b110fe919c1e96ba3bd5fdba177f03d365c5 Author: Aaron LI AuthorDate: 2025-04-02 11:23:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:51 +0000 timeout(1): Use _exit(2) instead of err() in child if exec failed (cherry picked from commit 35503fe28eb51ef606cf4ae077a96b3c717199d3) --- bin/timeout/timeout.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 83893ba0a601..1817ef24995f 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -178,7 +178,7 @@ main(int argc, char **argv) { int ch; int foreground, preserve; - int error, pstat, status; + int pstat, status; int killsig = SIGTERM; size_t i; pid_t pid, cpid; @@ -280,13 +280,9 @@ main(int argc, char **argv) signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL); - error = execvp(argv[0], argv); - if (error == -1) { - if (errno == ENOENT) - err(EXIT_CMD_NOENT, "exec(%s)", argv[0]); - else - err(EXIT_CMD_ERROR, "exec(%s)", argv[0]); - } + execvp(argv[0], argv); + warn("exec(%s)", argv[0]); + _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); } if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) From nobody Mon Jun 16 08:53:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1d5D52z5Vq13; Mon, 16 Jun 2025 08:53: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1d33W2z3wS8; Mon, 16 Jun 2025 08:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbhK4r0WT60Dhz0IuPNj90Rw2RIgse3rJpDucSiodVM=; b=UEeJ0pqk272ZrS/TlfWmHaushIq7L+KNB8zn9E9unAsFpBmT9ldwvxtiYVpud+ZCTHmFRH oCkN20q2XXFaz8kLTinV2Xu5+OByNcA50xN3Sc21QHeSOjvyDdxDbSJhe2cr77re2CJDQJ /A2/P1E+FYTitoVqi5j+OVpS2V94KTGszBgNb6GJZUcgfblDJwIlKQXn5MBc41NbnpLgIJ bGfQPkN1ZQf1SKBcJmFmfmJbaLdkwJDJey7Jc9IhaDLwLTH+85/jhhozuPqn2O18zw7ZHd CgW6fYa3EQK7/3x6+GvqzsWi4VG1np71MEJXHcb8jKgUp1P0sGX8tKK5VRpLjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbhK4r0WT60Dhz0IuPNj90Rw2RIgse3rJpDucSiodVM=; b=aO26eh+5Na47RH8668ZP1wbqM/1TmuAh07r2pQ0WsveEE8YaYidK4zqQn9SD/yfbmzVCLB M7Vsq3drrlNjDPg852eoTCF/QkvKPJAGn4iybAmfxqSq3al8elhiB4gmKxzUdG48mpu3k/ X0NwRFBmAlJsp0pTf6fRuwHJz0KLC8y24wJ5C7TNSRZjIlDhKBZpnBFukYNHPWZXm7FOz9 o2Yd9wijGDP2v+Dk1X6lux0btkS1cF8Fv7y49N4tbGMCK7u4N4IQEpuxx9Hu633dqk8IGo BZTX0eUwHewlnTjNi5WznbRmfkOa3GKRmAoTc6yx0Z/jtKySZg9qp/NB4oZccQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064037; a=rsa-sha256; cv=none; b=d5dYlmYOPjlO0BeToEyl90DkH8FNd22INCQCcy1SRrPY7iwEFIF1cUoHzTWK1qRES96G5J leZAnaJhgC1A8DY0HAOqGW8/2H2EZu5aLy2adKdK2vtamVO3ZA/ex7rq6FrtuTTBV6zd2r RelX+kgvcWFJ+fccprst9ZAQ1Yp9iFYAf3Xtu0wPNIps4j1grQfGy8VhBEQqFqcbyh3Smc 4BRU1vY0ZnApe3KhDIJty6uhYni4I5VljRtASpSOMvhjW5snfTUovXFoBLmSaFC7td39oc knDQwRdmfvJ1OIkmzBg0zmhhk4XxP8rGv3DVm+c85sGJ/fVkVm3EOXvndh8eaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1d2F6HzrdB; Mon, 16 Jun 2025 08:53: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 55G8rvHd043096; Mon, 16 Jun 2025 08:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rvLs043093; Mon, 16 Jun 2025 08:53:57 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:57 GMT Message-Id: <202506160853.55G8rvLs043093@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: 6081c375d6e6 - stable/14 - timeout(1): sig_atomic_t variables must also be 'volatile' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 6081c375d6e6582df95c97aa79606694867c03de Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6081c375d6e6582df95c97aa79606694867c03de commit 6081c375d6e6582df95c97aa79606694867c03de Author: Aaron LI AuthorDate: 2025-04-02 11:24:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): sig_atomic_t variables must also be 'volatile' (cherry picked from commit 92f8006e8901f876af1b97d996dd245aa2c92ec0) --- bin/timeout/timeout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 1817ef24995f..397d692d8647 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -45,10 +45,10 @@ #define EXIT_CMD_ERROR 126 #define EXIT_CMD_NOENT 127 -static sig_atomic_t sig_chld = 0; -static sig_atomic_t sig_term = 0; -static sig_atomic_t sig_alrm = 0; -static sig_atomic_t sig_ign = 0; +static volatile sig_atomic_t sig_chld = 0; +static volatile sig_atomic_t sig_term = 0; +static volatile sig_atomic_t sig_alrm = 0; +static volatile sig_atomic_t sig_ign = 0; static const char *command = NULL; static bool verbose = false; From nobody Mon Jun 16 08:53:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1f5Vc8z5Vq80; Mon, 16 Jun 2025 08:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1f3s1xz3w6L; Mon, 16 Jun 2025 08:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QPWRhrGWRFcZGibiCvtRcYZ4SKhP9nk2XStVUEAb2B0=; b=FzYahm/I1GO3IKAj0yI9DtzjuPv89aVE2/vYGHcWXGp9RqmSBuXsNyD4Zi5D0qV8LSLQVS RYIp+cD+GrK6BoP8x8nPsKOrM+Px2AT72sAlG1oFvNldBmJ11LNAwaAXGRTmp2GUd6FZch +Z1+orn4IKSZsCuTtKVDH+joycxQH8LCe0peilMekC78eCx6eq3SqH5zzVJHCeB9+g9XLc iO8WtPcHYnYh/l+YRuI7QlJKxo8xXGlEsLd+u8PKUa+iqg7ElMXF7Mf8Y11Vk7zqXC5tDq WXPDEJ2QmsKFMTF5J11UtuiPSROB8Sw0UfDFOURnMEyumSeuta9MiwDtAK+gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QPWRhrGWRFcZGibiCvtRcYZ4SKhP9nk2XStVUEAb2B0=; b=Wfh+zXq7wZmD+fn/uC/oadzhSL+W0BuZZc3GoK52Ark4kmGLAgrQXss20JFlNI8nnVg7er f3XlWCAhGJQUpmqj+v39YhR299d1fpiwVX/Qu+JBaXmNwvShZw0SjlomSQ4Puu4yKYmgpn Os0/g4XTZOLskvSsljZSj2GjuI6+kMMAzKjwwnBZ5fguuTWElbx+BWVOtfTSHlrQ/oEoQt DktrurjRJR2DSZE/lRrle2AKHpbr1bbqYxA0XELJ5i0ljx2vTZzxo90YTPxLEXXDq1TKtE wveYnkIrWCTUYxLbxuKvMIZQnz2KpgzXNHsPQuFpPNuERZzGeWExN/pRCjiFRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064038; a=rsa-sha256; cv=none; b=Jlu+Hn6pVhUBRdI4o0uOjl0jE5RIKt/6A6o8VR+kB6ZjoHTwgLocxpdXvN5AqRbeU9NrK4 Dv/Up0pez9gl6zSPvP4zdz1fFn1fUkk8Lgw/gHXKTBZ3mkCQdCQAKE77Rw6zwSJT72D6ve EU0dFyNMDOOHgB+WNWkosXNHFZ7KlTIvcMfmP9D2I0JqXKR/ZcnJq5lY5s9/c9cRipXBwG uvP1wsiT3TJpC8VZwANeQifJjqrR5gB+tIRrouWOzkftmMguYlv7h07WgVHQx58ahSOy+9 ZK9WB/W3hiRK8g0lpNe6lCDpxhhL4WLKCrl8g/XOrYEaqKmjwg8/GwIfKzpjFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1f37xMzrvd; Mon, 16 Jun 2025 08:53: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 55G8rw1x043136; Mon, 16 Jun 2025 08:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rwQR043133; Mon, 16 Jun 2025 08:53:58 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:58 GMT Message-Id: <202506160853.55G8rwQR043133@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: 8461d567cfab - stable/14 - timeout(1): Multiple minor tweaks and cleanups List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 8461d567cfab1d108768f2ceb21bd0a5773d1fab Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8461d567cfab1d108768f2ceb21bd0a5773d1fab commit 8461d567cfab1d108768f2ceb21bd0a5773d1fab Author: Aaron LI AuthorDate: 2025-04-02 11:53:42 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): Multiple minor tweaks and cleanups (cherry picked from commit 790e3617361a686c76276e0c2252a761726cd919) --- bin/timeout/timeout.1 | 65 ++++++++++++++------------ bin/timeout/timeout.c | 124 +++++++++++++++++++++++++------------------------- 2 files changed, 97 insertions(+), 92 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 1a5fd95a6256..b81ce2f74625 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 4, 2025 +.Dd April 2, 2025 .Dt TIMEOUT 1 .Os .Sh NAME @@ -33,36 +33,44 @@ .Sh SYNOPSIS .Nm .Op Fl k Ar time | Fl -kill-after Ar time -.Op Fl s Ar sig | Fl -signal Ar sig +.Op Fl s Ar signal | Fl -signal Ar signal .Op Fl v | Fl -verbose .Op Fl -foreground .Op Fl -preserve-status .Ar duration .Ar command -.Op Ar args ... +.Op Ar arg ... .Sh DESCRIPTION -.Nm +.Nm Timeout starts the .Ar command with its -.Ar args . +.Ar arg +list. If the .Ar command is still running after .Ar duration , -it is killed. -By default, +it is killed by sending the +.Ar signal , +or .Dv SIGTERM -is sent. +if the +.Fl s +option is unspecified. The special .Ar duration , zero, signifies no limit. -Therefore a signal is never sent if +Therefore, a signal is never sent if .Ar duration is 0. .Pp The options are as follows: .Bl -tag -width indent +.It Fl -foreground +Only time out the +.Ar command +itself, but do not propagate signals to its descendants. .It Fl k Ar time , Fl -kill-after Ar time Send a .Dv SIGKILL @@ -70,32 +78,29 @@ signal if .Ar command is still running after .Ar time -after the first signal was sent. -.It Fl s Ar sig , Fl -signal Ar sig +since the first signal was sent. +.It Fl -preserve-status +Always exit with the same status as +.Ar command , +even if the timeout was reached. +.It Fl s Ar signal , Fl -signal Ar signal Specify the signal to send on timeout. By default, .Dv SIGTERM is sent. .It Fl v , Fl -verbose Show information to stderr about any signal sent on timeout. -.It Fl -foreground -Do not propagate timeout to the children of -.Ar command . -.It Fl -preserve-status -Exit with the same status as -.Ar command , -even if it times out and is killed. .El -.Sh DURATION FORMAT +.Ss Duration Format The .Ar duration and .Ar time are non-negative integer or real (decimal) numbers, with an optional -unit-specifying suffix. +suffix specifying the unit. Values without an explicit unit are interpreted as seconds. .Pp -Supported unit symbols are: +Supported unit suffixes are: .Bl -tag -offset indent -width indent -compact .It Cm s seconds @@ -152,9 +157,9 @@ $ echo $? Run .Xr sleep 1 for 4 seconds and terminate process after 2 seconds. -124 is returned since no +The exit status is 124 since .Fl -preserve-status -is used: +is not used: .Bd -literal -offset indent $ timeout 2 sleep 4 $ echo $? @@ -162,8 +167,8 @@ $ echo $? .Ed .Pp Same as above but preserving status. -Exit status is 128 + signal number (15 for -.Va SIGTERM ) : +The exit status is 128 + signal number (15 for +.Dv SIGTERM ) : .Bd -literal -offset indent $ timeout --preserve-status 2 sleep 4 $ echo $? @@ -171,9 +176,9 @@ $ echo $? .Ed .Pp Same as above but sending -.Va SIGALRM +.Dv SIGALRM (signal number 14) instead of -.Va SIGTERM : +.Dv SIGTERM : .Bd -literal -offset indent $ timeout --preserve-status -s SIGALRM 2 sleep 4 $ echo $? @@ -186,9 +191,9 @@ the PDF version of the .Fx Handbook. Send a -.Va SIGTERM +.Dv SIGTERM signal after 1 minute and send a -.Va SIGKILL +.Dv SIGKILL signal 5 seconds later if the process refuses to stop: .Bd -literal -offset indent $ timeout -k 5s 1m fetch \\ @@ -202,7 +207,7 @@ $ timeout -k 5s 1m fetch \\ .Sh STANDARDS The .Nm -utility is compliant with the +utility is expected to conform to the .St -p1003.1-2024 specification. .Sh HISTORY diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 397d692d8647..aaecd7fec2e5 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -40,10 +40,10 @@ #include #include -#define EXIT_TIMEOUT 124 -#define EXIT_INVALID 125 -#define EXIT_CMD_ERROR 126 -#define EXIT_CMD_NOENT 127 +#define EXIT_TIMEOUT 124 +#define EXIT_INVALID 125 +#define EXIT_CMD_ERROR 126 +#define EXIT_CMD_NOENT 127 static volatile sig_atomic_t sig_chld = 0; static volatile sig_atomic_t sig_term = 0; @@ -52,15 +52,14 @@ static volatile sig_atomic_t sig_ign = 0; static const char *command = NULL; static bool verbose = false; -static void +static void __dead2 usage(void) { - - fprintf(stderr, "Usage: %s [-k time | --kill-after time]" - " [-s sig | --signal sig] [-v | --verbose] [--foreground]" - " [--preserve-status] \n", + fprintf(stderr, + "Usage: %s [--foreground] [-k time | --kill-after time]" + " [--preserve-status] [-s signal | --signal signal] " + " [-v | --verbose] [arg ...]\n", getprogname()); - exit(EXIT_FAILURE); } @@ -109,13 +108,11 @@ parse_signal(const char *str) const char *errstr; sig = strtonum(str, 1, sys_nsig - 1, &errstr); - if (errstr == NULL) return (sig); if (strncasecmp(str, "SIG", 3) == 0) str += 3; - for (i = 1; i < sys_nsig; i++) { if (strcasecmp(str, sys_signame[i]) == 0) return (i); @@ -133,7 +130,6 @@ sig_handler(int signo) } switch (signo) { - case 0: case SIGINT: case SIGHUP: case SIGQUIT: @@ -154,7 +150,7 @@ send_sig(pid_t pid, int signo) { if (verbose) { warnx("sending signal %s(%d) to command '%s'", - sys_signame[signo], signo, command); + sys_signame[signo], signo, command); } kill(pid, signo); } @@ -165,9 +161,11 @@ set_interval(double iv) struct itimerval tim; memset(&tim, 0, sizeof(tim)); - tim.it_value.tv_sec = (time_t)iv; - iv -= (double)tim.it_value.tv_sec; - tim.it_value.tv_usec = (suseconds_t)(iv * 1000000UL); + if (iv > 0) { + tim.it_value.tv_sec = (time_t)iv; + iv -= (double)(time_t)iv; + tim.it_value.tv_usec = (suseconds_t)(iv * 1000000UL); + } if (setitimer(ITIMER_REAL, &tim, NULL) == -1) err(EXIT_FAILURE, "setitimer()"); @@ -176,9 +174,9 @@ set_interval(double iv) int main(int argc, char **argv) { - int ch; + int ch, status; int foreground, preserve; - int pstat, status; + int pstat = 0; int killsig = SIGTERM; size_t i; pid_t pid, cpid; @@ -204,38 +202,36 @@ main(int argc, char **argv) second_kill = 0; const struct option longopts[] = { - { "preserve-status", no_argument, &preserve, 1 }, - { "foreground", no_argument, &foreground, 1 }, - { "kill-after", required_argument, NULL, 'k'}, - { "signal", required_argument, NULL, 's'}, - { "help", no_argument, NULL, 'h'}, - { "verbose", no_argument, NULL, 'v'}, - { NULL, 0, NULL, 0 } + { "foreground", no_argument, &foreground, 1 }, + { "help", no_argument, NULL, 'h' }, + { "kill-after", required_argument, NULL, 'k' }, + { "preserve-status", no_argument, &preserve, 1 }, + { "signal", required_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; while ((ch = getopt_long(argc, argv, "+k:s:vh", longopts, NULL)) != -1) { switch (ch) { - case 'k': - do_second_kill = true; - second_kill = parse_duration(optarg); - break; - case 's': - killsig = parse_signal(optarg); - break; - case 'v': - verbose = true; - break; - case 0: - break; - case 'h': - default: - usage(); + case 'k': + do_second_kill = true; + second_kill = parse_duration(optarg); + break; + case 's': + killsig = parse_signal(optarg); + break; + case 'v': + verbose = true; + break; + case 0: + break; + default: + usage(); } } argc -= optind; argv += optind; - if (argc < 2) usage(); @@ -247,7 +243,7 @@ main(int argc, char **argv) if (!foreground) { /* Acquire a reaper */ if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) - err(EXIT_FAILURE, "Fail to acquire the reaper"); + err(EXIT_FAILURE, "procctl(PROC_REAP_ACQUIRE)"); } memset(&signals, 0, sizeof(signals)); @@ -263,7 +259,7 @@ main(int argc, char **argv) signals.sa_flags = SA_RESTART; for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i++) { - if (signums[i] != -1 && signums[i] != 0 && + if (signums[i] > 0 && sigaction(signums[i], &signals, NULL) == -1) err(EXIT_FAILURE, "sigaction()"); } @@ -273,9 +269,9 @@ main(int argc, char **argv) signal(SIGTTOU, SIG_IGN); pid = fork(); - if (pid == -1) + if (pid == -1) { err(EXIT_FAILURE, "fork()"); - else if (pid == 0) { + } else if (pid == 0) { /* child process */ signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL); @@ -285,14 +281,15 @@ main(int argc, char **argv) _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); } + /* parent continues here */ + if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) err(EXIT_FAILURE, "sigprocmask()"); - /* parent continues here */ set_interval(first_kill); + sigemptyset(&signals.sa_mask); for (;;) { - sigemptyset(&signals.sa_mask); sigsuspend(&signals.sa_mask); if (sig_chld) { @@ -300,9 +297,7 @@ main(int argc, char **argv) while ((cpid = waitpid(-1, &status, WNOHANG)) != 0) { if (cpid < 0) { - if (errno == EINTR) - continue; - else + if (errno != EINTR) break; } else if (cpid == pid) { pstat = status; @@ -328,16 +323,18 @@ main(int argc, char **argv) killemall.rk_flags = 0; procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall); - } else + } else { send_sig(pid, killsig); + } if (do_second_kill) { set_interval(second_kill); do_second_kill = false; sig_ign = killsig; killsig = SIGKILL; - } else + } else { break; + } } else if (sig_term) { if (!foreground) { @@ -345,34 +342,37 @@ main(int argc, char **argv) killemall.rk_flags = 0; procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall); - } else + } else { send_sig(pid, sig_term); + } if (do_second_kill) { set_interval(second_kill); do_second_kill = false; sig_ign = killsig; killsig = SIGKILL; - } else + } else { break; + } } } while (!child_done && wait(&pstat) == -1) { if (errno != EINTR) - err(EXIT_FAILURE, "waitpid()"); + err(EXIT_FAILURE, "wait()"); } if (!foreground) procctl(P_PID, getpid(), PROC_REAP_RELEASE, NULL); - if (WEXITSTATUS(pstat)) - pstat = WEXITSTATUS(pstat); - else if (WIFSIGNALED(pstat)) - pstat = 128 + WTERMSIG(pstat); - - if (timedout && !preserve) + if (timedout && !preserve) { pstat = EXIT_TIMEOUT; + } else { + if (WIFEXITED(pstat)) + pstat = WEXITSTATUS(pstat); + else if (WIFSIGNALED(pstat)) + pstat = 128 + WTERMSIG(pstat); + } return (pstat); } From nobody Mon Jun 16 08:53:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1h1Glwz5VpgC; Mon, 16 Jun 2025 08:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1g4d87z3wSn; Mon, 16 Jun 2025 08:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l84g8cKXhYMV3vPFb3mB1OLKita99yzRKMKXjZxD15Y=; b=LuTNaBZSaD1eW2DxaTFCOWVJPVguwEc8QH+8je3Oh4pQP5cNi8n5tjMLuJfWOPZtFitKqj xflbvnndaZMuO3TVVBCww5bP+eKWO9UbD2j5XwThY1eNI/xU8lprkkFqcigbdxoGj+shzS nTwONCyYN4U76oFEzFhE9E7FInD+ufBzR1vV8jlubhTIbzLs3VbXE6gBVGNLk+pGCaJieF rBY5OxtlGDbk4stnjLGqDz9JZ+9oBgsFr2UDo5vruqu5oYeVHYncRwIXkzPXmMV0r0/V6x BWBWWuKG8Ta9RPP1RsJzA+jjqKGnNAp8p3csuBqMWq5guYQ562BH5IOzRjfQQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l84g8cKXhYMV3vPFb3mB1OLKita99yzRKMKXjZxD15Y=; b=lWZB3BATINi/lv4zpZHcUtCdFAqDdCmkZJzrjvDNIebymxDwdYXCUh5I7qp7J1vQqADjGT fM4tG5JIhj0uoacTLO8AZwc+ugAkgSK0CML/dhWYUBPtLOwoOGu5Wbucwm6JJDLiaGl+zi Z3DolXi9Rr5AraxbzgtQnOUMVPOXzCxV4l5wxx/1u+aX/Thi59QgB1ifMgRw2289NaLLfe H6U5HJP+w8eK29me+7nyP/fKZg5HqnFAbp/xUFsye7bsSwVuXwamnJm8lIt5ef/01/dwwo kCG/mqT7RbYzTyxEi7I5vKs1Mug1qct6Z7OKWzVbWE+aFq6yN5PjZ7S5uL8lXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064039; a=rsa-sha256; cv=none; b=lhcNoiokB+n1sjnMXIyiajVEHHo7oALJ5nZVTlWtr8hbj468miQtV9O+o5w0NntLINNLKY olDYSskAVD7pJPLpVgtfLf/+ctpYB6k9QVJm1Ryqk0WNTsy2eZoEf5dLU3RFZOqoIcQKAG zpmR9pHo/ZqJhu/UH7+stvhBMARQDcE77Ml5UIZgrWru5hDBJMsh5Q9P0V4YHiZWU3VeNh V+C+5II/tF/LPODUq7UtjI0TAfO0f8yXnCxw7JZpvvChmb2GZg78mTiHk3miFRG4wU4Uyr z6gh9NqiuFXpfNv4zVYMAuffGVCCxkqQwOuwEz17xBa2X8Cx3OISuqpfYLZmgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1g47qVzrqk; Mon, 16 Jun 2025 08:53: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 55G8rxkD043171; Mon, 16 Jun 2025 08:53:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8rxwC043168; Mon, 16 Jun 2025 08:53:59 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:53:59 GMT Message-Id: <202506160853.55G8rxwC043168@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: a56833c9f727 - stable/14 - timeout(1): Handle sig_alrm and sig_term together to dedup code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: a56833c9f72703ad6438c7236e60c2c44030c6ea Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a56833c9f72703ad6438c7236e60c2c44030c6ea commit a56833c9f72703ad6438c7236e60c2c44030c6ea Author: Aaron LI AuthorDate: 2025-04-02 14:34:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): Handle sig_alrm and sig_term together to dedup code (cherry picked from commit c5cdc13045650a9daf33dd6316ef57496e4a5dbc) --- bin/timeout/timeout.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index aaecd7fec2e5..4c81b64cd2b6 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -174,7 +174,7 @@ set_interval(double iv) int main(int argc, char **argv) { - int ch, status; + int ch, status, sig; int foreground, preserve; int pstat = 0; int killsig = SIGTERM; @@ -314,36 +314,23 @@ main(int argc, char **argv) break; } } - } else if (sig_alrm) { - sig_alrm = 0; - - timedout = true; - if (!foreground) { - killemall.rk_sig = killsig; - killemall.rk_flags = 0; - procctl(P_PID, getpid(), PROC_REAP_KILL, - &killemall); + } else if (sig_alrm || sig_term) { + if (sig_alrm) { + sig = killsig; + sig_alrm = 0; + timedout = true; } else { - send_sig(pid, killsig); + sig = sig_term; + sig_term = 0; } - if (do_second_kill) { - set_interval(second_kill); - do_second_kill = false; - sig_ign = killsig; - killsig = SIGKILL; + if (foreground) { + send_sig(pid, sig); } else { - break; - } - - } else if (sig_term) { - if (!foreground) { - killemall.rk_sig = sig_term; + killemall.rk_sig = sig; killemall.rk_flags = 0; procctl(P_PID, getpid(), PROC_REAP_KILL, - &killemall); - } else { - send_sig(pid, sig_term); + &killemall); } if (do_second_kill) { From nobody Mon Jun 16 08:54:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1j3krVz5Vplc; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1j21G4z3wJ5; Mon, 16 Jun 2025 08:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ziVaiVqJO8irIJTZz1KbQg8CUTakTxuDV38CsnZlqE=; b=a0RXDt5Nr1R4iNJ7BNb9t2b/BQdFhLPLabmaspGvLM2l0YY0LAPXoQXIRz3PmvXttdnMpf uW9kCrxQuxDBrchZuZUD4757VSr73+jQ+9/ZedN7/qJ7owjuyE7PcWwqcbq6xHErdiK4bf 5ya/bG7oDjWHMXvya5sudTOTFx0yCGkYjaGc26FeHPsrPi2AxkuayCeNXfH/JThx7FUOEV w2eRMhI3JEE2tc2rZfQktb/+VQoSFKHoXNNF1jaynyRg7vm9ikwaOifWLKb4Yl5f1GdOIZ /S9yA0/W5r+G8zoLtNFh9pKTiPxGS4yO8++RVK7GSYeCAWD2IrhvyQ1kpu67Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ziVaiVqJO8irIJTZz1KbQg8CUTakTxuDV38CsnZlqE=; b=Mx1YnZEQygPfr4Ak46AmSXNmZVJRnJbbN5PvJRSzfQIm/UKHRIsideuWE0vwPmUq4k2ewZ Qs1ZxoJAdKh0KsKQNk2lcOA/2+oD1xI7SGmpH823JefACePgSPv7pEi3SWUNnB8O5BisSn ClRdLdb9ozbVe2vMhYpHS9zgZC+gTxyvHXRREv0O2MDNYjUSbrJLO0EFzKcDSoczyKZzia xZQj0xiYINmU6ncAbZatC5teq47tpy/ZLQEAy3Oxsw2F6+aM0ERo/32xPKIIHrYYWl25dj jUyB1LIo5MacSCDToI26fTpGpmbbs/LupjsoPQsluUDnN66pzzCxdsGGMe9c8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064041; a=rsa-sha256; cv=none; b=rzzq9QXsQnLWRJeUYck/QQP53G7WzaUKbW/3lDiAQ5k77Y5pHl9LGWRJddyr3iKKlwBzpk xhtjd2cQpPL9La13alL2fBAf7QeV1k5DD0G3iDC+qPQZMyj6tTBe06sNQhdr4WbNoG2/Pq E+6M2pY4MpJpB7F8tsVZJJn6LNcz49ngqEpAQYj20UM/roudxKpwQBjdwGpjx2UoYZTk/V pbpMec7q43GaG2ZKKaV4U7osxh+AFCeBHwQOqUjr92aaS/r0MaK/rBY3ICLy5VvcOxzsMX NWYnxWo/YrucEhm0o55+N9oYztBx7a8wCqoDo1IRhhUwhdF9Lcg+HbahqxmAqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1h4tQrzrkK; Mon, 16 Jun 2025 08:54: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 55G8s0oR043211; Mon, 16 Jun 2025 08:54:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s0a1043208; Mon, 16 Jun 2025 08:54:00 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:00 GMT Message-Id: <202506160854.55G8s0a1043208@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: 865510547e24 - stable/14 - timeout(1): Add -f and -p options as per POSIX.1-2024 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 865510547e2499cb536137633419f47c7e4f5dea Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=865510547e2499cb536137633419f47c7e4f5dea commit 865510547e2499cb536137633419f47c7e4f5dea Author: Aaron LI AuthorDate: 2025-04-02 15:29:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): Add -f and -p options as per POSIX.1-2024 (cherry picked from commit 8a9927ecd4b6e8cb306e4b940201b4efbfbc5dcb) --- bin/timeout/timeout.1 | 8 ++++---- bin/timeout/timeout.c | 35 ++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index b81ce2f74625..3eacdd768410 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -32,11 +32,11 @@ .Nd run a command with a time limit .Sh SYNOPSIS .Nm +.Op Fl f | Fl -foreground .Op Fl k Ar time | Fl -kill-after Ar time +.Op Fl p | Fl -preserve-status .Op Fl s Ar signal | Fl -signal Ar signal .Op Fl v | Fl -verbose -.Op Fl -foreground -.Op Fl -preserve-status .Ar duration .Ar command .Op Ar arg ... @@ -67,7 +67,7 @@ is 0. .Pp The options are as follows: .Bl -tag -width indent -.It Fl -foreground +.It Fl f , Fl -foreground Only time out the .Ar command itself, but do not propagate signals to its descendants. @@ -79,7 +79,7 @@ signal if is still running after .Ar time since the first signal was sent. -.It Fl -preserve-status +.It Fl p , Fl -preserve-status Always exit with the same status as .Ar command , even if the timeout was reached. diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 4c81b64cd2b6..7e4009f8ac8a 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -56,8 +56,8 @@ static void __dead2 usage(void) { fprintf(stderr, - "Usage: %s [--foreground] [-k time | --kill-after time]" - " [--preserve-status] [-s signal | --signal signal] " + "Usage: %s [-f | --foreground] [-k time | --kill-after time]" + " [-p | --preserve-status] [-s signal | --signal signal] " " [-v | --verbose] [arg ...]\n", getprogname()); exit(EXIT_FAILURE); @@ -175,13 +175,14 @@ int main(int argc, char **argv) { int ch, status, sig; - int foreground, preserve; int pstat = 0; int killsig = SIGTERM; size_t i; pid_t pid, cpid; double first_kill; - double second_kill; + double second_kill = 0; + bool foreground = false; + bool preserve = false; bool timedout = false; bool do_second_kill = false; bool child_done = false; @@ -198,25 +199,29 @@ main(int argc, char **argv) SIGQUIT, }; - foreground = preserve = 0; - second_kill = 0; - + const char optstr[] = "+fhk:ps:v"; const struct option longopts[] = { - { "foreground", no_argument, &foreground, 1 }, - { "help", no_argument, NULL, 'h' }, - { "kill-after", required_argument, NULL, 'k' }, - { "preserve-status", no_argument, &preserve, 1 }, - { "signal", required_argument, NULL, 's' }, - { "verbose", no_argument, NULL, 'v' }, - { NULL, 0, NULL, 0 }, + { "foreground", no_argument, NULL, 'f' }, + { "help", no_argument, NULL, 'h' }, + { "kill-after", required_argument, NULL, 'k' }, + { "preserve-status", no_argument, NULL, 'p' }, + { "signal", required_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; - while ((ch = getopt_long(argc, argv, "+k:s:vh", longopts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, optstr, longopts, NULL)) != -1) { switch (ch) { + case 'f': + foreground = true; + break; case 'k': do_second_kill = true; second_kill = parse_duration(optarg); break; + case 'p': + preserve = true; + break; case 's': killsig = parse_signal(optarg); break; From nobody Mon Jun 16 08:54:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1k1Svkz5Vplg; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1j6T3Vz3wJF; Mon, 16 Jun 2025 08:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRzxHIiEq+bOgRlblvsdUlqKfX3csse8LImkH4wFtu4=; b=mW9RIv+XghA/fa4xI3gxIKQ+oo9QwcmZEzgewJBRccIwG8qMEfdEFl1RMLwfauc1DJSz+A ljpBsBd6bNBImSKTH+SM9GHivIukDAeYrkcQf2c95z2isxEhifDtwcskMCeVxfxbBBQzBE Xw2UzHGalQV7U6Zw0VBYR7FXvr/fnyO2qBoeE0ehMy5ZSGPfUCkPAntnbkMszUT0SIDJy3 0KMDa7UuHMkFE5mECiAX0MJ6jjaoaIqht7zVvXnr/dSA58TDo96hgXQNfxYqaRfQjjesLE DiCwLHyDrDdKfy9pfMkQww6male6cpyIiFhCTOomQg8oE8rps5AA7vZurFfi8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRzxHIiEq+bOgRlblvsdUlqKfX3csse8LImkH4wFtu4=; b=Z2h3nVFpc3CU78HBUKNRXwuNZJVp6WKdVbxDqznYlBMQ1FODwdmZhUZHwEPSsQ9Wt096TZ 0vaNjszsGHzYazcGfZ5jkJyzfshWfezKH5q1/3QF2P52Rzcs8qEG5/f9cHYEvgcQQEBBdA pJkUuoHg5KDvb2AVaXj5Y8UC+iHDPssOsyy6brtmdfGb8J1NBmmP3jjj9Mjht18hiRxXRX xnEw9NXet/xWT5Vzp+P8Srcn4afRwSO4VJgkyq6l6MhmAf2du6xc7p3xiEB06vTzew0q57 1X9I4e4DQi4yv2FfRN6Mw0cwlAjLRMXcrV4AvzSxs/8XvdJTZr10gyc/qVlXJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064041; a=rsa-sha256; cv=none; b=VjGB2EkJ8bjrmg2Ruua0yAucy4iMteTOsF4w7Cqo3EwH8dD8FXwjX1g3Lh+fhUP8EPk/q0 oL6uRD2YrDCPixwfVSB5Pwe206UvQBts76vnUyTSyD5M+TOG7EsCAkvJX89I8gilK8M6ra KUbudxmGOfu9XEtgoEkiI+2cg67dTQvNxEhPJHu5lAPuEDV5DqoPZ8PeeJU+60O9RHqTOz de7TIRwuDbzQlB54OxZVw9FC3TnFb4vP6L98de88vVFxFk2RPf3bOIwIhtvAQSha757m+A 58Dj6sVLDR/o312AaTUZwUSS+NKuWvH9H064RYvtONlsnqPXrV0wNHABLEV3Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1j5s6JzrJ2; Mon, 16 Jun 2025 08:54: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 55G8s1T9043245; Mon, 16 Jun 2025 08:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s162043242; Mon, 16 Jun 2025 08:54:01 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:01 GMT Message-Id: <202506160854.55G8s162043242@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: 48cbc068c88f - stable/14 - timeout(1): Enhance send_sig() and prepare for later updates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 48cbc068c88f96cc19c658bd6f759496e00fcca4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=48cbc068c88f96cc19c658bd6f759496e00fcca4 commit 48cbc068c88f96cc19c658bd6f759496e00fcca4 Author: Aaron LI AuthorDate: 2025-04-02 15:51:47 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): Enhance send_sig() and prepare for later updates (cherry picked from commit 086f17853677d072b8c5f4b2440f9e3a9aea7bdf) --- bin/timeout/timeout.c | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 7e4009f8ac8a..8f933f509407 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,19 @@ usage(void) exit(EXIT_FAILURE); } +static void +logv(const char *fmt, ...) +{ + va_list ap; + + if (!verbose) + return; + + va_start(ap, fmt); + vwarnx(fmt, ap); + va_end(ap); +} + static double parse_duration(const char *duration) { @@ -146,13 +160,25 @@ sig_handler(int signo) } static void -send_sig(pid_t pid, int signo) +send_sig(pid_t pid, int signo, bool foreground) { - if (verbose) { - warnx("sending signal %s(%d) to command '%s'", - sys_signame[signo], signo, command); + struct procctl_reaper_kill rk; + + logv("sending signal %s(%d) to command '%s'", + sys_signame[signo], signo, command); + if (foreground) { + if (kill(pid, signo) == -1) + warnx("kill(%d, %s)", (int)pid, sys_signame[signo]); + } else { + memset(&rk, 0, sizeof(rk)); + rk.rk_sig = signo; + if (procctl(P_PID, getpid(), PROC_REAP_KILL, &rk) == -1) + warnx("procctl(PROC_REAP_KILL)"); + else if (rk.rk_fpid > 0) + warnx("failed to signal some processes: first pid=%d", + (int)rk.rk_fpid); + logv("signaled %u processes", rk.rk_killed); } - kill(pid, signo); } static void @@ -188,7 +214,6 @@ main(int argc, char **argv) bool child_done = false; struct sigaction signals; struct procctl_reaper_status info; - struct procctl_reaper_kill killemall; int signums[] = { -1, SIGTERM, @@ -329,14 +354,7 @@ main(int argc, char **argv) sig_term = 0; } - if (foreground) { - send_sig(pid, sig); - } else { - killemall.rk_sig = sig; - killemall.rk_flags = 0; - procctl(P_PID, getpid(), PROC_REAP_KILL, - &killemall); - } + send_sig(pid, sig, foreground); if (do_second_kill) { set_interval(second_kill); From nobody Mon Jun 16 08:54:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1l5wDlz5Vq1D; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1l0Lzkz3wWd; Mon, 16 Jun 2025 08:54:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=stOH5DSqaWz+Xae20i/qZ3o6EvBXd4MNpw0Sc0WaAmk=; b=vT5/GLiYXFG3cmU0/E30rVCpLgIhrwuLVYrpLze16g5oJlIWzLcsfdyQMumTAZbwlSRp74 nw+lXLouZSb4NxrRCC4be+V+a7SjxQaIaqkt4qOdoQ3AS+18I2CWtc0VWNj2RoSqa7labL X6gp++BfXflAgMOh2yL6vTJ3wq1yGMroUKutOV/uJ2w7CQAx/AIU7qE42ZDQDhwbuU7Az/ 5ci+hHkoOm5zqzbYY3fm+tPkhWmqTWt5TERTndpWEAmCMtderqeOQQfO+0XyxGKjMpUPqk LO2XdwAm5yiUPaknozXtZydqPyPvIK1gSYf9t25KZBGDnXZv7iI07O/WQ4OoPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=stOH5DSqaWz+Xae20i/qZ3o6EvBXd4MNpw0Sc0WaAmk=; b=whT5zBOZtaUqbOZWrtTpAernTZCbNqovIH5uR7WEO5H4e2bQQuXMBsW0++iretAfnvo7IH FtsOHv5OeTPYB10FCnR9lHGWN+2dTx0FpzIVEvyUuKddohe9zusmT0NEpakUBT19TqJZn8 yAjxi3cD2LFxAGQNstPpgGjLgKtKr1oeWbBb4GyUkKG10oGAnpJ2BZPeCouhVJM5/Jq0Sc 92Af6wip+V8TGbiDe7otKIMDs6iXc+hzSsNgzdwsCY7VRNZ0f/3EFFBPZCbFXzy13N/IdN AIAqtQ1GdXIr7472hFHJdvTaR3LAZYAmEEOcJ8YfJsaXkaMEULEudhwIPPYObw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064043; a=rsa-sha256; cv=none; b=Op2l4gmRh/c6mk3sdjUW7gAODq0UBC3/U+vFW0iNC7aDh7a+G1Pvd4x3c7pb41dAnpB5wK M8iHpnW+LiXKLKOPOBTsoNTErSnNQ4u0yDJ1nCQQvfVM2ZhhXPJYHO/h0yPgnVLU73JoOi QPq3zZQGzzt06eEKny8WsYWud0NqLFT9M6faiN/O+2MCemSl0r2MRyzJXbF2oDaWcawZ3W tY4In7LiPpN7foBO4YBinltWHhr6FqwMfscKLl/GfJLDd9wuN+rsc5RQTmCAU5nv44D0WT xvbjKNZ6LpFOUXUBKp0aJu879GJASok2CYWGbW8YO6VYFtHxhSSUF1JTLc8rYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1k6y2Tzrql; Mon, 16 Jun 2025 08:54: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 55G8s27q043279; Mon, 16 Jun 2025 08:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s2jH043276; Mon, 16 Jun 2025 08:54:02 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:02 GMT Message-Id: <202506160854.55G8s2jH043276@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: e76807eb2360 - stable/14 - timeout(1): Also send SIGCONT because the child may be stopped List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: e76807eb2360f56a823569b9b751ee574e24aceb Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e76807eb2360f56a823569b9b751ee574e24aceb commit e76807eb2360f56a823569b9b751ee574e24aceb Author: Aaron LI AuthorDate: 2025-04-02 16:01:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:52 +0000 timeout(1): Also send SIGCONT because the child may be stopped (cherry picked from commit 06c74693c286185f299410afcd312fc54a96a052) --- bin/timeout/timeout.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 8f933f509407..e702803a25c2 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -179,6 +179,24 @@ send_sig(pid_t pid, int signo, bool foreground) (int)rk.rk_fpid); logv("signaled %u processes", rk.rk_killed); } + + /* + * If the child process was stopped by a signal, POSIX.1-2024 + * requires to send a SIGCONT signal. However, the standard also + * allows to send a SIGCONT regardless of the stop state, as we + * are doing here. + */ + if (signo != SIGKILL && signo != SIGSTOP && signo != SIGCONT) { + logv("sending signal %s(%d) to command '%s'", + sys_signame[SIGCONT], SIGCONT, command); + if (foreground) { + kill(pid, SIGCONT); + } else { + memset(&rk, 0, sizeof(rk)); + rk.rk_sig = SIGCONT; + procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); + } + } } static void From nobody Mon Jun 16 08:54:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1m4yK6z5VqD6; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1m21Jrz3wVD; Mon, 16 Jun 2025 08:54:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dZoDen9LJMTul+B/B8tMYmH9qMmG66L8yaQo/WcVMhY=; b=VHAotpBxvNpowD9CbsSIE0eLiE+Urkg5zaXCBpGeReNdPRwSkIJK1sllfxUXPb9RN7TkTC 71q92o1aqZX677xBU7qogXYJFx9QymRECwVW/BzOylrFi/adQ6K3BbPQNobmj6E+H5iYTs fe5oF8jiDQTfrc8c85R9XULB7v3/CYPxC5XVfaApXFux061nQtPdUXPEbL2Xd8H4CP2EQZ J1bVID9iN2LM3xmZKvRiyOdxrWW04kUSkjlvYCn5BfD1syvwgZXn7wHuUJW+S8/Dqy24Yh u3jiALBjl3dXvAA38WloLZZS3nKkVeMpotsK6OBd48ei+/yKQRBBJGU7nNepyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dZoDen9LJMTul+B/B8tMYmH9qMmG66L8yaQo/WcVMhY=; b=FQLcCYofnknEpClek7EjSB3O0n78OtvHNwVTSr1uA28MPziW/47doe6uI06PFQxoUHg5L2 cTL1JP0leteZV+si//2Q17uvhSesxU5pB2aMHM82RtarVBexaR3yJYt9q1Gx9zjvG9Lqz5 Akfz7ItMCKbJN0qOxAZlctAETcGKaEvTuZjLg6q7Wml3Hwxk0kPBRdMbgzkZNrxtVH9J5o Zl+RSgLVbKYhuQbAqqPDDP2DHyjoNqb5iigDsJaOK4m9L8iJyEZVDJXkDBktv0h3w3UANN dsfLcHVk2xuNTV8lQxWvgE92OGmtCKx20qyKC2SleLEDi/LpYEBmDIzkpEmlqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064044; a=rsa-sha256; cv=none; b=Sw5c+4GDgqy7jAh+X0AbnZeLaeIb6WUnTvcbMaoUFCuEhGp+b7FFPTz6/aDRcY7NFME4uI /1eEtZFo8OpCqhKQtL7oDdH/R9ukV9AM3MSGw9d+QkwzI/UiPt3o81RGatGCRo2muJGUWH a5RJBCd14fUnmMcDQXa6HFChea+8llwnt8wl67l6j6PBv/A0qZZl0JK9uIoRMJoWYmunYc YmTBBefGcKgAOZ88EwYy2V93D+7VWx1RJ0o8XtBs8XJlLDsJC7h2OJMaK09yORWaREIOhK faXTkNa/I/hPixBBpzYyNUjezvypeLhsYDOmOTTAb5DWZzf01QWLCIUaAd2HNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1m0wnZzrqm; Mon, 16 Jun 2025 08:54: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 55G8s4EE043320; Mon, 16 Jun 2025 08:54:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s4ct043317; Mon, 16 Jun 2025 08:54:04 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:04 GMT Message-Id: <202506160854.55G8s4ct043317@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: e59571c5a789 - stable/14 - timeout(1): Fix the handling of repeated terminating signals List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: e59571c5a78988a13eeaa473302a4029a459022f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e59571c5a78988a13eeaa473302a4029a459022f commit e59571c5a78988a13eeaa473302a4029a459022f Author: Aaron LI AuthorDate: 2025-04-02 16:14:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Fix the handling of repeated terminating signals (cherry picked from commit aae3eb24dfdbbe0a9e62fe7239d6038060cd07f6) --- bin/timeout/timeout.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index e702803a25c2..c3c7532a9d08 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -49,7 +49,6 @@ static volatile sig_atomic_t sig_chld = 0; static volatile sig_atomic_t sig_term = 0; static volatile sig_atomic_t sig_alrm = 0; -static volatile sig_atomic_t sig_ign = 0; static const char *command = NULL; static bool verbose = false; @@ -138,11 +137,6 @@ parse_signal(const char *str) static void sig_handler(int signo) { - if (sig_ign != 0 && signo == sig_ign) { - sig_ign = 0; - return; - } - switch (signo) { case SIGINT: case SIGHUP: @@ -377,19 +371,11 @@ main(int argc, char **argv) if (do_second_kill) { set_interval(second_kill); do_second_kill = false; - sig_ign = killsig; killsig = SIGKILL; - } else { - break; } } } - while (!child_done && wait(&pstat) == -1) { - if (errno != EINTR) - err(EXIT_FAILURE, "wait()"); - } - if (!foreground) procctl(P_PID, getpid(), PROC_REAP_RELEASE, NULL); From nobody Mon Jun 16 08:54:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1n5PMCz5VqBH; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1n2S4fz3wlB; Mon, 16 Jun 2025 08:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XT5gbQDmiHDdZEKIoMoDcZeLu3No5U6f4mrVrJOp6z0=; b=NWKqtQ7ks9lIjm2FDv/LFY2R4gYVuVMTnIjBfhHadPpTdKFF8TDm2TPPzpnKiagU8iuwSf FGScz3bY5eUOYYbvzaV9Mj8ECnI/+9+smaw3Ku370AMU4p/XytwGYC0nOKexlDwqQuBBhn zp3UkATaEYdpDWPejN8bXQffEugpEVmp+kzWb4BMMZR8quVpdV2o9nbmR2nbsbRWoJFyqG tzYnU2Uj8xmwppqM5iHQMRq/97UHtsjF6GTJTZuVRJHAJw2Hs5b6s93nZmXkrcuRxkmz+v DczMg+jXJjZYx2UwbxqXNpJrlvd6jnMGxBnqXvkN7JNLx5MCkM58W6kxPANF7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XT5gbQDmiHDdZEKIoMoDcZeLu3No5U6f4mrVrJOp6z0=; b=tpwt7NSFw8r9snXgEHgW5zFWB2U2LSX6DEAEdoMaoH0ox2hM5d4qoW+SXzBVzj0CVpOUtl CZ/8MDWKQL/1Qd0BBBINr6R1dMWdSr0hyLVYUS/vCYRTmvMjTgaIMihXJv2Erj2lU6KSxQ NFVcWq4heUrYTkN7idExxJxX/d5euGbOqLslN83K7xQqmeNTddoYMWGx4cKC7Gh5KjuHaZ hmlKRCdQQdV8ERcbnr9AIwcdOyPsN5jMvCEgjnOpkPfXlk9wnP8+Mb8/ttGkbtGcfFv0k2 RGLBMAPxULavhP+xLIPIiAe1d7yurhwLBNAIkDd0PlSU3aVJm0aigDNxU3bkMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064045; a=rsa-sha256; cv=none; b=WwjL5TaVAw+NOKHuIsPUwl5afi/XBMqyXInNWNiugzcpE7Gz/hNS+XnoE+ChPAOcxStTF2 nnP9Tjyc0o2eUH1eu/ZW6mDPoHAWH6HdyjCXNn6kTbX/eLg+2ROsfcBgL8bIYtgiZJKo+R vPIrRh2/wMYUh8AECXxn/bhu2QAo9mVEJ9OlwozD3iCaTT8cVMGUkJ3hnukDf+zTkAwtQX n1PI1kyO9yXwkYPvVRXkbKOK4FvAPwSVkf3cHw8QW8xmGs2kYBsprPTt99lbCdsjFa7PZ4 PZYeF76IrwkmJSaYFwrFWn2OI7cPZuxFdC7Xa2Wx87qii/+TxLLeo6vMEuKJhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1n1vtJzrFl; Mon, 16 Jun 2025 08:54: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 55G8s5hr043353; Mon, 16 Jun 2025 08:54:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s5se043350; Mon, 16 Jun 2025 08:54:05 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:05 GMT Message-Id: <202506160854.55G8s5se043350@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: f358b8dc7418 - stable/14 - timeout(1): Improve to show more verbose log messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f358b8dc7418776592470b9f08585431ac81632e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f358b8dc7418776592470b9f08585431ac81632e commit f358b8dc7418776592470b9f08585431ac81632e Author: Aaron LI AuthorDate: 2025-04-02 16:17:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Improve to show more verbose log messages (cherry picked from commit 8e1d9fe06621e22b9de6b3bf1b6164a00f0f26b5) --- bin/timeout/timeout.1 | 6 +++++- bin/timeout/timeout.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 3eacdd768410..14fc19292684 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -89,7 +89,11 @@ By default, .Dv SIGTERM is sent. .It Fl v , Fl -verbose -Show information to stderr about any signal sent on timeout. +Show information to +.Xr stderr 4 +about timeouts, signals to be sent, and the +.Ar command +exits. .El .Ss Duration Format The diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index c3c7532a9d08..8a2f0faecd83 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -344,6 +344,19 @@ main(int argc, char **argv) } else if (cpid == pid) { pstat = status; child_done = true; + logv("child terminated: pid=%d, " + "exit=%d, signal=%d", + (int)pid, WEXITSTATUS(status), + WTERMSIG(status)); + } else { + /* + * Collect grandchildren zombies. + * Only effective if we're a reaper. + */ + logv("collected zombie: pid=%d, " + "exit=%d, signal=%d", + (int)cpid, WEXITSTATUS(status), + WTERMSIG(status)); } } if (child_done) { @@ -361,9 +374,12 @@ main(int argc, char **argv) sig = killsig; sig_alrm = 0; timedout = true; + logv("time limit reached or received SIGALRM"); } else { sig = sig_term; sig_term = 0; + logv("received terminating signal %s(%d)", + sys_signame[sig], sig); } send_sig(pid, sig, foreground); From nobody Mon Jun 16 08:54:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1q1BTBz5Vq8M; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1p3XW6z3wlQ; Mon, 16 Jun 2025 08:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mx5cH5ItL3IUQve1YRj3oAXeGxLcHlgzcefScGukEY=; b=SpUA4edH0efDxAt1mT8JgJlDq638JAl4TLepkPvDb7Haxs2eymjSSbPs8evqL9nVAEujci +w3ktDE5uT6yyr47asVPWf52fiiGQCdnyPttw6IZcb5lPJL89cW8DFXOWT6Y5euHzjj2Fk 91LMwb3YIIUyVs1mC6GFRDK20boSJKl7AzYv/StihL3ZRRSraRFLKO+JgoAQSiRJBbzssr 5G7IKXwsFtBvKy+IGAbWPMNDB8er4+1p9xdZTIsYcXtfLQM6D+dH20C/XshCXEhzjxtbn4 031JZclUAPbt6fWvTQapnO6FbEXH6xVhvJX0V1vLi1TSGRO6MIuGAGr9Tv1vIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mx5cH5ItL3IUQve1YRj3oAXeGxLcHlgzcefScGukEY=; b=sexPJDUkO508V+EEU4zmWLgKbklUUPgmJVTtxHDTu31LsN6cSR1WIVG9cC78uKeYIH3j16 nhkGvONocaAG4FUi6zS5vy/sRbcaa2rjuAyLuOzEQXlEEioRSMn/Zvvy4WDwIu2dhbesp8 xEnjnX92EiYTCD0jGaTm06BQTYiUbTTsO4VYT6m8E67LnTmMwcq8h76x7ibRxxrMvmEXrz lDPparJOm8HXJXdMVlv/NVJFdhYBuS9bRZJgsNslKk2oWhUu1w2GeSpt3kYTEPcwmrAa/q xZFdYZdACuPh7AZaf3nXBjem04zdzZ5lZEUCmrNpsd2ObTsi3eDA0/x/kv3dMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064046; a=rsa-sha256; cv=none; b=f5hmMvpNShqn1+l81/XLpYCPjE0DgOJpKAudBVmtlXRFy7B/miAtb+M1u+aZqs9aBXAlJA 6eVxaZ+PglgwKMY/TXBd998ZS/+eKxWrUJ9+EfMUpMLn+PHnc9Yq6L6s5yiGbtH54sdTD/ VHNpFLAa61NHqc4adKMzEpmzmDWSgCu4RMfcfmsALmgac1GOch2dKd+j1rl1xPJwqw9b25 98xjChutpJj0popbEozyvaXUPTjR4c9gwHkkC8wcSx9HeWz9FghwFYFVfaEJkrePRQZM1T /Uj5Rv4QuPDco08MfJ+eJAc8Sz8smEa45oczcL0pFe6OCpADKsNoH8KCiVC6IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1p2xx8zrFm; Mon, 16 Jun 2025 08:54: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 55G8s66v043386; Mon, 16 Jun 2025 08:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s6d0043383; Mon, 16 Jun 2025 08:54:06 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:06 GMT Message-Id: <202506160854.55G8s6d0043383@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: 1fe93549714d - stable/14 - timeout(1): Fix the inheritance of signal dispositions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 1fe93549714d01e16e76af0d279bd05c5a7e0c7d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1fe93549714d01e16e76af0d279bd05c5a7e0c7d commit 1fe93549714d01e16e76af0d279bd05c5a7e0c7d Author: Aaron LI AuthorDate: 2025-04-03 01:07:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Fix the inheritance of signal dispositions (cherry picked from commit 2390cbfe55f55916eca25e8ba94a3320535e01c9) --- bin/timeout/timeout.1 | 10 +++++++++- bin/timeout/timeout.c | 50 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 14fc19292684..371a167d19f3 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 2, 2025 +.Dd April 3, 2025 .Dt TIMEOUT 1 .Os .Sh NAME @@ -65,6 +65,14 @@ Therefore, a signal is never sent if .Ar duration is 0. .Pp +The signal dispositions inherited by the +.Ar command +are the same as the dispositions that +.Nm +inherited, except for the signal that will be sent upon timeout, +which is reset to take the default action and should terminate +the process. +.Pp The options are as follows: .Bl -tag -width indent .It Fl f , Fl -foreground diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 8a2f0faecd83..1c4cfa6e017d 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -224,6 +224,7 @@ main(int argc, char **argv) bool timedout = false; bool do_second_kill = false; bool child_done = false; + sigset_t zeromask, allmask, oldmask; struct sigaction signals; struct procctl_reaper_status info; int signums[] = { @@ -288,6 +289,33 @@ main(int argc, char **argv) err(EXIT_FAILURE, "procctl(PROC_REAP_ACQUIRE)"); } + /* Block all signals to avoid racing against the child. */ + sigfillset(&allmask); + if (sigprocmask(SIG_BLOCK, &allmask, &oldmask) == -1) + err(EXIT_FAILURE, "sigprocmask()"); + + pid = fork(); + if (pid == -1) { + err(EXIT_FAILURE, "fork()"); + } else if (pid == 0) { + /* + * child process + * + * POSIX.1-2024 requires that the child process inherit the + * same signal dispositions as the timeout(1) utility + * inherited, except for the signal to be sent upon timeout. + */ + signal(killsig, SIG_DFL); + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(EXIT_FAILURE, "sigprocmask(oldmask)"); + + execvp(argv[0], argv); + warn("exec(%s)", argv[0]); + _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); + } + + /* parent continues here */ + memset(&signals, 0, sizeof(signals)); sigemptyset(&signals.sa_mask); @@ -310,29 +338,11 @@ main(int argc, char **argv) signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); - pid = fork(); - if (pid == -1) { - err(EXIT_FAILURE, "fork()"); - } else if (pid == 0) { - /* child process */ - signal(SIGTTIN, SIG_DFL); - signal(SIGTTOU, SIG_DFL); - - execvp(argv[0], argv); - warn("exec(%s)", argv[0]); - _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); - } - - /* parent continues here */ - - if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) - err(EXIT_FAILURE, "sigprocmask()"); - set_interval(first_kill); - sigemptyset(&signals.sa_mask); + sigemptyset(&zeromask); for (;;) { - sigsuspend(&signals.sa_mask); + sigsuspend(&zeromask); if (sig_chld) { sig_chld = 0; From nobody Mon Jun 16 08:54:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1r351nz5VprY; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1q4n5Jz3wpD; Mon, 16 Jun 2025 08:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZK3/bvBzQLX/NYdsrk44RvJCiYw88asK7yGZgXiNdj4=; b=l4aiyz+IRoVxF5ZrfYY9216vWwWzsDG5dq6faXDkOCegMGOPmVpdNlb5KWABl3nKBKZfMz oww7UtbFfOfHkZ11iDENS/bLpBB4QbuKmMZbQrUa4SEUNCDMKXQLlvYf6EfWjuffRadGES Yp30QiawB3HV7FvMYUrGmxk2OrN5LCH88ZVXQebIoOXd37PUVEtN94P17C2CD0n/2A/Sdk Bsdf1n1eZBOLCnYlHOlBjncT7AnYJyTbniQXADGK/wmWUL/Wff70Kwyr0+vNAytZlSvIQf /JO0etqKMNezlfKbRrHcR0kcmA39jfY53rd9sN9iPxP2ruH2zPFL2WY57yiEfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZK3/bvBzQLX/NYdsrk44RvJCiYw88asK7yGZgXiNdj4=; b=b1UWRuOw6bBCi1XloB0HJJFJrXQzsRSIQ/+yK3ArvyjWfqYA95PiDezZZTu5OZBlgYsPDD TZvl63LfJ+frlsdl1P/WQ0pP9bQeHYVGleEMLBCb3tnIaNlzLGRAX9DfEU1LFBs+s7WI9r O7qbWgbvxflcVJInVmgvLkYQBlr5dTEvaWpphIL6pXQPZdlrnGzWJl0tEHK6ZxwUl+ZSpU OhRVSHJ8VspBu1JuZn7YFL05yPVJCCivM5SRr+H5mCYQ1M72I1u5o18fi+ey+gjwyUp3PC IBd2ZAHuhbFG02jyd868MPBLHHE5pSXIDcf3yrWg/9nPfn2r9MqYx3gMrh6ekw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064047; a=rsa-sha256; cv=none; b=FSgyWoVNPsR8rbzrXOYl8nWnXMBpNFyl24U3akKYCUEGRSS4cgozqP+9hsvDgUspODp9te cfWagZ5/LwCsVUB/3zlkQTo8B0FAo6XdKlFy2cf0OdZ1/nfT0IG1e7EQrxJJnT8nw4pKXI /y73qgLZpDqapoEBQaxblpX5I/xM82yEdaNVQL3B9Hhd6U+UBHrklv3HzzTlmGtWxToDm7 w2Q4UPvJXnBh/I3g+pDqz6CYAsCyg32bqlI1h84mGZUFaYGlPtQ0lVRw4pbDEkvX6uoOX6 AFpk3KRnwU1yIpvBUx2AH/YGceW9efoZspadzP17URAj3q1eHZpYuNScVj97yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1q41gczrkL; Mon, 16 Jun 2025 08:54: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 55G8s7A3043419; Mon, 16 Jun 2025 08:54:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s7wg043416; Mon, 16 Jun 2025 08:54:07 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:07 GMT Message-Id: <202506160854.55G8s7wg043416@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: 795153bda6da - stable/14 - timeout(1): Catch all signals and propagate them List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 795153bda6dae27ceac4a7298106c00ca706b0ec Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=795153bda6dae27ceac4a7298106c00ca706b0ec commit 795153bda6dae27ceac4a7298106c00ca706b0ec Author: Aaron LI AuthorDate: 2025-04-03 01:20:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Catch all signals and propagate them (cherry picked from commit 844cef26e810d903e11bf83cc6f6fd2e22a299f1) --- bin/timeout/timeout.1 | 22 ++++++++++++ bin/timeout/timeout.c | 92 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 35 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 371a167d19f3..44525daaec59 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -73,6 +73,28 @@ inherited, except for the signal that will be sent upon timeout, which is reset to take the default action and should terminate the process. .Pp +If +.Nm +receives the +.Dv SIGALRM +signal, it will behave as if the time limit has been reached +and send the specified signal to +.Ar command . +For any other signals delivered to +.Nm , +it will propagate them to +.Ar command , +with the exception of +.Dv SIGKILL +and +.Dv SIGSTOP . +If you want to prevent the +.Ar command +from being timed out, send +.Dv SIGKILL +to +.Nm . +.Pp The options are as follows: .Bl -tag -width indent .It Fl f , Fl -foreground diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 1c4cfa6e017d..6e93e9e2911c 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -1,6 +1,7 @@ /*- * Copyright (c) 2014 Baptiste Daroussin * Copyright (c) 2014 Vsevolod Stakhov + * Copyright (c) 2025 Aaron LI * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,8 +48,10 @@ #define EXIT_CMD_NOENT 127 static volatile sig_atomic_t sig_chld = 0; -static volatile sig_atomic_t sig_term = 0; static volatile sig_atomic_t sig_alrm = 0; +static volatile sig_atomic_t sig_term = 0; /* signal to terminate children */ +static volatile sig_atomic_t sig_other = 0; /* signal to propagate */ +static int killsig = SIGTERM; /* signal to kill children */ static const char *command = NULL; static bool verbose = false; @@ -137,19 +140,46 @@ parse_signal(const char *str) static void sig_handler(int signo) { - switch (signo) { - case SIGINT: - case SIGHUP: - case SIGQUIT: - case SIGTERM: + if (signo == killsig) { sig_term = signo; - break; + return; + } + + switch (signo) { case SIGCHLD: sig_chld = 1; break; case SIGALRM: sig_alrm = 1; break; + case SIGHUP: + case SIGINT: + case SIGQUIT: + case SIGILL: + case SIGTRAP: + case SIGABRT: + case SIGEMT: + case SIGFPE: + case SIGBUS: + case SIGSEGV: + case SIGSYS: + case SIGPIPE: + case SIGTERM: + case SIGXCPU: + case SIGXFSZ: + case SIGVTALRM: + case SIGPROF: + case SIGUSR1: + case SIGUSR2: + /* + * Signals with default action to terminate the process. + * See the sigaction(2) man page. + */ + sig_term = signo; + break; + default: + sig_other = signo; + break; } } @@ -214,8 +244,6 @@ main(int argc, char **argv) { int ch, status, sig; int pstat = 0; - int killsig = SIGTERM; - size_t i; pid_t pid, cpid; double first_kill; double second_kill = 0; @@ -225,17 +253,8 @@ main(int argc, char **argv) bool do_second_kill = false; bool child_done = false; sigset_t zeromask, allmask, oldmask; - struct sigaction signals; + struct sigaction sa; struct procctl_reaper_status info; - int signums[] = { - -1, - SIGTERM, - SIGINT, - SIGHUP, - SIGCHLD, - SIGALRM, - SIGQUIT, - }; const char optstr[] = "+fhk:ps:v"; const struct option longopts[] = { @@ -316,22 +335,17 @@ main(int argc, char **argv) /* parent continues here */ - memset(&signals, 0, sizeof(signals)); - sigemptyset(&signals.sa_mask); - - if (killsig != SIGKILL && killsig != SIGSTOP) - signums[0] = killsig; - - for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i++) - sigaddset(&signals.sa_mask, signums[i]); - - signals.sa_handler = sig_handler; - signals.sa_flags = SA_RESTART; - - for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i++) { - if (signums[i] > 0 && - sigaction(signums[i], &signals, NULL) == -1) - err(EXIT_FAILURE, "sigaction()"); + /* Catch all signals in order to propagate them. */ + memset(&sa, 0, sizeof(sa)); + sigfillset(&sa.sa_mask); + sa.sa_handler = sig_handler; + sa.sa_flags = SA_RESTART; + for (sig = 1; sig < sys_nsig; sig++) { + if (sig == SIGKILL || sig == SIGSTOP || sig == SIGCONT || + sig == SIGTTIN || sig == SIGTTOU) + continue; + if (sigaction(sig, &sa, NULL) == -1) + err(EXIT_FAILURE, "sigaction(%d)", sig); } /* Don't stop if background child needs TTY */ @@ -399,6 +413,14 @@ main(int argc, char **argv) do_second_kill = false; killsig = SIGKILL; } + + } else if (sig_other) { + /* Propagate any other signals. */ + sig = sig_other; + sig_other = 0; + logv("received signal %s(%d)", sys_signame[sig], sig); + + send_sig(pid, sig, foreground); } } From nobody Mon Jun 16 08:54:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1s1VpDz5VppT; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1r5K3pz3wZb; Mon, 16 Jun 2025 08:54:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zw1JZksf3Ov17OtrZbbkoppFRxibyMksUk33SvckVOE=; b=dJsAnm9n25L23uNv2rOM/pypsxLgj+mcbdIqFzZW+GUiXJ2vsxpe96NQFQaYCFz0SccCbO ShdJ5/kFPHbuPeIxJ0GzORGGNYwEyk63zmik4WG1ORn4sUKaziHdejKXhVNyRR/cAaHuIH sPBvyvqFFOD0NUElxEDEIsg28xDhCQdOBOtGQwE59/RNSUavi9nGDtSBrmpVdSkpARf9jC tuWo7RO3KASQvXpA9FtT3JsRQPFDOmG0VWu3gtYM+zSYA1Jr9Scbydjr5WLmxmH0kEyLo4 tF78qOqZG++vSITYomT1Q2YZ9L0TC6VqUnGGZP9FaikXd5R+oBn7j+vIKvr6fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zw1JZksf3Ov17OtrZbbkoppFRxibyMksUk33SvckVOE=; b=X0QnkDGZsMO3t5a8TO2NeqjHIxtfbZidJG4UCRP0N/TpH7jemH235mcz3EtWBMnTkXc98B iaqHpUs72MWcRFm351o284E4r5gyroAeBKcStH3Ced7cl5kADAlUKpUTgKD9YH7YYyeMVu zgk8tAPVHrMiQ6Qnyq2GSBO7BYd/GB6tO+DWGSc9UndS8962SeL2OZTz9NbQq6ernade45 4+7i6viJSfAHFNmoOD4lhtGwlvVUKD9z+spfPHS345q+JdTDi53kSzVyCuuOtxYIyl/1+W G0rRvQwHdOFe7r64Ws021j/lflailB9IAVVl/zpa0oq6eChrehFSV5pjjWiCNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064048; a=rsa-sha256; cv=none; b=kq/rRb5Ih/OojOi71WWU8rPCXXwjwzmgP5qeXmVD77Et+a4LQex2X0YANADB8bLxrlxNlw Qu9EsF3A9CvqKp0fJf15CRBpRbKkA+rB21GqgP84qGymqt/cGMv3AL9+wVXkk86beg5RyQ i9xxK15/R/l19d63S3TNoxT/evFBR75AtJnC2H69utySrpaAOfHBGgS3nKPb/sN+erPf7a N4utSuabo2pq5UrR7GYzAw8s7t2WmopahHORnujQmDgh9qxnAYfakk4xIlM7LAvyRHTq+n N9AXu/MwhNtnB6AYY61wsWtilhQWR7myiEEzxhQUbMN0KFlttHS2zQ0xNt/N4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1r4c5Qzrvf; Mon, 16 Jun 2025 08:54: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 55G8s8AR043452; Mon, 16 Jun 2025 08:54:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s89e043449; Mon, 16 Jun 2025 08:54:08 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:08 GMT Message-Id: <202506160854.55G8s89e043449@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: de24ba56a663 - stable/14 - timeout(1): Kill self with the same signal that terminated the child List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: de24ba56a663c608edf8091900a49b48d088896c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de24ba56a663c608edf8091900a49b48d088896c commit de24ba56a663c608edf8091900a49b48d088896c Author: Aaron LI AuthorDate: 2025-04-03 02:51:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Kill self with the same signal that terminated the child (cherry picked from commit 613310263ae1f0f65df498dc8e98f460b781946d) --- bin/timeout/timeout.1 | 51 ++++++++++++++++++++++++--------------------------- bin/timeout/timeout.c | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 29 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 44525daaec59..43a484dac76f 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -146,37 +146,33 @@ hours days .El .Sh EXIT STATUS -If the timeout was not reached, the exit status of -.Ar command -is returned. -.Pp -If the timeout was reached and -.Fl -preserve-status -is set, the exit status of -.Ar command -is returned. -If +If the time limit was reached and the .Fl -preserve-status -is not set, an exit status of 124 is returned. -.Pp -If an invalid parameter is passed to -.Fl s -or -.Fl k , -the exit status returned is 125. -.Pp -If +option is not specified, the exit status is 124. +Otherwise, +.Nm +exits with the same exit status as the +.Ar command . +For example, +.Nm +will terminate itself with the same signal if the .Ar command -is an otherwise invalid program, the exit status returned is 126. +is terminated by a signal. .Pp -If +If an error occurred, the following exit values are returned: +.Bl -tag -offset indent with indent -compact +.It 125 +An error other than the two described below occurred. +For example, an invalid duration or signal was specified. +.It 126 +The .Ar command -refers to a non-existing program, the exit status returned is 127. -.Pp -If +was found but could not be executed. +.It 127 +The .Ar command -exits after receiving a signal, the exit status returned is the signal number -plus 128. +could not be found. +.El .Sh EXAMPLES Run .Xr sleep 1 @@ -202,7 +198,8 @@ $ echo $? .Pp Same as above but preserving status. The exit status is 128 + signal number (15 for -.Dv SIGTERM ) : +.Dv SIGTERM ) +for most shells: .Bd -literal -offset indent $ timeout --preserve-status 2 sleep 4 $ echo $? diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 6e93e9e2911c..e9c4e22fc7d3 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -239,6 +240,34 @@ set_interval(double iv) err(EXIT_FAILURE, "setitimer()"); } +/* + * In order to avoid any possible ambiguity that a shell may not set '$?' to + * '128+signal_number', POSIX.1-2024 requires that timeout mimic the wait + * status of the child process by terminating itself with the same signal, + * while disabling core generation. + */ +static void __dead2 +kill_self(int signo) +{ + sigset_t mask; + struct rlimit rl; + + /* Reset the signal disposition and make sure it's unblocked. */ + signal(signo, SIG_DFL); + sigfillset(&mask); + sigdelset(&mask, signo); + sigprocmask(SIG_SETMASK, &mask, NULL); + + /* Disable core generation. */ + memset(&rl, 0, sizeof(rl)); + setrlimit(RLIMIT_CORE, &rl); + + logv("killing self with signal %s(%d)", sys_signame[signo], signo); + kill(getpid(), signo); + err(128 + signo, "signal %s(%d) failed to kill self", + sys_signame[signo], signo); +} + int main(int argc, char **argv) { @@ -430,10 +459,12 @@ main(int argc, char **argv) if (timedout && !preserve) { pstat = EXIT_TIMEOUT; } else { + if (WIFSIGNALED(pstat)) + kill_self(WTERMSIG(pstat)); + /* NOTREACHED */ + if (WIFEXITED(pstat)) pstat = WEXITSTATUS(pstat); - else if (WIFSIGNALED(pstat)) - pstat = 128 + WTERMSIG(pstat); } return (pstat); From nobody Mon Jun 16 08:54:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1v3FZXz5VpT9; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1v0y28z3wgJ; Mon, 16 Jun 2025 08:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6xMhPRHF6P2v2tJQgkK+Mp74WJMnQedljGHAE/Y3Ps=; b=ocOWeg+mBjv7s3dekMEF4oidfLcMoObb7kdml++/YGQUVt6nqnxAbQzZ7qmOgkvjq6o48h iTcxpTUQvHraG7O8LyGCEinqes5Fjd5KBA2EcCmsfvUsCKAlySSX8NFzeXqfzTH9w0VF5Q TCvyZyHhLhdwX7rPzXsTZPG/LFU+JXczfXFC/4brCwEpZgSnY5Rau4F3V0XWOXieQdYmxE UIWcIa7L87ZA1ritAmZFi6jW/c3RXpcY7TQamMegkfP8/CtfWZQIi7lmleI60QbAVYiM2H 4GXcH2nryVIjmlqEBbjnkHk8/zjzYQdZxCrQ25QSbsei5TpYCrHSBrGGid/J0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6xMhPRHF6P2v2tJQgkK+Mp74WJMnQedljGHAE/Y3Ps=; b=yx2ssCRqdK/Sil530nEZZQcK7+uq4qKulneHxM+/y03+lG/luSq0j8CMFwhFuxgD7OkLvT fGOLi4O6PYWRXLrZcXw3fN4GAP5UDHqSEGBYaw7z4Q9Srm1amwZTm1vv4heOX1FNhl0CgF cAzHL3SkTY2eLn3hmYmEabRdI4vqVhPCxlmt5dpGEP7n0TVWQCNA65E2pUnpAEOc4PFLk8 mwMnvyzMiQi3HEl1aY4M9kvIfGfcWqMNThqFGxpNgRht51/cJhQV0p2MDfS11KnmZNlGrp 4BiH6L6bo3Os2C6iiAL1mf+BFo4vVQMUFSSYPU8z4xITwyxYhR/maXgGuF4QWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064051; a=rsa-sha256; cv=none; b=ywA3Z0+7AHBT2Ua1PmUZShYqH+jrXyA7IvEsx1IN3qyyvrZ9sj0DoMg3g+f/uiIveoufX5 kTApHev+L5RnMCs69w99N/6WO5OzulLrBhL4mWV9A5SwMKgZCLMGMY+orxGRekRHfklZbN bko/fwrs/2xE0RN7Lw8STFsBgusJDIaZ7D11yohO+0CfrLwp/uOkNXws7KI6gacojtCGWt qdyuustNNVU7q9PIzJG4geJHziKwiGIK4P5JNmxhhNiolt/7jtsCp0e908CiJ6v6aCW2Kb Cxa7fnkNM9brjtKkEDIBayKGRfKQtuEFDJLtdBK9JNldoxjy/UG2b8f9wxxfZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1t6HpKzrtF; Mon, 16 Jun 2025 08:54: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 55G8sAOG043524; Mon, 16 Jun 2025 08:54:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sALA043521; Mon, 16 Jun 2025 08:54:10 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:10 GMT Message-Id: <202506160854.55G8sALA043521@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: 91dc8fcff090 - stable/14 - timeout(1): Document the reaper implementation and behaivor List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 91dc8fcff09013ee44f72ee2c202466cb446afcb Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=91dc8fcff09013ee44f72ee2c202466cb446afcb commit 91dc8fcff09013ee44f72ee2c202466cb446afcb Author: Aaron LI AuthorDate: 2025-04-03 02:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Document the reaper implementation and behaivor (cherry picked from commit c362781c8d6a878ac93f3debc45d401bd5296eee) --- bin/timeout/timeout.1 | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 43a484dac76f..6486ccf99a36 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -1,6 +1,7 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2014 Baptiste Daroussin +.\" Copyright (c) 2025 Aaron LI .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -101,6 +102,9 @@ The options are as follows: Only time out the .Ar command itself, but do not propagate signals to its descendants. +See the +.Sx IMPLEMENTATION NOTES +section for more details. .It Fl k Ar time , Fl -kill-after Ar time Send a .Dv SIGKILL @@ -145,6 +149,30 @@ hours .It Cm d days .El +.Sh IMPLEMENTATION NOTES +If the +.Fl -foreground +option is not specified, +.Nm +runs as the reaper (see also +.Xr procctl 2 ) +of the +.Ar command +and its descendants, and will wait for all the descendants to terminate. +This behavior might cause surprises if there are descendants running +in the background, because they will ignore +.Dv SIGINT +and +.Dv SIGQUIT +signals. +For example, the following command that sends a +.Dv SIGTERM +signal will complete in 2 seconds: +.Dl $ timeout -s TERM 2 sh -c 'sleep 4 & sleep 5' +However, this command that sends a +.Dv SIGINT +signal will complete in 4 seconds: +.Dl $ timeout -s INT 2 sh -c 'sleep 4 & sleep 5' .Sh EXIT STATUS If the time limit was reached and the .Fl -preserve-status @@ -247,9 +275,9 @@ The command first appeared in .Fx 10.3 . .Pp -The +The initial .Fx -work is compatible with GNU +work was compatible with GNU .Nm by .An Padraig Brady , @@ -258,6 +286,7 @@ The .Nm utility first appeared in GNU Coreutils 7.0. .Sh AUTHORS -.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org -and +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org , .An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org +and +.An Aaron LI Aq Mt aly@aaronly.me From nobody Mon Jun 16 08:54:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1t5m1bz5VqDV; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1t2MTMz3wdr; Mon, 16 Jun 2025 08:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEw6meZT2O5S8I7zTy6DsiB+BE0TGSuoA57Xr6NcWbI=; b=P0lpZmlHtz/rk3EqFBfBt+yfCck/0vc6pFAV68kgk3CEy17T1qzV/AangUGEOr03oUdY0q cH2n1xDSI3/O3eVdWxQ6Wl35KvUJYSEWqK0y14K/b2hFye321F4Y1RjNvj74kFAAEhi4A3 qN3Y1k13i3voF323H4x9VkK8VjxhT0UqqZpouzrJEb1LgXxBPIzYmoZQkqBMmDSzgTfbu7 DHhUtwEhvjO0/+dNLnbik0HQeISqqQVh9nLOJIzjq6ivba80kuKMHn0WCl55qJSoqyumcO qtp2MhZyH/PdFFTn4Hvc5RvnjsFeW4+Gun7EyNarn78q8FJXsZjobyaaShrkJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iEw6meZT2O5S8I7zTy6DsiB+BE0TGSuoA57Xr6NcWbI=; b=MnaJAYi90jelbmCAVoR6onNjos6Hlv7lflKmSZ3uJTVSpGG22tgFfzoKWnN1njItBeHDGP DYg2fM4dX+zexVnwIvfYFPlCioVaWYNEbHxn4hbOQ3P9D59hsTGRM/4OwWOAisCun7eF03 d7fcZn4P6mQR8/sEkFdnZHpThiLG3l6nbVI9uLKEqxfN8gToLEggLYSbY6OBL7TZmYldeh 9eLibFKvdZYZzKEFadeWo30/wwbmB0ekCEEnRm5nwHp16JzXbM7yFvwBKeIvuJKz8W4EFI xF7hRXs90LFDLYcAkM7GxEkWhlYWsfiOmAYAAGE7dxyVvvCUvBMq5yGd4gVuxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064050; a=rsa-sha256; cv=none; b=FTSbE3Vt4kl1DmAzfE7LbECKiObD/ABl0DAqoOG1v/pryCtbOBTT1/p13kt9ZUHHNeF1xr vYGJGHhROmqaScmkjCsupdEwO/jjCpx+wdCH/+J3rGQI43KYc0ZWhFCbuedP2RBs/zZeQS qIegXXMflqKJLsW8h0kUlVkauMwhzxOFeyj18IKypTikcCooBYKepPxT+IEm/q6Uhw2pvH zxSKt6o8tEaSV1AlyiBJX3Gqfd9irQNUKCPRljyJXOwD3HuS2jBvk2GjAmHYIFUik6nM5x u5FO3mSD4G5JT+WKLmoslP7/iPacgsmFHiWrvslg3GgZO1Qvxl+0hAzRa2IYIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1s5P8VzrkM; Mon, 16 Jun 2025 08:54: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 55G8s9P3043489; Mon, 16 Jun 2025 08:54:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8s9rT043486; Mon, 16 Jun 2025 08:54:09 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:09 GMT Message-Id: <202506160854.55G8s9rT043486@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: 08d43f70eabf - stable/14 - timeout(1): adapt the preserve_status test to the new behaviour List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 08d43f70eabf1d769c7038dec1953b1275ea690e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=08d43f70eabf1d769c7038dec1953b1275ea690e commit 08d43f70eabf1d769c7038dec1953b1275ea690e Author: Baptiste Daroussin AuthorDate: 2025-04-16 19:41:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): adapt the preserve_status test to the new behaviour (cherry picked from commit a25b03791764b7817a1a3e05ac1ab91c75a946ac) --- bin/timeout/tests/timeout_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh index d08f6c01e067..a72aed609d47 100644 --- a/bin/timeout/tests/timeout_test.sh +++ b/bin/timeout/tests/timeout_test.sh @@ -86,7 +86,7 @@ exit_numbers_body() atf_check \ -o empty \ -e empty \ - -s exit:143 \ + -s signal:15 \ timeout --preserve-status .1 sleep 10 atf_check \ From nobody Mon Jun 16 08:54:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1w6FQ4z5Vq8c; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1w2pR9z3wrL; Mon, 16 Jun 2025 08:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq6UYtmZdGCtQ4fuheit/ABBBvDuSVoPau29dXUWnxE=; b=PRRtLiPdiRn7rYA39PFbPCxnIRk2lzqGzdc7Apde30X9jenxWtYOeG0Gtte4eIr8acFK+e zLx8MGVIl0y2ZJtIzwrynVJysmoN9ESCZcjVAF8+BIs3AF7hxcj3ld69Fx+ofHsHNjMnMc qFB5FpZv6j/bjJKGW0zwu0l/VWgQBl6kDR6nf/hTbbZrPIMsGIM/Qab/1pyHcY5tSNfLiq z1m85kkr8HwlelE6ntsmbiPNuzux50/D82eXeFItqBwe5ayP0PA9NivKJd6g9B9CUlbvIm pBo2zg7DCU4SpH0X6psrTQitzpj4T4wLrD7jMa1ELyC8hFc3A+7AAC4dtZTHWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qq6UYtmZdGCtQ4fuheit/ABBBvDuSVoPau29dXUWnxE=; b=EVA2bL4MpIlpX8kSfaKSJNq/UdBzts/l2G8JdKnWhKyyeEtIT/c6RkNkiFWOY3P7pnjVqn YXFxZ+I7tMkR2FGZryir9OxvN8cKT1s+Evww3pMuKLr2F54PjFSYChbNO+0ZwhZLH9qjuR RGFtwyYTCm3vsQ3N7RXymg0IUmfFm3+MzTJM4aYYO0RB6VEcwcArKqrS+CeGgG6G+JB30Q dY3sRDx0Yh3t4RbW4R4E/NSKogKcU2RWYcrd9c4t9/FjgDP2Zbi1NxODw/Y8IAUFlGp1nD mAjjelblAFpC4s0rttWJzFaAVr6uoGsoxrUqUeVPdjT74rl7ZeOhGTODU5rvlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064052; a=rsa-sha256; cv=none; b=vEKh0ej0eiRRtA5eVi7eB7McK4OkRrfuUZFT904J1fHqu8UPngPSIENi8rrEi73h50IMT4 8RBTimluV9pvJnSuerO1m67ZePsO/MlIzCZFc3YP6oEYOpSd4nvbbc1SwjmYpNFmQH2dC6 shQWEOTGVIDWzyeasJWo8OidMLtpp9OnoEHR5i7hxnl9H7t8YFcq/JBk4jUA8flygdqsPs zOCRh1uipeTdNkfPV7hypBoBDLyEAwLSGO8lxhptzOmm2tPc/U9HhKXDU60HJS39Ma8h2x td3rFV7vTGIEVCjmM125RQCRNtnkfsZva/vGhEvkuui6pKoy/pkoSMO5SDaPZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1w09Wlzrqn; Mon, 16 Jun 2025 08:54: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 55G8sBGO043556; Mon, 16 Jun 2025 08:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sBgb043553; Mon, 16 Jun 2025 08:54:11 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:11 GMT Message-Id: <202506160854.55G8sBgb043553@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: c55fd0184a17 - stable/14 - timeout(1): silence warnings for ESRCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: c55fd0184a17d2cb56884e6e2a15e70ad503ff76 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c55fd0184a17d2cb56884e6e2a15e70ad503ff76 commit c55fd0184a17d2cb56884e6e2a15e70ad503ff76 Author: Konstantin Belousov AuthorDate: 2025-06-07 11:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:54 +0000 timeout(1): silence warnings for ESRCH (cherry picked from commit 15e4b8d5ef845066819c4cbb5d03b63148688298) --- bin/timeout/timeout.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index e9c4e22fc7d3..424e72dac9ad 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -188,16 +188,23 @@ static void send_sig(pid_t pid, int signo, bool foreground) { struct procctl_reaper_kill rk; + int error; logv("sending signal %s(%d) to command '%s'", sys_signame[signo], signo, command); if (foreground) { - if (kill(pid, signo) == -1) - warnx("kill(%d, %s)", (int)pid, sys_signame[signo]); + if (kill(pid, signo) == -1) { + if (errno != ESRCH) + warnx("kill(%d, %s)", (int)pid, + sys_signame[signo]); + } } else { memset(&rk, 0, sizeof(rk)); rk.rk_sig = signo; - if (procctl(P_PID, getpid(), PROC_REAP_KILL, &rk) == -1) + error = procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); + if (error == 0 || (error == -1 && errno == ESRCH)) + ; + else if (error == -1) warnx("procctl(PROC_REAP_KILL)"); else if (rk.rk_fpid > 0) warnx("failed to signal some processes: first pid=%d", From nobody Mon Jun 16 08:54:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1x3XKNz5Vpm8; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1x1bJHz3wxQ; Mon, 16 Jun 2025 08:54:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fq3JIfTCi6dxf+wNZzZ03RNYhmbc88pQMA3eGf0KTPw=; b=RDtr1ieCROVqis5nLU8lubOGQyY5Z9RRkZC0LCRxFQ2w7ZgOh0fwvfxOP8QEyq67bXb7Si 78X9ANkjqOYKJYmjkq6163KQDEgPnYzGG3JEtxgqWnDmPhulg24Y8ykeThHRoevJNwS5nz SZUxn6KuYNX2RdyoQRxkC4qJAPEGh01V/tVsrKiI2zkvzIrvn62OP6Fy63LRjA7+mKbJNy umwt8c6RTyQk32hAS9W2Iac8dX0JRO83+Iy+owubzK2sJlDuK4pIz/b6pDnTjHizmfXBTG Yatb7DllIQkx5vnIW2C9frTRhC24rnF/H5VOjMJj4tgqa9zLC9PAR+gJcMKBTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fq3JIfTCi6dxf+wNZzZ03RNYhmbc88pQMA3eGf0KTPw=; b=x2/z5uF6i9a8/VHaKMSlFZohcNwO7hdMmypLjiZn8LbjCujTZi9d2IDZ58cnr+ZZLpDIUm IxP9N2u4gkosiku8ThN9GNDSE1SX7bw7juFbGzl4KaNDhaJb587XCoq0Oj0XfjR43HXSEq taQuF8ysxYMAPBKHfTLIx6nE++he11TK+wH7JF5+j5HsVbYuf2EcjhOWq99fEpmxba8WlY uuI2qhr0sw9jdCKeFi+7SWs2rT/KtgYoNlhSqp3VQ+QRTV3W70PZlAl8FW7fOwkVb1JoSp bFOl5igls3i6+yabj0d8deno40lzczDS6UHBNEM70GC2bNT3wRrPqzcq76lyJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064053; a=rsa-sha256; cv=none; b=ix3bl6j/K0MrjgsI9lhFi5zQfPMrFCjed03sq5g5aguFNbcK6PxmDTR7MR4WUN2uv2kUyU zP/IjqGcVcBEw0Ht3RS41cqR16daZNxJ/BUfJYqxBoAp11xQtWGer5s5EwACx7stUdmnwO SQaZCKVxjj9GQ1PRdBgDbAVhs87emwj8WOFzoahLAJIcXhmeFO9SFrhB2giTVeMeHf103L rzbuDG0nUMu4amtT9Y9OqU9y0V+eX8uvHm/vuXzPC8y/YK0XHunhcKD27WRrfyzEyD4UVS HkRPPsfgTxnc/0eGmWGwweP+GYCExQQnFZF0pStN7VnTDmY5BwP2gRBfenrwGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1x19r7zrkN; Mon, 16 Jun 2025 08:54: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 55G8sDJL043588; Mon, 16 Jun 2025 08:54:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sDvh043585; Mon, 16 Jun 2025 08:54:13 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:13 GMT Message-Id: <202506160854.55G8sDvh043585@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: 1adea6e97f81 - stable/14 - timeout(1): print errno when signalling syscalls failed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 1adea6e97f814194d986daeaf2ae1327183a6156 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1adea6e97f814194d986daeaf2ae1327183a6156 commit 1adea6e97f814194d986daeaf2ae1327183a6156 Author: Konstantin Belousov AuthorDate: 2025-06-07 11:29:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:54 +0000 timeout(1): print errno when signalling syscalls failed (cherry picked from commit bff05e8a8c3c64bfe6152870cb758d00991ec66b) --- bin/timeout/timeout.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 424e72dac9ad..05904522c5b5 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -195,7 +195,7 @@ send_sig(pid_t pid, int signo, bool foreground) if (foreground) { if (kill(pid, signo) == -1) { if (errno != ESRCH) - warnx("kill(%d, %s)", (int)pid, + warn("kill(%d, %s)", (int)pid, sys_signame[signo]); } } else { @@ -204,11 +204,13 @@ send_sig(pid_t pid, int signo, bool foreground) error = procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); if (error == 0 || (error == -1 && errno == ESRCH)) ; - else if (error == -1) - warnx("procctl(PROC_REAP_KILL)"); - else if (rk.rk_fpid > 0) - warnx("failed to signal some processes: first pid=%d", - (int)rk.rk_fpid); + else if (error == -1) { + warn("procctl(PROC_REAP_KILL)"); + if (rk.rk_fpid > 0) + warnx( + "failed to signal some processes: first pid=%d", + (int)rk.rk_fpid); + } logv("signaled %u processes", rk.rk_killed); } From nobody Mon Jun 16 08:54:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1y5Wwnz5VqBf; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1y2wKRz3wbb; Mon, 16 Jun 2025 08:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z3+6lWlhD8dyyLdzBnqQdA+KFJcj+56gYAxpt+nmaV0=; b=Sgi43nenYYYrGnAZ7XGKMOTOyqwRd22C6FLTW0HxnkeAVHvz/MLpYwFpSWURD3F+xB9LUq dA+hwwFqMFDkN5Da4VVI1V5Y+WIbXEUMjv4mf5VqqdpSrh0IpLkWtPmVu2smb0GdZ+ba04 C2pRRjLj1+dpGz/HeU6oncKgdupiRRdH0kSMSL0OIPZ7RWybT8daLim1DS7ufKuxviVx2v A54tUTe4JICDfRCweHSiv5QYyQH29VbGdaL6HF0mgHF2mgazontoK2fT4EUiMx5bZkuip5 iCxRfvqGRgBLVJW0t0kNjARbHoc6A08A6QqIl/NS5ImEn+Pyx/Yb3D0d7w07eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z3+6lWlhD8dyyLdzBnqQdA+KFJcj+56gYAxpt+nmaV0=; b=Rtjnkw9M1wHCf0tXuskQ3B9iyYrjHGbiXasj+lQAyR4vHuQ0eXYpFf/jZFZQI46Owv9Cbo oZBdOrN3mWDtHiLRiRBx+GeMyvIVOgoGZeviTWcMUOMOHkag7rvXGJElLW0g0GMNvEsKxN KlOtfPEdCBJQ9CngBfKYWFbm0fE7p2X+mPz9dv1AhrCbss/jc0DVnzvGjKvGNOJOB1hdwn 6ina/L7jmDyyPnOdFEggJFo4di4T2zJQfySgFDh6mQUy8/n+iZCAo+m9pRXzmBhIgBwuZw nubigdPilA1Dn7rSae8fexeD2xNRzKen13kpx1fV2RyAGmsa6340rtC5GY310A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064054; a=rsa-sha256; cv=none; b=EHz+UF4n/2JLK8McMn9BG/wVDTiEp6AdzD72zAAw7oyKLgUN+UAIsPe2XIpopavw4k2u1r yRt2VpMF/buc7fESVvHdHyPHQEks+crWThXzfidiHq1n9wkBbQ9fo0nCHwHJagm4s0fPRR /niDr0rLPwcMGMYuLbWj9Vhg4Z3aELtOEHiwLDz4ZsoObIDSpRk7mYIFtRZqb1SQpQSHF1 xpSO2IcJtn3S4ZYVZAy21wT33OLcxW9bLh6IUQ72FcyumZk1DnHkmwSpwG5AatBzK5ROT2 EjxdS66FTF+vHnrQYL7OJ32twzNET3hFmFpWysdfPXCO0FKN87Ib0VLylzBZmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1y20q0zrJ3; Mon, 16 Jun 2025 08:54: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 55G8sErj043620; Mon, 16 Jun 2025 08:54:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sEpp043617; Mon, 16 Jun 2025 08:54:14 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:14 GMT Message-Id: <202506160854.55G8sEpp043617@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: b535341df32c - stable/14 - timeout(1): only start the child command after the parent is fully set up List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b535341df32cccaa097da4be304b0fad2290ab43 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b535341df32cccaa097da4be304b0fad2290ab43 commit b535341df32cccaa097da4be304b0fad2290ab43 Author: Konstantin Belousov AuthorDate: 2025-06-08 15:47:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:54 +0000 timeout(1): only start the child command after the parent is fully set up (cherry picked from commit aa8cdb7cae7b7550d5cb81d85ee294c4f182f694) --- bin/timeout/timeout.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 05904522c5b5..f47976aa27df 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include #include @@ -283,6 +283,8 @@ main(int argc, char **argv) int ch, status, sig; int pstat = 0; pid_t pid, cpid; + int pp[2], error; + char c; double first_kill; double second_kill = 0; bool foreground = false; @@ -351,6 +353,9 @@ main(int argc, char **argv) if (sigprocmask(SIG_BLOCK, &allmask, &oldmask) == -1) err(EXIT_FAILURE, "sigprocmask()"); + if (pipe2(pp, O_CLOEXEC) == -1) + err(EXIT_FAILURE, "pipe2"); + pid = fork(); if (pid == -1) { err(EXIT_FAILURE, "fork()"); @@ -366,6 +371,11 @@ main(int argc, char **argv) if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) err(EXIT_FAILURE, "sigprocmask(oldmask)"); + error = read(pp[0], &c, 1); + if (error == -1) + err(EXIT_FAILURE, "read from control pipe"); + if (error == 0) + errx(EXIT_FAILURE, "eof from control pipe"); execvp(argv[0], argv); warn("exec(%s)", argv[0]); _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); @@ -391,6 +401,11 @@ main(int argc, char **argv) signal(SIGTTOU, SIG_IGN); set_interval(first_kill); + error = write(pp[1], "a", 1); + if (error == -1) + err(EXIT_FAILURE, "write to control pipe"); + if (error == 0) + errx(EXIT_FAILURE, "short write to control pipe"); sigemptyset(&zeromask); for (;;) { From nobody Mon Jun 16 08:54:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP200Tpxz5Vq23; Mon, 16 Jun 2025 08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1z3Ykvz3x0v; Mon, 16 Jun 2025 08:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nOyI7lEtqTDFXUhX3LKzinXQqgT5FU9+hGgMz3ZSCR4=; b=FhtvGyPVcIGpVZwAzu5mdlJb8uv7A4b3h9/YqTgSzfsBEKyQRDi70UTFJMbTcfFvvc1npf VnOr06Uqwsu6Mo8Mn18Yk8F75lYmSnsn9m/hlvXCEfXWhRGHxIXifgLQFJBajKifyVEHvp L4nM9HbKVyn9Ni2qQMVUd7xdnOmriFFIBEkUkaHFvAjKqeE8iJUYAWOUd9/EtRyAJ6u57X /N+sIlB1nIlT0dFrI5B7ZQjXvcVnJu1sXwTslT52nwowNrfRC35ds6RbI5L57QWnFk8AHh XGO0lNwhfNs26babVgQc31KKuLmIKFqmwCCAG+N21SeTMPZ3GQJtby3bVFZijg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nOyI7lEtqTDFXUhX3LKzinXQqgT5FU9+hGgMz3ZSCR4=; b=l+hmkIfsFMJoBPSwFKLR3P7Im3xDZHEGxaqKiwqB0j07SDknQ5kXKbSQrjM6OYVLubZz5f 1VFqPwnBK9ZQaoCOBKmGq7CXa7q1eoG1qwTeCG0Lo6+2WNHgw+ZSeolA0xLHuuoQNrnC0t 7IhAWZkKnh5/Wp6KgRqO+UCGS3jTH2qQhOxkXuSw9yUPtTiNXTidE5yoSHjkGOtKV9stsY ZvNOvZix5CEF76FPcQv0kSh7OwfsMLxynzkolbt7B0nVvttd3Fdn51rw1MKu/tDtkZYKxG pYG4Cli1WM98034Vw+BBo9i5poRVIGYkqTymludoasDH/d6Jf7AjmLG1hsB6Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064055; a=rsa-sha256; cv=none; b=BS03jkEYwk51FKcvzqBezZ4695vpA/u7g6cIT+FSyF9ZDk9lfsz5pgGNYaS0sqJbSPY46w 54ExVB+xcn3eoQh5QXujgqEoIrkq1BtQlVqNjFSVe1gkjYb3YY82uoSzJseacTw+O3YHoY cC6vfGmbyefm2yMt8Xj3V/tnutVr7I39g2KBGp2FdcUYOT0OUfLySt5bTAEgHcMnPrEEUx 4S6ASigUVo7iXbGBn37MObGF4BA+m06vJNtoNmJ425gGgjuyNLVSFtYfORygq4e1jOs8cR EvtjBIDYwHJF7ZtN005JxaGcIktX2XFqEvjD/yDGK0zbjb/gIAfk5EMkIpDasg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1z337zzrkP; Mon, 16 Jun 2025 08:54: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 55G8sFWj043656; Mon, 16 Jun 2025 08:54:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sFkn043653; Mon, 16 Jun 2025 08:54:15 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:15 GMT Message-Id: <202506160854.55G8sFkn043653@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: 5c2e905a7599 - stable/14 - timeout(1): pass full 32bit error return code from the exited child List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 5c2e905a75996a5a2aa16631f951502b7c43cc3e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5c2e905a75996a5a2aa16631f951502b7c43cc3e commit 5c2e905a75996a5a2aa16631f951502b7c43cc3e Author: Konstantin Belousov AuthorDate: 2025-06-09 03:20:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:55 +0000 timeout(1): pass full 32bit error return code from the exited child (cherry picked from commit 81ef00125056a68ca3bba1424d6cb13533bf474c) --- bin/timeout/timeout.c | 58 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index f47976aa27df..58a5797f3eaf 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -277,12 +277,25 @@ kill_self(int signo) sys_signame[signo], signo); } +static void +log_termination(const char *name, const siginfo_t *si) +{ + if (si->si_code == CLD_EXITED) { + logv("%s: pid=%d, exit=%d", name, si->si_pid, si->si_status); + } else if (si->si_code == CLD_DUMPED || si->si_code == CLD_KILLED) { + logv("%s: pid=%d, sig=%d", name, si->si_pid, si->si_status); + } else { + logv("%s: pid=%d, reason=%d, status=%d", si->si_pid, + si->si_code, si->si_status); + } +} + int main(int argc, char **argv) { - int ch, status, sig; + int ch, sig; int pstat = 0; - pid_t pid, cpid; + pid_t pid; int pp[2], error; char c; double first_kill; @@ -295,6 +308,7 @@ main(int argc, char **argv) sigset_t zeromask, allmask, oldmask; struct sigaction sa; struct procctl_reaper_status info; + siginfo_t si, child_si; const char optstr[] = "+fhk:ps:v"; const struct option longopts[] = { @@ -414,26 +428,27 @@ main(int argc, char **argv) if (sig_chld) { sig_chld = 0; - while ((cpid = waitpid(-1, &status, WNOHANG)) != 0) { - if (cpid < 0) { + for (;;) { + memset(&si, 0, sizeof(si)); + error = waitid(P_ALL, -1, &si, WEXITED | + WNOHANG); + if (error == -1) { if (errno != EINTR) break; - } else if (cpid == pid) { - pstat = status; + } else if (si.si_pid == pid) { + child_si = si; child_done = true; - logv("child terminated: pid=%d, " - "exit=%d, signal=%d", - (int)pid, WEXITSTATUS(status), - WTERMSIG(status)); - } else { + log_termination("child terminated", + &child_si); + } else if (si.si_pid != 0) { /* * Collect grandchildren zombies. * Only effective if we're a reaper. */ - logv("collected zombie: pid=%d, " - "exit=%d, signal=%d", - (int)cpid, WEXITSTATUS(status), - WTERMSIG(status)); + log_termination("collected zombie", + &si); + } else /* si.si_pid == 0 */ { + break; } } if (child_done) { @@ -482,13 +497,14 @@ main(int argc, char **argv) if (timedout && !preserve) { pstat = EXIT_TIMEOUT; + } else if (child_si.si_code == CLD_DUMPED || + child_si.si_code == CLD_KILLED) { + kill_self(child_si.si_status); + /* NOTREACHED */ + } else if (child_si.si_code == CLD_EXITED) { + pstat = child_si.si_status; } else { - if (WIFSIGNALED(pstat)) - kill_self(WTERMSIG(pstat)); - /* NOTREACHED */ - - if (WIFEXITED(pstat)) - pstat = WEXITSTATUS(pstat); + pstat = EXIT_FAILURE; } return (pstat); From nobody Mon Jun 16 08:54:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP2108bKz5Vprr; Mon, 16 Jun 2025 08:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP204rNDz3wsB; Mon, 16 Jun 2025 08: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=1750064056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k2emwGjVF+oRp1I1tvDrVMI8QmsBASPLc+agHSAYBdw=; b=mq48rR+csK2+z2YNpoXYnL3e4fNBIJzYufaiPerQC9wDnEEmjPwCFi74T7X5x7gnDHABGq adyfHhqxtU7p0atc/rVJRzzEBEioKSwviMG3AZStC5IsWPDxiv026crq1BRQAaKRA45ia0 pjAAyClM7Jmantz0EG3/kVfqEuJhptV9Bej2UH3STp83U2rvHwK8XZSeEQoYxNJBeFCkJB aXRVaqIqEKK6HcgtVWIq95vwDu5Cy2zqH3Rnb0zGhLV1hUd+KXM3Av1wPJ/iR2YD5VZwo3 +qlt++QcxuzNVJPFvgQt8SVcCps7IJkyXfSEj3GowvVlQaSlVxyI9LkRGtzeNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k2emwGjVF+oRp1I1tvDrVMI8QmsBASPLc+agHSAYBdw=; b=LMNzI+ra3C/s7cl4wxGCAMogA/G90hA3puxO3IRXulqu6U3MapxgnUR7t+gos3rjqg2lTA kt0FAMFMx0CDHkbX3aEe6No8PPX1MCI/lztU5VC/wioyjRgcUrwH1pWXTZX1bG9mmvjxkI FYT96VjxPIiNcCVHlGM0YGVHJpLrcT2WJI9u/m2bNLetqhw01/2xvAgf5JU/5OGlPmTUdD wErM5LP8cCsG6PlIswY785pYk6+w+PHgXt29EGXoe5iV4prE3dpw2RSplSnx51ORaBlZ1U 0MBhAu7pFSlCWw5dro4bS5F1s+Irh45+e2UR7lqokbKBj6ivd5xo8KprTu0FFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064056; a=rsa-sha256; cv=none; b=vEnpQWka8Vjct+uYPytHefWSKoK8mnfi5Zqbac0qG+fF8m0dTjzbOH4NX0uypP6qQK2tR2 bJD9S2qjpDcw6Kbiyc/11tTkALOYhlKGFUVzvp5wzZSGBIpQhkE0lOIhnB+qBTEs/aHo9v CWDYWdGY3wG4UGUo5eTh+LpR5cXOGbrc0C+6wwlyLbsFlZHrH4wkzrRIUcF59pwZP+lcoI ppFNPXQzxFfAWBDJs9veyMbC630L3FZxaudP8l3+kMY84LLYjYrI/2v6jP/Ssbgu1G+XQl TmQbVkHdJodD39oEmdQ7SOr7rwrvIvu4YuxJoqgCMHAmaVdSGGlrPOuSMvs2kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP2040Bpzrqp; Mon, 16 Jun 2025 08: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 55G8sGxx043690; Mon, 16 Jun 2025 08: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 55G8sGlA043687; Mon, 16 Jun 2025 08:54:16 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:16 GMT Message-Id: <202506160854.55G8sGlA043687@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: d4922e20a980 - stable/14 - timeout(1) tests: atf_fail requires a reason List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: d4922e20a980de452a66b014fb56d5492c60d934 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4922e20a980de452a66b014fb56d5492c60d934 commit d4922e20a980de452a66b014fb56d5492c60d934 Author: Konstantin Belousov AuthorDate: 2025-06-09 10:26:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:55 +0000 timeout(1) tests: atf_fail requires a reason (cherry picked from commit 4078e0d1d6f8189bff44fcad04df256220035f76) --- bin/timeout/tests/timeout_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh index a72aed609d47..b1bf69968e84 100644 --- a/bin/timeout/tests/timeout_test.sh +++ b/bin/timeout/tests/timeout_test.sh @@ -112,7 +112,7 @@ with_a_child_body() { out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo') status=$? - test "$out" = "" && test $status = 124 || atf_fail + test "$out" = "" && test $status = 124 || atf_fail "wrong status $status" } From nobody Mon Jun 16 20:24:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLhLf2zKNz5yMkR; Mon, 16 Jun 2025 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLhLf0pdxz3JRg; Mon, 16 Jun 2025 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xidhFoG+oW7SGpPwh1m67XKwzdyqLtAVrdUT2pA176E=; b=SkCFXWiNP3XaAAihfJvCB9VcxyhLhCwiRMugn/tqN82IXggRtWMPJtGr2md/3q9W4xyW/g MK2S5xXrfL+vOYFZ14tJqc9V14+Ow4po52/ScvISORpXMZsgjj0Lxh9d210Z5ZSAoFTLS1 3Yd1ipTMHRCVZJhYUpKTun11h3TL5R+k/ppzQziBBTnOne+5nDPem2B8/Ek66Dpx9yfqKC O5VezVNNjJyY0+Y4kG4NhF8qwObum3vOIrpfJdD+4y1StXNalFl/ukQLlcj3lTON68G+DQ VC6kHgaueRgb/LO4zlUeEmAJVbBCX008+iVMU8JWC0a9zmq24SbMbx1mOaKdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xidhFoG+oW7SGpPwh1m67XKwzdyqLtAVrdUT2pA176E=; b=Y3CUkghaJoM6AL9kTz+6itx8OL8xSxZP4s8n8qv9njXZcdnEet8iA+Ivt7jiF737kYcgQw 1nX5mbgZ6e2EhDs9Eksh9IivJaGlAn+vugsT0mpSWzH3QoQ1IuY+B9xNhsIeGpEczyWIYO Tpai1xliYAsVvccxj0t/nPm/V3ELUykXwl7ioU0H/FkwmhS7uTVkH3e6mXr/FaqL5GaqKg ntgVgdxxO+wjxS6iFERi1QCAr+JPSGMt5Rvn4eHvVRW8V9bDXqiSo2CoVkkHYFj2TcHWiF lw0rbKzfrfIqnvbj8DrX09ubdnQknxLIXoyiq5ZdSPjkA3aOwx0KtGGg8DgA1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750105482; a=rsa-sha256; cv=none; b=og0WrFd0al6GhwTGODl2yQ32NXi+3bQ78b0e3Cdd8FGOxuZXPLUSynDY2bR2Ikqg67tkGW 4bZkgHLL2FGdSjgL91XjMBXo8VC+CBW9gaWVwRQOs4Er5LaUn1rwLpysvA5tby2EUiKZUs mPzngerFpDVBYt70ClTZaEWHUaqoofjn1+rwcrfsNsbZ3GLZ+VYysrFnQJb/oz562rVcyx 2cwhuRIHOJNdUXbZBi1hpv6DBYVcgd9K10Cn7TAzBOgnjHEoGAb3bNm5lm16MB2Op8b+rB ZRmRSH15jSW6GxTyr0TRSSKtp0/mNhXVNuvqP+gqmsk8MZeNFL/aj0xCahK5+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 4bLhLf0MYgz1BZt; Mon, 16 Jun 2025 20:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55GKOf8j040240; Mon, 16 Jun 2025 20:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55GKOfpw040237; Mon, 16 Jun 2025 20:24:41 GMT (envelope-from git) Date: Mon, 16 Jun 2025 20:24:41 GMT Message-Id: <202506162024.55GKOfpw040237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 27955ed58e19 - stable/14 - mac_do(4): Examples: Fix some descriptions and a typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 27955ed58e1900549d9da48b3fb7d615c0470e40 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=27955ed58e1900549d9da48b3fb7d615c0470e40 commit 27955ed58e1900549d9da48b3fb7d615c0470e40 Author: Olivier Certner AuthorDate: 2025-06-11 23:07:49 +0000 Commit: Olivier Certner CommitDate: 2025-06-16 20:08:19 +0000 mac_do(4): Examples: Fix some descriptions and a typo MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 94828b33803314b5c8e833b233ca6894a340aa88) Event: Kitchener-Waterloo Hackathon 202506 --- share/man/man4/mac_do.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index 4c067205225c..f64eae600436 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -348,12 +348,12 @@ Here are several examples of single rules matching processes having a real user ID of 10001: .Bl -tag -width indent .It Li uid=10001>uid=10002 -Allows the process to switch any of its real, effective or saved user ID to +Allows the process to switch all of its real, effective or saved user ID to 10002, but keeping the groups it is already in, and with the same primary/supplementary groups split. .It Li uid=10001>uid=10002,uid=10003 Same as the first example, but also allows to switch to UID 10003 instead of -10002. +10002, or possibly having both in different user IDs. .It Li uid=10001>uid=10002,gid=10002 Same as the first example, but the new primary groups must be set to 10002 and no supplementary groups should be set. @@ -387,7 +387,7 @@ group, allowing its members to switch to root without password. .It Li gid=10001>gid=10002 Allows the process to enter GID 10002 as a primary group, but only if giving up all its supplementary groups. -.It Li security.mac.do.rules=gid=10001>gid=10002,+gid=.\& +.It Li gid=10001>gid=10002,+gid=.\& Same as the previous example, but allows to retain any current supplementary groups. .It Li gid=10001>gid=10002,!gid=.\& From nobody Mon Jun 16 20:24:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLhLh0Z3bz5yMrZ; Mon, 16 Jun 2025 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLhLg1c9Fz3JXF; Mon, 16 Jun 2025 20:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvbZjHAvPQ6NnYvXWpCagIO/wxp4F4TowFho78qENV0=; b=HaD4mISt1GxLP8mYXZc5Zra4nwgco4BSwZ/pXRAdAv4VJFKhuNX8RTq2+c5wsN6uUUYs1q xpMI1rhvHveI0Ad1w+RoaaXgjPeLY6yMSGjpBqyZFfynC7LgfFhyjClNm0OWAgsHVXYasP ezXZuPx8BMeDY+DnUBY070OY3uU8Mrrm2lLMFSK7zmhz1j+aYjrNB8ttJeJmmrKvQk1f+S 788X35N1EVp47Obj0EGxrVziMuh3NK/CQJ4JOgaQtI6stx4Z0HpfOfC4YCPyZTfZOqj3xb JVYReg3a1gtpl1Hgp0CrKJYT57nwUjSta5ueRMWUNl+j+j54TD148B8Vuk6HFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvbZjHAvPQ6NnYvXWpCagIO/wxp4F4TowFho78qENV0=; b=H1IZQLamiABwf4ABra6x/ioFvQNjLxxopbeHANE1jj903r8YTIZUT4uPfgKisc2HMspQGk BezOhllT1+87b81EPa4Ee37Ss/eCSf5AeUYhrm6B7AFmxVbtkl2B1jo/8JQI7mzWHOf7Tv t3XroJr+5qNpxgvnmY19moS1tnqw0uVpKm/eRuOhZSKhnEQEwd8NouMipkPUX5kdqPevGm badwLS2TuQh0o5z2f2c/L+/FEzjOaG0L8QqDPnr3Ufe+w8Rmf2sg36zSXz6g77Y8vlZjbl 6bsIs6Qe5UG75c3JTfiufGRnm1FYUK3hJQG2FcpwYmtnoM1e/rgCZtAxicOU7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750105483; a=rsa-sha256; cv=none; b=KmBsh2hOP2v+XZoOUXShWZBgWL3E4AVfndQCRbQybvGPAcP6ibj+tsaiBwZbUlpO0w+d/D AIi9jEogjdqUo0n0s+aM8SXQ3VIKweNIaNPyo0uYs9cwolCQ1LNOdZ7LiaxvBuJqgzz2iI JeGXPMtVKBYcmhUC5uDvR0F3dh+/0P+CGwapoiO/WpRJVFPCUIrhobpEmedwmXBRghuISO uKRlrrqgglVoE6NBnUACZ6Dk7cUlEGSiqDF2YY73I0DX1cJ8llnFleaXh+zfvbVo5xG4CM V1Lyh7cWYgd/kSOEq3XGJ9DyuX171RjWUJACC6iq7EHIPTJoJ6QaL3cWvCwLHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLhLg0zF6z1Byl; Mon, 16 Jun 2025 20:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55GKOhvc040273; Mon, 16 Jun 2025 20:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55GKOh5c040270; Mon, 16 Jun 2025 20:24:43 GMT (envelope-from git) Date: Mon, 16 Jun 2025 20:24:43 GMT Message-Id: <202506162024.55GKOh5c040270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9e185ae1d4b5 - stable/14 - mac_do(4): Bump .Dd to reflect latest update List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9e185ae1d4b5c589b2cf8d940eb775520bc945ee Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9e185ae1d4b5c589b2cf8d940eb775520bc945ee commit 9e185ae1d4b5c589b2cf8d940eb775520bc945ee Author: Olivier Certner AuthorDate: 2025-06-13 18:06:24 +0000 Commit: Olivier Certner CommitDate: 2025-06-16 20:08:59 +0000 mac_do(4): Bump .Dd to reflect latest update MFC with: 94828b338033 ("mac_do(4): Examples: Fix some descriptions and a typo") Sponsored by: The FreeBSD Foundation (cherry picked from commit 7747d826573a38e6caa06619f5596b792dc5a976) Event: Kitchener-Waterloo Hackathon 202506 --- share/man/man4/mac_do.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index f64eae600436..fb165dfe5a1a 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -8,7 +8,7 @@ .\" at Kumacom SARL under sponsorship from the FreeBSD .\" Foundation. .\" -.Dd December 19, 2024 +.Dd June 11, 2025 .Dt MAC_DO 4 .Os .Sh NAME From nobody Mon Jun 16 20:24:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLhLh42Qlz5yMmG; Mon, 16 Jun 2025 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLhLh2QlLz3JjL; Mon, 16 Jun 2025 20: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=1750105484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uw0lHvG8ZSR0WdSfAax7AKsIedykbUi5UxjbW4rQAuU=; b=WH8b6FY2d387XEXob3D5cnvbpSTpOgPzpdq3XzSdf4F9qwJXc3fxIRbbDwJK5c0/c+d7EP i5scGBAlca7Ri7qVQ1Q3JJyJIfh79xJ8c/34UQ6C/FR7gEvOhWGIomNVsx0JURxHjgnT4R XQWmYfbj6KvVsGvxcmmlLiyKONoMR7EFKwoTxc1sG5QagCzyVNzoI7+yanlyo7PpUevkhB MQSlTBb5MQtqJON9buBhg8W8m771BQyNsdrMCoJOB0Uu+gBY54SKQe2pim1UOnl1eMnwXy hOFUOSJP2IcIlyJTEllLQC55JqYt+nOk5piejdAMPhcyjGrpvMgFA9oGBDDB0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uw0lHvG8ZSR0WdSfAax7AKsIedykbUi5UxjbW4rQAuU=; b=Elkw7QjNawmglMPbYfmUgx5gLoun0yzOj0EpcrxkPfKJqrrj5Zu9lnKKpE4Sig1OItj14r NgoN1c9yrYX8SiYqywGriGjjfpI9PK+VG6DaCbPCJ81aUMBIOhZbpWtIyTYQGOpX/s0m8G KBWRYF70NcZvJTU+Q/xtQkOKqncbktrKc4iK64oR1yn4gIUIOeVw0YoFC/81/cIqnzYZ+g YTQXs1wDsQweKn/G/uZMFePnT3cR27uxLjhfB83s2tEX5Rp4cOXjD+dqrg/QhcpjgiLEiv 9CmPUVaw5jKtlc7TRajumAX5BBjJgf/vjZTPC+pVFUpnjc2jfxGxXYlxfya6Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750105484; a=rsa-sha256; cv=none; b=pnheWuSlp0m1WtuVGCxQyuYUba9V5SqdX+SE+bkQQ++AARP2WiRVm+lbmukjR4HH8ywQAr HoiHu7XdVVEboRVCpW4+tAK6jCcGi1FH9lcu1Jllgu++tgbI/Ko8k5cKLPqkap9C0/36C3 dsX/sQyx96UNcB6n8cyc3iFewfL0MMVjpYOD/0bI36ASCdCkgW23M+1m9cglLBqVvEmjud 8aLc+nQXnGGhyQrVl+kNXBFbKUfpp+9PvtJu1Tlsqt0Q6YdB3gJlqgEjg3+Yiuvr/kGC+m UKoAtGPZIvg3S5FX+aZaniZ/uzS8CGVWare5spEL5gMQzjg8f849VO/hyK2yYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLhLh1vfwz1BZv; Mon, 16 Jun 2025 20: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 55GKOiYu040312; Mon, 16 Jun 2025 20: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 55GKOiZh040309; Mon, 16 Jun 2025 20:24:44 GMT (envelope-from git) Date: Mon, 16 Jun 2025 20:24:44 GMT Message-Id: <202506162024.55GKOiZh040309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: bb5a2106555d - stable/14 - config.5: Document CONF_CFLAGS under 'makeoptions' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: bb5a2106555d810bb6a5ec0a80584abf8154cfbd Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bb5a2106555d810bb6a5ec0a80584abf8154cfbd commit bb5a2106555d810bb6a5ec0a80584abf8154cfbd Author: Olivier Certner AuthorDate: 2025-05-27 07:41:19 +0000 Commit: Olivier Certner CommitDate: 2025-06-16 20:09:06 +0000 config.5: Document CONF_CFLAGS under 'makeoptions' This variable serves to tweak CFLAGS from the kernel configuration file, easing some custom kernel builds. It was introduced by bde@ in 1999. The description has been kept simple on purpose. It does not completely reflect reality as the build infrastructure actually appends variables to CFLAGS after CONF_CFLAGS has been processed in a few cases. However, these cases do not collide with expected common uses of CONF_CFLAGS, so have not been mentioned. Reviewed by: markj (older version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50544 (cherry picked from commit 1bdf1b8186359d4ea26e26de03e03b7c1543b707) Event: Kitchener-Waterloo Hackathon 202506 --- usr.sbin/config/config.5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index f77b79a31510..a04ecd4ac0fe 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -307,11 +307,28 @@ variable is specified, .Ar value is assumed to be the empty string. .Pp +Note that, as the common makefiles overwrite the +.Va CFLAGS +variable after having processed the configuration file, +customizing +.Va CFLAGS +directly via +.Ic makeoptions +is not possible. +Nonetheless, custom compiler flags can be specified using the +.Va CONF_CFLAGS +variable instead. +Its content is appended to +.Va CFLAGS +after the common makefiles have set the latter, allowing to override their +compilation flags. +.Pp Example: .Bd -literal -offset indent -compact makeoptions MYMAKEOPTION="foo" makeoptions MYMAKEOPTION+="bar" makeoptions MYNULLMAKEOPTION +makeoptions CONF_CFLAGS+="-DSOME_CONTROLLING_MACRO" .Ed .\" -------- MAXUSERS -------- .Pp From nobody Mon Jun 16 20:24:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLhLk1nsVz5yMZm; Mon, 16 Jun 2025 20:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLhLj3SWHz3JPV; Mon, 16 Jun 2025 20:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHl/DrjMQ1KGbA/7jw4DWYBeZLdtN1G9+aFussv/Np4=; b=IHBcTIV90rgrTp840sCtBKTR3MvJErE90ZOdojPQpLl5o4AJQ6GKDlVsazd2M0vH1VvVx+ FmJyrOVcHPKFbLC15Pe6fa2NlOudMpm4MC3g6bqRFVIzB22UU30R6j/PQ/HvF7R/4aZVRL zNpoXXMJbF7SztKPHoxCONuxVXh7TyPDZThjoY6ugKdsbgPvsTyOrBuPUo2OzB24vvRw+v ofskEEkxjzxqY/iRv7hA6OtYNV7VQwEEfy80iuj2FNtVuAyCib74I814kPQ/li+xgO8Jbi NkN8eH8S5hapEfFcan/caT6gVHG2V2FEK4Kkn+H+pPOOaOiX2OmNSk7L5ItCRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750105485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eHl/DrjMQ1KGbA/7jw4DWYBeZLdtN1G9+aFussv/Np4=; b=HOCHWaHMVpsMCMXJbFOJiWetZM25mSskmHhKQ3WEmLt58Fy55UjPfp3L6OAQxaSeGY3JD1 O7TlVnl4yWm5t9oDfcP0u0qV/4epnCkcKN1eNEzMP8L6Hn6yEAsoQdCr7YnOdoBgG4mUNB HCDO8Ba31IN7gBOja6PYH3hn5XlI67SrR6PqCYK3SCfVtJy/zSgxvGCohSUALf7eZlZWfT 7yN7e7ksA2gsfDCAol2MRfXm/ehhdm12jTdkN0aGqimyLlFEXClwtSoXCtk7H7deptp9cv 7eGnE9v0XbSelK9V46U7H+796kjHw5PFGWmVXO8MoATkhTspSb2eOVC6EiDPng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750105485; a=rsa-sha256; cv=none; b=doOgkqMQYNkgBzKeloZIri0mvwtbKNWYq/t2/gvujCpUeYV545/3hCkwdOAxIAOJnzVt8h tpBAAe5op/yogyc5/wQ3G7hFf9mYnyHjvsjEPT/yxtcTqfujAfyNJPqwN7q+Uo1AeTivuG wx8RQaxLvIC3s8XdjDwoyScdA3Be/2w2gnCqjCMAvsqcuDufILSHcufej+Fz1/UmrhXPoZ TYhwKHWs6K/pHckgfF5Q8aX/GJjO1clYOV4gmoZnZ1MnLTvkUATLNSJk/V7O81kpcO3EKL kpJz26dAeQyCCYZ05DOq3EVF8lECkLkgTbaIIF86G0idheXKvGGB7sIRY/nH1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLhLj2rylz1C51; Mon, 16 Jun 2025 20:24: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 55GKOjSq040346; Mon, 16 Jun 2025 20:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55GKOjcw040343; Mon, 16 Jun 2025 20:24:45 GMT (envelope-from git) Date: Mon, 16 Jun 2025 20:24:45 GMT Message-Id: <202506162024.55GKOjcw040343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 14fc13501409 - stable/14 - config.5: Bump .Dd to reflect latest update List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 14fc135014091e3df222f3276cfba1412b17c208 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=14fc135014091e3df222f3276cfba1412b17c208 commit 14fc135014091e3df222f3276cfba1412b17c208 Author: Olivier Certner AuthorDate: 2025-06-16 18:56:33 +0000 Commit: Olivier Certner CommitDate: 2025-06-16 20:13:17 +0000 config.5: Bump .Dd to reflect latest update MFC with: 1bdf1b818635 ("config.5: Document CONF_CFLAGS under 'makeoptions'") Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 956100d60fa86daebc1bd46ea62f207f6b54d93d) Fixed the "MFC with" tag (which is wrong in main). Event: Kitchener-Waterloo Hackathon 202506 --- usr.sbin/config/config.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index a04ecd4ac0fe..11832c55be94 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 17, 2022 +.Dd June 13, 2025 .Dt CONFIG 5 .Os .Sh NAME From nobody Mon Jun 16 23:46:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLmq170WJz5Vd0Y; Mon, 16 Jun 2025 23:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLmq11shPz41jF; Mon, 16 Jun 2025 23:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750117565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOGW6It/aG0evghIKZO9HSvSvRNBt36rblBk4eOJr3E=; b=LpdRbOm6MdqrtTiSpUbq5sRYHF+0a56urQhbG8aiIk1EAm7x8QKNlYIgkGggYnma7sNrFs qKjoL5076dyvi4Obnd8visM9/UWFV6AwXXas445D/+LYKcUSUjQHOdzRkPrGuoQ+pcRBzN +05Ofz2jG3AQy5QF4euaV8oYcz0WVFfTsRSAisS3ukEmTtXbT1iZ3izk2zyb99c2sXen/V GpsSYXdjAXWbQSo0WjcuqmiwbQEfmvx8vFVogbU6R6pPQPa6ggDJKn/c/KG6rWVVxSX+A4 io9V8CB6kEUL/thPcBKGqAX4cmONKeSPkWfWQ6bnUrD/sMF7CF9/M9SqGjvNKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750117565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOGW6It/aG0evghIKZO9HSvSvRNBt36rblBk4eOJr3E=; b=WKfk7UZ2KgxJ/11rT6zkqZ7nf682JNE5H90/VUhYeKCwQQQmolv7vVZtLliclNghbXOJDf n2G9BmCU2AD18GejOh5SvGKrtQ+H2EBaCJVhgunmlmkCZBOTnLVyMpvCZYYpCtnc9XoDKg tZX/7KC3jmGO7DwSCa1DQdzaW6rZUtStDLZPuFbnu5Otjh9jMDrfnw7S0MG4BqBoKE0Jwh sYmpN/WSqJjtFzTOIjJz9sL3gZ1CBG8iu9iLpqMUMcqkNLJxDQgq62QIfRuCiLNcVuAF77 sbnLZNZSnBHPrb73Aey8Y1tEvSsKIh3Rdo3+j4iLOzve+rOT9fWpCAb1oALCJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750117565; a=rsa-sha256; cv=none; b=GTuQHfJckPsMZkc5N+vs0fVbNrWQIPo9i9uXiKuO7Q3Anxvh6DlTARHOcwDdoBj8gGoNaZ oS+hKrHfjmtxVqO+coLvPHcMIjGO0zLfRZu3ta7ysKDyaxOW3Uy6+DeGeUbQPmfxl33MRu CUOWTprHyppVg420+xpYsO1Jyc9L6K0gh+M8EbvOdspCLUABQJ1uwe69MwlQ3nc/b2s426 8Jt+6aNy0nRcGViusBWluVW+KeBH9heMgrUF3ET0hDRfog36BBpGOHnoXJe2v59aCEQTgl NYT7PNxxklIMKJzxz0mbT4cbW5V1yIRrjvz9Qmu9beVf7r0TQvtdG5HvNDz+RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLmq10rQ7z3rZ; Mon, 16 Jun 2025 23:46: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 55GNk5NM017165; Mon, 16 Jun 2025 23:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55GNk5qf017162; Mon, 16 Jun 2025 23:46:05 GMT (envelope-from git) Date: Mon, 16 Jun 2025 23:46:05 GMT Message-Id: <202506162346.55GNk5qf017162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 0e8890a425bc - stable/14 - Add a new sysctl in order to diffrentiate UEFI architectures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e8890a425bc778d323566c881e26bad7c54baf2 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=0e8890a425bc778d323566c881e26bad7c54baf2 commit 0e8890a425bc778d323566c881e26bad7c54baf2 Author: Ahmad Khalifa AuthorDate: 2024-06-03 01:40:43 +0000 Commit: Ahmad Khalifa CommitDate: 2025-06-16 23:07:25 +0000 Add a new sysctl in order to diffrentiate UEFI architectures With the new 32-bit UEFI loader, it's convenient to have a sysctl to figure out how we booted. Can be accessed at machdep.efi_arch Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1098 (cherry picked from commit b538d4911004ca541507166b8ec9689d2e87d1aa) Approved by: imp (mentor) --- stand/efi/loader/bootinfo.c | 8 +++++++- sys/amd64/amd64/machdep.c | 21 +++++++++++++++++++++ sys/x86/include/metadata.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 5afb4c78353e..2961b8b97fb7 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -447,9 +447,15 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) module = *modulep; file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif -#if defined(EFI) && !defined(__i386__) +#ifdef EFI +#ifndef __i386__ file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); #endif +#if defined(__amd64__) || defined(__i386__) + file_addmetadata(kfp, MODINFOMD_EFI_ARCH, sizeof(MACHINE_ARCH), + MACHINE_ARCH); +#endif +#endif #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index e4109b0ff791..70a7aa677c9f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1691,6 +1691,27 @@ SYSCTL_PROC(_machdep, OID_AUTO, efi_map, efi_map_sysctl_handler, "S,efi_map_header", "Raw EFI Memory Map"); +static int +efi_arch_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + char *arch; + caddr_t kmdp; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + + arch = (char *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_ARCH); + if (arch == NULL) + return (0); + + return (SYSCTL_OUT_STR(req, arch)); +} +SYSCTL_PROC(_machdep, OID_AUTO, efi_arch, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + efi_arch_sysctl_handler, "A", "EFI Firmware Architecture"); + void spinlock_enter(void) { diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h index dbc6d3275e53..b3eb4b16c1ba 100644 --- a/sys/x86/include/metadata.h +++ b/sys/x86/include/metadata.h @@ -34,6 +34,7 @@ #define MODINFOMD_EFI_FB 0x1005 #define MODINFOMD_MODULEP 0x1006 #define MODINFOMD_VBE_FB 0x1007 +#define MODINFOMD_EFI_ARCH 0x1008 struct efi_map_header { uint64_t memory_size; From nobody Tue Jun 17 18:59:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGQ11Ymhz5VpL6; Tue, 17 Jun 2025 18:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGQ10M3qz3nm3; Tue, 17 Jun 2025 18:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tEKOYuFycoUZXrNifLCuhie2fbNV/t4vw6KEbDDdaLo=; b=Bge31bU8HCA7jnU7xP5ExHTnfARqhNf9jBwNJgq5s3l/xsc0BfgCr3IST4ClPSDHHPtvNf tvtZAYgfZ3BRhwRnNFK+2c+DZbojJ/aACN3DMk3e1pGuByxzL1BvtySvQlJNlQHysW9yxf lr11m10ZaIxL0rKXflne5kY37o0v5dl2f6XEGEMiIUW0GJfipk7ZP8vyNQzH8y+j8knvoT SycIGaQFyCmPgOLtOzr9FtG8iiHsDDNxl84ODmzMZ8Of7bhB3ZeUQGtfbS3vuFq5iRswAo LLmjf9xW4cOiFtgP1vokkSvlObZHJZ6PoIbIMTK8LeVUAor9ki6NgFeNx5Lbmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tEKOYuFycoUZXrNifLCuhie2fbNV/t4vw6KEbDDdaLo=; b=EYNTeBy0x8QNHsU3IJwBsIbyVm2PTSMur+vZ+j0fHkSFJB5IkqjX00AFRybge7neW+KoI7 DFOMXs7B8Txl7FR37TqYIW6xuRS5wGvE9RQyFtE2RCcrK7IU4oswaCfdhh1x6dXmwoy0+e aJgIIXd/0C50rbN9dHQTmz81xNKqTrSTASJGGJWBEUIcqi05ufq74966WfYr6Sn699ymZA 43orB/W72xSPJUWRzjOFMbdBTgu5oKHdbeq7sIj11wxDDaOqX+Du9MUBjKfjDQUUuv0fVo D0wle/ZGZ7QhZNyk9I+gX4b4VFC02bcdD0f3rip6eIGvWaNidH3NPOeClQuGhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186777; a=rsa-sha256; cv=none; b=kxVIlfQJ0Kcc12B8qUM/RK6tz8uY7bILMPly7W/8oSCAXT6Q0OKoE3VttGp9+p7V6usq7s ed2FR0fWahTK7nlx8SkvYycF5AsYbASL8kYCHkKE4tPR4Z4W61z7Vl5lZyJD18/G6vdmWh AkitDqpAb50YmhD1sWLvclkUznRYkG6RkMeKL8LJEzNIdWPZbUZWZF376Oq1IxbjMSY/ny Rmq8vNB5snEq9xyVrgF5YT970hf40Audi1X7kSnzVRoX1CPHxP62KiFbsUUI7fyjg3b3zM c7e95xOQBeScFwiOrv88HB9IkeoJMf6BNlqojOzvsYvovxvhFQjsOsyPAjZqXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGQ06jwPzw8k; Tue, 17 Jun 2025 18:59: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 55HIxapp002380; Tue, 17 Jun 2025 18:59:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55HIxaaN002376; Tue, 17 Jun 2025 18:59:36 GMT (envelope-from git) Date: Tue, 17 Jun 2025 18:59:36 GMT Message-Id: <202506171859.55HIxaaN002376@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: c8c759c23e2e - stable/14 - src.conf.5: Update MALLOC_PRODUCTION diag options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: c8c759c23e2eb0ef3a5f18d55b8671f20b442190 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c759c23e2eb0ef3a5f18d55b8671f20b442190 commit c8c759c23e2eb0ef3a5f18d55b8671f20b442190 Author: Ed Maste AuthorDate: 2025-06-13 14:35:38 +0000 Commit: Ed Maste CommitDate: 2025-06-17 18:59:10 +0000 src.conf.5: Update MALLOC_PRODUCTION diag options PR: 287502 Reviewed by: kbowling, ziaee Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50834 (cherry picked from commit 9eb6cafe377e11d4fe8cbeb22f3cd64909a44ce9) --- share/man/man5/src.conf.5 | 9 +++++++-- tools/build/options/WITHOUT_MALLOC_PRODUCTION | 7 ++++++- tools/build/options/WITH_MALLOC_PRODUCTION | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 53264e4034b4..63fba6d2ac01 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 April 30, 2025 +.Dd June 13, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1187,7 +1187,12 @@ for more details. .It Va WITH_MALLOC_PRODUCTION Disable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to false. .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: diff --git a/tools/build/options/WITHOUT_MALLOC_PRODUCTION b/tools/build/options/WITHOUT_MALLOC_PRODUCTION index 57b8ab574f93..90efc200fd54 100644 --- a/tools/build/options/WITHOUT_MALLOC_PRODUCTION +++ b/tools/build/options/WITHOUT_MALLOC_PRODUCTION @@ -1,3 +1,8 @@ Enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to on. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to true. diff --git a/tools/build/options/WITH_MALLOC_PRODUCTION b/tools/build/options/WITH_MALLOC_PRODUCTION index 1a214ff805be..ac267bdc48a6 100644 --- a/tools/build/options/WITH_MALLOC_PRODUCTION +++ b/tools/build/options/WITH_MALLOC_PRODUCTION @@ -1,3 +1,8 @@ Disable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to false. From nobody Tue Jun 17 19:01:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGSJ2MMyz5VpDR; Tue, 17 Jun 2025 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGSH4g3sz3pX9; Tue, 17 Jun 2025 19: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=1750186895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOS9DLq9wuOwQ3mYhckfHaPYit5IO2sqE7zBsy6uuXo=; b=C/KDtimRm4tQss9mEgqhUFpni/RSzSlxNK+Mi3yHC58qWy3n2jinl6tJqxx9HC9Pg3c10D scBQqsPQNyz15kK4aHv9c1ks8+3MPf51jY+YUbUjufE7EE75l7oHaxZiQ+KfAhtIGwFAuj 8ddTdIBEmnJ4hFyPt+jT1/hpS+ia9zbnGdOzFLFIkyOKYiZ23/B+3To50T6uriGLm155B6 VmkgZuiV6aAo/fcj62M/DXhOm9EW9ezJS1CRgTFmPOO7PnM9hlhyvdq/fSYdzr/pOnX74h 5dzBS/DltR0Q1yOY6/g7QqDHF9wySFhBrykfE+rxDvLgVeOlLWDe/Oanr4pFyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOS9DLq9wuOwQ3mYhckfHaPYit5IO2sqE7zBsy6uuXo=; b=qvvNERtK85A/p8pT1HcWtTJTKbheZYkERcXffMQYbVuJCxHbcz40jtPExL9s493bIImQc6 kULNm2VMe6oH+agKTjkWQjnHOY3DqAFvR7piAmvSAHm+dh0Bv9WOqJoNg4Wp0A+ndNZtPB BOxcqe+5WZJ33j4euoUwoTzhLQseuiKegMkTtuvJmDQY8nF8fqnlV+MKBbIPGEAqI6Duva It4ZC1tC7qcT758uMWBgw8psgkJK2vGrT42h6A+r3DQVwdPZBQfJ0m00WxY7TS+VJk8Wr2 kHr0NI6jluoSMGMrakJ2fhYagiMYVhjVOktdMRlY4xehAQhQqo9qVk6KJy/5Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186895; a=rsa-sha256; cv=none; b=yxTXf94uMVHeJVj4yNNBtHJcwawKUXYZe51gz0MtmA/Ms72tqx8Y5QUcA8tp40F8G6mXsG QdISkQxS366lqCUl65SaFGXc7C0CsB07PQIR9joIYF3D7mxr05/CLATOT7JR7hxD4xT5r7 cFx6OStSkFuCaWVAhzYNfS7AreIco52vNvE9MNlrPg8oR4/5SNt+QIi/oRGjbequMGvGvq R7+Usy9YbB45hELStwisd6UkYjctXPL80g9WVr0hVFtYDeEiJJVNOMz+yFc10Akc3ZOLSz HiBiQfr8Pa3LzjH0kmvwEhgj1Se0tswfZYDDILSSuIflAkfuY4lEBqGco/I99w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGSH3zRpzwFd; Tue, 17 Jun 2025 19: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 55HJ1ZEu012864; Tue, 17 Jun 2025 19: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 55HJ1ZYf012861; Tue, 17 Jun 2025 19:01:35 GMT (envelope-from git) Date: Tue, 17 Jun 2025 19:01:35 GMT Message-Id: <202506171901.55HJ1ZYf012861@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: abd596c4e0ef - stable/14 - release/pkg-stage: Put each package on a separate line List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: abd596c4e0ef8145cb15931088aaeb0c34ff13b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abd596c4e0ef8145cb15931088aaeb0c34ff13b8 commit abd596c4e0ef8145cb15931088aaeb0c34ff13b8 Author: Ed Maste AuthorDate: 2025-05-06 19:37:55 +0000 Commit: Ed Maste CommitDate: 2025-06-17 18:59:11 +0000 release/pkg-stage: Put each package on a separate line The list of packages included in dvd1.iso is maintained in pkg-stage.sh itself, and sees regular additions and deletions. Rearrange the beginning and end of the variable so that each package is alone on a line, to make it easier to track changes. Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50221 (cherry picked from commit 16d0fe1f721f63d15c741ff4c0072390aaa27e73) --- release/scripts/pkg-stage.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 77e9dbd1e789..cff3b9edcb16 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -12,7 +12,8 @@ export ROOTDIR="$PWD/dvd" export PKGCMD="/usr/sbin/pkg -d --rootdir ${ROOTDIR}" export PORTSDIR="${PORTSDIR:-/usr/ports}" -_DVD_PACKAGES="devel/git@lite +_DVD_PACKAGES=" +devel/git@lite misc/freebsd-doc-all net/mpd5 net/rsync @@ -30,7 +31,8 @@ x11/gnome x11/kde x11/sddm x11/xorg -x11-wm/sway" +x11-wm/sway +" # If NOPORTS is set for the release, do not attempt to build pkg(8). if [ ! -f ${PORTSDIR}/Makefile ]; then From nobody Tue Jun 17 19:01:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGSK1FRSz5VpGD; Tue, 17 Jun 2025 19:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGSJ61Rpz3q0c; Tue, 17 Jun 2025 19:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wzbe8DauI0rFhQtrN1QqjlVtZ0JP3T8zAWSNBNWyItQ=; b=BGdaWGAxgX+ThAQujWo/UyyvjsUsqrc+noD6UR+KIFpPNMHtwR/8K13dm/Dnfeqiv8Hbo7 vk72QeY4FThdIWnBRBzDxMxI3ba0H9BrMG630ynohe0JpIjYdJWptfwONg4SReRejUFNHB Q0MD46sH4XrXtSRlKSBUpbmDQbYFJurVLI26A2ZQ25Le26Bi4VW2mltm3ISNNsWRruZt4r oDDSMz2GV+ZHmCuQFYwtHw3T7HYFtbG5WTZpdgIaDtzhnkPN9x3BTRgm8A1s+NxDBRx3bV dPT+Bs4qr/HeLI1gqIhYpgEWXipU+VTOsbZQNnSALl12DWoxQ4WELDzOj9X00A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wzbe8DauI0rFhQtrN1QqjlVtZ0JP3T8zAWSNBNWyItQ=; b=CTu1zLzou7acahzTvoEM81Fol2j+en6TOXgPO7jzosyFULK62BquXPmz9rBt0ZgH9eZMis ELHq9VEUUCfEOzftc5SAN5gGF4IUKXoqwR/avoRvcOyqVy8hheVzx4jjyR3ldFZkX0wWlK VrmMbVdBFnixrUNazC7MmwsrnPQXmF/yIHwOKQJ+0RUD1oBMjm3jIWvpUnSDT6EThJhJio h4Cjy2JL4WEzmMV5BivZTEOColAWktikMU/WsFkA3rPMx/USseiZ2UHAcRs32UCmDyOuOb Ch5CyyS6NTS2eD9McTErD5F500ti+n2gDfUgLKQ4B6tSGi5XQus7XdipL8o9ZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186896; a=rsa-sha256; cv=none; b=f8chMpPRPp7Cj9b59qgf06QO6VdMGYSn01OKoYK7pFegYwKAolZGl2zdiee22IMLYesWtA sjUqlWJ4xrofcIZebo8XUWZUAHKWxCOc9VwLhlKbreAc0gUqhzcQ2BWi7KD4FTq7/72LL+ Sr8hSAKyz+FaSJTch9ZpJs4cvHCrIbOtm/SEMkiKRIF5NGnpHemA/BN9ZAmNUv3b7cMdzI NBHN193awHl5WOJA6FFAttHO9i98ok9gstmTzwb8sHt1Vop4s9LdjHGsBBNqefkOpNtPZf FT3KsHCu/5gs5MenQB03b0nS/OS1X6kY0ZEFcCaLUGJeUUfzM4dY8xQ+S/HSYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGSJ54Q8zwrG; Tue, 17 Jun 2025 19:01: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 55HJ1aZW012905; Tue, 17 Jun 2025 19: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 55HJ1aKt012902; Tue, 17 Jun 2025 19:01:36 GMT (envelope-from git) Date: Tue, 17 Jun 2025 19:01:36 GMT Message-Id: <202506171901.55HJ1aKt012902@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: 2c2edbe9acf7 - stable/14 - elf.5: Document .init_array and .fini_array List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e commit 2c2edbe9acf7f22b6ff4cdb3f9c280155c67c46e Author: Ed Maste AuthorDate: 2025-05-16 16:20:10 +0000 Commit: Ed Maste CommitDate: 2025-06-17 19:01:18 +0000 elf.5: Document .init_array and .fini_array And note that .init and .fini are legacy interfaces. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50380 (cherry picked from commit 4eabcb77d5bbf418aa86efae6523375d28150d4d) --- share/man/man5/elf.5 | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index 2aebd1b27702..bda2020b2d5d 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 25, 2022 +.Dd May 24, 2025 .Dt ELF 5 .Os .Sh NAME @@ -915,7 +915,7 @@ This section is of type The attribute used is .Sy SHF_ALLOC . .It .fini -This section holds executable instructions that contribute to the process +This legacy section holds executable instructions that contribute to the process termination code. When a program exits normally the system arranges to execute the code in this section. @@ -925,6 +925,19 @@ The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . +.It .fini_array +This section holds pointers to finalization routines. +When a program exits normally +.Xr rtld 1 +executes the code referenced by this section. +This section is of type +.Sy SHT_FINI_ARRAY . +The attributes used are +.Sy SHF_ALLOC . +Refer to +.Dv NT_FREEBSD_NOINIT_TAG +.Pq below +for a description of how initialization and finalization code is invoked. .It .got This section holds the global offset table. This section is of type @@ -937,7 +950,7 @@ This section is of type The attribute used is .Sy SHF_ALLOC . .It .init -This section holds executable instructions that contribute to the process +This legacy section holds executable instructions that contribute to the process initialization code. When a program starts to run the system arranges to execute the code in this section before calling the main program entry point. @@ -947,6 +960,20 @@ The attributes used are .Sy SHF_ALLOC and .Sy SHF_EXECINSTR . +.It .init_array +This section holds pointers to initialization routines. +When a program starts to run +.Xr rtld 1 +executes the code referenced by this section before calling the program entry +point. +This section is of type +.Sy SHT_INIT_ARRAY . +The attributes used are +.Sy SHF_ALLOC . +Refer to +.Dv NT_FREEBSD_NOINIT_TAG +.Pq below +for a description of how initialization and finalization code is invoked. .It .interp This section holds the pathname of a program interpreter. If the file has From nobody Tue Jun 17 19:01:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGSL0Nwqz5VpLZ; Tue, 17 Jun 2025 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGSK682sz3plh; Tue, 17 Jun 2025 19:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NkhrSEHKLG/lXUZ+T2nluiS5Fmr57dEkfDzxDgfNFo=; b=wJX6Piz68+QhiJqDV8hD72yRxu/NKWeg9VvHKtBGDike6uyWL4Sl2JZ6GHOoz+LdbgxURE h8Fl3zDBf8S52uqJreWYeSNUwl/Phg0lK/2BGNQUQ4Fy/SPi6f1cYvUjAO0W/CUfuJYfaF Hu1LBxoNR7JuLfw5Ymllt8APsXqYfELuaIj0lKUWLNazgGh01PHTCnhO2XJFXyGgrNgfxL HictW1ZrwO4A8SXHATdcwbCYsOS2Bg/bSxO5zgkmFYIwSdoDrxx8ofoFkUXpeRABGuluXH cq9rvk8RswrOESHx1ZKqndc1y5i2JXO1sNn5kgYBhrJZb9rU18UXskwyvwDk2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NkhrSEHKLG/lXUZ+T2nluiS5Fmr57dEkfDzxDgfNFo=; b=PNVb2eQErs+R6cCGW5oQgc7G4DMviZDSA5LbQcQzwSksv1kMHnaPd5cVsHNux+m1CCpT6O v+Lo88l6SCFo/Wu0JFkd2xPtAvJ9FmJlt4gcOQqIpXYk9cfMbeuAm0uKLL4rhLEnjcwJol mRgn16dtnkk5rkYpLHqLfIsm+XRZIQULk1o0YE2NU2EOu4D6FLJ5G+tj9iHvp4yxZqfKAW 1YWibxHDKOuNfdEPszvavxzXVkAvGHi3DioC0397Y9ya1R9Wanw8If/RwY8ul5GrlsBi9M aU6jndowRAU/gaAQ75K7cNbQxH0ecdfTZpunRSIgwOEl4GJOGmlL2iND+RaXBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186897; a=rsa-sha256; cv=none; b=mMu4KF5HsEu6BCb9JARqA6ru53gF5ALINgLFc++jkueiJzwxMNE4RWrC/gUmJTGH3aM+DA 6vtaxtLbvWZFRpGBH44JFETJPyGQi35avR+HthtN4n0cpLW1VF4JWQ1a/Tj1M+rhpaNjAt InUCryEgEeNTJxaPcRD5/snpnFX/vpIXHwSxTcskP/T7viOYsFK6He0Iim0gBefIxZFCDj KmJm9mTl7VWNqA1AuSVnN2DwLLfdR8m9r/P8li3AXS5XG/OHu5vSX3RkV7yQfkna6Q/d3x osnh7V3W0G6OyCatxEDF/oyAyJhr/BsOe9WmSpcxeMmUm1KZo7gstcPUEgYeLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGSK5jM3zwrJ; Tue, 17 Jun 2025 19: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 55HJ1bpM012939; Tue, 17 Jun 2025 19:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55HJ1bWg012936; Tue, 17 Jun 2025 19:01:37 GMT (envelope-from git) Date: Tue, 17 Jun 2025 19:01:37 GMT Message-Id: <202506171901.55HJ1bWg012936@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: 056cf3be3464 - stable/14 - elf.5: Add description of .ctors and .dtors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 056cf3be3464589c73a9c6683cd6e9cf5afff8dc Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=056cf3be3464589c73a9c6683cd6e9cf5afff8dc commit 056cf3be3464589c73a9c6683cd6e9cf5afff8dc Author: Ed Maste AuthorDate: 2025-05-26 19:05:25 +0000 Commit: Ed Maste CommitDate: 2025-06-17 19:01:18 +0000 elf.5: Add description of .ctors and .dtors Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50536 (cherry picked from commit 136053f7db824b72ede67b40b0e7a393f6686a8c) --- share/man/man5/elf.5 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index bda2020b2d5d..fac51adeea7c 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 24, 2025 +.Dd May 26, 2025 .Dt ELF 5 .Os .Sh NAME @@ -864,6 +864,13 @@ This section holds version control information. This section is of type .Sy SHT_PROGBITS . No attribute types are used. +.It .ctors +This legacy section holds pointers to initialization routines, +executed before calling the main program entry point. +This section is of type +.Sy SHT_PROGBITS . +The attributes used are +.Sy SHF_ALLOC . .It .data This section holds initialized data that contribute to the program's memory image. @@ -889,6 +896,13 @@ are unspecified. This section is of type .Sy SHT_PROGBITS . No attribute types are used. +.It .dtors +This legacy section holds pointers to finalization routines, +executed when the program exits normally. +This section is of type +.Sy SHT_PROGBITS . +The attributes used are +.Sy SHF_ALLOC . .It .dynamic This section holds dynamic linking information. The section's attributes From nobody Tue Jun 17 19:01:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMGSM2ZPbz5VpLf; Tue, 17 Jun 2025 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMGSM0Gbqz3pZ5; Tue, 17 Jun 2025 19: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=1750186899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0WN/OhajedUXl07Yyz5sqMsGUPooCh6KrL2NAlnjflc=; b=ej1rtos2qQ41+b/v6UrpBgq3lzAnRTTyrTRd3Xkfl2Hjm1+4hmS4RoYD15I7A0GamptkGg kCJWKdsElS9cJA7PDzNYhKyNtWE+bJPMmpB1OZWesprnkJ2M/AlTPVgJ65LBsEVqrwQMtV IMhnIweQjqbpwe5E3fQKT9M+ID2ThCJVn8GV39hnFrdmjEh8ycGuKGLCnVqxH3r/SMAA5s P+Y0CteVrM53mrOmaxPNpq3WS1GnBFOMUgNQv8N65fuI0hxhg6Uw4KTYqtHf7078cSYy2/ ODZr1iQRDP6Ez1GAyMGZK/1DjwRZEYlTPHArFdhVYRC6NzchIGEW3dx8viAYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750186899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0WN/OhajedUXl07Yyz5sqMsGUPooCh6KrL2NAlnjflc=; b=M6GuUsk5t1vpFaYaz1nhsPSlmL4x4WJajkdIIDm5XN4bi1gs0p/I00rrl+4bEbjx7UlCTo ropSwJOhpg/WpskTjFOsOiaeFWnmcZE+zkLRa5h3yiKg/K+Qe10/UPUeBwNJOrt9Iih8bZ ONqmzlgO3DDDifGdxAbQN0SBo/m4kOsJYXOXGzNR/mmE6dj12iEOND6IrAjWx0ODdokjyw 6Uc54K2FdtuNBUaycX60UIop91Q5XCpDU39pXCiHzvWB4Ml3ya4u5W1uD99MqWq4g0N6pB zEJRVv1a1t2J5XOf9jtoDvNiMpMr5nubxDjAmBSstjDG3GpOIsHKnU7LXIDqEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750186899; a=rsa-sha256; cv=none; b=eKpM3ifePzkc3f6TBj3HkN7q8SGMkkc/JNp9XBo39bHXBLty6CR50r8KP1TzoIeKaPXVqa jdvRKCFWUfSssc16Pfvl4a2VBufXlbOJhuKAisNHiu1IbayiW0/VAlGLGija7WN/Wn7vtz XOc+Aa45GSPakVQjmW1cd5wnCdVkstPN3h/WmWT0uaQksnMgCjRNaA5dIHZF/OvOeiP6zP SrtPi6rQtL7EuFd6lCNzq0ungsOouCWJW6R7hgxyA+kkPwiWxMc0L6KDCJDMyUELU/3zQl yZQprk+OGlI2WSQ8xs6rzqpErN/0PMTW1LBCUebgH7vPCR9FI11E9QTgpEbExg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMGSL6yjNzwHs; Tue, 17 Jun 2025 19: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 55HJ1cUP012973; Tue, 17 Jun 2025 19: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 55HJ1c7j012970; Tue, 17 Jun 2025 19:01:38 GMT (envelope-from git) Date: Tue, 17 Jun 2025 19:01:38 GMT Message-Id: <202506171901.55HJ1c7j012970@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: 9425e8051e09 - stable/14 - elf.5: Add NT_FREEBSD_FCTL_LA48 and NT_FREEBSD_FCTL_LA57 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 9425e8051e091f6597cf6f08790eb1c375a2bf75 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9425e8051e091f6597cf6f08790eb1c375a2bf75 commit 9425e8051e091f6597cf6f08790eb1c375a2bf75 Author: Ed Maste AuthorDate: 2025-05-21 01:42:15 +0000 Commit: Ed Maste CommitDate: 2025-06-17 19:01:18 +0000 elf.5: Add NT_FREEBSD_FCTL_LA48 and NT_FREEBSD_FCTL_LA57 Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50443 (cherry picked from commit 059fbe9a716d5023d559424bf2ab2aa62eae6ec8) --- share/man/man5/elf.5 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index fac51adeea7c..be568f0c6096 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -1422,6 +1422,10 @@ Disable stack gap. .It NT_FREEBSD_FCTL_WXNEEDED Pq Value: 0x08 Indicate that the binary requires mappings that are simultaneously writeable and executable. +.It NT_FREEBSD_FCTL_LA48 Pq Value: 0x10 +Request 48-bit linear address space on amd64. +.It NT_FREEBSD_FCTL_LA57 Pq Value: 0x40 +Accept 57-bit linear address space on amd64. .El .El .Sh SEE ALSO From nobody Wed Jun 18 07:16:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZmr3q7Wz5yMgC; Wed, 18 Jun 2025 07:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZmr1Qsqz3DxT; Wed, 18 Jun 2025 07:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G/DYIPGvlUh9P8DYNse4StA8Nj2Le4pYgke7WyiEU6Q=; b=rqurFCg3v14VyLoaF2f5YM93dfcWulKtxaJM8s7Qr+HQ3Lb9Gm38zlTkQ9k7jC3c/F21TG N/NqE5ROYepbvugu7lvW0PPhL8MtbVy02bL4DPKrCAkWC2uQXz5Ibp4QZ6UmkGeU7bu3tp LPp2yHdNZ+CesEbr4uTwzng6KSONSsyvo2uIwtgFE6boEcP5QvCoqCLL7m/mima/TQ4+eX 4nES2JYCwEtucsmCZoGfDQVqEve6O60MaIVRRCsILdo6oM985WzYGIMzPFpEpNTds79f1o T2kRuIr1gJ3C+nhsq7nbdX6vQ2skBqAnnyRCg2TETIxfaTPUh/TQp+M2u+AtVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G/DYIPGvlUh9P8DYNse4StA8Nj2Le4pYgke7WyiEU6Q=; b=pEQEur8fLxCbU8Ye3osnSqoIgpFyIRsmusQUzPSORqAgVdE4wgFmly9Z8MGtFPjfXlEDFN HOTUaNxHlr2QV1sd9D2F7RzZt+Mny82kktRhZ11CjiIvaV/qY8BedorcHuhTyHGRlwbNw1 Fsd2N/uVCoApDhJsOMFXFpXGjo0XZ/rYDH6h6u3HvzNn79wYC3iv1yov3hS9Fc+dPjYul/ N30AukB1Kx3H95WfDEfvDDIXMefEMOfexw3EmEtpx2vCmA2T4mMKS9aHVNsXJQhqolVpey M8tPSMf6F3ZauMJ0pFWdmoweun5MmR8WJFeE9MGrIevRNN9agMm4o3nar0Dl4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231020; a=rsa-sha256; cv=none; b=lme4zncSXfb94n/ZGBxaEHUAmz94oPcYxjvw8d7v8B5I3UTwCrz9nf26/GabUU33mzk1h9 wZkaM85KsT/GVXntXWG/PEgKypsrEiKhB58Rb4Txoh53s2KzICM4s6p1ZQ0trTpjglQtZa 57nq5aHJQoXnPSDACBlaiwmzquuW3w2SR2D5k8zvY8cxtnzHQPeFLzjdIiIbDalsnunnYC 83XNGOMEwwyIVnsDtuW2DSNh0yslgq3yg7ybwOsOkQTHg7G+ctxCbzFuSHlRWwdxFme61H HBLtgBX1Wy9te48pO0pocQcroBIeUkLHt8VELS6Up+X60XC0mShi/giAwFK0uQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZmr07mQz3j3; Wed, 18 Jun 2025 07:17: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 55I7GxSl090321; Wed, 18 Jun 2025 07:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7GxDH090318; Wed, 18 Jun 2025 07:16:59 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:16:59 GMT Message-Id: <202506180716.55I7GxDH090318@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: 4e50831dc9af - stable/14 - iwlwifi: add message how to install firmware on FreeBSD List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 4e50831dc9af6b1b30a41b35f0988501b89e3a5d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4e50831dc9af6b1b30a41b35f0988501b89e3a5d commit 4e50831dc9af6b1b30a41b35f0988501b89e3a5d Author: Bjoern A. Zeeb AuthorDate: 2025-06-10 14:04:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:07:33 +0000 iwlwifi: add message how to install firmware on FreeBSD While it is too late for 14.3-R point people at fwget(8) to install firmware if the driver cannot find any. Sponsored by: The FreeBSD Foundation Reviewed by: emaste, ziaee Differential Revision: https://reviews.freebsd.org/D50777 (cherry picked from commit 8ac82ba19efbaeec065621215c3843f054fa419e) --- sys/contrib/dev/iwlwifi/iwl-drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/iwl-drv.c b/sys/contrib/dev/iwlwifi/iwl-drv.c index b99204d87283..b5c5268f8ddd 100644 --- a/sys/contrib/dev/iwlwifi/iwl-drv.c +++ b/sys/contrib/dev/iwlwifi/iwl-drv.c @@ -277,6 +277,9 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first) IWL_ERR(drv, "check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git\n"); +#if defined(__FreeBSD__) + IWL_ERR(drv, "On FreeBSD the firmware package can be installed running fwget(8).\n"); +#endif return -ENOENT; } From nobody Wed Jun 18 07:17:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZms3fx5z5yMj6; Wed, 18 Jun 2025 07:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZms1Xwsz3DvF; Wed, 18 Jun 2025 07:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rY1T8YlvEhVQwbodwkcSLUIJXOTgZAK+diAtvwWNzSk=; b=TycU83gbaQCmGo/TBFmICmvqf9o8rTglx6Q9s+v1vNyaq6vnIH/Hpwu5mzsi6WBxC0ZbLx RSW+3iHiWuUnnxujy033E4aMsD3laEl6LRCSAplHS1MySGaPr/F1mwXYc9X+ib385w+/wc 4E8KBag8J7BE5jChD/sdQkZCAqapSKb+pHtUOx/P3OVCr2bRyI4LD2D5x/dy8emB9gcjRa voBzFOlIIMPe01usBSQRykygTXZmrvlhNHXx2aMHdGjIE+eWvQg7dt2XLlunjmQv+sXrG5 49Zh325e5ovNh6UzSffVNdTS/Ed4mifW+KYF2ziLaYvdka8qDnF2+X9LwqGxig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rY1T8YlvEhVQwbodwkcSLUIJXOTgZAK+diAtvwWNzSk=; b=BwX6jVxDxb31XJTaXX7kbPkxNXY2tN13ZjOOnJcOHIbloMiWJPvWvGKcYcbKl6Ew8CKIWx gUXizrSZ9VUhM+JmVO/RP2hwmQQUDlkPbdslGfIvFOln8vqHTqh9wKS3Dcyuda1F1G6xl0 vGF2tQ10UyUBngQVJDCTkQ+ZX+E7kgZCyCAROD9NJTbM3t4zLv/bvMMTe1sFFlUiormpzx HFvkRL+y2bXwf4XFD0Xde4jHDuY2qn2f9+n8BMnTzkJBqe8SX80jwPzTJSj62BMyJyt3jQ A/eELQIwZg7Qad85sr1yJcczgF1drjVdgiekRDxhb13ZHGHHBxRHNO+naYbizg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231021; a=rsa-sha256; cv=none; b=j8wMQy0e29B8yHdlFVG9o+BkrJLLmgncMKjMU6yRIHboUnkUyc1Q6lS3vXTvmcEUiZND+9 eMMudPggo1AA29YX3E7/uTWoF+vDKnEOOgq/ixXhbKxuE5ZLmu68rbk/fNc8z2f8cay1dG BjYilRA4vME5kbtFn3ukmnq/yhDuYIYH432G/3esYXuVlFpZO0pCDkW3Ns6bjo6lduzxoO 2L7CKN2NQc1X727JevXEKW3kqCWyxih8U2SOTp9KPJrmSUX5R17eQw5bDVJheaOlp3BaJn Pxcrudcthvi1q8AOy6nwZjKixRcSMo879+L0zrRUT86j7I42aFqHig4geaP1ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZms00ghz4Bv; Wed, 18 Jun 2025 07:17: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 55I7H0Ph090371; Wed, 18 Jun 2025 07:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7H0UO090368; Wed, 18 Jun 2025 07:17:00 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:17:00 GMT Message-Id: <202506180717.55I7H0UO090368@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: a22c61e95408 - stable/14 - loader.conf: add LinuxKPI based wireless drivers to module_blacklist List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: a22c61e954086eab0e64ed0844db3769f6c8496c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a22c61e954086eab0e64ed0844db3769f6c8496c commit a22c61e954086eab0e64ed0844db3769f6c8496c Author: Bjoern A. Zeeb AuthorDate: 2025-06-12 15:06:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:08:44 +0000 loader.conf: add LinuxKPI based wireless drivers to module_blacklist Despite being discouraged in the man page people are trying to load the driver from loader. In that case firmware is missing and the root file system is not there yet and the LinuxKPI based drivers will panic the system on boot. Simply avoid any further support trouble by disallowing them to be loaded from loader. If someone still wants to do it, they will need to figure out how to remove them from the blocklst and how to loader the firmware file(s) in advance themselves. Sponsored by: The FreeBSD Foundation PR: 287480 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50817 (cherry picked from commit 55efb3bf2b6edb8e1b888dc7ed52046f5b9b6591) --- stand/defaults/loader.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index c3de7cdfb74b..7397082ac29b 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -109,7 +109,7 @@ kernels_autodetect="YES" # Auto-detect kernel directories in /boot #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays" # Set the module search path -module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist +module_blacklist="drm drm2 radeonkms i915kms amdgpu if_iwlwifi if_rtw88 if_rtw89" # Loader module blacklist #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem From nobody Wed Jun 18 07:17:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZmt4Vpkz5yMTG; Wed, 18 Jun 2025 07:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZmt24mwz3DvJ; Wed, 18 Jun 2025 07:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5hezSLrkWESwSQtb2/yiXv6kw2Dd7kR7/oGfk7LfkaI=; b=jXtHnODavm+ZiMBJkznQ6tnJJ5B/qTN4jqvchbuewXJp+/Bj3JjkHxv0cflEgukzIOUDmg io4NXrZYb+PC+VeGYU9fsp3qWQjLm+m3dIQy0fihSJNA6mNDSJlu+XD4Z1Nqpta5VYAWHf GIZAEUYH5a8pA0a8isaX2K3PyxrmH0huhXegGLjpumNACTRSlfLBoSAOy3OAPbEbAhm9Hy K3zqkRsMnofyUy23XhG8m+sITD35SUlCCO8kapKMy2cPK/DoAgEUfzY+MjT7ndLt0nQv9B z1rOmrqkRvkiuTEqIaegOi93SURveUvt24jvArHclC6y1ECLHTg4wSQrJtSjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5hezSLrkWESwSQtb2/yiXv6kw2Dd7kR7/oGfk7LfkaI=; b=bRvwLUZqooG1oW7oZV49CjJkqNDcYJhNCOjjhV7gl76KNslxApd14zQzDJaNgFzVYeXvfE MUapTxe7/oQ4y4G96g/XepVX2kYJPxfP6JhtdDo2XoweblRIb39+UV1o8PGii5z47/RteR EcPtcmXkKDw6lspGr4rmSX4eCFGBSwdBjtFmbXaXhLaURlscHMAQuvC8j8U4jD6kJozWVK pus0eqzqC3rPrJeyAQKDMjwydTjqQBHORDe2g52ofNENUgzpnyLqfkW2Pdnbi92SKvEdop iJIz6RcyD7A79NKkfbW7Pf4hx38x11xQwzEnNmgyZl8wNthn38Ymz+iC1+7uqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231022; a=rsa-sha256; cv=none; b=luAHMcnRnsNEBpyDS2TRf9ygeBqz+ukM3GSUTaxK57Ua7D0vlhJxjl0rp/7WJAbhRi78Fm C78tVyw3nqS3PZYZI3+auKGzHib0VpMn1LOTjfN2gIs0f7BwWL0xiNPM3Ve5Uav2d6f2rp 0ZGBXPV7v17q4HuCrcu+NO6gNAyVFqJ9Q//wKWz8pR/QBhNe9dkEi6FRRma2S2g2nuocKA uS9XFOBWOZpfUqw8cjmoLWuVPEEzwUx6iK8hkLa/CLprH49UCZOlsv9Bja/A1j+oe308LW bPAJ0LNKtmt949N0sV8M/n7I4mm7NkHSVeNifaKBGNAnG4i95w2PjxP9qIcS2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZmt103Pz41R; Wed, 18 Jun 2025 07:17: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 55I7H2Em090412; Wed, 18 Jun 2025 07:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7H2xB090408; Wed, 18 Jun 2025 07:17:02 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:17:02 GMT Message-Id: <202506180717.55I7H2xB090408@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: 97a52002d3de - stable/14 - wlan.4: add rtw89 driver to see also List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 97a52002d3de2b6715779965b58aad38974f9b44 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=97a52002d3de2b6715779965b58aad38974f9b44 commit 97a52002d3de2b6715779965b58aad38974f9b44 Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 06:37:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:16:05 +0000 wlan.4: add rtw89 driver to see also Sponsored by: The FreBSD Foundation X-MFC: no iwx.4 in stable/14 yet Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D50788 (cherry picked from commit a3d38c1abf6c7987ece04c5eb27b0a48ecd88c0d) --- share/man/man4/wlan.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 4cd1bfbdc9d5..39f99b8aa6a3 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2023 +.Dd June 13, 2025 .Dt WLAN 4 .Os .Sh NAME @@ -181,6 +181,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr ral 4 , .Xr rsu 4 , .Xr rtw88 4 , +.Xr rtw89 4 , .Xr rtwn 4 , .Xr rum 4 , .Xr run 4 , From nobody Wed Jun 18 07:17:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZmv4zGDz5yMX0; Wed, 18 Jun 2025 07:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZmv2vjLz3F2b; Wed, 18 Jun 2025 07:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LVIYpjgmSCmiWXlqhodXwpMTZ2IXh2ZDT9D6h/q91c=; b=xgdSXNo34iAdVqoAI0/aWhzBAeo1IzSs0ctl4QiAsdp1by907pTcIZo+fYNEMxBc5iZEOv VnI9gsthSNMJ9aaE2S3uX8SKfTbU10Ui7mOYTFVohtUk3Ig9CuG+fUguUkJ2cmGUsP0Z/H Fe4MVgNYZ0byQC6R+GBgdjA0f/nhaVunmSLlfUrj5q2Xl20m9wDSY3GkCJU4K0sfv9Q48d fGG1JcGdbCnSpsWDk1ouTQebvqLXkC1nlMDk2jnugAqbXkfa6Wt1YdZsl5gsaNSjQtcOmf WFtT9PXzqEwL5XcZSdcGDYR2bwZS0lQSJeNt9JC/gr2DWSgu+KvpMdYgR/HWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LVIYpjgmSCmiWXlqhodXwpMTZ2IXh2ZDT9D6h/q91c=; b=Lp+REa3cTkh/7WMgj9NwxyiAwW8qJO8B6+0zmjPCJlpTWfExezG1J8sFNRS4vbXwU1tB/P 8s3G+u3u36ePrhl/+G6kGs47w9KzZWgU7TdeZRFISilZI2vU5pmSxpguvJV6uWKUUVVtg9 MI/oco4Lw7jCg267+oUkcJZctkHp2i2mUgiD+fOjnREYysSRe1xo47d0qRpfWaKUz49PT2 JrL0PInV3vBam5YLJZYwXygzuOGeC6su+GO81rfQp42sAD4gS/HkAZedREgwnVaKeqJTQS VJmuQ+iCqbe0Z0cL7mbW9Xh5qwdQhPMzZalRSCKgUgEgtbb1tiGVQA/aLX2rTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231023; a=rsa-sha256; cv=none; b=S95DoDXeDOKrKfpx8Y8vD3gxFzRXM3HVQuJTXEbhplO1u+UCP7wG/T1rIteJt/QPgTNZ2z 1Q4epYPuG0jcDPMcrj/v/ecdnIqPzgm4Q4c7Vg2lx9j6dtR7jMT6m12jaAzz6+V43PONQz NpecCJMrJxyFKEOxeyXz8GI7u5qjgaV9ppI+6O4mBUbBFIpXraESUbiJUmMPKw38tmL6tG tUxrtiIA32GgCvfHvgKpnHyzbLaq9ccsbpg0/BE++lQbwJf/r4CMCg30C8l+12LtiYbDnI U1eAS81km8YrJyicmx9jq95CZglEzXJ32tJdwr2RtpyQzvAd9mzmiPmjXAcsTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZmv1m5Fz4QT; Wed, 18 Jun 2025 07:17: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 55I7H3Ps090454; Wed, 18 Jun 2025 07:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7H3dR090451; Wed, 18 Jun 2025 07:17:03 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:17:03 GMT Message-Id: <202506180717.55I7H3dR090451@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: 669062384f55 - stable/14 - linuxkpi.4, linuxkpi_wlan.4: add short man pages and connect to build List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 669062384f5548098bb1c70ca904574aa81a1f98 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=669062384f5548098bb1c70ca904574aa81a1f98 commit 669062384f5548098bb1c70ca904574aa81a1f98 Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 07:47:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:19:00 +0000 linuxkpi.4, linuxkpi_wlan.4: add short man pages and connect to build Add brief documentation on LinuxKPI. Add brief documentation on LinuxKPI 802.11 compat so we can refer to something about which features are supported. Sponsored by: The FreeBSD Foundation Reviewed by: dumbbell, ziaee, pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50790 (cherry picked from commit bfaec3e6474139c592f39b4adbdbeb35c9026c25) (cherry picked from commit 1563b306d19db25f5bbf071897b60429b192040c) (cherry picked from commit 8b399d613f5420bb7e57be94806e156e4c1579fb) --- share/man/man4/Makefile | 2 + share/man/man4/linuxkpi.4 | 42 +++++++++++++ share/man/man4/linuxkpi_wlan.4 | 130 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 3521444e29f5..12048cf5fe06 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -280,6 +280,8 @@ MAN= aac.4 \ led.4 \ lge.4 \ ${_linux.4} \ + linuxkpi.4 \ + linuxkpi_wlan.4 \ liquidio.4 \ lm75.4 \ lo.4 \ diff --git a/share/man/man4/linuxkpi.4 b/share/man/man4/linuxkpi.4 new file mode 100644 index 000000000000..cd4135c28d6d --- /dev/null +++ b/share/man/man4/linuxkpi.4 @@ -0,0 +1,42 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI 4 +.Os +.Sh NAME +.Nm linuxkpi +.Nd Linux Kernel Programming Interface support +.Sh DESCRIPTION +The +.Nm +kernel module provides a limited KPI (kernel programming interface) to allow +Linux kernel drivers and other Linux kernel code to be compiled on +.Fx +and used along the +.Fx +kernel with little or no modification. +.Pp +While historically +.Em OpenFabrics Enterprise Distribution (Infiniband) , +and certain vendor drivers have used +.Nm . +.Em drm-kmod +for graphics driver support +and +.Xr linuxkpi_wlan 4 +for wireless drivers are prominent consumers. +.Pp +.Nm +is not to be confused with +.Xr linux 4 +which provides limited Linux ABI (application binary interface) compatibility +to allow running Linux application binaries unmodified on +.Fx . +.Sh SEE ALSO +.Xr linuxkpi_wlan 4 diff --git a/share/man/man4/linuxkpi_wlan.4 b/share/man/man4/linuxkpi_wlan.4 new file mode 100644 index 000000000000..e433fc1c8549 --- /dev/null +++ b/share/man/man4/linuxkpi_wlan.4 @@ -0,0 +1,130 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI_WLAN 4 +.Os +.Sh NAME +.Nm linuxkpi_wlan +.Nd LinuxKPI 802.11 support +.Sh DESCRIPTION +The +.Nm +kernel module provides an 802.11 compat layer to translate between Linux +802.11 drivers and the native net8011 wireless stack. +It currently supports +.Em mac80211 +based drivers. +Parts of the +.Em cfg80211 +exist but there is no code for net80211 to drive it. +.Pp +.Nm +currently supports the following +.Em wlanmode +operating modes: +.Bl -tag -width monitor -compact +.It Cm sta +client station in an infrastructure bss (IBSS). +.El +.Pp +Compat code for 802.11n (HT) and 802.11ac (VHT) is implemented but +support may vary for different drivers due to different KPI usage. +.Pp +Crypto support for hardware acceleration needs to be enabled using the +.Va compat.linuxkpi.80211.hw_crypto +tunable. +The following cipher suites are supported: +.Bl -tag -width CCMP -compact +.It Cm tkip +Support for +.Xr wlan_tkip 4 +has to be manually enabled using the +.Va compat.linuxkpi.80211.tkip +tunable. +.It Cm ccmp +Support for +.Xr wlan_ccmp 4 +is available. +.El +Further cipher suites will be implemented as soon as +.Xr net80211 4 +grows support. +While it would be possible to implement +.Xr wlan_wep 4 +support, it was decided not to do so given +.Em Wired Equivalent Privacy (WEP) +has been deprecated since 2004. +.Pp +The list of supported drivers includes +.Xr iwlwifi 4 , +.Xr rtw88 4 , +and +.Xr rtw89 4 . +.Sh SYSCTL VARIABLES AND LOADER TUNABLES +The +.Nm +module supports the following +.Xr loader 8 +tunable and read-only +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.hw_crypto" +.It Va compat.linuxkpi.80211.hw_crypto +Turn on hardware crypto offload support. +Default +.Ql 0 . +.It Va compat.linuxkpi.80211.tkip +Turn on support for +.Xr wlan_tkip 4 +offloading. +Default +.Ql 0 . +.El +.Pp +The +.Nm +module supports the following +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.IF.dump_stas" +.It Va compat.linuxkpi.80211.debug +If the kernel is compiled with +.Dv IEEE80211_DEBUG +or +.Dv LINUXKPI_DEBUG_80211 +is manually enabled, the sysctl is a bitmask to turn on individual +debug messages. +See +.Pa sys/compat/linuxkpi/common/src/linux_80211.h +for details. +.It Va compat.linuxkpi.80211.IF.dump_stas +Print statistics for a given, associated +.Xr wlan 4 +interface; typically IF would be +.Em wlan0 . +.El +.Sh SEE ALSO +.Xr iwlwifi 4 , +.Xr linuxkpi 4 , +.Xr rtw88 4 , +.Xr rtw89 4 , +.Xr wlan 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 13.1 . +Support for IEEE 802.11n and 802.11ac in +.Nm +first appeared in +.Fx 14.3 . +.Sh AUTHORS +LinuxKPI 802.11 support was developed by +.An Bjoern A. Zeeb +under sponsorship from the FreeBSD Foundation. From nobody Wed Jun 18 07:17:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZmx4Hrzz5yMX4; Wed, 18 Jun 2025 07:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZmw4Nhxz3F2d; Wed, 18 Jun 2025 07:17:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cLuEYkMUvx7Fnm8i8JL8uq0jJecopDP9G5WhW+iMsw=; b=YwZqWxfdBeUB7lL314Yb/FpsF/bbNrtxPDrV3Nsp7OyTGniXK639hM7aIq4o0lJJ9UgifP Res9pQaCmnuymUdw3WwnwxIlgB8fxCpN++3hCiXy5bRpEiY1lHQgDW2zODHZY2wKoWq8i1 47NUJPMhDXw4cJmJvZJ0COM8YmVdDo97BVRmR31ZGnTfZgefM3tZ67V/md2TpKl+9gYV5I 9GDNSuk5Ww4tPNrlI9orqoqiMYrETjuhQ/FSMjV/EldQ+l+us9OfotVbwdXnPZlipQlRez 2qXGD28raS9lACB8VlCyxt8Gkkc6JEUMJ1h3Vl1u0mTtjSfWhnwdn+o+ytrmCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1cLuEYkMUvx7Fnm8i8JL8uq0jJecopDP9G5WhW+iMsw=; b=hRghlcR/sdSlR+UYM9VKEgEOzBaXoADXuo241Bji1FHShaQlEAoGwZwUt7JyTTe6/6BnWh 4N10M4KPfI1FFz8ClEZVh0v1Flel3cUdY1KbHXGVRYGP9TxzvGsWSuTmpUWOxSgaElWSDI 0auLYJtj5WUtTdjObIwIvBKlHW3RfrYLpgRlSL6wNcKtfND2t0FGRcwg7GKnncW/fpASAB ZsdLFKvjxFmAk6y47FbO2/m/jdlOY97GzmcfopN/cCOPyxY41H2JepUaHgIh3tfJD8ZOiD P5t56PuISbwKANmZ7ylo4c/pWGk7LolaSKDMfuB6qqpKIg58wKa5XW1K8v1Bhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231024; a=rsa-sha256; cv=none; b=w8hfox4EqOKc0pQpahU8KKXyzfesBKNMKWjjC8eYtGo5yEUfBI60UgOhi0XdWorS68dfl1 o+KeukRvN1qBdSrSgPGYM/NFYS7K6uFLdQLZz7QEXErE6dsaOKUoaFj1sFdejH/FIm626I TtTFZ8OQ8BmTMOX1fdA3Gh2ag5v9mPontQjCEV60UG1Tv2Qe/QIBpGdAhngrgQLvDOGKs9 84EFxQ+jF77qiaqOGVXLsxy/+dCcnVJIQvGIf7oWAdnFAemlrRfW0Bo5sEBZ2jNbfogily y13KbeErVjMfAEF9ER6N5wg5AxtKu4tjHo+EmK16e9rSolarXCfyfaP5IY/LRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZmw2MBgz3pR; Wed, 18 Jun 2025 07:17: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 55I7H4wZ090490; Wed, 18 Jun 2025 07:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7H4OW090487; Wed, 18 Jun 2025 07:17:04 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:17:04 GMT Message-Id: <202506180717.55I7H4OW090487@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: ca8d1e4f2d4d - stable/14 - iwlwifi.4: add a note on how to bootstrap firmware files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: ca8d1e4f2d4dcf6dac078760e9a50799b1dc2b7d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ca8d1e4f2d4dcf6dac078760e9a50799b1dc2b7d commit ca8d1e4f2d4dcf6dac078760e9a50799b1dc2b7d Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 08:14:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:19:01 +0000 iwlwifi.4: add a note on how to bootstrap firmware files In case someone ends up without any networking and no firmware files add short instructions on how firmware can be bootstrapped manually. This was prompted by PR287393 and D50777 during the 14.3-RELEASE days after firmware was removed from the stable/14 and only available via ports/package/fwget. Sponsored by: The FreeBSD Foundation Reviewed by: ziaee, pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50791 (cherry picked from commit 458308acf38bd53bc957a4f7ebbe1f6bc4ce1bf4) --- share/man/man4/iwlwifi.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4 index 3da4e68ad805..c34553fe53d3 100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 12, 2025 +.Dd June 13, 2025 .Dt IWLWIFI 4 .Os .Sh NAME @@ -302,6 +302,17 @@ driver requires firmware from This firmware package will be installed automatically with .Xr fwget 8 if the appropriate hardware is detected at installation or runtime. +.Pp +As a last resort for bootstrapping, individual firmware files can be +manually downloaded, e.g., on a different computer and transferred using a +.Xr umass 4 +device. +The firmware files can be found at +.Lk git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git +with names as requested by the driver. +Copies should be placed into the +.Pa /boot/firmware +directory. .Sh SEE ALSO .Xr iwlwififw 4 , .Xr iwm 4 , From nobody Wed Jun 18 07:17:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMZmy0JMQz5yMnm; Wed, 18 Jun 2025 07:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMZmx3dmzz3Drx; Wed, 18 Jun 2025 07:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6yQwYK4mS+epQhrQOFsMYjk6ITFdZIPRTyC+7kR1Qcs=; b=DyGkhMJzLIBidcsYUhUt/jSnPwLRJz3DHMc+ye+Zsh1ZPafA9+aJmSl3paP6VsZ+pllQ4B pmW6F+u2zZ8y8w4/sTS4AgMFgia+t8HQt2qDqQzMyVZyG0FEDyozoREb64SjNq22Xz4z0x 7LEpdpduc+U33R6Ql/a9XDEa5WGC2O74RYkYReUyAhBugTKN4uoJCLISou1SZMtrUNCOMo w0TA65/9ci6LOFnFoH/eFFicCDJbWehq+ziaDDMnv46IhUR91ojeG+Re4WWTFBy15alG9o A5DSV1L4J/MLq858+gk9LmBBhDMLhu/IpvQJzv8N2o3DUSNcwGUnWLvOmVpkQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750231025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6yQwYK4mS+epQhrQOFsMYjk6ITFdZIPRTyC+7kR1Qcs=; b=HNlLNSHlGuO+QSpG3jj2bxgceI4Fh0hA6i2x1Z50o3sDwuHRTmxsexuv51RCdIjU8PpM2k 6nwREpOuzpysdrR/6hy2oe8SOdKTO7OD3jUy5Ya5dZ9gPDSuO683lGnyAGtcggxX0RwJk0 gCptSvBkclnWyQ+i7GmBdOuiA/M1gT42Veqgr19ddK5BYld+HPuyy5lnJNEtSZ67O8QKHE E+LdZeBAKXfH4GgDD8wNJ/Lhy41kUwyplLPhJ/IFilfl2vxDdniGnArZ8Q2zpuIl46q4Ao F4mv3raEHIzynJ5n52ttuDvY+OmsWeMNWiZ4r9VtwgH2sebUX8RY4lJvkwhMQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750231025; a=rsa-sha256; cv=none; b=EirpWg8FV4ng8zHr/hXJwt1PSffGBWfn4icsqorT93y4t/JP5dGOHnTGiKs2aAcon1/C2Q gTNi8JTVfOWm1bpDQJLgyW/hE4MDUI6M8dD4n9/+LWJ6cYVo7YxWWpGu9c6Y7JVLQL3grf WkV3OC9djmf34YIr/oZluJm87rrl+VqNmAUFJkwo7O9DDA9dbMbBWSIXmDhDw6Z1CGegMB S+WxgtJqyCflqOrEGu/4GISqm6bXQPuDg7ozjSGCafYwGfNxAbntpb9RgUrKndcs5X+rbi T4mcg4An5YqI/tAADK1o/gGRE8w4Xn7u/7MIdxNQgLPTulOHvg5n7zNnv/5Avw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMZmx2cWgz4N9; Wed, 18 Jun 2025 07:17: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 55I7H5me090527; Wed, 18 Jun 2025 07:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55I7H5gO090524; Wed, 18 Jun 2025 07:17:05 GMT (envelope-from git) Date: Wed, 18 Jun 2025 07:17:05 GMT Message-Id: <202506180717.55I7H5gO090524@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: 8f56270e2045 - stable/14 - iwlwifi.4/rtw88.4/rtw89.4: adjust note about loading from loader List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 8f56270e2045ebc06671a3d1f1f054d019241ee0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8f56270e2045ebc06671a3d1f1f054d019241ee0 commit 8f56270e2045ebc06671a3d1f1f054d019241ee0 Author: Bjoern A. Zeeb AuthorDate: 2025-06-12 15:01:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-17 23:19:01 +0000 iwlwifi.4/rtw88.4/rtw89.4: adjust note about loading from loader Despite being discouraged in the man page already, people are trying to load the driver(s) from loader. Now that the drivers are on module_blacklist="" simply state that it is not possible. If someone wants anyway they can figure out how to remove it from there, load the driver, and loader the firmware file(s) upfront. Sponsored by: The FreeBSD Foundation (iwlwifi) PR: 287480 Reviewed by: pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50816 (cherry picked from commit eb8a794662d2e694a99f927d7161b6efffdd295d) --- share/man/man4/iwlwifi.4 | 2 +- share/man/man4/rtw88.4 | 33 ++++----------------------------- share/man/man4/rtw89.4 | 27 +++------------------------ 3 files changed, 8 insertions(+), 54 deletions(-) diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4 index c34553fe53d3..4a251f239a55 100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@ -54,7 +54,7 @@ See section .Sx "FILES" below for how to install the firmware. .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/rtw88.4 b/share/man/man4/rtw88.4 index 19f503f7d39a..21a3c1d9f1aa 100644 --- a/share/man/man4/rtw88.4 +++ b/share/man/man4/rtw88.4 @@ -1,30 +1,9 @@ .\"- -.\" SPDX-License-Identifer: BSD-2-Clause +.\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2022-2024 Bjoern A. Zeeb +.\" Copyright (c) 2022-2025 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. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW88 4 .Os .Sh NAME @@ -44,11 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw88" .Ed .Pp -The driver should automatically load any -.Xr rtw88fw 4 -firmware needed for the particular chipset. -.Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/rtw89.4 b/share/man/man4/rtw89.4 index 5834a804630c..8c7132673db5 100644 --- a/share/man/man4/rtw89.4 +++ b/share/man/man4/rtw89.4 @@ -1,30 +1,9 @@ .\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2023-2024 Bjoern A. Zeeb +.\" Copyright (c) 2023-2025 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. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW89 4 .Os .Sh NAME @@ -44,7 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw89" .Ed .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The From nobody Wed Jun 18 18:48:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMt6F6R1Cz5q1H2; Wed, 18 Jun 2025 18:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMt6F4Jxkz3s6k; Wed, 18 Jun 2025 18:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750272485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQdYEA1TZ/rRzHZAGKcBBJlkWTu0CPVUhkdIZAmmzQs=; b=YeceTwevbmcNZkmCWL9WodDLlpoUxGj6yVHV9v+oy0DcPk/YgBswEipDWgcKm6tZApcxN0 xoN5jwRcFYlkv5wEkBLgEpm0kh4UwoOT36KbbsQr0fZRutISMC+9TRiX34IIpLe2barfpZ bUFMP7Ij/yOUTnryw0jqTQM3reT7mE7JmAbh24aDoAvDdpnSTHCFwGyzU1YuwKRxjKlRLZ u8w+yDZv9v+Tigpoo8bj+B7QKtUlLYQmmX32tjtUs13wExBAyOnQKglgJcP2285XvP6UNH t3ySLV9Y00ZzBGyxW1QzywluKPQjaqdHsiG3nG9KkFrorE1wQhJQaCowzUw93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750272485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQdYEA1TZ/rRzHZAGKcBBJlkWTu0CPVUhkdIZAmmzQs=; b=w/nUeQe8OeLWNs4LyfqbSDObE3SxlYwxbinWvcu2JZ7fIT5gnbMuuBA3xZpRN95H4kdlhX zhCgx4g8AqP+nnyIvfipX6kiNyLJwux+YgHn1DosVv2oxyGlGTxE1RjLdzODe789mz7JMv 4kRrFT/5eoeGZk864tzGr8dWAcS30TknUoN106m3QDmdX0cOMY6zx1SAx+Lw+fiiX8ZgsE lbHQdcspft7x/hvf6LJ2QiNNjfQ0h18CyIAezXhY7HYg9yjl6wahmIqMsuiwjTmmGQwafJ Me85n50fD75b9AMfre83oA0DPWBKIoZit/F0HhZTh6nHSOf/m5DF4CtNyCui5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750272485; a=rsa-sha256; cv=none; b=flSPe8jHBftnaII1PBneHT5GmjWhmUBVGqPr4PYznX/Obw7Yk5JPaBDo4q22wetvwd7rRy ivV8hGTVVlu0XFQYuwiSfLmNSslBqjA1Ltdcv6o/vML7/QtFDbcTR6Ep4FzhlbIxa/+xGI LaKdm0Xm4/7VJsPD+NeWxf18GdE4IRIaqZK301DQxTFnSadJT1unCPRUNr12MoYySA5n/h nqOvl2re5PmWmoFRMpBOLpmjl29gzypu5WqR3ibNon9HSHwmcI+v0yY3H01kMXtivJ+ON7 S9ZdWrnMDO9ONqEa55gmZxY3Fj7kk9+HxQPKSzDuVO1wxYJgfLw26+JjhHFcMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMt6F397RzhYb; Wed, 18 Jun 2025 18:48: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 55IIm5nR087220; Wed, 18 Jun 2025 18:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55IIm5bH087217; Wed, 18 Jun 2025 18:48:05 GMT (envelope-from git) Date: Wed, 18 Jun 2025 18:48:05 GMT Message-Id: <202506181848.55IIm5bH087217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 26f6f7393155 - stable/14 - bridge: fix vlan(4) on a bridge member List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 26f6f73931557a2f2f298c3ae275d041412d7563 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=26f6f73931557a2f2f298c3ae275d041412d7563 commit 26f6f73931557a2f2f298c3ae275d041412d7563 Author: Lexi Winter AuthorDate: 2025-06-04 06:05:12 +0000 Commit: Lexi Winter CommitDate: 2025-06-18 18:46:54 +0000 bridge: fix vlan(4) on a bridge member If an interface is a bridge member, and a vlan(4) is also created on that interface, and net.link.bridge.member_ifaddrs=0, then vlan(4) will never see any incoming frames because bridge doesn't pass them to the host for processing. Work around this by checking for locally-addressed frames using the MAC address of the interface we received the frame on, but only if the frame has a .1q tag and there's a vlan trunk on the interface. This behaviour is almost certainly "wrong" and it's not clear if we really want to support this, but it did work in the past and the member_ifaddrs change was not supposed to break it, so this restores the previous behaviour. PR: 287150 MFC after: 1 week Reviewed by: kevans, des Approved by: kevans (mentor), des (mentor) Differential Revision: https://reviews.freebsd.org/D50623 (cherry picked from commit a5fe142e08447c7116b89159c110d02e860ac6a1) --- sys/net/if_bridge.c | 23 ++++++++----------- tests/sys/net/if_bridge_test.sh | 51 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 7246d5a8e7c3..4d4f52263748 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -2735,22 +2735,19 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) do { GRAB_OUR_PACKETS(bifp) } while (0); /* - * We only need to check members interfaces if member_ifaddrs is - * enabled; otherwise we should have never traffic destined for a - * member's lladdr. + * Check the interface the packet arrived on. For tagged frames, + * we need to do this even if member_ifaddrs is disabled because + * vlan(4) might need to handle the traffic. */ - - if (V_member_ifaddrs) { - /* - * Give a chance for ifp at first priority. This will help when - * the packet comes through the interface like VLAN's with the - * same MACs on several interfaces from the same bridge. This - * also will save some CPU cycles in case the destination - * interface and the input interface (eq ifp) are the same. - */ + if (V_member_ifaddrs || (vlan && ifp->if_vlantrunk)) do { GRAB_OUR_PACKETS(ifp) } while (0); - /* Now check the all bridge members. */ + /* + * We only need to check other members interface if member_ifaddrs + * is enabled; otherwise we should have never traffic destined for + * a member's lladdr. + */ + if (V_member_ifaddrs) { CK_LIST_FOREACH(bif2, &sc->sc_iflist, bif_next) { GRAB_OUR_PACKETS(bif2->bif_ifp) } diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 715c8810f11d..2698b5cb887b 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -779,6 +779,56 @@ member_ifaddrs_disabled_cleanup() vnet_cleanup } +# +# Test kern/287150: when member_ifaddrs=0, and a physical interface which is in +# a bridge also has a vlan(4) on it, tagged packets are not correctly passed to +# vlan(4). +atf_test_case "member_ifaddrs_vlan" "cleanup" +member_ifaddrs_vlan_head() +{ + atf_set descr 'kern/287150: vlan and bridge on the same interface' + atf_set require.user root +} + +member_ifaddrs_vlan_body() +{ + vnet_init + vnet_init_bridge + + epone=$(vnet_mkepair) + eptwo=$(vnet_mkepair) + + # The first jail has an epair with an IP address on vlan 20. + vnet_mkjail one ${epone}a + atf_check -s exit:0 jexec one ifconfig ${epone}a up + atf_check -s exit:0 jexec one \ + ifconfig ${epone}a.20 create inet 192.0.2.1/24 up + + # The second jail has an epair with an IP address on vlan 20, + # which is also in a bridge. + vnet_mkjail two ${epone}b + + jexec two ifconfig + atf_check -s exit:0 -o save:bridge jexec two ifconfig bridge create + bridge=$(cat bridge) + atf_check -s exit:0 jexec two ifconfig ${bridge} addm ${epone}b up + + atf_check -s exit:0 -o ignore jexec two \ + sysctl net.link.bridge.member_ifaddrs=0 + atf_check -s exit:0 jexec two ifconfig ${epone}b up + atf_check -s exit:0 jexec two \ + ifconfig ${epone}b.20 create inet 192.0.2.2/24 up + + # Make sure the two jails can communicate over the vlan. + atf_check -s exit:0 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 + atf_check -s exit:0 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 +} + +member_ifaddrs_vlan_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -796,4 +846,5 @@ atf_init_test_cases() atf_add_test_case "many_bridge_members" atf_add_test_case "member_ifaddrs_enabled" atf_add_test_case "member_ifaddrs_disabled" + atf_add_test_case "member_ifaddrs_vlan" } From nobody Wed Jun 18 20:12:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMvzt0T0vz5q6BN; Wed, 18 Jun 2025 20:12: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMvzs71T1z3YJV; Wed, 18 Jun 2025 20:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750277562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6otd2ksLwQr3ec0jvVEcvUEcVZLr1h4S81UCeJ6LQI=; b=mD6WCOGTt5o0QRcs1j6zyMFcF3nnsrqnudoR9ENWEfnjIiye8iHWufEJmNShhR/LeB24m+ 9PX11rZNhxzbAjI0YnSeKxVV2832BR+w/2TSyQoHdr6pXLi4yG6KCExCYbTgiW8Msj0fSL 9roXHNz9d5m9umCanp4x61YdviVOamJWILvokW+3LCfarHhhZzlibkY5tPK2iVBB0SI6Pe sU4cTM7Ipsxkf33NLIE+/c2k69HMMrgnlxddGHqFJ4Vtsq3+s1nTKPAMovaDAO3hmZGAOE LgojQcyPNW55KrYvr+7eBodFB9EINd7tM1WAY/l9im8cAuDACoLtLnwQQ4ineQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750277562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L6otd2ksLwQr3ec0jvVEcvUEcVZLr1h4S81UCeJ6LQI=; b=NG4OwjM1Nk23wGsO5NudoXCsxpuF5HVSVJVw33eG+gtxbm9bGyIFv+m+7QNVRT2oo5HH89 9K+duVCfNv0GDb3uZXS63W23vsve11zhqD4RU9YJmnRDAWm7apDomi6Yy9FKVjIxD8Ubkr JsrWGMi/ubrFkLTIh6k5Mme540GZNQ24+5vuH3ByQqrxI8Zsuz3RsToVq6Kx29L5/iIhZS odZN7/bF6p/AUupUQrkTfnYGvgT8yrWVMnlbUPA09EDExjahlc9OS6xKoNs7Ywpb2Xjq/Q 7Ygh16Mef6Qu/RGCd9XxAMP+2aKhAbtqBmPslH+l4YvbRNobCUUNNrYjU46TSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750277562; a=rsa-sha256; cv=none; b=WqhrtgXl7/FXpTsdtN9fF+/DPrC0YCdaXkLX+uAlWsXNs8Abcv2kpTf/rpLUIWiU6feXwV PfDJw5GRVL/pX9xTioiedLWAoQh/DXxNTi2r6xdunxyDR0/jlDgwKW2AuvqIqThcGv0OZR pWLHhdhvN9LWdSysQDEp0ONOULhWGIj4mUQn130yRFJKcM5DNrDUbWQ+ulWxTTi+98H1S4 nNa1o9mXOH0Hqdv5YKwuoJHYQ8PduHBAvkAL4jqeTZYgMhDuEKuohWXu+hBRHt8kss+I1G cN5OvCwbTukQ0CL8A3bEZFA81oduk2kRE28BsO6LE5IUV0S71X5kGl/2T3tNjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMvzs6GHmzl2t; Wed, 18 Jun 2025 20:12: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 55IKCf71054999; Wed, 18 Jun 2025 20:12:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55IKCfKB054996; Wed, 18 Jun 2025 20:12:41 GMT (envelope-from git) Date: Wed, 18 Jun 2025 20:12:41 GMT Message-Id: <202506182012.55IKCfKB054996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a2408c4e976a - stable/14 - nfsd: Fix accumulating nfslockfile structures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a2408c4e976a9499358e40cc326cb1ce4bd6de7a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a2408c4e976a9499358e40cc326cb1ce4bd6de7a commit a2408c4e976a9499358e40cc326cb1ce4bd6de7a Author: Rick Macklem AuthorDate: 2025-06-04 23:09:01 +0000 Commit: Rick Macklem CommitDate: 2025-06-18 20:09:54 +0000 nfsd: Fix accumulating nfslockfile structures If a NFSv4 client does an exclusive open where the file already exists, the server returns EEXIST. However, without this patch, a partially filled in nfslockfile structure is allocated, but is not referenced by any open and, as such, never gets freed. This patch fixes the bug by checking for EEXIST before calling nfsvno_open(). (cherry picked from commit 1749465947a807caa53ce09b90a30b820eaab62e) --- sys/fs/nfsserver/nfs_nfsdserv.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index a38ef3d47946..7ac5b61b0ae9 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2829,7 +2829,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, int how = NFSCREATE_UNCHECKED; int32_t cverf[2], tverf[2] = { 0, 0 }; vnode_t vp = NULL, dirp = NULL; - struct nfsvattr nva, dirfor, diraft; + struct nfsvattr nva, dirfor, diraft, nva2; struct nameidata named; nfsv4stateid_t stateid, delegstateid; nfsattrbit_t attrbits; @@ -3076,11 +3076,23 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, } break; case NFSCREATE_EXCLUSIVE: - exclusive_flag = 1; if (nd->nd_repstat == 0 && named.ni_vp == NULL) nva.na_mode = 0; - break; + /* FALLTHROUGH */ case NFSCREATE_EXCLUSIVE41: + if (nd->nd_repstat == 0 && named.ni_vp != NULL) { + nd->nd_repstat = nfsvno_getattr(named.ni_vp, + &nva2, nd, p, 1, NULL); + if (nd->nd_repstat == 0) { + tverf[0] = nva2.na_atime.tv_sec; + tverf[1] = nva2.na_atime.tv_nsec; + if (cverf[0] != tverf[0] || + cverf[1] != tverf[1])) + nd->nd_repstat = EEXIST; + } + if (nd->nd_repstat != 0) + done_namei = true; + } exclusive_flag = 1; break; } @@ -3170,16 +3182,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, NFSACCCHK_VPISLOCKED, NULL); } - if (!nd->nd_repstat) { + if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); - if (!nd->nd_repstat) { - tverf[0] = nva.na_atime.tv_sec; - tverf[1] = nva.na_atime.tv_nsec; - } - } - if (!nd->nd_repstat && exclusive_flag && (cverf[0] != tverf[0] || - cverf[1] != tverf[1])) - nd->nd_repstat = EEXIST; /* * Do the open locking/delegation stuff. */ From nobody Wed Jun 18 20:13:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bMw1L0xX5z5q6C1; Wed, 18 Jun 2025 20:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bMw1K4Nyzz3ZFB; Wed, 18 Jun 2025 20:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750277637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXzNecR1nGsKHA8g8R54V82ljSSTnjqNI/wBcNCbwwc=; b=XwORiVyxC1q0/0/2DhPSHDgh8XCZwwRDoSClfwnOkxr70rMOQyplqnYM3YDizEXycuQWFn OpndVoQIcEChQgXfQFon12KOc5KP0TqiJReoxiHAct/S3DXxpGfqi4/w5TksotoMEJ8Et2 SIDFbPKVswGD+KgrlgSdk1bnI3i/U/S0F/h4jCkxmmPKQtjwzD2GYFHaLBuUVMys7dkvN8 Riiumi8QI8RbjoiwS55bDeAzOhziKofAOiX+n9qMgOzXHKG54vtTt1d5n2VPljBt3QXmTf 3JRfMFO4Aj2+t2zvBr5Rs+2fDkGy5x5qQLMgBDWk/izP/TnczgxjI4M6O5oO/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750277637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXzNecR1nGsKHA8g8R54V82ljSSTnjqNI/wBcNCbwwc=; b=GyPszzIhcWibGF97/9hl+7KpZNUzaza54v5L3FiG4gBZ3TZgHr8Wi2c/1iluFHe3DVV88W uqSwW9GuJmOvLqG97WgGElmUY9xyLI9Tda5pJDpTtuYlZGunZyxrwzsRg4KkcJG0/wRQ/B Uf5E1pj49cMsohxR6A08lgw33Kl22PlPDkeT+QdbMh7A5GchPDdGGY7HryS7WqBNZnMLu5 UDLy+QmeHnO+8v/9Zkd32vFA/QhyEemykoNGm5uy9nWwpfDDZqlDEQhqh5yBWYMWeiNKip 9AvlG8WzcwSyiSn+ADiQ8yEtXxARCxOyTWwAzaz8AnjnDvmqVchlJWMAPGwgQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750277637; a=rsa-sha256; cv=none; b=AatjpOM6TV+m4iDK7bXaPlTKJx3Xz+sUqnuTlqf5FiIwNDeHxrifLFChEWfD8+YI6jzWG5 kjlH4FssVYrEPTvsa2DS6HcCFBfvzUgbOCCtIF12YV8Ea1wjIIB6BYRzDZ6WfuwUHWFUzc hRyiwwj7BbCgqh9GNEMU1BSwkGXEf/Yci3ptFsAlyfB/lUml9FIQ/bkyPMTlV8/mvLIUkr xmM0WR/FA+vStpXJLm8lIa2UxkvSH0afoczeAY05BGUC8adey4g1Po4MTCH9HgMq5Rao74 Riyt/3Hohz6jMz3fUYBg2QDEHZIFtYhk948Pr7F6YzcHAn9LJqUci5ydAWOBAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bMw1K3pSwzlC5; Wed, 18 Jun 2025 20:13: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 55IKDvvX055550; Wed, 18 Jun 2025 20:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55IKDvGb055547; Wed, 18 Jun 2025 20:13:57 GMT (envelope-from git) Date: Wed, 18 Jun 2025 20:13:57 GMT Message-Id: <202506182013.55IKDvGb055547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: ca5be69fb96d - stable/14 - nfsd: Fix the build for 1749465947a8 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ca5be69fb96dac9eb005154fd0702731e5f45b08 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ca5be69fb96dac9eb005154fd0702731e5f45b08 commit ca5be69fb96dac9eb005154fd0702731e5f45b08 Author: Rick Macklem AuthorDate: 2025-06-05 01:57:07 +0000 Commit: Rick Macklem CommitDate: 2025-06-18 20:11:26 +0000 nfsd: Fix the build for 1749465947a8 Fixes: 1749465947a8 ("nfsd: Fix accumulating nfslockfile structures") (cherry picked from commit 4be12de1d630383ab5e0c0f3ff48aa9f2f192ab6) --- sys/fs/nfsserver/nfs_nfsdserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 7ac5b61b0ae9..846d4037ef27 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3087,7 +3087,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, tverf[0] = nva2.na_atime.tv_sec; tverf[1] = nva2.na_atime.tv_nsec; if (cverf[0] != tverf[0] || - cverf[1] != tverf[1])) + cverf[1] != tverf[1]) nd->nd_repstat = EEXIST; } if (nd->nd_repstat != 0) From nobody Thu Jun 19 18:26:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNTZc03L9z600lc; Thu, 19 Jun 2025 18:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNTZb5B2wz43wx; Thu, 19 Jun 2025 18:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750357575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AJoJSWAj8CfVQ4Jfl3OfHIKCDRbJ8g9aiYLI2bcJ2a8=; b=TguJlEorHN5wF6Vzyn54ynrppdjiSlQ18vlNTmcBOv2iAPhg/1eeyjfdJm65mDJzsPXck8 aXJYrPa3U0Dhf3fFACk5xWIpAcrQA5YD94hh/9rDdVYdlTkuykgHl8gqZSUei6WhqSADlJ IHRgfBIu8GEAsIfsO0FIFbGrXvRS8e4e8wNHyEzOySXES2RP1mD8U71GegQ+TZ51kvPnzM q7otEGgaXHrtUwl/JE/kK9cW5E39waegAcfNFkxJEDAvJZG+hP+MwmPsQqNJKhC3kN34qW 17wcDdVlWFXg6m3NaClhjxychCF+J24brUVFr7WXmZ0EHdkKQBPgvFZnHcFkHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750357575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AJoJSWAj8CfVQ4Jfl3OfHIKCDRbJ8g9aiYLI2bcJ2a8=; b=yJ7ARC6Uru2m4NfBRafyuu0NXaXruLr5XNwZqCtvqaNsvdsxpzfmnuahvvi+YbEgtem2pU n9bVEWlmIRcqoFOS/HhXJ+cJO7ez/CxncHV+zjIgDoNbchDvCjK/EHlsUDSCvkcIW813LJ lJxXaRgU5BJZICvbW53tY8BPCVmzgRuFnhbV5qBxMqo4MaQnI9XZA79RGpHunkxOcXEPy9 /Ezc1WTDYH7DFPhf/qr9KPfcPaxJJsT22H+xi+Lcl3cy/NFA9RJam3sVO1SyXim/YwV8zV Y4zl9aWDuD4dUhKU0m/XvE37hFI5m9gIp/TUF+DwlctJWVzn2RTRkEl2jvQFuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750357575; a=rsa-sha256; cv=none; b=htInODxN9OAjgTjgw5H9etuwXPDgeFqnbh/3Ax7fWUMSRG+Ozu4ExQZOtja3CoT0pBwZo+ 2S7zBUYoH1g2g5uiUVUYvnHqriV/1f/NhYB9EbQyJiq4xuqK49rruOEizfACgnK+Iqon7S iQ0WwsCJ2Hv8+f6/0qSPRHXJZZodeP0PS+hBDVvgfLX1cFCD9U//qqQPl3r76XnMpz5pPL ymbKZ3HqdgzDkQTiqp2qmFcwu8amOmjmx9x7KnImz1xClvWt0NTdtcEzW5Oh0d9dRGSQTR pyxTaNuFaxLA/L2YiyWHEiDJ/Gj6+xzpBWp3I3oY/awcapxGoPgnZr9R+9xPVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNTZb4FZVz1PPR; Thu, 19 Jun 2025 18:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55JIQFCZ055864; Thu, 19 Jun 2025 18:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55JIQF3A055861; Thu, 19 Jun 2025 18:26:15 GMT (envelope-from git) Date: Thu, 19 Jun 2025 18:26:15 GMT Message-Id: <202506191826.55JIQF3A055861@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: e3fd26a3d71b - stable/13 - bsdinstall: Fix grammatical issues. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: e3fd26a3d71b753e302b6f7ee49e9879d2f3f5a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e3fd26a3d71b753e302b6f7ee49e9879d2f3f5a7 commit e3fd26a3d71b753e302b6f7ee49e9879d2f3f5a7 Author: Nathan Whitehorn AuthorDate: 2022-01-02 00:34:48 +0000 Commit: Ed Maste CommitDate: 2025-06-19 18:25:48 +0000 bsdinstall: Fix grammatical issues. PR: 263488 (cherry picked from commit dfa5a74357f3837b93b0cc90e5bee0a1d298ca3e) --- usr.sbin/bsdinstall/scripts/bootconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 0f00872fb2ec..b595317eed49 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -73,7 +73,7 @@ update_uefi_bootentry() fi $DIALOG --backtitle 'FreeBSD Installer' --title 'Boot configuration' \ - --yesno 'There is multiple "FreeBSD" efi boot entries, would you like to remove them all and add a new one?' 0 0 + --yesno 'There are multiple "FreeBSD" EFI boot entries. Would you like to remove them all and add a new one?' 0 0 if [ $? -eq $DIALOG_OK ]; then for entry in $(efibootmgr | awk '$NF == "FreeBSD" { sub(/.*Boot/,"", $1); sub(/\*/,"", $1); print $1 }'); do efibootmgr -B -b ${entry} From nobody Thu Jun 19 20:01:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNWhL1pxCz5PSrB; Thu, 19 Jun 2025 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNWhL0WHdz3CZK; Thu, 19 Jun 2025 20: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=1750363282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFgz5I21c3DF6+6mzF6XlnVGJXa2Qzn1+fEP16EQZtc=; b=dAG3byi8zUMwVUVM13xb26zdcmQ4nl1vt6bzVMS42iKBNdOd3vl8GlYFR825TqO8Xv9JJi 0mcRBmRuYtANh71RRIBT46gHFTm4DH1OAafGC88Ez1X97PG7cCunDHYHUz0S5EANu0prKH ZYQScz0GkMFoAHV/eyOu6+FXQuyaa3Seoq/nQvJ0EDXIxYbmoRXoJLOvnXIBsfK1F43DHn 3sYDCaEiFZymIQeTwmbD84QtlbpggYHXPVYxjJd3sWIg390BR21k6PR/FlOBO8zMskv0MQ E6f6WQ7JeYhUFC9tizdGBCyus87pjGFVWl1FaBCBA9L9JDbraSy0yxS0MalW3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750363282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFgz5I21c3DF6+6mzF6XlnVGJXa2Qzn1+fEP16EQZtc=; b=J9L9+DgL8TUugYFJXBiv7yOcMXoQkxI/STB9NECnAHm+xJNg282Bz42aHEmEWmNEPhCQkB ddlIVFMdAdL4KdFLTr8Okh4kG6IW1fa3J+ciIr1ES0DurHsYYlS4EfPLwXA9RyTZjbEbOd cDNiEfWuPBYsGP+oRw97t1PN3yOuTW6eAwH/rksiwCyS/0Rq8ix2UFLmiZQzcoocBHtsy2 epI/QuwOeGBooe6EBXOlpLVB2kbiEEJby0/nIzjhGKoEU7xtBPOtLNaWb4IHl+i/sE5lwi RX5/zJ0PVXZfTlEAwe3DFtS0byYBZ51C2M8h88EMaFmQ8rmoZcvm06SUPQeR5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750363282; a=rsa-sha256; cv=none; b=U9GYf3qCZojgyq+wWmUhjNcZXtxioAa+O4jIN2Pfg9q1I0X4NwbZlDaRKTwiZaX8tBX9LZ F7GVzPEqpwYkmGpKlxKD5XQbPoYD3bUBQ6nuH+i5IpU1rTGrTxjefY5n1ih5BEgqR+OIn2 z4NhuO/B3wnNMbub67NBIBQZjUyoakzcDwR8HRZZlhXE+QgwNncmXacPfe/VbZdxJzvJp3 uksnvba/xUbxj7bOIoNkbIIOjXhuQDeY0pubFB1yERzg8bSoVtEFXmgfoXX87oL9b5ET7I wcodF0VLqNIjdSDjoeqSG6TGjPWAR9KFhdynScsZ/HV3RkkxbgW16cW1F4Mhug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNWhL04kJz1S84; Thu, 19 Jun 2025 20: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 55JK1Lmw039110; Thu, 19 Jun 2025 20: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 55JK1Lcu039107; Thu, 19 Jun 2025 20:01:21 GMT (envelope-from git) Date: Thu, 19 Jun 2025 20:01:21 GMT Message-Id: <202506192001.55JK1Lcu039107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 8d98d889e1fc - stable/14 - libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeout List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d98d889e1fcdf38488b107b7191c38f3ea662d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8d98d889e1fcdf38488b107b7191c38f3ea662d2 commit 8d98d889e1fcdf38488b107b7191c38f3ea662d2 Author: Gleb Smirnoff AuthorDate: 2025-03-28 21:35:35 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-19 20:00:19 +0000 libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeout A nameserver timeout is a soft failure, future attempts may succeed. Returning EAI_AGAIN is crucial for API users to tell a soft name resolution failure from negative resolution result. Before the change we would return EAI_ADDRFAMILY, which I believe, is a regression from 144361386696, and before that revision we used to return EAI_NONAME in most of the cases. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49411 (cherry picked from commit d803854bccb9ea527c1769ac403e011ff0e121e5) --- lib/libc/net/getaddrinfo.c | 58 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 2b9499d5099b..b8af23ebe8da 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -2341,9 +2341,14 @@ _dns_getaddrinfo(void *rv, void *cb_data, va_list ap) if (res_searchN(hostname, &q, res) < 0) { free(buf); free(buf2); - if (res->res_h_errno == NO_DATA) + switch (res->res_h_errno) { + case NO_DATA: return (NS_ADDRFAMILY); - return (NS_NOTFOUND); + case TRY_AGAIN: + return (NS_TRYAGAIN); + default: + return (NS_NOTFOUND); + } } /* prefer IPv6 */ if (q.next) { @@ -2705,9 +2710,18 @@ res_queryN(const char *name, struct res_target *target, res_state res) int n; u_int oflags; struct res_target *t; - int rcode; + u_int rcode; int ancount; + /* + * Extend rcode values in the scope of this function. The DNS header + * rcode we use in this function (hp->rcode) is limited by 4 bits, so + * anything starting from 16 is safe wrt aliasing. However, nameser.h + * already has extended enum __ns_rcode, so for future safety let's use + * even larger values. + */ +#define RCODE_UNREACH 32 +#define RCODE_TIMEDOUT 33 rcode = NOERROR; ancount = 0; @@ -2768,7 +2782,29 @@ again: printf(";; res_nquery: retry without EDNS0\n"); goto again; } - rcode = hp->rcode; /* record most recent error */ + /* + * Historically if a DNS server replied with ICMP port + * unreach res_nsend() would signal that with + * ECONNREFUSED and the upper layers would convert that + * into TRY_AGAIN. See 3a0b3b673936b and deeper. + * Also, res_nsend() may set errno to ECONNREFUSED due + * to internal failures. This may not be intentional, + * but we also treat that as soft failures. + * + * A more practical case is when a DNS server(s) were + * queried and didn't respond anything, which usually + * indicates a soft network failure. + */ + switch (errno) { + case ECONNREFUSED: + rcode = RCODE_UNREACH; + break; + case ETIMEDOUT: + rcode = RCODE_TIMEDOUT; + break; + default: + rcode = hp->rcode; + } #ifdef DEBUG if (res->options & RES_DEBUG) printf(";; res_query: send error\n"); @@ -2800,6 +2836,8 @@ again: case NXDOMAIN: RES_SET_H_ERRNO(res, HOST_NOT_FOUND); break; + case RCODE_UNREACH: + case RCODE_TIMEDOUT: case SERVFAIL: RES_SET_H_ERRNO(res, TRY_AGAIN); break; @@ -2862,10 +2900,6 @@ res_searchN(const char *name, struct res_target *target, res_state res) ret = res_querydomainN(name, NULL, target, res); if (ret > 0 || trailing_dot) return (ret); - if (errno == ECONNREFUSED) { - RES_SET_H_ERRNO(res, TRY_AGAIN); - return (-1); - } switch (res->res_h_errno) { case NO_DATA: case HOST_NOT_FOUND: @@ -2906,7 +2940,6 @@ res_searchN(const char *name, struct res_target *target, res_state res) ret = res_querydomainN(name, *domain, target, res); if (ret > 0) return (ret); - /* * If no server present, give up. * If name isn't found in this domain, @@ -2920,11 +2953,6 @@ res_searchN(const char *name, struct res_target *target, res_state res) * but try the input name below in case it's * fully-qualified. */ - if (errno == ECONNREFUSED) { - RES_SET_H_ERRNO(res, TRY_AGAIN); - return (-1); - } - switch (res->res_h_errno) { case NO_DATA: got_nodata++; @@ -2933,8 +2961,8 @@ res_searchN(const char *name, struct res_target *target, res_state res) /* keep trying */ break; case TRY_AGAIN: - got_servfail++; if (hp->rcode == SERVFAIL) { + got_servfail++; /* try next search element, if any */ break; } From nobody Thu Jun 19 20:01:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNWhM3xrjz5PSrC; Thu, 19 Jun 2025 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNWhM1Slrz3Clc; Thu, 19 Jun 2025 20: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=1750363283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icANkMNJpdI9ZS1/nagUdF3+dvXeLJJwjW+T7pBNOnU=; b=yNywmgQ3hBk9PrahzjdSz3pf7RqR4ok4OlLdGFZfV4jPOjkibjgu58tk1xCT/trn1KYTSJ piWImZLKIQ3VdCwNVgXEu5wAL3r124ZDaIKoruyB3abRMduQ6H02hunj7TDB/zsOx0uW3W oXF2DQUwvXgq39pdckwHoTnSnM3MVxPyeD3JI+Fu+5LOfGLexJ4QG29pniU3Z3N6K/pAld 0ld1kx5HZvjEe1iyMduQbur2ohM7K10ZqmwbDSjVSTMLG9UdAOYX1bpqK6Xr9pT7+wWkGm 0dkIgM2x1R5lw5/tLSOonYZvjaJ3RxR8GHrFhGDmK/gXXu7MkNcmNjnjLq/5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750363283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=icANkMNJpdI9ZS1/nagUdF3+dvXeLJJwjW+T7pBNOnU=; b=Z4yESdDQy1+RZA6HuWOP0CqjbolpdQQpIiaHPXuIywZVM3WqdXJl+02gDvHXX9tiXlBQb5 zcGQDRl1MhX9G8uoCJz8/6+LA8BiCllzXt9HuM0NpEMtanTQEEKspzdICnQSBfAXDA1g2G aX8D95Jd65fVjZ3K8hZy/SohoaC6rJGHNblrsth9oUn27G4xlIIV6vlvp5hOcoy2NDbaGT DJRokXAY9zAh779jY3JFR96H8yKr6O6Sesz0srhR6dPc3V2few0ArKCkNMoNoD+MmPGvLM UVIJwQ2rdYbAPfTRQ9S8NHdu1JFXRaWs2mznb0oO0pwtw+MnoFnOEuSnQb7L8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750363283; a=rsa-sha256; cv=none; b=ZrUsvaS9iqkKu7HDxFbjQTThpAuaEsGt2uzHhwyFgHcLFojZjlrx6x+jLaaajzGY26320+ KtyRCKko14DERu8iafpjqePDKrcaEvUyf4TwHpYltwQlPU0DBjqHkruGt16IRBgIcoFAYm YMjGXA91UWVG4NOhfc/oQ6P3Ow/CvHtT5GuJzunfEFvU499admhGjtzQhSYCTTIlvh5Nu9 H6Ox530BdPChF9J/4GzxVFVS77pHn1hXLkw+doHjJAdXJjXOueMzOBNXhaxoa+5InM8y/T C5nxD1FM1L74iyFyPotnhH+k9770ztrE4b5+DKQC1sHHMILLW0lQnck+X2tOSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNWhM10cPz1RyV; Thu, 19 Jun 2025 20: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 55JK1NTu039146; Thu, 19 Jun 2025 20: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 55JK1Nkg039143; Thu, 19 Jun 2025 20:01:23 GMT (envelope-from git) Date: Thu, 19 Jun 2025 20:01:23 GMT Message-Id: <202506192001.55JK1Nkg039143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 421d49371d33 - stable/14 - mount_nfs: make temporary DNS failure non-fatal with background mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 421d49371d33aa475099d592738ecccbd1782b0e Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=421d49371d33aa475099d592738ecccbd1782b0e commit 421d49371d33aa475099d592738ecccbd1782b0e Author: Gleb Smirnoff AuthorDate: 2025-03-28 21:31:54 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-19 20:01:01 +0000 mount_nfs: make temporary DNS failure non-fatal with background mode Typical problem with network mounts is remote equipment not being available when our host boots up after a power failure. Even if you properly configure boot order of all local services and wait for link coming up on your NIC, you still may boot faster than some intermediate switch on the network or the DNS server itself. Let's refer to this as a "server room boot race". For NFS mounts with hostname in hosts(5) the race is addressed by a retry loop on NFS mount timeout. However, a DNS resolution timeout is treated differently to NFS mount timeout. We fail on the former and keep retrying on the latter. With feedback received on current@, I see that the problem is so old, that people got used to it and see it as a desired behavior rather than a problem. And for those who is affected by the problem, they suggest hosts(5) as a solution. Note that using hosts(5) isn't scalable, and using bare IP addresses is neither scalable, nor compatible with Kerberized mounts. A trade-off solution would be to enable the retry cycle over DNS timeouts only when background mode is specified, which is a typical use in fstab(5) and very uncommon in a command line. That would address the server room boot race problem without breaking POLA for command line. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D49145 (cherry picked from commit 5fa093b6efcb7eb16a17d9830dbd4404bff5a565) --- sbin/mount_nfs/mount_nfs.c | 59 ++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 5c194a1c3676..82568a9a56de 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -599,6 +599,7 @@ getnfsargs(char **specp, char **hostpp, struct iovec **iov, int *iovlen) char *hostp, *delimp, *errstr, *spec; size_t len; static char nam[MNAMELEN + 1], pname[MAXHOSTNAMELEN + 5]; + bool resolved; spec = *specp; if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && @@ -655,30 +656,7 @@ getnfsargs(char **specp, char **hostpp, struct iovec **iov, int *iovlen) else if (nfsproto == IPPROTO_UDP) hints.ai_socktype = SOCK_DGRAM; - if (getaddrinfo(hostp, portspec, &hints, &ai_nfs) != 0) { - hints.ai_flags = AI_CANONNAME; - if ((ecode = getaddrinfo(hostp, portspec, &hints, &ai_nfs)) - != 0) { - if (portspec == NULL) - errx(1, "%s: %s", hostp, gai_strerror(ecode)); - else - errx(1, "%s:%s: %s", hostp, portspec, - gai_strerror(ecode)); - return (0); - } - - /* - * For a Kerberized nfs mount where the "principal" - * argument has not been set, add it here. - */ - if (got_principal == 0 && secflavor != AUTH_SYS && - ai_nfs->ai_canonname != NULL) { - snprintf(pname, sizeof (pname), "nfs@%s", - ai_nfs->ai_canonname); - build_iovec(iov, iovlen, "principal", pname, - strlen(pname) + 1); - } - } + resolved = (getaddrinfo(hostp, portspec, &hints, &ai_nfs) == 0); if ((opflags & (BGRNDNOW | ISBGRND)) == BGRNDNOW) { warnx("Mount %s:%s, backgrounding", @@ -690,6 +668,37 @@ getnfsargs(char **specp, char **hostpp, struct iovec **iov, int *iovlen) ret = TRYRET_LOCALERR; for (;;) { + if (!resolved) { + hints.ai_flags = AI_CANONNAME; + if ((ecode = getaddrinfo(hostp, portspec, &hints, + &ai_nfs)) != 0) { + if (portspec == NULL) + warnx("%s: %s", hostp, + gai_strerror(ecode)); + else + warnx("%s:%s: %s", hostp, portspec, + gai_strerror(ecode)); + if (ecode == EAI_AGAIN && + (opflags & (BGRNDNOW | BGRND))) + goto retry; + else + exit(1); + } + resolved = true; + /* + * For a Kerberized nfs mount where the + * "principal" argument has not been set, add + * it here. + */ + if (got_principal == 0 && secflavor != AUTH_SYS && + ai_nfs->ai_canonname != NULL) { + snprintf(pname, sizeof (pname), "nfs@%s", + ai_nfs->ai_canonname); + build_iovec(iov, iovlen, "principal", pname, + strlen(pname) + 1); + } + } + /* * Try each entry returned by getaddrinfo(). Note the * occurrence of remote errors by setting `remoteerr'. @@ -717,7 +726,7 @@ getnfsargs(char **specp, char **hostpp, struct iovec **iov, int *iovlen) /* Exit if all errors were local. */ if (!remoteerr) exit(1); - +retry: /* * If retrycnt == 0, we are to keep retrying forever. * Otherwise decrement it, and exit if it hits zero. From nobody Thu Jun 19 21:06:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNY7T0kCVz5PWtk; Thu, 19 Jun 2025 21:06: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNY7S6rjBz3tpW; Thu, 19 Jun 2025 21:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750367189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KUOSFMUsCuF3L/NexVavHAub//n9Oivy6uHryy+7Wyg=; b=AoN1tDMRiZQ7CLT1ByZOecWN8gKdtneNvBrRkdX4ayev8mdGVKMJTYmOzcgxtoWkYzBz3W 3D8nWY4Xgj9dnDMjUAfVHHLw8/nA7mkszWzRcsfc8I4witL/4RIwUC4pEBiynipXKScHlo Po1uVpM4xsI+09675e4PhhuYpWyZDo6K0ocSRDgkXwbOv+zpDRLNNvAbc35QkJ4z/vHKT6 xdX/pSSMwrwHdbr9K85VwyuYNVMSXqJUduJGgQc0TlIh5jvuvDYH0/RUj9oIwt9ebeKQlu NyihYVcI+8nS3JtqH6EuswjagXxv9rU1zZIVHuOcWa1EUqvGCaQ6pIR6zYYRZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750367189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KUOSFMUsCuF3L/NexVavHAub//n9Oivy6uHryy+7Wyg=; b=wZzIugOLKeuv9APYnjJkPCJ/VYNairubxLqEKgDZqjoxOwu1JtGme0tqE209Z1zFYEXcOU tWyGkqqAkje2EkCIOx1laua6oRynJBw2h4g3ppE4fcqyPIvDdftoCuUUiXzah+3koWsx5e qwOBv0J/pe6WqN8gBQn68huGcvrmmWYJANMh3Q0mgZEL9rGciVDePZA1S48zvewyWN815y 2LzaTe+lN1H3gPFZ5lk5+TYH4+vYP6Pw40qqMlsNSsRvQIIGbkvu+x3/RKuS/vIjggOXt4 yeYrVOs2kiSQVdmvegY1VT58YrAxNLbEYwKxp1VC2XT3Zf4T1+FUanOelwYEiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750367189; a=rsa-sha256; cv=none; b=dovCeDf3BVzQBMEKza7urI00AwGoSp/YIV4OP5iP7f0lv7AXMyqzIu6V3Isz7q7wYNAlWW hU3Tqyl+x1G1qcXZUi7Bt+6wHEK8322HcMx84VXgY6kth3sdUcFa71gWzzBep6m/+jGiZM O4cCSY3J3NoGHAW0MRmz/6WeY53P4Hu19GILSE50ICJJBQfQDvkFuFwSEsASZtBIO3H3IA x1unpnbV9tSvAcrM2gPrERbhBCXZHiVFKs+WpvaJyeUozk7aSRl04uXmfGgtqAp7kyAcIt rS7VVJ3uGfVFrRxW0qCe8vyzUzQgRysa78fPQpCMTy5xirxivVCItavBiiFUJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNY7S6Ndkzrk; Thu, 19 Jun 2025 21:06: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 55JL6Seg057664; Thu, 19 Jun 2025 21:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55JL6SeN057661; Thu, 19 Jun 2025 21:06:28 GMT (envelope-from git) Date: Thu, 19 Jun 2025 21:06:28 GMT Message-Id: <202506192106.55JL6SeN057661@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: 47552b548d5a - stable/14 - usbhid.4: Add cross-references to "other USB HID drivers" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 47552b548d5ad4509ef342324910e748318fee77 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=47552b548d5ad4509ef342324910e748318fee77 commit 47552b548d5ad4509ef342324910e748318fee77 Author: Ed Maste AuthorDate: 2025-05-20 15:45:50 +0000 Commit: Ed Maste CommitDate: 2025-06-19 21:06:17 +0000 usbhid.4: Add cross-references to "other USB HID drivers" Reviewed by: ziaee Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50437 (cherry picked from commit 084046ad8f859d270a3cf900a82c5254153afcac) --- share/man/man4/usbhid.4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man4/usbhid.4 b/share/man/man4/usbhid.4 index 156f53a051ea..1dff0ef0e6d6 100644 --- a/share/man/man4/usbhid.4 +++ b/share/man/man4/usbhid.4 @@ -55,7 +55,11 @@ tunables: .It Va hw.usb.usbhid.enable Enable .Nm -and make its priority greater than other USB HID drivers have. +and make its priority greater than other USB HID drivers, such as +.Xr ukbd 4 , +.Xr ums 4 , +and +.Xr uhid 4 . Default is 0. .El .Bl -tag -width indent From nobody Thu Jun 19 22:47:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNbN65pyBz5y4DX; Thu, 19 Jun 2025 22:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNbN65LVsz41j6; Thu, 19 Jun 2025 22:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750373254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pCq/wVJgERq7XEnjnt0orlXYcBgQR45zKH4B/wWHrC8=; b=ZOxkXRMLHg2Fgq+YTais6w9nvpWavj4btz66Pydz8blhkXM33LqYxvOEKmIgtikP0ja8bu u0aPrTs3wbdoEiA8Rzk/od3UenuUxRuidr1jjpoy3yylItaD0CI2ONt7bFlzbsns3G/ukV F9ZyHB4Kq2W3laJtaCUOiZN6szVQFUQjFeBp0eS855WEZeE0VfsgQvat05deGCc3AJbHqk ONGQdz9Tm1oGyCdyxKvQbME4WJsxS4pEpW5lCkNaVcRM7JnCWOQV/SxpPMFBcFcBzOWvmo 3/7vr/5TitZhC6/kMX+BlttnK/mRsx4jqN0Jkp0af8IhVu+zq/2qZpTaVNLlcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750373254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pCq/wVJgERq7XEnjnt0orlXYcBgQR45zKH4B/wWHrC8=; b=fF06JdAMkscAcqpSS7F7+QnCWR3AisEoD1GHQiPd44dO3EREVSEEuiPBZxD3iKN7E+eoz0 UEbCMuReCjrb/OOM0oWvyeH7I3rHzCeIxDbR2qaICbb0j2oVVrPbIu1AuMuiPD4P4dH9rJ 0Gm1ko303/jbDZyQOiGbbtI9wVHvNN3TaPRgEebMEtw1jGYruRQ9ssU0Eae1kWwjvouS8d ezMDQ5UrH7I7bIeIJ906DZ3SiTmClK0Lkk82Sr2pQ2grn4qJoSXXe+XH8LS6JiszJjwW77 fp7UzUwwd0k+G1zdo5L8D0XB5OljyprNK9LV4ikoCK20cEmYoZUqD4Y1C4sWvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750373254; a=rsa-sha256; cv=none; b=HT1LHHivVldDWEe2+/mYBaK8jlbyrhCZjMa+5JeQlmBaLdkWoulH4n4OyljMwgNmeRfYCw LOR3C5IriJlIQk17OHFyuQVIcq+7wZMKY2saf3+Ol0yaoL0vuk1Moayv3eriSHHzlHNYpH JHIRkmy2vYg5gH7BtvHFcbk0Pv2VvhY+dgqdbKjohiYMwdSxAguuvHF62Z9j6UX6l6my/X qTNSaoICTgoYRHyckgdtPfUpFmrkBerdbWv0gZZ10awOcX6335yzSfsYXmaOjvxTSQg9Dr NAOPfPv4mLiAQOsJGKomHF/IAu5z81eGO5nDoHXeVaRQD8E+c86z+ToKDjetLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNbN64VRVz3vs; Thu, 19 Jun 2025 22:47: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 55JMlY1n045651; Thu, 19 Jun 2025 22:47:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55JMlYvm045648; Thu, 19 Jun 2025 22:47:34 GMT (envelope-from git) Date: Thu, 19 Jun 2025 22:47:34 GMT Message-Id: <202506192247.55JMlYvm045648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 6dad4525a291 - stable/14 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6dad4525a2910496ecf3c41de659aac906f6c1f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=6dad4525a2910496ecf3c41de659aac906f6c1f4 commit 6dad4525a2910496ecf3c41de659aac906f6c1f4 Author: Martin Matuska AuthorDate: 2025-06-01 20:16:26 +0000 Commit: Martin Matuska CommitDate: 2025-06-19 22:16:24 +0000 libarchive: merge from vendor branch libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname (CVE-2024-57970) #2532 tar reader: fix unchecked return value in list_item_verbose() (CVE-2025-25724) #2532 unzip: fix null pointer dereference (CVE-2025-1632) #2568 warc: prevent signed integer overflow (CVE-2025-5916) #2584 rar: do not skip past EOF while reading (CVE-2025-5918) #2588 tar: fix overflow in build_ustar_entry (CVE-2025-5917) #2598 rar: fix double free with over 4 billion nodes (CVE-2025-5914) #2599 rar: fix heap-buffer-overflow (CVE-2025-5915) Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724, CVE-2025-5914, CVE-2025-5915, CVE-2025-5916, CVE-2025-5917, CVE-2025-5918 PR: 286944 (exp-run, main, libarchive 3.8.0) (cherry picked from commit 2e113ef82465598b8c26e0ca415fbe90677fbd47) --- contrib/libarchive/COPYING | 2 +- contrib/libarchive/NEWS | 8 + contrib/libarchive/README.md | 9 +- .../github_actions/install-macos-dependencies.sh | 19 + contrib/libarchive/cpio/cpio.c | 2 +- contrib/libarchive/cpio/test/test_format_newc.c | 12 +- contrib/libarchive/cpio/test/test_option_a.c | 2 +- contrib/libarchive/cpio/test/test_option_c.c | 8 +- contrib/libarchive/libarchive/archive.h | 57 +- contrib/libarchive/libarchive/archive_acl.c | 14 +- .../libarchive/libarchive/archive_acl_private.h | 2 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 +- .../libarchive/archive_cryptor_private.h | 8 + contrib/libarchive/libarchive/archive_digest.c | 344 +- .../libarchive/libarchive/archive_digest_private.h | 35 +- .../libarchive/archive_disk_acl_freebsd.c | 4 +- contrib/libarchive/libarchive/archive_entry.c | 54 +- contrib/libarchive/libarchive/archive_entry.h | 84 +- .../libarchive/archive_entry_link_resolver.c | 8 + .../libarchive/libarchive/archive_entry_locale.h | 2 +- .../libarchive/libarchive/archive_entry_private.h | 13 +- .../libarchive/libarchive/archive_hmac_private.h | 2 +- contrib/libarchive/libarchive/archive_match.c | 102 +- contrib/libarchive/libarchive/archive_options.c | 4 +- .../libarchive/archive_options_private.h | 4 +- contrib/libarchive/libarchive/archive_pack_dev.h | 2 +- .../{archive_getdate.c => archive_parse_date.c} | 65 +- contrib/libarchive/libarchive/archive_platform.h | 5 + .../libarchive/libarchive/archive_platform_acl.h | 2 +- .../libarchive/libarchive/archive_platform_xattr.h | 2 +- contrib/libarchive/libarchive/archive_ppmd7.c | 11 +- contrib/libarchive/libarchive/archive_ppmd8.c | 15 +- .../libarchive/libarchive/archive_ppmd_private.h | 18 +- .../libarchive/libarchive/archive_random_private.h | 2 +- contrib/libarchive/libarchive/archive_rb.h | 2 +- contrib/libarchive/libarchive/archive_read.c | 6 - .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_entry_from_file.c | 2 +- .../libarchive/archive_read_disk_posix.c | 9 +- .../libarchive/archive_read_disk_private.h | 7 +- .../libarchive/libarchive/archive_read_format.3 | 15 + .../libarchive/libarchive/archive_read_open_fd.c | 42 +- .../libarchive/libarchive/archive_read_open_file.c | 121 +- .../libarchive/archive_read_open_filename.c | 61 +- .../archive_read_support_filter_by_code.c | 14 - .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_lz4.c | 1 - .../libarchive/archive_read_support_format_7zip.c | 445 +- .../archive_read_support_format_by_code.c | 15 - .../libarchive/archive_read_support_format_cab.c | 7 +- .../libarchive/archive_read_support_format_cpio.c | 22 +- .../archive_read_support_format_iso9660.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 73 +- .../libarchive/archive_read_support_format_rar.c | 184 +- .../libarchive/archive_read_support_format_rar5.c | 101 +- .../libarchive/archive_read_support_format_tar.c | 409 +- .../libarchive/archive_read_support_format_warc.c | 7 +- .../libarchive/archive_read_support_format_xar.c | 355 +- .../libarchive/archive_read_support_format_zip.c | 33 +- contrib/libarchive/libarchive/archive_string.c | 141 +- .../libarchive/archive_string_composition.h | 3 +- .../libarchive/libarchive/archive_string_sprintf.c | 11 +- contrib/libarchive/libarchive/archive_time.c | 163 + .../{archive_getdate.h => archive_time_private.h} | 26 +- contrib/libarchive/libarchive/archive_util.c | 76 +- .../libarchive/archive_version_details.c | 405 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 2 +- .../libarchive/archive_write_add_filter_gzip.c | 19 +- .../libarchive/archive_write_add_filter_uuencode.c | 2 +- .../libarchive/archive_write_disk_posix.c | 15 +- .../libarchive/archive_write_open_filename.c | 8 +- .../libarchive/archive_write_set_format_7zip.c | 298 +- .../libarchive/archive_write_set_format_gnutar.c | 16 +- .../libarchive/archive_write_set_format_iso9660.c | 25 +- .../libarchive/archive_write_set_format_mtree.c | 123 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_xar.c | 692 +- .../libarchive/archive_write_set_format_zip.c | 986 +- .../libarchive/archive_write_set_options.3 | 43 +- contrib/libarchive/libarchive/libarchive-formats.5 | 20 +- .../libarchive/libarchive/test/read_open_memory.c | 2 +- .../libarchive/test/test_7zip_filename_encoding.c | 200 +- contrib/libarchive/libarchive/test/test_acl_pax.c | 8 +- .../libarchive/test/test_acl_platform_nfs4.c | 10 +- .../libarchive/test/test_acl_platform_posix1e.c | 3 +- .../libarchive/libarchive/test/test_acl_posix1e.c | 8 +- contrib/libarchive/libarchive/test/test_acl_text.c | 2 +- .../libarchive/test/test_archive_match_time.c | 71 +- ...archive_getdate.c => test_archive_parse_date.c} | 21 +- .../test/test_archive_string_conversion.c | 4 +- .../libarchive/test/test_compat_gtar_large.c | 224 + .../libarchive/test/test_compat_solaris_tar_acl.c | 4 +- .../libarchive/test/test_compat_star_acl.c | 6 +- contrib/libarchive/libarchive/test/test_entry.c | 2 +- .../libarchive/libarchive/test/test_open_file.c | 9 +- .../test/test_read_disk_directory_traversals.c | 2 +- .../libarchive/test/test_read_format_7zip.c | 315 +- .../test_read_format_7zip_deflate_powerpc.7z.uu | 55 + .../test_read_format_7zip_extract_second.7z.uu | 22 +- .../test/test_read_format_7zip_lzma2_powerpc.7z.uu | 48 + .../test/test_read_format_7zip_lzma2_riscv.7z.uu | 49 + .../test/test_read_format_7zip_lzma2_sparc.7z.uu | 51 + .../test/test_read_format_7zip_sfx_elf.elf.uu | 9442 ++++++++++++++++++++ .../test_read_format_7zip_sfx_modified_pe.exe.uu | 109 + .../test/test_read_format_7zip_sfx_pe.exe.uu | 4751 ++++++++++ .../test/test_read_format_7zip_zstd_sparc.7z.uu | 59 + .../test/test_read_format_gtar_redundant_L.c | 40 + .../test_read_format_gtar_redundant_L.tar.Z.uu | 16 + .../libarchive/test/test_read_format_gtar_sparse.c | 8 +- .../test/test_read_format_gtar_sparse_length.c | 53 + .../test_read_format_gtar_sparse_length.tar.Z.uu | 12 + ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 18 +- .../libarchive/test/test_read_format_rar.c | 74 +- .../libarchive/test/test_read_format_rar5.c | 29 +- .../test/test_read_format_rar5_unicode.rar.uu | 18 +- .../test/test_read_format_rar_encryption.c | 4 +- .../test/test_read_format_rar_endarc_huge.rar.uu | 4 + .../test/test_read_format_rar_newsub_huge.rar.uu | 5 + .../test/test_read_format_rar_overflow.c | 48 + .../test/test_read_format_rar_overflow.rar.uu | 11 + .../test/test_read_format_rar_symlink_huge.rar.uu | 5 + .../test_read_format_tar_empty_with_gnulabel.c | 2 +- .../test/test_read_format_tar_mac_metadata.c | 85 + .../test_read_format_tar_mac_metadata_1.tar.uu | 231 + .../test/test_read_format_tar_pax_g_large.c | 53 + .../test/test_read_format_tar_pax_g_large.tar.uu | 49 + .../test/test_read_format_tar_pax_negative_time.c | 68 + .../test_read_format_tar_pax_negative_time.tar.uu | 60 + .../libarchive/test/test_read_format_warc.c | 24 + .../test/test_read_format_warc_incomplete.warc.uu | 10 + .../libarchive/test/test_read_format_zip.c | 5 +- .../test/test_read_pax_empty_val_no_nl.c | 65 + .../test/test_read_pax_empty_val_no_nl.tar.uu | 60 + .../libarchive/test/test_read_position.c | 2 +- .../libarchive/libarchive/test/test_sparse_basic.c | 8 +- .../libarchive/libarchive/test/test_tar_large.c | 2 +- .../libarchive/test/test_write_disk_perms.c | 8 +- .../test/test_write_disk_secure_noabsolutepaths.c | 4 +- .../libarchive/test/test_write_filter_gzip.c | 5 +- .../libarchive/test/test_write_format_7zip.c | 6 + .../libarchive/test/test_write_format_7zip_large.c | 6 + .../libarchive/test/test_write_format_gnutar.c | 29 +- .../test/test_write_format_mtree_preset_digests.c | 2107 +++++ .../libarchive/test/test_write_format_tar_sparse.c | 4 +- .../libarchive/test/test_write_format_xar.c | 39 + .../test/test_write_format_zip64_stream.c | 192 +- .../test/test_write_format_zip_compression_bzip2.c | 362 + .../test_write_format_zip_compression_lzmaxz.c | 425 + .../test/test_write_format_zip_compression_store.c | 277 +- .../test/test_write_format_zip_compression_zstd.c | 366 + .../test/test_write_format_zip_entry_size_unset.c | 150 +- .../libarchive/test/test_write_format_zip_file.c | 164 +- .../test/test_write_format_zip_file_zip64.c | 192 +- .../libarchive/test/test_write_format_zip_large.c | 35 +- .../libarchive/test/test_write_format_zip_stream.c | 156 +- contrib/libarchive/libarchive_fe/passphrase.c | 10 +- contrib/libarchive/tar/bsdtar.1 | 74 +- contrib/libarchive/tar/bsdtar.c | 35 +- contrib/libarchive/tar/bsdtar.h | 12 +- contrib/libarchive/tar/cmdline.c | 2 + contrib/libarchive/tar/subst.c | 1 + contrib/libarchive/tar/test/test_list_item.c | 63 + contrib/libarchive/tar/test/test_list_item.tar.uu | 169 + contrib/libarchive/tar/test/test_option_C_mtree.c | 4 +- .../{test_option_P.c => test_option_P_upper.c} | 0 .../libarchive/tar/test/test_option_ignore_zeros.c | 4 +- contrib/libarchive/tar/test/test_option_mtime.c | 82 + contrib/libarchive/tar/test/test_option_s.c | 14 +- contrib/libarchive/tar/test/test_stdio.c | 48 +- contrib/libarchive/tar/util.c | 57 +- contrib/libarchive/tar/write.c | 4 + contrib/libarchive/test_utils/test_common.h | 2 +- contrib/libarchive/test_utils/test_main.c | 192 +- contrib/libarchive/test_utils/test_utils.c | 48 + contrib/libarchive/test_utils/test_utils.h | 11 +- contrib/libarchive/unzip/bsdunzip.c | 21 +- contrib/libarchive/unzip/la_getline.h | 16 + lib/libarchive/Makefile | 3 +- lib/libarchive/tests/Makefile | 35 +- usr.bin/tar/tests/Makefile | 5 +- 181 files changed, 25587 insertions(+), 2345 deletions(-) diff --git a/contrib/libarchive/COPYING b/contrib/libarchive/COPYING index 1b9723574a7b..9d0bcf81ff61 100644 --- a/contrib/libarchive/COPYING +++ b/contrib/libarchive/COPYING @@ -20,7 +20,7 @@ the actual statements in the files are controlling. libarchive/mtree.5 * The following source files are in the public domain: - libarchive/archive_getdate.c + libarchive/archive_parse_date.c * The following source files are triple-licensed with the ability to choose from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 6af50e4e4033..caca7d5cbdb9 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,11 @@ +Jun 01, 2026: libarchive 3.8.1 released + +May 20, 2025: libarchive 3.8.0 released + +Mar 30, 2025: libarchive 3.7.9 released + +Mar 20, 2025: libarchive 3.7.8 released + Oct 13, 2024: libarchive 3.7.7 released Sep 23, 2024: libarchive 3.7.6 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 933de6986425..0d63357292ec 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats: * PWB binary cpio * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) - * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives * XAR archives The library also detects and handles any of the following before evaluating the archive: @@ -120,15 +121,18 @@ The library can create archives in any of the following formats: * PWB binary cpio * shar archives * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives * XAR archives When creating archives, the result can be filtered with any of the following: * uuencode + * base64 * gzip compression * bzip2 compression * compress/LZW compression @@ -241,4 +245,3 @@ questions we are asked about libarchive: appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations. - diff --git a/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh new file mode 100755 index 000000000000..2aa4823fc3d0 --- /dev/null +++ b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -eux + +# Uncommenting these adds a full minute to the CI time +#brew update > /dev/null +#brew upgrade > /dev/null + +# This does an upgrade if the package is already installed +brew install \ + autoconf \ + automake \ + libtool \ + pkg-config \ + cmake \ + xz \ + lz4 \ + zstd \ + libxml2 \ + openssl diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 6bc6eb22e967..2bf1bfa2985a 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c index 884b6c9c4da7..33aa16d07a81 100644 --- a/contrib/libarchive/cpio/test/test_format_newc.c +++ b/contrib/libarchive/cpio/test/test_format_newc.c @@ -189,10 +189,10 @@ DEFINE_TEST(test_format_newc) gid = from_hex(e + 30, 8); /* gid */ assertEqualMem(e + 38, "00000003", 8); /* nlink */ t = from_hex(e + 46, 8); /* mtime */ - failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now, + failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now, (intmax_t)now); assert(t <= now); /* File wasn't created in future. */ - failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2, + failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2, (intmax_t)now - 2); assert(t >= now - 2); /* File was created w/in last 2 secs. */ failure("newc format stores body only with last appearance of a link\n" @@ -219,7 +219,7 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) /* Mode: Group members bits and others bits do not work. */ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); #else @@ -230,7 +230,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000001", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created" - " at t2=%#08jx", (intmax_t)t, (intmax_t)t2); + " at t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -266,7 +266,7 @@ DEFINE_TEST(test_format_newc) #endif t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -300,7 +300,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000003", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); diff --git a/contrib/libarchive/cpio/test/test_option_a.c b/contrib/libarchive/cpio/test/test_option_a.c index e6b87948c65a..28e5b73765d7 100644 --- a/contrib/libarchive/cpio/test/test_option_a.c +++ b/contrib/libarchive/cpio/test/test_option_a.c @@ -52,7 +52,7 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) times.actime = 86400; times.modtime = 86400; #else diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index e8748449514b..2414a4658bb1 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -18,7 +18,7 @@ is_octal(const char *p, size_t l) return (1); } -static long long int +static unsigned long long int from_octal(const char *p, size_t l) { long long int r = 0; @@ -117,7 +117,7 @@ DEFINE_TEST(test_option_c) gid = (int)from_octal(e + 30, 6); assertEqualMem(e + 36, "000001", 6); /* nlink */ failure("file entries should not have rdev set (dev field was 0%o)", - dev); + (unsigned int)dev); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ assert(t <= now); /* File wasn't created in future. */ @@ -133,7 +133,7 @@ DEFINE_TEST(test_option_c) assert(is_octal(e, 76)); /* Entire header is octal digits. */ assertEqualMem(e + 0, "070707", 6); /* Magic */ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */ - assert(ino != from_octal(e + 12, 6)); /* ino */ + assert(ino != (int)from_octal(e + 12, 6)); /* ino */ #if !defined(_WIN32) || defined(__CYGWIN__) /* On Windows, symbolic link and group members bits and * others bits do not work. */ @@ -163,7 +163,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(dev, from_octal(e + 6, 6)); /* Ino must be different from first entry. */ assert(is_octal(e + 12, 6)); /* ino */ - assert(ino != from_octal(e + 12, 6)); + assert(ino != (int)from_octal(e + 12, 6)); #if defined(_WIN32) && !defined(__CYGWIN__) /* Group members bits and others bits do not work. */ assertEqualMem(e + 18, "040777", 6); /* Mode */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5b65475f61e2..002190a24663 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,12 +34,15 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007007 +#define ARCHIVE_VERSION_NUMBER 3008001 #include #include /* for wchar_t */ #include /* For FILE * */ +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* time_t is slated to be removed from public includes in 4.0 */ #include /* For time_t */ +#endif /* * Note: archive.h is for use outside of libarchive; the configuration @@ -63,12 +66,15 @@ #define __LA_INT64_T_DEFINED # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) typedef __int64 la_int64_t; +typedef unsigned __int64 la_uint64_t; # else # include /* ssize_t */ # if defined(_SCO_DS) || defined(__osf__) typedef long long la_int64_t; +typedef unsigned long long la_uint64_t; # else typedef int64_t la_int64_t; +typedef uint64_t la_uint64_t; # endif # endif #endif @@ -94,6 +100,22 @@ typedef ssize_t la_ssize_t; # endif #endif +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for time_t */ +#define __LA_TIME_T time_t +#else +/* Use 64-bits integer types for time_t */ +#define __LA_TIME_T la_int64_t +#endif + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for dev_t */ +#define __LA_DEV_T dev_t +#else +/* Use 64-bits integer types for dev_t */ +#define __LA_DEV_T la_int64_t +#endif + /* Large file support for Android */ #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) #include "android_lf.h" @@ -132,7 +154,7 @@ typedef ssize_t la_ssize_t; #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif -#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define __LA_DEPRECATED __attribute__((deprecated)) #else # define __LA_DEPRECATED @@ -155,7 +177,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.7" +#define ARCHIVE_VERSION_ONLY_STRING "3.8.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -178,6 +200,23 @@ __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); __LA_DECL const char * archive_libzstd_version(void); +__LA_DECL const char * archive_liblzo2_version(void); +__LA_DECL const char * archive_libexpat_version(void); +__LA_DECL const char * archive_libbsdxml_version(void); +__LA_DECL const char * archive_libxml2_version(void); +__LA_DECL const char * archive_mbedtls_version(void); +__LA_DECL const char * archive_nettle_version(void); +__LA_DECL const char * archive_openssl_version(void); +__LA_DECL const char * archive_libmd_version(void); +__LA_DECL const char * archive_commoncrypto_version(void); +__LA_DECL const char * archive_cng_version(void); +__LA_DECL const char * archive_wincrypt_version(void); +__LA_DECL const char * archive_librichacl_version(void); +__LA_DECL const char * archive_libacl_version(void); +__LA_DECL const char * archive_libattr_version(void); +__LA_DECL const char * archive_libiconv_version(void); +__LA_DECL const char * archive_libpcre_version(void); +__LA_DECL const char * archive_libpcre2_version(void); /* Declare our basic types. */ struct archive; @@ -449,6 +488,8 @@ __LA_DECL int archive_read_support_format_by_code(struct archive *, int); __LA_DECL int archive_read_support_format_cab(struct archive *); __LA_DECL int archive_read_support_format_cpio(struct archive *); __LA_DECL int archive_read_support_format_empty(struct archive *); +/* archive_read_support_format_gnutar() is an alias for historical reasons + * of archive_read_support_format_tar(). */ __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_lha(struct archive *); @@ -828,6 +869,10 @@ __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const ch __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +__LA_DECL int archive_write_zip_set_compression_lzma(struct archive *); +__LA_DECL int archive_write_zip_set_compression_xz(struct archive *); +__LA_DECL int archive_write_zip_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_zip_set_compression_zstd(struct archive *); /* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, @@ -1083,6 +1128,10 @@ __LA_DECL int archive_compression(struct archive *) __LA_DEPRECATED; #endif +/* Parses a date string relative to the current time. + * NOTE: This is not intended for general date parsing, and the resulting timestamp should only be used for libarchive. */ +__LA_DECL time_t archive_parse_date(time_t now, const char *datestr); + __LA_DECL int archive_errno(struct archive *); __LA_DECL const char *archive_error_string(struct archive *); __LA_DECL const char *archive_format_name(struct archive *); @@ -1201,8 +1250,10 @@ __LA_DECL int archive_match_include_gname_w(struct archive *, const wchar_t *); /* Utility functions */ +#if ARCHIVE_VERSION_NUMBER < 4000000 /* Convenience function to sort a NULL terminated list of strings */ __LA_DECL int archive_utility_string_sort(char **); +#endif #ifdef __cplusplus } diff --git a/contrib/libarchive/libarchive/archive_acl.c b/contrib/libarchive/libarchive/archive_acl.c index bbb085afe7af..9e71f5ee5610 100644 --- a/contrib/libarchive/libarchive/archive_acl.c +++ b/contrib/libarchive/libarchive/archive_acl.c @@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, /* Set remaining fields to blank. */ for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; + + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } - if (field[0].start != NULL && *(field[0].start) == L'#') { + if (*(field[0].start) == L'#') { /* Comment, skip entry */ continue; } @@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text, for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - if (field[0].start != NULL && *(field[0].start) == '#') { + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } + + if (*(field[0].start) == '#') { /* Comment, skip entry */ continue; } diff --git a/contrib/libarchive/libarchive/archive_acl_private.h b/contrib/libarchive/libarchive/archive_acl_private.h index 2c9b5053430e..54e4439692ed 100644 --- a/contrib/libarchive/libarchive/archive_acl_private.h +++ b/contrib/libarchive/libarchive/archive_acl_private.h @@ -80,4 +80,4 @@ int archive_acl_from_text_l(struct archive_acl *, const char * /* text */, int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */, size_t /* size of text */, int /* type */, struct archive_string_conv *); -#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ +#endif /* !ARCHIVE_ACL_PRIVATE_H_INCLUDED */ diff --git a/contrib/libarchive/libarchive/archive_cmdline.c b/contrib/libarchive/libarchive/archive_cmdline.c index 2e5428cae516..23bb05d6424a 100644 --- a/contrib/libarchive/libarchive/archive_cmdline.c +++ b/contrib/libarchive/libarchive/archive_cmdline.c @@ -71,7 +71,7 @@ get_argument(struct archive_string *as, const char *p) archive_string_empty(as); /* Skip beginning space characters. */ - while (*s != '\0' && *s == ' ') + while (*s == ' ') s++; /* Copy non-space characters. */ while (*s != '\0' && *s != ' ') { diff --git a/contrib/libarchive/libarchive/archive_cryptor_private.h b/contrib/libarchive/libarchive/archive_cryptor_private.h index c13f29260a07..4b3c6c161433 100644 --- a/contrib/libarchive/libarchive/archive_cryptor_private.h +++ b/contrib/libarchive/libarchive/archive_cryptor_private.h @@ -64,6 +64,7 @@ typedef struct { #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA #include +#define ARCHIVE_CRYPTOR_USE_CNG 1 /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS @@ -86,6 +87,7 @@ typedef struct { #include #include #include +#define ARCHIVE_CRYPTOR_USE_MBED 1 #define AES_MAX_KEY_SIZE 32 #define AES_BLOCK_SIZE 16 @@ -105,6 +107,7 @@ typedef struct { #endif #include #include +#define ARCHIVE_CRYPTOR_USE_NETTLE 1 typedef struct { #if NETTLE_VERSION_MAJOR < 3 @@ -125,6 +128,7 @@ typedef struct { #elif defined(HAVE_LIBCRYPTO) #include "archive_openssl_evp_private.h" +#define ARCHIVE_CRYPTOR_USE_OPENSSL 1 #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 @@ -140,6 +144,10 @@ typedef struct { #else +#if defined(_WIN32) && !defined(__CYGWIN__) && !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) +#define ARCHIVE_CRYPTOR_USE_WINCRYPT 1 +#endif + #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3776831b21c9..45fc36af1145 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) +// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards. +// We need to continue supporting this feature regardless, so suppress the warnings. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + static int __archive_md5init(archive_md5_ctx *ctx) { @@ -218,13 +225,46 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif defined(ARCHIVE_CRYPTO_MD5_WIN) + +static int +__archive_md5init(archive_md5_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif +} + +static int +__archive_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_md5final(archive_md5_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 16, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int __archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_starts(ctx) == 0) +#else if (mbedtls_md5_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -234,7 +274,11 @@ static int __archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_update(ctx, indata, insize) == 0) +#else if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -243,7 +287,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata, static int __archive_md5final(archive_md5_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_finish(ctx, md) == 0) { +#else if (mbedtls_md5_finish_ret(ctx, md) == 0) { +#endif mbedtls_md5_free(ctx); return (ARCHIVE_OK); } else { @@ -311,31 +359,6 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_MD5_WIN) - -static int -__archive_md5init(archive_md5_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); -#endif -} - -static int -__archive_md5update(archive_md5_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_md5final(archive_md5_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 16, ctx)); -} - #else static int @@ -420,7 +443,11 @@ static int __archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_starts(ctx) == 0) +#else if (mbedtls_ripemd160_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -430,7 +457,11 @@ static int __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_update(ctx, indata, insize) == 0) +#else if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -439,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, static int __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_finish(ctx, md) == 0) { +#else if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { +#endif mbedtls_ripemd160_free(ctx); return (ARCHIVE_OK); } else { @@ -605,13 +640,42 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) + +static int +__archive_sha1init(archive_sha1_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif +} + +static int +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_sha1final(archive_sha1_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 20, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int __archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_starts(ctx) == 0) +#else if (mbedtls_sha1_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -621,7 +685,11 @@ static int __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_update(ctx, indata, insize) == 0) +#else if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -630,7 +698,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, static int __archive_sha1final(archive_sha1_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_finish(ctx, md) == 0) { +#else if (mbedtls_sha1_finish_ret(ctx, md) == 0) { +#endif mbedtls_sha1_free(ctx); return (ARCHIVE_OK); } else { @@ -698,31 +770,6 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) - -static int -__archive_sha1init(archive_sha1_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); -#endif -} - -static int -__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_sha1final(archive_sha1_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 20, ctx)); -} - #else static int @@ -873,13 +920,42 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_WIN) + +static int +__archive_sha256init(archive_sha256_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif +} + +static int +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} *** 35191 LINES SKIPPED *** From nobody Thu Jun 19 22:47:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNbN820jfz5y3wR; Thu, 19 Jun 2025 22:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNbN75x79z41ZX; Thu, 19 Jun 2025 22:47:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750373255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8T3JY4bRwsbLz9HvetWBiC5SVw+mK6WrcI5mfcKDJ9o=; b=Z+D8LBeXqy5qSIG1BAMRM2g2VK0MYTjkDsjv8NGru0EAWbPQL8C05ESnxuBKaAPHu4M7Bh PukmYDuoFTTPdcJUBpIk/eKhYf6I4ErZS3zUIXTk+71w5NwnnsuKAt+6BmXC9sNX2OZlJw NU3HlqLsLZx4LAVaRZjmNTeLGJ6vVn0krF/vktqGBqBK8J+bTcyT0vek8eT8uyN784OHAu bcCPpKMa6UvkP6pHB7Gkktm/kuZRWkMqXYDxiyLh5/ODWvN68CUoWMWIUjk0Zb+3yWv+rl Bn5IPH+rNFmHiOy7Yxle7nEq+aD3cbtEKaOLes8oPvG3/gCu69ZjUdGGOR/7Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750373255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8T3JY4bRwsbLz9HvetWBiC5SVw+mK6WrcI5mfcKDJ9o=; b=Z2S32vzSWarj5o8y0Ntw0+dAqiLZaohdbKuxHaHrbSVT7nu1bpdka5tFjEWI7tGzaii06C ferIqyEQ8n7uJhnm9pv2XhMA7ZVs15tWB6IXtuh1mUxOBUdN5FWIe8pS5mELVXMo4MVmTc 9f4iuNI8MTa2ui7aUwYu0btmWtO137hVo23bca52kJ7KB7Wc1TnHLGIZLg6ZTtECWPaBZj CM/yKdAtJJsvIz7N9/e5pt+e/vSI21ULZEmG+wXdZHqy8TwFJoejtc4Hapen0KlcGpt4Iq kiL2TiUOwPoDa2keBQ6xI/yKjiNHsXyGCwk9n55l0Krmp+EriLIfV6u4CNoE1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750373255; a=rsa-sha256; cv=none; b=clNU0KK3zFl6VRf40Tq3ZuMtVEODMNyrRg0lZrFtqxDpjx1UC5yBewKWHd6MAp3nMqU8e8 32jXoVXS03SR1NRXBiT43bZZb3j+T+0F7QYChNFO7yb0dT+hstpz6IctqJLu2Y14e9nNGf /lO9YXMO4T9dUDXvADC2lMQnXNicm2QxfyDm/qeL7V3k4OMqEetnNxTNfaW8KgjT0fGhPO fULCLYn9MVbR2dHtAdpf5LUSncti0sLU8SMPnjhDR5GURrZnijyaVlJeBHfNiu9ZNnUq46 VMyS+ywrbfd1a+Rhr2a8rwP0OSl4DONa4HlMRfJMGy7LJ/45A3TDWfQ+Qr4oAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNbN75KkPz3VD; Thu, 19 Jun 2025 22:47: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 55JMlZEH045688; Thu, 19 Jun 2025 22:47:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55JMlZ17045685; Thu, 19 Jun 2025 22:47:35 GMT (envelope-from git) Date: Thu, 19 Jun 2025 22:47:35 GMT Message-Id: <202506192247.55JMlZ17045685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: bcaefdc4267a - stable/14 - libarchive: fix duplicate entry in tests Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bcaefdc4267a1ed0e4cc5a4691fa0b7e28b7e854 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=bcaefdc4267a1ed0e4cc5a4691fa0b7e28b7e854 commit bcaefdc4267a1ed0e4cc5a4691fa0b7e28b7e854 Author: Martin Matuska AuthorDate: 2025-06-02 12:55:00 +0000 Commit: Martin Matuska CommitDate: 2025-06-19 22:17:49 +0000 libarchive: fix duplicate entry in tests Makefile Reported by: des MFC after: 2 weeks (together with 2e113ef82) (cherry picked from commit 331f2c1c46584510fa9104c86f31f44ece3838c5) --- lib/libarchive/tests/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index fb20d954537e..07c5fe24dd30 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -493,7 +493,6 @@ ${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm64.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_powerpc.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_riscv.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_lzma2_sparc.7z.uu -${PACKAGE}FILES+= test_read_format_7zip_lzma2_powerpc.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_malformed.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_malformed2.7z.uu ${PACKAGE}FILES+= test_read_format_7zip_packinfo_digests.7z.uu From nobody Thu Jun 19 22:47:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNbN926TJz5y4Dg; Thu, 19 Jun 2025 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNbN86Sssz41Zb; Thu, 19 Jun 2025 22: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=1750373256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wIDODDXnLtrTsU0NQqTTlnP5d8bWZykooFXmdzPg2J4=; b=v8EBEGEC94V5Fix8uTJlWVW0bIT0ap73ny42d70YX1ROei85t36UYYxHWLsT7vbQ9Snw+T kiy0IEz+fxUv5UxbZnaL3hHPDBIIpChbLeR47gV1ilFf5F2oYgJN8TTDkqsmfbhCOxGA26 RIsc0UoP9fuIJWwtmmc3I5fZBUOuvOVli5Ae9C2bINgZfdwcr+dn5KwvJTpMAheITiZKYL KTXC+mv2ZNxnhHNlWKixWLi7k/TLw757jVXrpDL6hybZvs0KbDP5cFG0CrcKyDqoZC8q1Z XizR7ZLDK6Kg5DKGbr74/KwYYbUKq+VB/rrehEWxCZyoXn7wILfJFxv9J01i/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750373256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wIDODDXnLtrTsU0NQqTTlnP5d8bWZykooFXmdzPg2J4=; b=myUN1Z3XmV7a5wh67qOkX6PiwSpxjx5MwHtFm6/NFIR8OE9gZF4KaY2HjOORuzOCQsrhZr pbDdIPJLYTz4i11psxr+Hi/LKe9Rhy1KwNEkSKx9D1cclaOmtUJNg3bMnMKYXUXLBl4WxT 0D96bIN8CWDuyspFDb4aWba41DLV4bsAapEb7SFPMhv935ux7cB01h3WB9k+Sas9EKQcf+ 88q0R4WCVGVaZz4TstZ8vtCm47CVOEGrqXM8Ads2odMJsmR6552CBmNCjckoUGfV4YywKx uqfK3tr0fvTAT7b1ftNWiyxYDkRrdaOQtkkAtpirTI4xV1fcmrI3wYo1EzqSXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750373256; a=rsa-sha256; cv=none; b=FMfJrWMm4eiTEf9GWJ5728cyDcBZygJnujJhmnZYwwbeKaq+uw4/AjOEY/+s3FTmnuHe7o qhQsaxwPM+xTEVW2DZrQy4Fa7F6D/fkj6/8CQRkJLx6pE9hwleZYGxkDGMoRPvCVpq5dsd Wroi+gja5PKrIUHmYxspU1+1UCLI2F3pGJpnczYt/PvkYofC6uc35nALW82GDqlQrkif1T trclSTLeuK3NYorXxM3dW7JvVfuSPwHAzzKvTUCl+cAy/L3eY/qwuEhEzs9T+A0ELjeA4l pDC+SZtMap9m7i61DsBJZDwmPkwnFPaCkTd5MV1XMXfnzn0od8OHkPmy8Gh9ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNbN85zRnz3sR; Thu, 19 Jun 2025 22: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 55JMlaIe045724; Thu, 19 Jun 2025 22: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 55JMlaxU045720; Thu, 19 Jun 2025 22:47:36 GMT (envelope-from git) Date: Thu, 19 Jun 2025 22:47:36 GMT Message-Id: <202506192247.55JMlaxU045720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 9a20657ac79d - stable/14 - libarchive/test: fix build when memcpy() is a macro List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a20657ac79d206723f2841683fa3fa6f364b37f Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9a20657ac79d206723f2841683fa3fa6f364b37f commit 9a20657ac79d206723f2841683fa3fa6f364b37f Author: Kyle Evans AuthorDate: 2025-06-17 14:17:59 +0000 Commit: Martin Matuska CommitDate: 2025-06-19 22:17:57 +0000 libarchive/test: fix build when memcpy() is a macro After importing the latest libarchive into FreeBSD, Shawn Webb @ HardenedBSD noted that the test build is broken when FORTIFY_SOURCE=2 while building the base system. Braced initializer lists are a special case that need some extra fun parentheses when we're dealing with the preprocessor. While it's not a particularly common setup, the extra parentheses don't really hurt readability all that much so it's worth fixing for wider compatibility. This corresponds to libarchive PR #2660 Reported by: Shawn Webb (HardenedBSD) (cherry picked from commit e2a605e7ab7ff83d15b1a0b994223768169b0f1e) --- .../test/test_write_format_mtree_preset_digests.c | 68 +++++++++++----------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c b/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c index cdf789b4b002..bb8ddf49431b 100644 --- a/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c +++ b/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c @@ -326,10 +326,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -419,10 +419,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -519,10 +519,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -710,10 +710,10 @@ DEFINE_TEST(test_write_format_mtree_digests_rmd160_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.rmd160, (unsigned char[]) { + memcpy(ed.rmd160, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.rmd160)); + }), sizeof(ed.rmd160)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -810,10 +810,10 @@ DEFINE_TEST(test_write_format_mtree_digests_rmd160_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.rmd160, (unsigned char[]) { + memcpy(ed.rmd160, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.rmd160)); + }), sizeof(ed.rmd160)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -910,10 +910,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1003,10 +1003,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1103,10 +1103,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1203,12 +1203,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1298,12 +1298,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1400,12 +1400,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1502,13 +1502,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1598,13 +1598,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1701,13 +1701,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1804,7 +1804,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -1812,7 +1812,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_no_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1903,7 +1903,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -1911,7 +1911,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_empty_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -2009,7 +2009,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -2017,7 +2017,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_non_empty_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); From nobody Fri Jun 20 13:52:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzRx72Z7z5y41S; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzRx3crRz3Xcr; Fri, 20 Jun 2025 13:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGvLBeEd2pokjcacevf/YubwxKkGb4sTN/WYIoR+Qpo=; b=Ac6j2ih5NjaOTdHUioloVzMC96n/s3EQE8EGZuuRmn07z8DFBjguO5hwQ0TNQlT1YxiueO 6Q5hQ+cTwXlzYp4XAVaDugUwNbRP5RxJA39EH7VwKz8caNWB3G8C99JA3rxEBfvijiBYXx S8R1mrsgEVMPseCLSsJPA+9PlXzGbD73t65yJoncrCudyrPNBU4gW334/4LEFkso+QSEDl 6UiNNZzH0bKiJnw5tM+10wxLkixZRkncBks8rBCxIOyZGWQtnNPcr/1wPaqStPkDrPpxYc sWOCZfy/vww5yYltWfiuMNAILDKqJsJMNpC4jQLQ6PVDdeh6K/Nh0lDPF/OSdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGvLBeEd2pokjcacevf/YubwxKkGb4sTN/WYIoR+Qpo=; b=wI9RO+CS/oMXrfIkafkH/3ZfFttRh+pp2Ef3xvaardJHNUvVfOmfekJDHFgOtMUtzXjyqD aQMaCVOT0Ndkqa0Rd+uYu+noGY8kwNYaphUQs8ms550BYG0FwYvFt4EqmMU6Q5Oh98WMjs OtPm1m9pQ8M92Uso5sHfcu5rhIhaD1Adfol45WEbwEGcmGBOr2P1bHbkPIo51K6Anolzn1 2R0Qk8BpYBcg5TpEaYrPhbwMz4rMrYGU5VYl6d4eIu4sxmPAozPAjU5Zm5VHu4sCT7K+Mk 7EcLrD72mIer3uYYc+bAPSr2/m4bcl3aVA86ECy55aucEi76jUHiIjoGXOOWUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427533; a=rsa-sha256; cv=none; b=apN+crFVunglisZwbrxRsKVmy4IvL8uxVW5+EYbyUikSrsUtoj/FePGILH2NVXdt6Q0FEM 2jyyFFX+QL0StLhta+mJR+6VpgpjoXtcwFBUHfiwPWkWvmyMBbX87KN2Iip1eDV9xbHiOv d9FDuhNv0j9kcxVUskgmVJhI/WJW4rt1Bmg0A89Ek+aWUYsuBNQ8yuxoHMi4sXVUJGkGET 4iX4mhAAAp30mGHvt+BvWvRoZaWtjQVQicZMU4uSV6doduE1u0P4fe7LRpKNa+X2mkARnX kFUO97xSSO9qaJkuF+TQdv14sMcFIZWNssVYlN1boasOmGKQCGHk35ikhuNy6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzRx2yTYznsw; Fri, 20 Jun 2025 13:52: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 55KDqDnj057744; Fri, 20 Jun 2025 13:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqDFo057741; Fri, 20 Jun 2025 13:52:13 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:13 GMT Message-Id: <202506201352.55KDqDFo057741@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: 2060337c0937 - stable/14 - file: Qualify pointers to capsicum rights as const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 2060337c0937f08d9960d629eb59ce737339640c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2060337c0937f08d9960d629eb59ce737339640c commit 2060337c0937f08d9960d629eb59ce737339640c Author: Mark Johnston AuthorDate: 2025-05-20 20:19:30 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 file: Qualify pointers to capsicum rights as const File descriptor lookup routines typically take a set of capsicum rights as input to the lookup, so that the fd's rights can be atomically checked. This set should be qualified with const. No functional change intended. Reviewed by: olce, oshogbo, brooks, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50419 (cherry picked from commit 5319cb21610ad947c56fd0cd4f18ef5b58bc8db7) --- sys/kern/kern_descrip.c | 52 +++++++++++++++++++++++++++--------------------- sys/kern/sys_procdesc.c | 5 +++-- sys/kern/uipc_mqueue.c | 5 +++-- sys/kern/uipc_sem.c | 6 +++--- sys/kern/uipc_syscalls.c | 7 ++++--- sys/kern/vfs_syscalls.c | 5 +++-- sys/sys/file.h | 21 +++++++++---------- sys/sys/filedesc.h | 19 +++++++++--------- sys/sys/namei.h | 4 ++-- sys/sys/procdesc.h | 6 ++++-- sys/sys/socketvar.h | 4 ++-- 11 files changed, 74 insertions(+), 60 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 56e8a14f71b3..30be63d8e5d5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -111,7 +111,8 @@ static void fdgrowtable_exp(struct filedesc *fdp, int nfd); static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); static int fget_unlocked_seq(struct thread *td, int fd, - cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp); + const cap_rights_t *needrightsp, struct file **fpp, + seqc_t *seqp); static int getmaxfd(struct thread *td); static u_long *filecaps_copy_prep(const struct filecaps *src); static void filecaps_copy_finish(const struct filecaps *src, @@ -2879,7 +2880,7 @@ finit_vnode(struct file *fp, u_int flag, void *data, const struct fileops *ops) } int -fget_cap_noref(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, +fget_cap_noref(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp) { struct filedescent *fde; @@ -2912,7 +2913,7 @@ out: #ifdef CAPABILITIES int -fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, +fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp) { struct filedesc *fdp = td->td_proc->p_fd; @@ -2952,7 +2953,7 @@ get_locked: } #else int -fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, +fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp) { int error; @@ -3223,7 +3224,7 @@ out_free: */ #ifdef CAPABILITIES static int -fget_unlocked_seq(struct thread *td, int fd, cap_rights_t *needrightsp, +fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp) { struct filedesc *fdp; @@ -3279,7 +3280,7 @@ fget_unlocked_seq(struct thread *td, int fd, cap_rights_t *needrightsp, } #else static int -fget_unlocked_seq(struct thread *td, int fd, cap_rights_t *needrightsp, +fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp __unused) { struct filedesc *fdp; @@ -3322,7 +3323,7 @@ fget_unlocked_seq(struct thread *td, int fd, cap_rights_t *needrightsp, * racing with itself. */ int -fget_unlocked(struct thread *td, int fd, cap_rights_t *needrightsp, +fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp) { struct filedesc *fdp; @@ -3391,7 +3392,7 @@ out_fallback: */ #ifdef CAPABILITIES int -fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, +fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp) { const struct filedescent *fde; @@ -3421,7 +3422,7 @@ fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, } #else int -fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, +fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp) { struct file *fp; @@ -3457,7 +3458,7 @@ fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, */ static __inline int _fget(struct thread *td, int fd, struct file **fpp, int flags, - cap_rights_t *needrightsp) + const cap_rights_t *needrightsp) { struct file *fp; int error; @@ -3503,15 +3504,15 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, } int -fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +fget(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp) { return (_fget(td, fd, fpp, 0, rightsp)); } int -fget_mmap(struct thread *td, int fd, cap_rights_t *rightsp, vm_prot_t *maxprotp, - struct file **fpp) +fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp, + vm_prot_t *maxprotp, struct file **fpp) { int error; #ifndef CAPABILITIES @@ -3554,22 +3555,24 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rightsp, vm_prot_t *maxprotp, } int -fget_read(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +fget_read(struct thread *td, int fd, const cap_rights_t *rightsp, + struct file **fpp) { return (_fget(td, fd, fpp, FREAD, rightsp)); } int -fget_write(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +fget_write(struct thread *td, int fd, const cap_rights_t *rightsp, + struct file **fpp) { return (_fget(td, fd, fpp, FWRITE, rightsp)); } int -fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, int needfcntl, - struct file **fpp) +fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp, + int needfcntl, struct file **fpp) { #ifndef CAPABILITIES return (fget_unlocked(td, fd, rightsp, fpp)); @@ -3607,7 +3610,7 @@ fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, int needfcntl, * XXX: what about the unused flags ? */ static __inline int -_fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp, +_fgetvp(struct thread *td, int fd, int flags, const cap_rights_t *needrightsp, struct vnode **vpp) { struct file *fp; @@ -3629,14 +3632,15 @@ _fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp, } int -fgetvp(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp) +fgetvp(struct thread *td, int fd, const cap_rights_t *rightsp, + struct vnode **vpp) { return (_fgetvp(td, fd, 0, rightsp, vpp)); } int -fgetvp_rights(struct thread *td, int fd, cap_rights_t *needrightsp, +fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp, struct filecaps *havecaps, struct vnode **vpp) { struct filecaps caps; @@ -3668,14 +3672,16 @@ out: } int -fgetvp_read(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp) +fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp, + struct vnode **vpp) { return (_fgetvp(td, fd, FREAD, rightsp, vpp)); } int -fgetvp_exec(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp) +fgetvp_exec(struct thread *td, int fd, const cap_rights_t *rightsp, + struct vnode **vpp) { return (_fgetvp(td, fd, FEXEC, rightsp, vpp)); @@ -3683,7 +3689,7 @@ fgetvp_exec(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp #ifdef notyet int -fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, +fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp) { diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c index dbf8e579530f..3221885c9277 100644 --- a/sys/kern/sys_procdesc.c +++ b/sys/kern/sys_procdesc.c @@ -121,7 +121,7 @@ static const struct fileops procdesc_ops = { * died. */ int -procdesc_find(struct thread *td, int fd, cap_rights_t *rightsp, +procdesc_find(struct thread *td, int fd, const cap_rights_t *rightsp, struct proc **p) { struct procdesc *pd; @@ -168,7 +168,8 @@ procdesc_pid(struct file *fp_procdesc) * Retrieve the PID associated with a process descriptor. */ int -kern_pdgetpid(struct thread *td, int fd, cap_rights_t *rightsp, pid_t *pidp) +kern_pdgetpid(struct thread *td, int fd, const cap_rights_t *rightsp, + pid_t *pidp) { struct file *fp; int error; diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 7dd0f9796682..75daf94b9849 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -2155,13 +2155,14 @@ sys_kmq_unlink(struct thread *td, struct kmq_unlink_args *uap) return (error); } -typedef int (*_fgetf)(struct thread *, int, cap_rights_t *, struct file **); +typedef int (*_fgetf)(struct thread *, int, const cap_rights_t *, + struct file **); /* * Get message queue by giving file slot */ static int -_getmq(struct thread *td, int fd, cap_rights_t *rightsp, _fgetf func, +_getmq(struct thread *td, int fd, const cap_rights_t *rightsp, _fgetf func, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq) { struct mqfs_node *pn; diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index 35ca9a9fb06e..2fc4d3e9cfb3 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -123,8 +123,8 @@ static int ksem_create(struct thread *td, const char *path, semid_t *semidp, mode_t mode, unsigned int value, int flags, int compat32); static void ksem_drop(struct ksem *ks); -static int ksem_get(struct thread *td, semid_t id, cap_rights_t *rightsp, - struct file **fpp); +static int ksem_get(struct thread *td, semid_t id, + const cap_rights_t *rightsp, struct file **fpp); static struct ksem *ksem_hold(struct ksem *ks); static void ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks); static struct ksem *ksem_lookup(char *path, Fnv32_t fnv); @@ -587,7 +587,7 @@ ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, } static int -ksem_get(struct thread *td, semid_t id, cap_rights_t *rightsp, +ksem_get(struct thread *td, semid_t id, const cap_rights_t *rightsp, struct file **fpp) { struct ksem *ks; diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 6121bde4c574..4dca0522f707 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -87,7 +87,7 @@ static int sockargs(struct mbuf **, char *, socklen_t, int); * A reference on the file entry is held upon returning. */ int -getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, +getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp, struct filecaps *havecapsp) { struct file *fp; @@ -107,7 +107,8 @@ getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, } int -getsock(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +getsock(struct thread *td, int fd, const cap_rights_t *rightsp, + struct file **fpp) { struct file *fp; int error; @@ -737,7 +738,7 @@ kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct uio auio; struct iovec *iov; struct socket *so; - cap_rights_t *rights; + const cap_rights_t *rights; #ifdef KTRACE struct uio *ktruio = NULL; #endif diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 02908f76ef85..d2a7b4d9d364 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4325,7 +4325,7 @@ out: * semantics. */ int -getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, +getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp) { struct file *fp; @@ -4363,7 +4363,8 @@ getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, * A reference on the file entry is held upon returning. */ int -getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, + struct file **fpp) { int error; diff --git a/sys/sys/file.h b/sys/sys/file.h index 07f6bbd5bcae..bad161d5d46b 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -257,14 +257,15 @@ extern const struct fileops socketops; extern int maxfiles; /* kernel limit on number of open files */ extern int maxfilesperproc; /* per process limit on number of open files */ -int fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp); -int fget_mmap(struct thread *td, int fd, cap_rights_t *rightsp, +int fget(struct thread *td, int fd, const cap_rights_t *rightsp, + struct file **fpp); +int fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp, vm_prot_t *maxprotp, struct file **fpp); -int fget_read(struct thread *td, int fd, cap_rights_t *rightsp, +int fget_read(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); -int fget_write(struct thread *td, int fd, cap_rights_t *rightsp, +int fget_write(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); -int fget_fcntl(struct thread *td, int fd, cap_rights_t *rightsp, +int fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp, int needfcntl, struct file **fpp); int _fdrop(struct file *fp, struct thread *td); int fget_remote(struct thread *td, struct proc *p, int fd, struct file **fpp); @@ -289,15 +290,15 @@ int file_kcmp_generic(struct file *fp1, struct file *fp2, struct thread *td); void finit(struct file *, u_int, short, void *, const struct fileops *); void finit_vnode(struct file *, u_int, void *, const struct fileops *); -int fgetvp(struct thread *td, int fd, cap_rights_t *rightsp, +int fgetvp(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_exec(struct thread *td, int fd, cap_rights_t *rightsp, +int fgetvp_exec(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_rights(struct thread *td, int fd, cap_rights_t *needrightsp, +int fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp, struct filecaps *havecaps, struct vnode **vpp); -int fgetvp_read(struct thread *td, int fd, cap_rights_t *rightsp, +int fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, +int fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch); int fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index c0fb4e3834e1..ecb8c58e5d29 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -277,22 +277,23 @@ struct filedesc_to_leader * struct filedesc_to_leader * filedesc_to_leader_share(struct filedesc_to_leader *fdtol, struct filedesc *fdp); -int getvnode(struct thread *td, int fd, cap_rights_t *rightsp, +int getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); -int getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, +int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); -int fget_cap_noref(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp); -int fget_cap(struct thread *td, int fd, cap_rights_t *needrightsp, +int fget_cap_noref(struct filedesc *fdp, int fd, + const cap_rights_t *needrightsp, struct file **fpp, + struct filecaps *havecapsp); +int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp); /* Return a referenced file from an unlocked descriptor. */ -int fget_unlocked(struct thread *td, int fd, cap_rights_t *needrightsp, - struct file **fpp); +int fget_unlocked(struct thread *td, int fd, + const cap_rights_t *needrightsp, struct file **fpp); /* Return a file pointer without a ref. FILEDESC_IS_ONLY_USER must be true. */ -int fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - struct file **fpp); +int fget_only_user(struct filedesc *fdp, int fd, + const cap_rights_t *needrightsp, struct file **fpp); #define fput_only_user(fdp, fp) ({ \ MPASS(FILEDESC_IS_ONLY_USER(fdp)); \ MPASS(refcount_load(&fp->f_count) > 0); \ diff --git a/sys/sys/namei.h b/sys/sys/namei.h index f6279700e735..3db7b8e13749 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -70,7 +70,7 @@ struct nameidata { */ const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ - cap_rights_t *ni_rightsneeded; /* rights required to look up vnode */ + const cap_rights_t *ni_rightsneeded; /* rights needed to look up vnode */ /* * Arguments to lookup. */ @@ -243,7 +243,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp) \ do { \ struct nameidata *_ndp = (ndp); \ - cap_rights_t *_rightsp = (rightsp); \ + const cap_rights_t *_rightsp = (rightsp); \ MPASS(_rightsp != NULL); \ NDINIT_PREFILL(_ndp); \ NDINIT_DBG(_ndp); \ diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h index ca26d65d5417..4e8b06fb7377 100644 --- a/sys/sys/procdesc.h +++ b/sys/sys/procdesc.h @@ -94,8 +94,10 @@ struct procdesc { * In-kernel interfaces to process descriptors. */ int procdesc_exit(struct proc *); -int procdesc_find(struct thread *, int fd, cap_rights_t *, struct proc **); -int kern_pdgetpid(struct thread *, int fd, cap_rights_t *, pid_t *pidp); +int procdesc_find(struct thread *, int fd, const cap_rights_t *, + struct proc **); +int kern_pdgetpid(struct thread *, int fd, const cap_rights_t *, + pid_t *pidp); void procdesc_new(struct proc *, int); void procdesc_finit(struct procdesc *, struct file *); pid_t procdesc_pid(struct file *); diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 40fdd142525f..1efff4a18bee 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -490,9 +490,9 @@ struct uio; */ int getsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr, size_t len); -int getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, +int getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp, struct filecaps *havecaps); -int getsock(struct thread *td, int fd, cap_rights_t *rightsp, +int getsock(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); void soabort(struct socket *so); int soaccept(struct socket *so, struct sockaddr **nam); From nobody Fri Jun 20 13:52:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzRy5rGyz5y448; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzRy3hfWz3XZw; Fri, 20 Jun 2025 13:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBYhbeFwApHu/Mq3b3OIXTydbMopoe3XiIBj2RNykuQ=; b=QACbGsutDf+aTwdBnFZ4Wq9/2rz5L54mboTfw5978/nF4PxqarL74i+TI/s/TPOxUdqD45 cWrvVe+IXPTvZopwLVN1VPQovFTMwpUXqHldhc75/aqCyZ9zVXCu5nLvyPtXTQbaphTY5c gNbXeBwi3cNuLvMXa/p76mA7Rqc6knSsicqvJfWWuJUb6VQGZ0MJH+eH8p6kqiCjL5wpc4 6MFahjKuoANI6tVROx3su8rngKtbuFxDuiONtcqR89FpGnt06VfapebTGbgxOKXDyMG4jm udOYBj/VB6grDurjnS2cvuP8u6sf7/1q5OvYm4qjLwbdGaGFf/3qUxUjaUcn/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBYhbeFwApHu/Mq3b3OIXTydbMopoe3XiIBj2RNykuQ=; b=fogEk8L+n9xSWHmFHxUhX97x+pqifKoe+AhU+hzAVxsks1Nr27k7YTrWk+WPZC+iKVd3wU 6oqRIl8qx4ZvqBAJPEd7H0Er0JTu3FdpGdE4Klwb9QnO7om3IUrvXK7T0JdJHpE2ui8/Za j89DTR6lZ7btadnzQTaguN+2TYraxAkKbpEGS4DVAk+wJAJnD1JCvAAjIoiWdYIgVm03qN c7Cf+tnWM3aYBMkmwbjiXezc5KO2zfbBk0wZm2HRFmI8W0J1SgkXOg4LeIUAP4VIa3GMr0 f625vOB80JKbcbbx/rJX7GUrZBc/M2+0rVNJiUsbTUka9K9oOjT07uPtSGj9YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427534; a=rsa-sha256; cv=none; b=yV7G3k4Ojysik9sttCGYOIWRGODdOqfkKOOwyCUZafvtz4W/znV1d4XWpxJGOMZ5ANKsyI qxz+iz9yYTeAlHbWovldTZJQCyU3oyyEpX/I/RrDB2pLO5hWNmF20YBuYQGWDoNooKuRJK P+uXjD9hH8NY5zlgzIuRf+n+FkWr33LkUGzX1lNNq9AyTBLCWOEJfM99XRW1JVlIWQg8N2 YkbU3+jmyFfYxoq+gUMjLKEiQCiW0cfMWkFFDwr2p5LHD03ntR4kdXVeWtUPGj2IlQpWXB bTj6Em4v2WjCMw63vcsGJJxzZZ+JQB/fIEzlR05F4e9ch6e8rqW8iLVP8UsyPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzRy3Gf6znhY; Fri, 20 Jun 2025 13:52: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 55KDqExX057776; Fri, 20 Jun 2025 13:52:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqEDX057773; Fri, 20 Jun 2025 13:52:14 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:14 GMT Message-Id: <202506201352.55KDqEDX057773@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: 1225d1a7c948 - stable/14 - capsicum: Statically initialize commonly used capability rights List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 1225d1a7c948dd1f1ef6afce231d276a8269c36e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1225d1a7c948dd1f1ef6afce231d276a8269c36e commit 1225d1a7c948dd1f1ef6afce231d276a8269c36e Author: Mark Johnston AuthorDate: 2025-05-20 20:19:47 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 capsicum: Statically initialize commonly used capability rights Rather than initializing all of these sets during boot, define a macro which can do so at compile-time. This lets us get rid of the silly sysinit and furthermore allows the sets to live in .rodata, where they ought to be anyway. The CAP_RIGHTS_INITIALIZER2 macro can create a set out of up to two capsicum rights. This could be made more general, but we currently don't have any use for a more abstract implementation, so just keep it simple for now. Also remove the unused cap_chflags_rights symbol. No functional change intended. Reviewed by: olce, oshogbo, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50420 (cherry picked from commit 1f922483cc993e282329ffed9096f437799b630e) --- sys/kern/subr_capability.c | 153 ++++++++++++++++----------------------------- sys/sys/caprights.h | 90 +++++++++++++------------- sys/sys/capsicum.h | 18 ++++++ 3 files changed, 117 insertions(+), 144 deletions(-) diff --git a/sys/kern/subr_capability.c b/sys/kern/subr_capability.c index 1f3a181a91cb..b4fedb402b43 100644 --- a/sys/kern/subr_capability.c +++ b/sys/kern/subr_capability.c @@ -50,105 +50,60 @@ #ifdef _KERNEL #define assert(exp) KASSERT((exp), ("%s:%u", __func__, __LINE__)) -__read_mostly cap_rights_t cap_accept_rights; -__read_mostly cap_rights_t cap_bind_rights; -__read_mostly cap_rights_t cap_chflags_rights; -__read_mostly cap_rights_t cap_connect_rights; -__read_mostly cap_rights_t cap_event_rights; -__read_mostly cap_rights_t cap_fchdir_rights; -__read_mostly cap_rights_t cap_fchflags_rights; -__read_mostly cap_rights_t cap_fchmod_rights; -__read_mostly cap_rights_t cap_fchown_rights; -__read_mostly cap_rights_t cap_fcntl_rights; -__read_mostly cap_rights_t cap_fexecve_rights; -__read_mostly cap_rights_t cap_flock_rights; -__read_mostly cap_rights_t cap_fpathconf_rights; -__read_mostly cap_rights_t cap_fstat_rights; -__read_mostly cap_rights_t cap_fstatfs_rights; -__read_mostly cap_rights_t cap_fsync_rights; -__read_mostly cap_rights_t cap_ftruncate_rights; -__read_mostly cap_rights_t cap_futimes_rights; -__read_mostly cap_rights_t cap_getpeername_rights; -__read_mostly cap_rights_t cap_getsockopt_rights; -__read_mostly cap_rights_t cap_getsockname_rights; -__read_mostly cap_rights_t cap_ioctl_rights; -__read_mostly cap_rights_t cap_listen_rights; -__read_mostly cap_rights_t cap_linkat_source_rights; -__read_mostly cap_rights_t cap_linkat_target_rights; -__read_mostly cap_rights_t cap_mmap_rights; -__read_mostly cap_rights_t cap_mkdirat_rights; -__read_mostly cap_rights_t cap_mkfifoat_rights; -__read_mostly cap_rights_t cap_mknodat_rights; -__read_mostly cap_rights_t cap_pdgetpid_rights; -__read_mostly cap_rights_t cap_pdkill_rights; -__read_mostly cap_rights_t cap_pread_rights; -__read_mostly cap_rights_t cap_pwrite_rights; -__read_mostly cap_rights_t cap_read_rights; -__read_mostly cap_rights_t cap_recv_rights; -__read_mostly cap_rights_t cap_renameat_source_rights; -__read_mostly cap_rights_t cap_renameat_target_rights; -__read_mostly cap_rights_t cap_seek_rights; -__read_mostly cap_rights_t cap_send_rights; -__read_mostly cap_rights_t cap_send_connect_rights; -__read_mostly cap_rights_t cap_setsockopt_rights; -__read_mostly cap_rights_t cap_shutdown_rights; -__read_mostly cap_rights_t cap_symlinkat_rights; -__read_mostly cap_rights_t cap_unlinkat_rights; -__read_mostly cap_rights_t cap_write_rights; -__read_mostly cap_rights_t cap_no_rights; - -static void -cap_rights_sysinit(void *arg) -{ - cap_rights_init_one(&cap_accept_rights, CAP_ACCEPT); - cap_rights_init_one(&cap_bind_rights, CAP_BIND); - cap_rights_init_one(&cap_connect_rights, CAP_CONNECT); - cap_rights_init_one(&cap_event_rights, CAP_EVENT); - cap_rights_init_one(&cap_fchdir_rights, CAP_FCHDIR); - cap_rights_init_one(&cap_fchflags_rights, CAP_FCHFLAGS); - cap_rights_init_one(&cap_fchmod_rights, CAP_FCHMOD); - cap_rights_init_one(&cap_fchown_rights, CAP_FCHOWN); - cap_rights_init_one(&cap_fcntl_rights, CAP_FCNTL); - cap_rights_init_one(&cap_fexecve_rights, CAP_FEXECVE); - cap_rights_init_one(&cap_flock_rights, CAP_FLOCK); - cap_rights_init_one(&cap_fpathconf_rights, CAP_FPATHCONF); - cap_rights_init_one(&cap_fstat_rights, CAP_FSTAT); - cap_rights_init_one(&cap_fstatfs_rights, CAP_FSTATFS); - cap_rights_init_one(&cap_fsync_rights, CAP_FSYNC); - cap_rights_init_one(&cap_ftruncate_rights, CAP_FTRUNCATE); - cap_rights_init_one(&cap_futimes_rights, CAP_FUTIMES); - cap_rights_init_one(&cap_getpeername_rights, CAP_GETPEERNAME); - cap_rights_init_one(&cap_getsockname_rights, CAP_GETSOCKNAME); - cap_rights_init_one(&cap_getsockopt_rights, CAP_GETSOCKOPT); - cap_rights_init_one(&cap_ioctl_rights, CAP_IOCTL); - cap_rights_init_one(&cap_linkat_source_rights, CAP_LINKAT_SOURCE); - cap_rights_init_one(&cap_linkat_target_rights, CAP_LINKAT_TARGET); - cap_rights_init_one(&cap_listen_rights, CAP_LISTEN); - cap_rights_init_one(&cap_mkdirat_rights, CAP_MKDIRAT); - cap_rights_init_one(&cap_mkfifoat_rights, CAP_MKFIFOAT); - cap_rights_init_one(&cap_mknodat_rights, CAP_MKNODAT); - cap_rights_init_one(&cap_mmap_rights, CAP_MMAP); - cap_rights_init_one(&cap_pdgetpid_rights, CAP_PDGETPID); - cap_rights_init_one(&cap_pdkill_rights, CAP_PDKILL); - cap_rights_init_one(&cap_pread_rights, CAP_PREAD); - cap_rights_init_one(&cap_pwrite_rights, CAP_PWRITE); - cap_rights_init_one(&cap_read_rights, CAP_READ); - cap_rights_init_one(&cap_recv_rights, CAP_RECV); - cap_rights_init_one(&cap_renameat_source_rights, CAP_RENAMEAT_SOURCE); - cap_rights_init_one(&cap_renameat_target_rights, CAP_RENAMEAT_TARGET); - cap_rights_init_one(&cap_seek_rights, CAP_SEEK); - cap_rights_init_one(&cap_send_rights, CAP_SEND); - cap_rights_init(&cap_send_connect_rights, CAP_SEND, CAP_CONNECT); - cap_rights_init_one(&cap_setsockopt_rights, CAP_SETSOCKOPT); - cap_rights_init_one(&cap_shutdown_rights, CAP_SHUTDOWN); - cap_rights_init_one(&cap_symlinkat_rights, CAP_SYMLINKAT); - cap_rights_init_one(&cap_unlinkat_rights, CAP_UNLINKAT); - cap_rights_init_one(&cap_write_rights, CAP_WRITE); - cap_rights_init(&cap_no_rights); -} -SYSINIT(cap_rights_sysinit, SI_SUB_COPYRIGHT, SI_ORDER_ANY, cap_rights_sysinit, - NULL); - +const cap_rights_t cap_accept_rights = CAP_RIGHTS_INITIALIZER(CAP_ACCEPT); +const cap_rights_t cap_bind_rights = CAP_RIGHTS_INITIALIZER(CAP_BIND); +const cap_rights_t cap_connect_rights = CAP_RIGHTS_INITIALIZER(CAP_CONNECT); +const cap_rights_t cap_event_rights = CAP_RIGHTS_INITIALIZER(CAP_EVENT); +const cap_rights_t cap_fchdir_rights = CAP_RIGHTS_INITIALIZER(CAP_FCHDIR); +const cap_rights_t cap_fchflags_rights = CAP_RIGHTS_INITIALIZER(CAP_FCHFLAGS); +const cap_rights_t cap_fchmod_rights = CAP_RIGHTS_INITIALIZER(CAP_FCHMOD); +const cap_rights_t cap_fchown_rights = CAP_RIGHTS_INITIALIZER(CAP_FCHOWN); +const cap_rights_t cap_fcntl_rights = CAP_RIGHTS_INITIALIZER(CAP_FCNTL); +const cap_rights_t cap_fexecve_rights = CAP_RIGHTS_INITIALIZER(CAP_FEXECVE); +const cap_rights_t cap_flock_rights = CAP_RIGHTS_INITIALIZER(CAP_FLOCK); +const cap_rights_t cap_fpathconf_rights = CAP_RIGHTS_INITIALIZER(CAP_FPATHCONF); +const cap_rights_t cap_fstat_rights = CAP_RIGHTS_INITIALIZER(CAP_FSTAT); +const cap_rights_t cap_fstatfs_rights = CAP_RIGHTS_INITIALIZER(CAP_FSTATFS); +const cap_rights_t cap_fsync_rights = CAP_RIGHTS_INITIALIZER(CAP_FSYNC); +const cap_rights_t cap_ftruncate_rights = CAP_RIGHTS_INITIALIZER(CAP_FTRUNCATE); +const cap_rights_t cap_futimes_rights = CAP_RIGHTS_INITIALIZER(CAP_FUTIMES); +const cap_rights_t cap_getpeername_rights = + CAP_RIGHTS_INITIALIZER(CAP_GETPEERNAME); +const cap_rights_t cap_getsockopt_rights = + CAP_RIGHTS_INITIALIZER(CAP_GETSOCKOPT); +const cap_rights_t cap_getsockname_rights = + CAP_RIGHTS_INITIALIZER(CAP_GETSOCKNAME); +const cap_rights_t cap_ioctl_rights = CAP_RIGHTS_INITIALIZER(CAP_IOCTL); +const cap_rights_t cap_listen_rights = CAP_RIGHTS_INITIALIZER(CAP_LISTEN); +const cap_rights_t cap_linkat_source_rights = + CAP_RIGHTS_INITIALIZER(CAP_LINKAT_SOURCE); +const cap_rights_t cap_linkat_target_rights = + CAP_RIGHTS_INITIALIZER(CAP_LINKAT_TARGET); +const cap_rights_t cap_mmap_rights = CAP_RIGHTS_INITIALIZER(CAP_MMAP); +const cap_rights_t cap_mkdirat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKDIRAT); +const cap_rights_t cap_mkfifoat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKFIFOAT); +const cap_rights_t cap_mknodat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKNODAT); +const cap_rights_t cap_pdgetpid_rights = CAP_RIGHTS_INITIALIZER(CAP_PDGETPID); +const cap_rights_t cap_pdkill_rights = CAP_RIGHTS_INITIALIZER(CAP_PDKILL); +const cap_rights_t cap_pread_rights = CAP_RIGHTS_INITIALIZER(CAP_PREAD); +const cap_rights_t cap_pwrite_rights = CAP_RIGHTS_INITIALIZER(CAP_PWRITE); +const cap_rights_t cap_read_rights = CAP_RIGHTS_INITIALIZER(CAP_READ); +const cap_rights_t cap_recv_rights = CAP_RIGHTS_INITIALIZER(CAP_RECV); +const cap_rights_t cap_renameat_source_rights = + CAP_RIGHTS_INITIALIZER(CAP_RENAMEAT_SOURCE); +const cap_rights_t cap_renameat_target_rights = + CAP_RIGHTS_INITIALIZER(CAP_RENAMEAT_TARGET); +const cap_rights_t cap_seek_rights = CAP_RIGHTS_INITIALIZER(CAP_SEEK); +const cap_rights_t cap_send_rights = CAP_RIGHTS_INITIALIZER(CAP_SEND); +const cap_rights_t cap_send_connect_rights = + CAP_RIGHTS_INITIALIZER2(CAP_SEND, CAP_CONNECT); +const cap_rights_t cap_setsockopt_rights = + CAP_RIGHTS_INITIALIZER(CAP_SETSOCKOPT); +const cap_rights_t cap_shutdown_rights = CAP_RIGHTS_INITIALIZER(CAP_SHUTDOWN); +const cap_rights_t cap_symlinkat_rights = CAP_RIGHTS_INITIALIZER(CAP_SYMLINKAT); +const cap_rights_t cap_unlinkat_rights = CAP_RIGHTS_INITIALIZER(CAP_UNLINKAT); +const cap_rights_t cap_write_rights = CAP_RIGHTS_INITIALIZER(CAP_WRITE); +const cap_rights_t cap_no_rights = CAP_RIGHTS_INITIALIZER(0ULL); #endif #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) diff --git a/sys/sys/caprights.h b/sys/sys/caprights.h index 32ae05172e24..b2fb2898437a 100644 --- a/sys/sys/caprights.h +++ b/sys/sys/caprights.h @@ -58,51 +58,51 @@ typedef struct cap_rights cap_rights_t; #endif #ifdef _KERNEL -extern cap_rights_t cap_accept_rights; -extern cap_rights_t cap_bind_rights; -extern cap_rights_t cap_connect_rights; -extern cap_rights_t cap_event_rights; -extern cap_rights_t cap_fchdir_rights; -extern cap_rights_t cap_fchflags_rights; -extern cap_rights_t cap_fchmod_rights; -extern cap_rights_t cap_fchown_rights; -extern cap_rights_t cap_fcntl_rights; -extern cap_rights_t cap_fexecve_rights; -extern cap_rights_t cap_flock_rights; -extern cap_rights_t cap_fpathconf_rights; -extern cap_rights_t cap_fstat_rights; -extern cap_rights_t cap_fstatfs_rights; -extern cap_rights_t cap_fsync_rights; -extern cap_rights_t cap_ftruncate_rights; -extern cap_rights_t cap_futimes_rights; -extern cap_rights_t cap_getpeername_rights; -extern cap_rights_t cap_getsockopt_rights; -extern cap_rights_t cap_getsockname_rights; -extern cap_rights_t cap_ioctl_rights; -extern cap_rights_t cap_linkat_source_rights; -extern cap_rights_t cap_linkat_target_rights; -extern cap_rights_t cap_listen_rights; -extern cap_rights_t cap_mkdirat_rights; -extern cap_rights_t cap_mkfifoat_rights; -extern cap_rights_t cap_mknodat_rights; -extern cap_rights_t cap_mmap_rights; -extern cap_rights_t cap_no_rights; -extern cap_rights_t cap_pdgetpid_rights; -extern cap_rights_t cap_pdkill_rights; -extern cap_rights_t cap_pread_rights; -extern cap_rights_t cap_pwrite_rights; -extern cap_rights_t cap_read_rights; -extern cap_rights_t cap_recv_rights; -extern cap_rights_t cap_renameat_source_rights; -extern cap_rights_t cap_renameat_target_rights; -extern cap_rights_t cap_seek_rights; -extern cap_rights_t cap_send_rights; -extern cap_rights_t cap_send_connect_rights; -extern cap_rights_t cap_setsockopt_rights; -extern cap_rights_t cap_shutdown_rights; -extern cap_rights_t cap_symlinkat_rights; -extern cap_rights_t cap_unlinkat_rights; -extern cap_rights_t cap_write_rights; +extern const cap_rights_t cap_accept_rights; +extern const cap_rights_t cap_bind_rights; +extern const cap_rights_t cap_connect_rights; +extern const cap_rights_t cap_event_rights; +extern const cap_rights_t cap_fchdir_rights; +extern const cap_rights_t cap_fchflags_rights; +extern const cap_rights_t cap_fchmod_rights; +extern const cap_rights_t cap_fchown_rights; +extern const cap_rights_t cap_fcntl_rights; +extern const cap_rights_t cap_fexecve_rights; +extern const cap_rights_t cap_flock_rights; +extern const cap_rights_t cap_fpathconf_rights; +extern const cap_rights_t cap_fstat_rights; +extern const cap_rights_t cap_fstatfs_rights; +extern const cap_rights_t cap_fsync_rights; +extern const cap_rights_t cap_ftruncate_rights; +extern const cap_rights_t cap_futimes_rights; +extern const cap_rights_t cap_getpeername_rights; +extern const cap_rights_t cap_getsockopt_rights; +extern const cap_rights_t cap_getsockname_rights; +extern const cap_rights_t cap_ioctl_rights; +extern const cap_rights_t cap_linkat_source_rights; +extern const cap_rights_t cap_linkat_target_rights; +extern const cap_rights_t cap_listen_rights; +extern const cap_rights_t cap_mkdirat_rights; +extern const cap_rights_t cap_mkfifoat_rights; +extern const cap_rights_t cap_mknodat_rights; +extern const cap_rights_t cap_mmap_rights; +extern const cap_rights_t cap_no_rights; +extern const cap_rights_t cap_pdgetpid_rights; +extern const cap_rights_t cap_pdkill_rights; +extern const cap_rights_t cap_pread_rights; +extern const cap_rights_t cap_pwrite_rights; +extern const cap_rights_t cap_read_rights; +extern const cap_rights_t cap_recv_rights; +extern const cap_rights_t cap_renameat_source_rights; +extern const cap_rights_t cap_renameat_target_rights; +extern const cap_rights_t cap_seek_rights; +extern const cap_rights_t cap_send_rights; +extern const cap_rights_t cap_send_connect_rights; +extern const cap_rights_t cap_setsockopt_rights; +extern const cap_rights_t cap_shutdown_rights; +extern const cap_rights_t cap_symlinkat_rights; +extern const cap_rights_t cap_unlinkat_rights; +extern const cap_rights_t cap_write_rights; #endif #endif /* !_SYS_CAPRIGHTS_H_ */ diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h index 405a7af419bf..9dd34cff943a 100644 --- a/sys/sys/capsicum.h +++ b/sys/sys/capsicum.h @@ -371,6 +371,24 @@ _Static_assert(CAP_RIGHTS_VERSION == CAP_RIGHTS_VERSION_00, _r; \ }) +#define _CAP_RIGHTS_WORD_INITIALIZER(i, r) \ + (CAPIDXBIT(r) == (i) + 1 ? (r) : 0ULL) + +/* + * Define a set of up to two rights at compile time. + */ +#define CAP_RIGHTS_INITIALIZER2(r1, r2) ((struct cap_rights){ \ + .cr_rights = { \ + [0] = ((uint64_t)CAP_RIGHTS_VERSION << 62) | \ + _CAP_RIGHTS_WORD_INITIALIZER(0, r1) | \ + _CAP_RIGHTS_WORD_INITIALIZER(0, r2), \ + [1] = _CAP_RIGHTS_WORD_INITIALIZER(1, r1) | \ + _CAP_RIGHTS_WORD_INITIALIZER(1, r2), \ + }, \ +}) +#define CAP_RIGHTS_INITIALIZER(r) \ + CAP_RIGHTS_INITIALIZER2(r, 0ULL) + /* * Allow checking caps which are possibly getting modified at the same time. * The caller is expected to determine whether the result is legitimate via From nobody Fri Jun 20 13:52:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS00sqyz5y449; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzRz4gn0z3XJp; Fri, 20 Jun 2025 13:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WUg6uMqU5EzeE4O7/EzTN65dCCeIaBD/K7wUoFd+klk=; b=Y9+EfCRS08jXHxcstuPojYU8e+7cpuSPEM4P2a6fG97ypexMc0fRiddOvXnQcydw7a0YMM ATSpZh7hjkUv+wSk/HpZHp3wOf0aqRdDFB05NRiHO2mf5WgJ9XZ/3iKCMmd20ZyN3oeAPn 24O+iGxmyhgcWMU8LHOotIjLkr/w3zy/MRkSC++FWXawJXf8jDreanboWz1oXyTV7CApfO kSU0488h+hgXXEWW0fD2ra7rn/ZhY/05Rds3VytQwtT/RfY7Uq5jDWlBsvV1y7CXPmNFSJ 1p7IRlhaWFA4dTpLEkIPvt1ANjelAlD8i5bw549ImVaJlzPQOOaQbfwIp6yabg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WUg6uMqU5EzeE4O7/EzTN65dCCeIaBD/K7wUoFd+klk=; b=WYVqdxL6MGMc2ci4Xy5y2RDmc+eCdv8s5rPfff3W/m/TysPdP9+wr6/SX04wsMlDE2E33v MgKvCJzze6mj45yVvEUUE/xCbfZYMeEhhKG7VQUExqdzD/H5j4TXc1PccqJX1eOtBXGJhe J54pan1aRMcyuFYbEuHxNm9/2gw4/+6+N5hjSJwBzvZTPHnHxEp+jz/t7o6+c8D6gMzQSX +vGjWNTmpwYKcHbs4oWuDK/0NO4yGpQO0yYf4WpDWxDbVXjINNIoVW3D/cAwRCCyhAICNN 39oYu+jw8Ito5+v4bDqFP1UH0oTL6y7GV/zfEN4aEgwXRjZhyo8F1LCGE3Nvkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427535; a=rsa-sha256; cv=none; b=NtIFOrk3m8deh9oL4cCYw2Awk51e/HUQwZVPn8MNCHPiur822DtohPTTrLJarlib8dv/Xy qegqNj7jJb7cksSrH3vA7Qy3BzTbGKEZhKkIg2xTAdXGnVw8DYHpipKdjWkuk7KBLYuAOb 2WnlVn4wLmqcRwyhADnsDS8AapGIaYS+SazpAbjjT6uWJZkbyhMTb7v9WNxoq5njFPVajQ HdR0wW+sn0XEZyRL+VJqbSTtF6p5Dbcwc0olZoJGqk9ntl3w0Ru4PhpE33S5rN27YiDaeB a3/Bj+I7k4pDOQ36vO+/9zgay1kC85Zxu1RX7Otal/5r4j4a4btMvH0lsSbKfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzRz49d5znCp; Fri, 20 Jun 2025 13:52: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 55KDqFc0057808; Fri, 20 Jun 2025 13:52:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqFdY057805; Fri, 20 Jun 2025 13:52:15 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:15 GMT Message-Id: <202506201352.55KDqFdY057805@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: 4e8531ec2633 - stable/14 - gve: Use load-acquire to fetch generation bits List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 4e8531ec2633ea101fa29c09acf73f48cf2bcc17 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4e8531ec2633ea101fa29c09acf73f48cf2bcc17 commit 4e8531ec2633ea101fa29c09acf73f48cf2bcc17 Author: Jasper Tran O'Leary AuthorDate: 2025-05-20 23:34:44 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 gve: Use load-acquire to fetch generation bits When running the driver using the DQO queue format, we must load the generation bit and check it before possibly reading the rest of the descriptor's fields. Previously, we guarded against reordering of reads using an explicit thread fence. This commit changes the thread fence to a load with acquire semantics. Because the tx and rx generation fields are in a bitfield, we cannot explicitly address them in an atomic load. Instead we load the respective containing bytes in the descriptor and mask them appropriately. Signed-off-by: Jasper Tran O'Leary Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50384 (cherry picked from commit b044f125373e05c20ca16edfd29cccad1f4025bd) --- sys/dev/gve/gve_adminq.h | 3 ++- sys/dev/gve/gve_dqo.h | 20 ++++++++++++++++---- sys/dev/gve/gve_rx_dqo.c | 24 +++++++++++++++++------- sys/dev/gve/gve_tx_dqo.c | 25 +++++++++++++++++-------- 4 files changed, 52 insertions(+), 20 deletions(-) diff --git a/sys/dev/gve/gve_adminq.h b/sys/dev/gve/gve_adminq.h index bc51046a3037..531a844f7d90 100644 --- a/sys/dev/gve/gve_adminq.h +++ b/sys/dev/gve/gve_adminq.h @@ -377,7 +377,8 @@ struct stats { _Static_assert(sizeof(struct stats) == 16, "gve: bad admin queue struct length"); -/* These are control path types for PTYPE which are the same as the data path +/* + * These are control path types for PTYPE which are the same as the data path * types. */ struct gve_ptype_entry { diff --git a/sys/dev/gve/gve_dqo.h b/sys/dev/gve/gve_dqo.h index 214138303a77..212bfa1a6ad3 100644 --- a/sys/dev/gve/gve_dqo.h +++ b/sys/dev/gve/gve_dqo.h @@ -208,9 +208,14 @@ _Static_assert(sizeof(struct gve_tx_metadata_dqo) == 12, #define GVE_TX_METADATA_VERSION_DQO 0 +/* Used to access the generation bit within a TX completion descriptor. */ +#define GVE_TX_DESC_DQO_GEN_BYTE_OFFSET 1 +#define GVE_TX_DESC_DQO_GEN_BIT_MASK 0x80 + /* TX completion descriptor */ struct gve_tx_compl_desc_dqo { - /* For types 0-4 this is the TX queue ID associated with this + /* + * For types 0-4 this is the TX queue ID associated with this * completion. */ uint16_t id:11; @@ -222,12 +227,14 @@ struct gve_tx_compl_desc_dqo { /* Flipped by HW to notify the descriptor is populated. */ uint16_t generation:1; union { - /* For descriptor completions, this is the last index fetched + /* + * For descriptor completions, this is the last index fetched * by HW + 1. */ __le16 tx_head; - /* For packet completions, this is the completion tag set on the + /* + * For packet completions, this is the completion tag set on the * TX packet descriptors. */ __le16 completion_tag; @@ -258,6 +265,10 @@ struct gve_rx_desc_dqo { _Static_assert(sizeof(struct gve_rx_desc_dqo) == 32, "gve: bad dqo desc struct length"); +/* Used to access the generation bit within an RX completion descriptor. */ +#define GVE_RX_DESC_DQO_GEN_BYTE_OFFSET 5 +#define GVE_RX_DESC_DQO_GEN_BIT_MASK 0x40 + /* Descriptor for HW to notify SW of new packets received on RX queue. */ struct gve_rx_compl_desc_dqo { /* Must be 1 */ @@ -266,7 +277,8 @@ struct gve_rx_compl_desc_dqo { /* Packet originated from this system rather than the network. */ uint8_t loopback:1; - /* Set when IPv6 packet contains a destination options header or routing + /* + * Set when IPv6 packet contains a destination options header or routing * header. */ uint8_t ipv6_ex_add:1; diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c index a499ac9d3c6a..11b2c7ea0c55 100644 --- a/sys/dev/gve/gve_rx_dqo.c +++ b/sys/dev/gve/gve_rx_dqo.c @@ -962,6 +962,19 @@ drop_frag_clear_ctx: rx->ctx = (struct gve_rx_ctx){}; } +static uint8_t +gve_rx_get_gen_bit(uint8_t *desc) +{ + uint8_t byte; + + /* + * Prevent generation bit from being read after the rest of the + * descriptor. + */ + byte = atomic_load_acq_8(desc + GVE_RX_DESC_DQO_GEN_BYTE_OFFSET); + return ((byte & GVE_RX_DESC_DQO_GEN_BIT_MASK) != 0); +} + static bool gve_rx_cleanup_dqo(struct gve_priv *priv, struct gve_rx_ring *rx, int budget) { @@ -971,17 +984,14 @@ gve_rx_cleanup_dqo(struct gve_priv *priv, struct gve_rx_ring *rx, int budget) NET_EPOCH_ASSERT(); while (work_done < budget) { - bus_dmamap_sync(rx->dqo.compl_ring_mem.tag, rx->dqo.compl_ring_mem.map, + bus_dmamap_sync(rx->dqo.compl_ring_mem.tag, + rx->dqo.compl_ring_mem.map, BUS_DMASYNC_POSTREAD); compl_desc = &rx->dqo.compl_ring[rx->dqo.tail]; - if (compl_desc->generation == rx->dqo.cur_gen_bit) + if (gve_rx_get_gen_bit((uint8_t *)compl_desc) == + rx->dqo.cur_gen_bit) break; - /* - * Prevent generation bit from being read after the rest of the - * descriptor. - */ - atomic_thread_fence_acq(); rx->cnt++; rx->dqo.tail = (rx->dqo.tail + 1) & rx->dqo.mask; diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index 7361d47b8ce6..8a1993c3e712 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -1029,6 +1029,19 @@ gve_clear_tx_ring_dqo(struct gve_priv *priv, int i) gve_tx_clear_compl_ring_dqo(tx); } +static uint8_t +gve_tx_get_gen_bit(uint8_t *desc) +{ + uint8_t byte; + + /* + * Prevent generation bit from being read after the rest of the + * descriptor. + */ + byte = atomic_load_acq_8(desc + GVE_TX_DESC_DQO_GEN_BYTE_OFFSET); + return ((byte & GVE_TX_DESC_DQO_GEN_BIT_MASK) != 0); +} + static bool gve_tx_cleanup_dqo(struct gve_priv *priv, struct gve_tx_ring *tx, int budget) { @@ -1041,20 +1054,16 @@ gve_tx_cleanup_dqo(struct gve_priv *priv, struct gve_tx_ring *tx, int budget) uint16_t type; while (work_done < budget) { - bus_dmamap_sync(tx->dqo.compl_ring_mem.tag, tx->dqo.compl_ring_mem.map, + bus_dmamap_sync(tx->dqo.compl_ring_mem.tag, + tx->dqo.compl_ring_mem.map, BUS_DMASYNC_POSTREAD); compl_desc = &tx->dqo.compl_ring[tx->dqo.compl_head]; - if (compl_desc->generation == tx->dqo.cur_gen_bit) + if (gve_tx_get_gen_bit((uint8_t *)compl_desc) == + tx->dqo.cur_gen_bit) break; - /* - * Prevent generation bit from being read after the rest of the - * descriptor. - */ - atomic_thread_fence_acq(); type = compl_desc->type; - if (type == GVE_COMPL_TYPE_DQO_DESC) { /* This is the last descriptor fetched by HW plus one */ tx_head = le16toh(compl_desc->tx_head); From nobody Fri Jun 20 13:52:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS10kc4z5y46P; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS05FtMz3Xcx; Fri, 20 Jun 2025 13:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrY5nm67km/6vujT0z5LEH3EcroCb+4MFFcP6VkFs6Y=; b=NheAm41+sVRh0JQ1E9dlIvVMqbzLsrB8+g5yPxPrfsCGlUxUcz5qFhbDnykgLIi8spuMHP cj7SYlqWQtQoe1+YncXCcAA+uwvCER2EHtItJgMaOn9EQzwO+/WuxxsTnbisNP2iF3z5vF 0GMssOWzNLyg2PEAh1jbIT/LS7ZJ7KXgMqaXIC7VGeFQHDpI842kJXApmLVcuGpjHaxNPf DeafHhrM8sWp77CDmlHpUQ+zkcICzoRjN50eX8/OPwd/8VGTUHP+NpJclFW7a2B6ytkZ2T xeL84MPZo7eidxJMzhis5TfADIRGflOmjGZIG+UD3ukPEibHTRDx0rDDCT+APQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrY5nm67km/6vujT0z5LEH3EcroCb+4MFFcP6VkFs6Y=; b=t07+5QFDJS8glZGmLCo1zfLqp9lZfO8xBxOmFjatHvES3LbQgblUuyTngZFomKI+VItf/2 D31Ja/94tJsr/NV/clvqxEBFArn8adUQLn//DSWQU4rK4yNWoMPt8PUZTCHV/8prbU3T8m 5dr3mc8pdHroAM2pPI3P46wrQriSr2lsRyTKxKNPXgpkvecdmODPFLoxdIGzQ7MNEjXX8A wtzPraIm0ZCq6iQuLLbfJTTvTs8XhcakRy67Ltp9ZnEhtbNJN6nesuPf9k4S7mEmZKckD/ YWwAIJekPLooy98zwz0Ytwztf01H88iQYkR4oCCi0ohyxt7LHTIm2CtA2e7KWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427536; a=rsa-sha256; cv=none; b=kvQdOFZKSPhBD4ug24349tXYO9kO8nwpA0+xmpauWBhDDdq54z6KS6B7KT+GmlQjCy/b4M F1+XKyAayZIPZkMApakG5webZ6QhCDWLG7PfCpqIEabqJYGI/sZzecv9CxVFLpFRvoWze+ gqqwZK6PF7NaQ3MkNBiAmKoFkCMOSinWf/PmvXSDj5d79EfPSSibPgCQ/tvR04DVsgikTF v/CLj5crLwnFe4LTy1b0Odku/2MnEEtrM24mmASzGFXKv1ofKD+g4WbKlAwhimUukU2eey 4y2dfurGJEVwZciGrzskldyQgTUbpc4PbMVi6PTwnlW4bc+EjmK/AnqfltPgVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS04sZXznsy; Fri, 20 Jun 2025 13:52: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 55KDqGFr057841; Fri, 20 Jun 2025 13:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqGWa057838; Fri, 20 Jun 2025 13:52:16 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:16 GMT Message-Id: <202506201352.55KDqGWa057838@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: f7a5aab53f26 - stable/14 - gve: Add callout to detect and handle TX timeouts List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f7a5aab53f26f364def01e3006dd9ef7c90f9ab8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7a5aab53f26f364def01e3006dd9ef7c90f9ab8 commit f7a5aab53f26f364def01e3006dd9ef7c90f9ab8 Author: Jasper Tran O'Leary AuthorDate: 2025-05-20 23:34:45 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 gve: Add callout to detect and handle TX timeouts A TX timeout occurs when the driver allocates resources on a TX queue for a packet to be sent, prompts the hardware to send the packet, but does not receive a completion for the packet within a given timeout period. An accumulation of TX timeouts can cause one or more queues to run out of space and cause the entire driver to become stuck. This commit adds a lockless timer service that runs periodically and checks queues for timed out packets. In the event we detect a timeout, we prompt the completion phase taskqueue to process completions. Upon the next inspection of the queue we still detect timed out packets, if the last "kick" occurred within a fixed cooldown window, we opt to reset the driver, even if the prior kick successfully freed timed out packets. Signed-off-by: Jasper Tran O'Leary Reviewed by: markj, ziaee MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50385 (cherry picked from commit 3d2957336c7ddaa0a29cf60cfd458c07df1f5be9) --- share/man/man4/gve.4 | 8 ++++- sys/dev/gve/gve.h | 47 +++++++++++++++++++++++++++++ sys/dev/gve/gve_main.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++-- sys/dev/gve/gve_sysctl.c | 6 +++- sys/dev/gve/gve_tx.c | 32 ++++++++++++++++++++ sys/dev/gve/gve_tx_dqo.c | 32 +++++++++++++++++++- sys/dev/gve/gve_utils.c | 43 ++++++++++++++++++++++++++ 7 files changed, 241 insertions(+), 5 deletions(-) diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 32f5d2819e0d..a94951415d61 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -26,7 +26,7 @@ .\" ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.Dd October 14, 2024 +.Dd May 20, 2025 .Dt GVE 4 .Os .Sh NAME @@ -180,6 +180,12 @@ These messages are seen if any admin queue command fails: .It "Unknown AQ command opcode %d" .El .Pp +These messages appear if a TX timeout is detected: +.Bl -diag +.It "Found %d timed out packet(s) on txq%d, kicking it for completions" +.It "Found %d timed out packet(s) on txq%d with its last kick %ld sec ago which is less than the cooldown period %d. Resetting device" +.El +.Pp These messages are recorded when the device is being reset due to an error: .Bl -diag .It "Scheduling reset task!" diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 5b298b889ed6..48e9a371df21 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -47,6 +47,21 @@ #define GVE_TX_MAX_DESCS 4 #define GVE_TX_BUFRING_ENTRIES 4096 +#define GVE_TX_TIMEOUT_PKT_SEC 5 +#define GVE_TX_TIMEOUT_CHECK_CADENCE_SEC 5 +/* + * If the driver finds timed out packets on a tx queue it first kicks it and + * records the time. If the driver again finds a timeout on the same queue + * before the end of the cooldown period, only then will it reset. Thus, for a + * reset to be able to occur at all, the cooldown must be at least as long + * as the tx timeout checking cadence multiplied by the number of queues. + */ +#define GVE_TX_TIMEOUT_MAX_TX_QUEUES 16 +#define GVE_TX_TIMEOUT_KICK_COOLDOWN_SEC \ + (2 * GVE_TX_TIMEOUT_CHECK_CADENCE_SEC * GVE_TX_TIMEOUT_MAX_TX_QUEUES) + +#define GVE_TIMESTAMP_INVALID -1 + #define ADMINQ_SIZE PAGE_SIZE #define GVE_DEFAULT_RX_BUFFER_SIZE 2048 @@ -337,6 +352,14 @@ struct gve_tx_fifo { struct gve_tx_buffer_state { struct mbuf *mbuf; + + /* + * Time at which the xmit tq places descriptors for mbuf's payload on a + * tx queue. This timestamp is invalidated when the mbuf is freed and + * must be checked for validity when read. + */ + int64_t enqueue_time_sec; + struct gve_tx_iovec iov[GVE_TX_MAX_DESCS]; }; @@ -357,12 +380,21 @@ struct gve_txq_stats { counter_u64_t tx_mbuf_defrag_err; counter_u64_t tx_mbuf_dmamap_enomem_err; counter_u64_t tx_mbuf_dmamap_err; + counter_u64_t tx_timeout; }; #define NUM_TX_STATS (sizeof(struct gve_txq_stats) / sizeof(counter_u64_t)) struct gve_tx_pending_pkt_dqo { struct mbuf *mbuf; + + /* + * Time at which the xmit tq places descriptors for mbuf's payload on a + * tx queue. This timestamp is invalidated when the mbuf is freed and + * must be checked for validity when read. + */ + int64_t enqueue_time_sec; + union { /* RDA */ bus_dmamap_t dmamap; @@ -396,6 +428,8 @@ struct gve_tx_ring { uint32_t req; /* free-running total number of packets written to the nic */ uint32_t done; /* free-running total number of completed packets */ + int64_t last_kicked; /* always-valid timestamp in seconds for the last queue kick */ + union { /* GQI specific stuff */ struct { @@ -594,6 +628,11 @@ struct gve_priv { struct gve_state_flags state_flags; struct sx gve_iface_lock; + + struct callout tx_timeout_service; + /* The index of tx queue that the timer service will check on its next invocation */ + uint16_t check_tx_queue_idx; + }; static inline bool @@ -652,6 +691,7 @@ int gve_alloc_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_ void gve_free_tx_rings(struct gve_priv *priv, uint16_t start_idx, uint16_t stop_idx); int gve_create_tx_rings(struct gve_priv *priv); int gve_destroy_tx_rings(struct gve_priv *priv); +int gve_check_tx_timeout_gqi(struct gve_priv *priv, struct gve_tx_ring *tx); int gve_tx_intr(void *arg); int gve_xmit_ifp(if_t ifp, struct mbuf *mbuf); void gve_qflush(if_t ifp); @@ -662,6 +702,7 @@ void gve_tx_cleanup_tq(void *arg, int pending); int gve_tx_alloc_ring_dqo(struct gve_priv *priv, int i); void gve_tx_free_ring_dqo(struct gve_priv *priv, int i); void gve_clear_tx_ring_dqo(struct gve_priv *priv, int i); +int gve_check_tx_timeout_dqo(struct gve_priv *priv, struct gve_tx_ring *tx); int gve_tx_intr_dqo(void *arg); int gve_xmit_dqo(struct gve_tx_ring *tx, struct mbuf **mbuf_ptr); int gve_xmit_dqo_qpl(struct gve_tx_ring *tx, struct mbuf *mbuf); @@ -697,6 +738,12 @@ int gve_alloc_irqs(struct gve_priv *priv); void gve_unmask_all_queue_irqs(struct gve_priv *priv); void gve_mask_all_queue_irqs(struct gve_priv *priv); +/* Miscellaneous functions defined in gve_utils.c */ +void gve_invalidate_timestamp(int64_t *timestamp_sec); +int64_t gve_seconds_since(int64_t *timestamp_sec); +void gve_set_timestamp(int64_t *timestamp_sec); +bool gve_timestamp_valid(int64_t *timestamp_sec); + /* Systcl functions defined in gve_sysctl.c */ extern bool gve_disable_hw_lro; extern char gve_queue_format[8]; diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 8a00deedef36..2abd9d1aa698 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -32,10 +32,10 @@ #include "gve_adminq.h" #include "gve_dqo.h" -#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.3\n" +#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.4\n" #define GVE_VERSION_MAJOR 1 #define GVE_VERSION_MINOR 3 -#define GVE_VERSION_SUB 3 +#define GVE_VERSION_SUB 4 #define GVE_DEFAULT_RX_COPYBREAK 256 @@ -50,6 +50,9 @@ static struct gve_dev { struct sx gve_global_lock; +static void gve_start_tx_timeout_service(struct gve_priv *priv); +static void gve_stop_tx_timeout_service(struct gve_priv *priv); + static int gve_verify_driver_compatibility(struct gve_priv *priv) { @@ -99,6 +102,72 @@ gve_verify_driver_compatibility(struct gve_priv *priv) return (err); } +static void +gve_handle_tx_timeout(struct gve_priv *priv, struct gve_tx_ring *tx, + int num_timeout_pkts) +{ + int64_t time_since_last_kick; + + counter_u64_add_protected(tx->stats.tx_timeout, 1); + + /* last_kicked is never GVE_TIMESTAMP_INVALID so we can skip checking */ + time_since_last_kick = gve_seconds_since(&tx->last_kicked); + + /* Try kicking first in case the timeout is due to a missed interrupt */ + if (time_since_last_kick > GVE_TX_TIMEOUT_KICK_COOLDOWN_SEC) { + device_printf(priv->dev, + "Found %d timed out packet(s) on txq%d, kicking it for completions\n", + num_timeout_pkts, tx->com.id); + gve_set_timestamp(&tx->last_kicked); + taskqueue_enqueue(tx->com.cleanup_tq, &tx->com.cleanup_task); + } else { + device_printf(priv->dev, + "Found %d timed out packet(s) on txq%d with its last kick %jd sec ago which is less than the cooldown period %d. Resetting device\n", + num_timeout_pkts, tx->com.id, + (intmax_t)time_since_last_kick, + GVE_TX_TIMEOUT_KICK_COOLDOWN_SEC); + gve_schedule_reset(priv); + } +} + +static void +gve_tx_timeout_service_callback(void *data) +{ + struct gve_priv *priv = (struct gve_priv *)data; + struct gve_tx_ring *tx; + uint16_t num_timeout_pkts; + + tx = &priv->tx[priv->check_tx_queue_idx]; + + num_timeout_pkts = gve_is_gqi(priv) ? + gve_check_tx_timeout_gqi(priv, tx) : + gve_check_tx_timeout_dqo(priv, tx); + if (num_timeout_pkts) + gve_handle_tx_timeout(priv, tx, num_timeout_pkts); + + priv->check_tx_queue_idx = (priv->check_tx_queue_idx + 1) % + priv->tx_cfg.num_queues; + callout_reset_sbt(&priv->tx_timeout_service, + SBT_1S * GVE_TX_TIMEOUT_CHECK_CADENCE_SEC, 0, + gve_tx_timeout_service_callback, (void *)priv, 0); +} + +static void +gve_start_tx_timeout_service(struct gve_priv *priv) +{ + priv->check_tx_queue_idx = 0; + callout_init(&priv->tx_timeout_service, true); + callout_reset_sbt(&priv->tx_timeout_service, + SBT_1S * GVE_TX_TIMEOUT_CHECK_CADENCE_SEC, 0, + gve_tx_timeout_service_callback, (void *)priv, 0); +} + +static void +gve_stop_tx_timeout_service(struct gve_priv *priv) +{ + callout_drain(&priv->tx_timeout_service); +} + static int gve_up(struct gve_priv *priv) { @@ -149,6 +218,9 @@ gve_up(struct gve_priv *priv) gve_unmask_all_queue_irqs(priv); gve_set_state_flag(priv, GVE_STATE_FLAG_QUEUES_UP); priv->interface_up_cnt++; + + gve_start_tx_timeout_service(priv); + return (0); reset: @@ -164,6 +236,8 @@ gve_down(struct gve_priv *priv) if (!gve_get_state_flag(priv, GVE_STATE_FLAG_QUEUES_UP)) return; + gve_stop_tx_timeout_service(priv); + if (gve_get_state_flag(priv, GVE_STATE_FLAG_LINK_UP)) { if_link_state_change(priv->ifp, LINK_STATE_DOWN); gve_clear_state_flag(priv, GVE_STATE_FLAG_LINK_UP); diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c index f7c7b5803865..661f61918853 100644 --- a/sys/dev/gve/gve_sysctl.c +++ b/sys/dev/gve/gve_sysctl.c @@ -168,7 +168,7 @@ gve_setup_txq_sysctl(struct sysctl_ctx_list *ctx, &stats->tx_delayed_pkt_tsoerr, "TSO packets delayed due to err in prep errors"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "tx_mbuf_collpase", CTLFLAG_RD, + "tx_mbuf_collapse", CTLFLAG_RD, &stats->tx_mbuf_collapse, "tx mbufs that had to be collapsed"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, @@ -187,6 +187,10 @@ gve_setup_txq_sysctl(struct sysctl_ctx_list *ctx, "tx_mbuf_dmamap_err", CTLFLAG_RD, &stats->tx_mbuf_dmamap_err, "tx mbufs that could not be dma-mapped"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "tx_timeout", CTLFLAG_RD, + &stats->tx_timeout, + "detections of timed out packets on tx queues"); } static void diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index b667df4ca06e..84e3a4c4eb9f 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -173,6 +173,8 @@ gve_tx_alloc_ring(struct gve_priv *priv, int i) } com->q_resources = com->q_resources_mem.cpu_addr; + tx->last_kicked = 0; + return (0); abort: @@ -218,6 +220,7 @@ gve_tx_clear_desc_ring(struct gve_tx_ring *tx) for (i = 0; i < com->priv->tx_desc_cnt; i++) { tx->desc_ring[i] = (union gve_tx_desc){}; tx->info[i] = (struct gve_tx_buffer_state){}; + gve_invalidate_timestamp(&tx->info[i].enqueue_time_sec); } bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, @@ -344,6 +347,30 @@ gve_destroy_tx_rings(struct gve_priv *priv) return (0); } +int +gve_check_tx_timeout_gqi(struct gve_priv *priv, struct gve_tx_ring *tx) +{ + struct gve_tx_buffer_state *info; + uint32_t pkt_idx; + int num_timeouts; + + num_timeouts = 0; + + for (pkt_idx = 0; pkt_idx < priv->tx_desc_cnt; pkt_idx++) { + info = &tx->info[pkt_idx]; + + if (!gve_timestamp_valid(&info->enqueue_time_sec)) + continue; + + if (__predict_false( + gve_seconds_since(&info->enqueue_time_sec) > + GVE_TX_TIMEOUT_PKT_SEC)) + num_timeouts += 1; + } + + return (num_timeouts); +} + int gve_tx_intr(void *arg) { @@ -396,7 +423,10 @@ gve_tx_cleanup_tq(void *arg, int pending) if (mbuf == NULL) continue; + gve_invalidate_timestamp(&info->enqueue_time_sec); + info->mbuf = NULL; + counter_enter(); counter_u64_add_protected(tx->stats.tbytes, mbuf->m_pkthdr.len); counter_u64_add_protected(tx->stats.tpackets, 1); @@ -685,6 +715,8 @@ gve_xmit(struct gve_tx_ring *tx, struct mbuf *mbuf) /* So that the cleanup taskqueue can free the mbuf eventually. */ info->mbuf = mbuf; + gve_set_timestamp(&info->enqueue_time_sec); + /* * We don't want to split the header, so if necessary, pad to the end * of the fifo and then put the header at the beginning of the fifo. diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index 8a1993c3e712..bbf2ee1b0324 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -527,6 +527,8 @@ gve_alloc_pending_packet(struct gve_tx_ring *tx) tx->dqo.free_pending_pkts_csm = pending_pkt->next; pending_pkt->state = GVE_PACKET_STATE_PENDING_DATA_COMPL; + gve_set_timestamp(&pending_pkt->enqueue_time_sec); + return (pending_pkt); } @@ -539,6 +541,8 @@ gve_free_pending_packet(struct gve_tx_ring *tx, pending_pkt->state = GVE_PACKET_STATE_FREE; + gve_invalidate_timestamp(&pending_pkt->enqueue_time_sec); + /* Add pending_pkt to the producer list */ while (true) { old_head = atomic_load_acq_32(&tx->dqo.free_pending_pkts_prd); @@ -939,6 +943,29 @@ gve_handle_packet_completion(struct gve_priv *priv, return (pkt_len); } +int +gve_check_tx_timeout_dqo(struct gve_priv *priv, struct gve_tx_ring *tx) +{ + struct gve_tx_pending_pkt_dqo *pending_pkt; + int num_timeouts; + uint16_t pkt_idx; + + num_timeouts = 0; + for (pkt_idx = 0; pkt_idx < tx->dqo.num_pending_pkts; pkt_idx++) { + pending_pkt = &tx->dqo.pending_pkts[pkt_idx]; + + if (!gve_timestamp_valid(&pending_pkt->enqueue_time_sec)) + continue; + + if (__predict_false( + gve_seconds_since(&pending_pkt->enqueue_time_sec) > + GVE_TX_TIMEOUT_PKT_SEC)) + num_timeouts += 1; + } + + return (num_timeouts); +} + int gve_tx_intr_dqo(void *arg) { @@ -960,8 +987,11 @@ gve_tx_clear_desc_ring_dqo(struct gve_tx_ring *tx) struct gve_ring_com *com = &tx->com; int i; - for (i = 0; i < com->priv->tx_desc_cnt; i++) + for (i = 0; i < com->priv->tx_desc_cnt; i++) { tx->dqo.desc_ring[i] = (union gve_tx_desc_dqo){}; + gve_invalidate_timestamp( + &tx->dqo.pending_pkts[i].enqueue_time_sec); + } bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/gve/gve_utils.c b/sys/dev/gve/gve_utils.c index 4e9dd4625e2f..707b8f039d88 100644 --- a/sys/dev/gve/gve_utils.c +++ b/sys/dev/gve/gve_utils.c @@ -439,3 +439,46 @@ gve_mask_all_queue_irqs(struct gve_priv *priv) gve_db_bar_write_4(priv, rx->com.irq_db_offset, GVE_IRQ_MASK); } } + +/* + * In some cases, such as tracking timeout events, we must mark a timestamp as + * invalid when we do not want to consider its value. Such timestamps must be + * checked for validity before reading them. + */ +void +gve_invalidate_timestamp(int64_t *timestamp_sec) +{ + atomic_store_64(timestamp_sec, GVE_TIMESTAMP_INVALID); +} + +/* + * Returns 0 if the timestamp is invalid, otherwise returns the elapsed seconds + * since the timestamp was set. + */ +int64_t +gve_seconds_since(int64_t *timestamp_sec) +{ + struct bintime curr_time; + int64_t enqueued_time; + + getbintime(&curr_time); + enqueued_time = atomic_load_64(timestamp_sec); + if (enqueued_time == GVE_TIMESTAMP_INVALID) + return (0); + return ((int64_t)(curr_time.sec - enqueued_time)); +} + +void +gve_set_timestamp(int64_t *timestamp_sec) +{ + struct bintime curr_time; + + getbintime(&curr_time); + atomic_store_64(timestamp_sec, curr_time.sec); +} + +bool +gve_timestamp_valid(int64_t *timestamp_sec) +{ + return (atomic_load_64(timestamp_sec) != GVE_TIMESTAMP_INVALID); +} From nobody Fri Jun 20 13:52:17 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS22MNbz5y44B; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS166dkz3XYK; Fri, 20 Jun 2025 13:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R2NkSLTNbupRDwe3gbLSEJMz2H7m9CVCJijl9wv2Z6s=; b=yPVY4lhJrx12zGBBvYDJB7jSXfV59lW6PSqZgKwjPVy6oVIManZHN9zZ3ER+FMV7i/VksI u6G1zO42HnfWU38GFT6YLiJvCTzB+PCOOZSS8CV+ifjYJcUuhy/gfFig9BxsFCbS94Jb9y sKdULGIyqUbCmGWVk4wHtiEgcfeNUMgvLdB3+QRrT0qY9wgW3YW9KjGAoZ8+lwtBK7AGiN u+gaRhMPfbg2/Zqqq6lrEMzEpeZY3hICoOiMmynBuICDko7QVwi50469cpOfLfXqgBouGa ljnUbjg53ttxey6ujHig5fB0cAmosJ2EpS9Lja66wEL1YOkkuvfBKgOto2Y/UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R2NkSLTNbupRDwe3gbLSEJMz2H7m9CVCJijl9wv2Z6s=; b=qHbPrR9jmP9miSGDHMfX7vI7NbjLe3gpLFMddXFxAoNvSZAYjZ6Lgal7peUTDDME6ycNVV MaEz95WmjkrjZbY43PqjJheCGg5XqsIWgVsLEsf7xElsa//m1NRIs0ScFil9fTgySwNhBJ +JcbTMnKpxuUGBKLVZ5MAFFyMXVytu5pCa/rxzI/mCW/ZNe6C3Ezra5U8dxkY2YoxuNBPl 0affORPRQtA3UhWSeATQ05m2QnKwxH0Ni6D9RqqN44gkQ9pvBgzD2PixwPfr3Xi8fWbcri 4+Sb/phtDqngOrQS6v1cLwZlwVydGUqC7uAnfn9c94NIcMdgquO0wn1fR5wLFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427537; a=rsa-sha256; cv=none; b=inhVhdI7gPqUsAgOu2Qfs/mhZboQ9OkH5yCqDeJCtA9RX/2Z2C+vEsXiLxnBs7aoioKHH4 4MP2EBLoz0MbbU4IDGEEXoPbwfSsq+t9K0FboPlQrpJtwOeWPyYOJy0iH2zCDYXM3nNytA 1Ri032HVrOsTtOdZZYXCms1pTgV0mIXcGkwv3iyNFNcAF+G0fY+cJtxroEE7YWl+096IIQ C/KV7nhlZdPijOTTB6hNu29qe5rOSmMSfsMz+UFp5cd1LKxXttG2vsBYOn5bN/3dhRZKUT r6NBhUmI2Dk1sNnoY6uJzYyxhMGgXDVsMZsvpXBt7nFi1AlhBWTNp5UZw8MhbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS15kdJznCq; Fri, 20 Jun 2025 13:52: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 55KDqHso057882; Fri, 20 Jun 2025 13:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqHFI057879; Fri, 20 Jun 2025 13:52:17 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:17 GMT Message-Id: <202506201352.55KDqHFI057879@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: 1e3b1b09c3b3 - stable/14 - makefs: Make sure that directory entry order is consistent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 1e3b1b09c3b3f723125ddeb414466c05afa7771d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e3b1b09c3b3f723125ddeb414466c05afa7771d commit 1e3b1b09c3b3f723125ddeb414466c05afa7771d Author: Mark Johnston AuthorDate: 2025-05-08 15:50:23 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 makefs: Make sure that directory entry order is consistent When walking a directory hierarchy (as opposed to reading an mtree), makefs builds up a tree of file nodes. Within a directory, the order of the sibling nodes is determined by the order they're returned by readdir(), which isn't very reproducible (e.g., depends on filesystem, build parallelism). Add a routine which sorts entries within a directory after its contents have been read. This is a bit more expensive, but I wasn't able to measure a significant runtime cost (and I don't think makefs has been optimized very much to begin with), and we avoid this cost in mtree mode anyway. This fixes some sources of reproducibility problems. In mtree mode, for now we let the ordering of METALOG entries determine the ordering in the fsnode tree. It might be worth sorting these too, since with parallel installworld they won't have a consistent ordering, and single-threaded installworld is pretty slow. Reviewed by: emaste MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50197 (cherry picked from commit 31c3ef95ec430d130363a664e96135eb7abebd7b) --- usr.sbin/makefs/makefs.c | 8 +++++ usr.sbin/makefs/walk.c | 83 ++++++++++++++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index e02571f42997..e8e9fbf99bc3 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -104,6 +105,13 @@ main(int argc, char *argv[]) setprogname(argv[0]); + /* + * Set the locale for collation, so that directory entry sorting is + * consistent. + */ + if (setlocale(LC_COLLATE, "C") == NULL) + err(1, "setlocale"); + debug = 0; if ((fstype = get_fstype(DEFAULT_FSTYPE)) == NULL) errx(1, "Unknown default fs type `%s'.", DEFAULT_FSTYPE); diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c index 98ddb53f7917..12164ae78bd4 100644 --- a/usr.sbin/makefs/walk.c +++ b/usr.sbin/makefs/walk.c @@ -61,6 +61,50 @@ static void apply_specentry(const char *, NODE *, fsnode *); static fsnode *create_fsnode(const char *, const char *, const char *, struct stat *); +static int +cmp(const void *_a, const void *_b) +{ + const fsnode * const *a = _a; + const fsnode * const *b = _b; + + assert(strcmp((*a)->name, (*b)->name) != 0); + if (strcmp((*a)->name, ".") == 0) + return (-1); + if (strcmp((*b)->name, ".") == 0) + return (1); + return (strcoll((*a)->name, (*b)->name)); +} + +/* + * Sort the entries rather than relying on the order given by readdir(3), + * which might not be reproducible. + */ +static fsnode * +sort_dir(fsnode *list) +{ + fsnode **array; + fsnode *cur; + size_t nitems, i; + + nitems = 0; + for (cur = list; cur != NULL; cur = cur->next) + nitems++; + assert(nitems > 0); + + array = malloc(nitems * sizeof(fsnode *)); + if (array == NULL) + err(1, "malloc"); + for (i = 0, cur = list; cur != NULL; i++, cur = cur->next) + array[i] = cur; + qsort(array, nitems, sizeof(fsnode *), cmp); + for (i = 0; i < nitems; i++) { + array[i]->first = array[0]; + array[i]->next = i == nitems - 1 ? NULL : array[i + 1]; + } + cur = array[0]; + free(array); + return (cur); +} /* * walk_dir -- @@ -73,7 +117,7 @@ static fsnode *create_fsnode(const char *, const char *, const char *, fsnode * walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) { - fsnode *first, *cur, *prev, *last; + fsnode *first, *cur; DIR *dirp; struct dirent *dent; char path[MAXPATHLEN + 1]; @@ -97,10 +141,8 @@ walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) first = cur = join; while (cur->next != NULL) cur = cur->next; - prev = cur; } else - first = prev = NULL; - last = prev; + first = NULL; while ((dent = readdir(dirp)) != NULL) { name = dent->d_name; dot = 0; @@ -138,10 +180,6 @@ walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) for (;;) { if (cur == NULL || strcmp(cur->name, name) == 0) break; - if (cur == last) { - cur = NULL; - break; - } cur = cur->next; } if (cur != NULL) { @@ -162,24 +200,11 @@ walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) cur = create_fsnode(root, dir, name, &stbuf); cur->parent = parent; - if (dot) { - /* ensure "." is at the start of the list */ - cur->next = first; - first = cur; - if (! prev) - prev = cur; - cur->first = first; - } else { /* not "." */ - if (prev) - prev->next = cur; - prev = cur; - if (!first) - first = cur; - cur->first = first; - if (S_ISDIR(cur->type)) { - cur->child = walk_dir(root, rp, cur, NULL); - continue; - } + cur->next = first; + first = cur; + if (!dot && S_ISDIR(cur->type)) { + cur->child = walk_dir(root, rp, cur, NULL); + continue; } if (stbuf.st_nlink > 1) { fsinode *curino; @@ -206,13 +231,9 @@ walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) cur->symlink = estrdup(slink); } } - assert(first != NULL); - if (join == NULL) - for (cur = first->next; cur != NULL; cur = cur->next) - cur->first = first; if (closedir(dirp) == -1) err(1, "Can't closedir `%s/%s'", root, dir); - return (first); + return (sort_dir(first)); } static fsnode * From nobody Fri Jun 20 13:52:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS32LnXz5y3y0; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS26cmdz3XDM; Fri, 20 Jun 2025 13:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6eIs9n52Qm0b+Fijn8Y7W7wSMrQejh1p7oI8deFvqlY=; b=lwTiLwBuPLABS5gDjji/dUy2AxDCawWqdwgOWx0Fk2EZdZXG3PZPvP4yFqExmmuWuoqPxg 7HInqoTDSvey2/fPfDZYlJxnWTQjE1uxSYBbGFqiWi4g/Kzw56vtcsZ0+RWQYyBNKURYRm 65sECc/jEAnbLtfqGcmeJ8fX+xe/4Gr5QTA7RszGIuZ3o+WbjHRoqi4PrHyla+QGvjHG3z 265EB4pySRsBCsmU/x+s8YLqe73Lnp4I/pgs7T4n+0rJhX91s+KUMqjg+bPDh3vfO7Cm+H vABkJZuZ3a/RtROrldQpV2BQJ3498zDEYO6ecmQ5pmXt+NblsRicxw00w71tnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6eIs9n52Qm0b+Fijn8Y7W7wSMrQejh1p7oI8deFvqlY=; b=GfJFx4jQsKRvdstiOjQtYBWxOD0NXy3uQYhD68ZaLrl5p7pzfApR129t0JkfnAXDbi6jWh vLWcC9V89iFTuekWuoYqgzeAAwCAzWpSyln0wKTI3+ihJaGic4mjQKe8xq0MN91Fi+3yJy dmpk+0rnkolG9W0Cx10KCWnilzr6nk4cOFT/3GTJEL5GdAxJhyZorfOytdUcs0fI0O1isK 9azxaYCGcWhAIm7mN+KGPfxmTrLVxa4XpYep4bp04x5xDW6P1vdOp2baQCtqefTAy4oaQJ 4LfXJEoXR3bsAPxQg3dx+aVcIeknlKF2VyWEn4FVpJITkLdY+xmObzX9mre6bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427538; a=rsa-sha256; cv=none; b=WFGJTcvXWUo2MpXJIUTjuX9jaUgAhx6iZP8vzGEj00tznqtErF3R9DEyuX58COMm11aoYM WFH8CCaa231zniQCFQ+RPyvXv+7Ty4uBA04QPtl4HEQfQtv+lepvuIHTg2EkzVVJMlOu3n 8Atwl/Af5qHzewvwDXGeeAfhqDqtsKiYD7SCI6lpquOTTOX15hrZhqRX3hpDUQc6L29kLi Cc4+RE/wXto/86HRsFxoIsnWks+Md1NcY7JAD5r/6r/HtJJWie8j8X7e4UNAJ7aaOkEU9f x9Ga+f9pxs0VjQ4RzfnN6Ko5X4UVlxgKZshg/lF/Zc5cZ+VqQoPgfHOvZzuX1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS266MPznSG; Fri, 20 Jun 2025 13:52: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 55KDqIqQ057915; Fri, 20 Jun 2025 13:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqIbH057912; Fri, 20 Jun 2025 13:52:18 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:18 GMT Message-Id: <202506201352.55KDqIbH057912@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: 4b3ee88ea7f8 - stable/14 - makefs: Use gmtime() instead of localtime for timestamps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 4b3ee88ea7f886ea4cd15f7838007e9cf7d3fcd5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b3ee88ea7f886ea4cd15f7838007e9cf7d3fcd5 commit 4b3ee88ea7f886ea4cd15f7838007e9cf7d3fcd5 Author: Mark Johnston AuthorDate: 2025-05-08 15:51:26 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 makefs: Use gmtime() instead of localtime for timestamps Otherwise the output file's contents will depend on the configured time zone. Reviewed by: emaste MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50198 (cherry picked from commit 018493d32ac2a637bfb9196bc80ecff89789b808) --- usr.sbin/makefs/msdos/msdosfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index 13a6ade47d6d..e5a4cb133204 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -114,7 +114,7 @@ unix2fattime(const struct timespec *tsp, uint16_t *ddp, uint16_t *dtp) struct tm lt = {0}; t1 = tsp->tv_sec; - localtime_r(&t1, <); + gmtime_r(&t1, <); unsigned long fat_time = ((lt.tm_year - 80) << 25) | ((lt.tm_mon + 1) << 21) | From nobody Fri Jun 20 13:52:19 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS52fQWz5y3y8; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS42QG8z3XYY; Fri, 20 Jun 2025 13:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FNxGzyNLYr5FLecFGPQgOO3YohqsJh+kdjRl83gLP/o=; b=N0vldEI6bMdyeOlVtBOUkCq16b9FqPbRvl8mNHDtjTh/3G832JqQqktRyrH/ZQ20E+Vkgu HKTAdUYCPjpv9jIWykaJhlunvUrnHvI57rACl7326gI/kPbePUp7IZHJlhFfesdIV9BLTX WeV/e2DkLVl6HTXDvvMglZskJyB4PFjTTNXjiww52QBP2hFzx/JvfP7FofZuyAhTvOMzVL cZ693JTDmIUp7tYoZfqHyVqXcCXaLS1B+U1OjsAoS7M96p27MS8TiBqX7YkTGu0kNz/OU3 pP3h3Flqn5jNWY54fGGJ7fLnZ/HdiG+rMoqRTY9YwT/jMSty9KqyBDZd2w87wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FNxGzyNLYr5FLecFGPQgOO3YohqsJh+kdjRl83gLP/o=; b=vw0rllOz9wfHCYSmlMAigICATkT/KI0smAp06qxpTvBfAGUgb9X+Dm5aa/y2mDF/Yjn09Y ISp/b2ENTV0VX4Hujx2SDv6mG02T/Rh+0ilfw46R6Ysett6XNpqgPwAMGIm+c0irTy3Adt E1M6cK34SFhbdbIgIxrOJBhhxT9nY1U8vv2TnNkLo4MNpaR73CWm+G9TeNt4pPHPDcI/iW H3MAq0nr5BhRsLFmCCBI9a63qCtoZThJcp0vE3jJ8zUP8lbm0GVWWNL+FUV2PwD1Pf7lP0 PU2JLeIiW6jLqAPO2ORGkgVsT83ZnTmOA0cTqbgaokj25qrX3QRuwfOdZd4XvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427540; a=rsa-sha256; cv=none; b=k40N3gsGsC4eb6Bch2b/XU+Tt5L1yegwaTgJJ3RJHhlDzzI+Jc5vqsYuRpSkFpAeqin1bL 05dkFHNBQkn8TYFqy29xu7g9fZz+SzASPNvPUnJWddfMPWJlRnsjG10CJyuYY2Tm5brVPH Idt50x+kUgA+l0387KiWCmlqH6/S6dRI3Y457qRod+07deGije4z7JWhbG6iuVjK1H+4IT yhTiEsUV8CcnLQ0tMFKPyX820nMfWyvGNMpbjkBI6Q+C5egeNdi56ObUClPNSiIYBPf9cZ BpP0RZMkzm7tqS94CWH0WLOduaEPynhlxQFhZx4vH8N8XxRFY3a8+E8lqnobvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS40Kw5znNr; Fri, 20 Jun 2025 13:52: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 55KDqJmI057948; Fri, 20 Jun 2025 13:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqJAv057945; Fri, 20 Jun 2025 13:52:19 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:19 GMT Message-Id: <202506201352.55KDqJAv057945@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: 18dac500d86f - stable/14 - e1000: Initialize helper variables in em_newitr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 18dac500d86f95c1a2399f2f3d94566e5a1e42c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18dac500d86f95c1a2399f2f3d94566e5a1e42c4 commit 18dac500d86f95c1a2399f2f3d94566e5a1e42c4 Author: Mark Johnston AuthorDate: 2025-05-27 16:31:06 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 e1000: Initialize helper variables in em_newitr() Due to races with the threaded transmit and receive paths, it's possible to have r/tx_bytes != 0 && r/tx_packets == 0, in which case the maximum byte count could be left uninitialized. Initialize them to zero to handle this case. PR: 286819 Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50416 (cherry picked from commit e0267657f3965a56d877075fe3d4d41b8afb2faf) --- sys/dev/e1000/if_em.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index f49682285875..27500f936c25 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1671,6 +1671,7 @@ em_newitr(struct e1000_softc *sc, struct em_rx_queue *que, goto em_set_next_itr; } + bytes = bytes_packets = 0; /* Get largest values from the associated tx and rx ring */ if (txr->tx_bytes && txr->tx_packets) { bytes = txr->tx_bytes; From nobody Fri Jun 20 13:52:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSB0GZPz5y41m; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS85SyTz3Xkw; Fri, 20 Jun 2025 13:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSh3FlE7lMrfmKcSkxFJD7KjA30DfmGazVPvzRt56NA=; b=higBBXjimzXkOTkuoFqKTc4aPE+RnX8j3g+Je16tg+zIGeKEKAH4sb4Jnp4lyPa6444Mwx 1JwKEDWYgjQNr7rbxHvxMMlZkvhW9T+z0WvL5UvErTGNi2PZDFKtgzBq0iEwG7z/M9vYF4 u+dsGvYkTKU9JtNPXXT4SYQGs+o7YyG5cv/M1hnYUX9KASaslpdcyw3gyI2GMUNXPBylAX ihyLbUj9A2EQ7VfMhH5gjIH7AWXo6qFvcA5HpXve0Ax1yxw6HziA+d84Qk1FyjCVUO2lmi ZAewSA8Hjd18V5+NP0OwRAKFk7HGl4z8A7iOx59iYqUcRaiD1tw56l/kjoyAjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSh3FlE7lMrfmKcSkxFJD7KjA30DfmGazVPvzRt56NA=; b=knXDYeYey+piBEJz1V3fXSmEAZy7PnNnfDz2HMwx2Cqkspkxn+DY8hOwQdHXh/KnGeup1t pY4h7p0Z/DVovLgMqRvzC0bOwVsLG+YviEN0pq4auc0hXZ0SKRqmtA8bCUmEbocC81voxs hIStqnOpGOeYGdImytgM0zW5CIPpSzqSgmZXX9BCbHqNC6x2cCxjNMLfQFauPcXLV9oB99 kbLqoBjs8PKqDur0P1LLurhrbmP8cPf4RAXkkt+EvuWBvFTKpu4S5g28mo0jbSnesaZdxp aifV1nTwYQTl865d66irkm8xL+zx1B3QvmkWhMgxbolR0SzXtkaWOi0Z/hdBOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427544; a=rsa-sha256; cv=none; b=Us71pCbfJVTv6A9NmnfCKnHD9Z5/I/ojPgCkt/TD5EHdjGttqxG1K2puVK+FQykJCH2Ajw QWsVth0HuIh5Ss5OaQfK0O1ei4tyOcg+8rH5hMn9KffRz2zht+fxWIlqYhV6Pm6KUsK86t ptOr+oQ8eF5PmNa7+rYRNcMQ5y1iCahPf0TqUIkt2CSbUYiCJNKlA0KWtxveNjC5hTNTmd uxsXjwQBRfnmh/hTCH44QwoghGjOEAOV+fL4kCxmIq1UkNVG1nYlKzYhh4DKuf/qgxkb6Y IJa/4GZ9/tTpyqCuu2I2kVrffQ8z4n4KlL4hEKOoEsi5be9VV5XPd3FtlkAY5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS83qTJznNt; Fri, 20 Jun 2025 13:52: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 55KDqOZv058091; Fri, 20 Jun 2025 13:52:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqOJf058088; Fri, 20 Jun 2025 13:52:24 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:24 GMT Message-Id: <202506201352.55KDqOJf058088@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: 0700107b4b7c - stable/14 - dtrace: Add compiler barriers around updates to per-CPU flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 0700107b4b7c7fcb858b5ed70a85d64bcb75d7cd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0700107b4b7c7fcb858b5ed70a85d64bcb75d7cd commit 0700107b4b7c7fcb858b5ed70a85d64bcb75d7cd Author: Mark Johnston AuthorDate: 2025-05-28 20:45:27 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 dtrace: Add compiler barriers around updates to per-CPU flags Otherwise there's nothing preventing reordering of memory accesses with respect to these flags being set or cleared. Since their most common use is to create a section in dtrace probe context where memory faults are intercepted by dtrace_trap(), such reordering can turn dtrace errors into fatal exceptions. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 0440b3d2cbf83afb55209a9938b31a48912f222c) --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 ++ sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index cfd403ac1a01..7192df200ae2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -549,10 +549,12 @@ dtrace_load##bits(uintptr_t addr) \ return (0); \ } \ \ + __compiler_membar(); \ *flags |= CPU_DTRACE_NOFAULT; \ /*CSTYLED*/ \ rval = *((volatile uint##bits##_t *)addr); \ *flags &= ~CPU_DTRACE_NOFAULT; \ + __compiler_membar(); \ \ return (!(*flags & CPU_DTRACE_FAULT) ? rval : 0); \ } diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 263b254b9021..c274a9f3357a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2421,11 +2421,17 @@ extern void dtrace_helpers_destroy(proc_t *); #define DTRACE_CPUFLAG_ISSET(flag) \ (cpu_core[curcpu].cpuc_dtrace_flags & (flag)) -#define DTRACE_CPUFLAG_SET(flag) \ - (cpu_core[curcpu].cpuc_dtrace_flags |= (flag)) - -#define DTRACE_CPUFLAG_CLEAR(flag) \ - (cpu_core[curcpu].cpuc_dtrace_flags &= ~(flag)) +#define DTRACE_CPUFLAG_SET(flag) do { \ + __compiler_membar(); \ + cpu_core[curcpu].cpuc_dtrace_flags |= (flag); \ + __compiler_membar(); \ +} while (0) + +#define DTRACE_CPUFLAG_CLEAR(flag) do { \ + __compiler_membar(); \ + cpu_core[curcpu].cpuc_dtrace_flags &= ~(flag); \ + __compiler_membar(); \ +} while (0) #endif /* _KERNEL */ From nobody Fri Jun 20 13:52:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS86clkz5y3yC; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS74PFXz3Xmt; Fri, 20 Jun 2025 13:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBQGYkyzsYGmU3SPruwTC3JTWpq0ImL6Oso85DoB3lg=; b=Izc47YM09Q/HTJOalL8VpKedqW8A5upVI65L2hy2ze/F1BPmNbcdESyPucRGX4JiW2QuAQ PrvmzuKOb2F4u+/rm11Cl/i7pPhGFRsq6sDyGXhs++mo59gwrJysUx8iWZm7QP+sf9Rm9a ulArbxs6kLdnmSwRmsXKQbu0De9r157tr1ABH60S6dOkpGFi6gATq9ippnvb7B9grLg4VX O42jOXoEaNmXM9THulKqT46mlc0xy730iI2v/QmS84pYyUF5EU+kqEBAQcC345HVD9rfFg P1m44sXg9CkXj8IDkBiZSyufeMdoHIcqsXhhc1jXAcLy8QtxjASZ39EM+xUMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HBQGYkyzsYGmU3SPruwTC3JTWpq0ImL6Oso85DoB3lg=; b=ZEl7BiHq1Yntq1hQKX0a9j2TMBIGjoXMCQRuRg5MB7I9RJISbFwJqR98ZxfL0ETocDuGwx pWHmNJell3CsesnlkExP0lJ+htZk0zPFliaB7h4V61a7wWzYSdGlCs/9VZC7Z+pvSo9Tof QtNVmpcJl6O9Xfl++9ItHdsf3/KXwgp9d/PfZukDJBwhcjH18FbQDVEE+pZUducKKsu4Jv L2SnRwCxpVnnWyPNtpriomj4CA0EP0CeUq9i8faFthwrb8k8kUPnp+yKrLWYQ6hdgA3goz OMS1kAL0HDGDQe2dMLNlRHxMFejam2L9xqxNjmVHQk4zM99gzC+hEG+dt+A/Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427543; a=rsa-sha256; cv=none; b=jOkbG7kQRZFNJovoOoEUsu3X9Kihio/xSSL1kbhQGSrxLNnWO4d5YvQADMev6FsNU2ZBh3 KYYozNrOQTTnUZy+Arhw4X3FKgi4h5rkdGdDkk/bZQ7LXw4w3gx4r3LF1uYEwjt64tCqKI /oiXT+xS1u4CeqpKnvsCm0gm/c1xy4rLKyL872pQTE9XOThjfwUrfn1CzcsHnBkQQn3UD6 8xuKerYnOLcJk7znMARj6VLuJhvIGxuRynR/kiMuyXNXvEOBHA9noJtqNsRGmYtImG2Ju7 3B5MkrZfenclIkjpHmqs2KmWiYWWHLUfkcr24CLxI73HavSoeGb0vzf7evU5aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS72v40znfF; Fri, 20 Jun 2025 13:52: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 55KDqNKH058051; Fri, 20 Jun 2025 13:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqNd1058048; Fri, 20 Jun 2025 13:52:23 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:23 GMT Message-Id: <202506201352.55KDqNd1058048@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: f3ac4f027b26 - stable/14 - dtrace/profile: Stop storing the probe name in struct profile_probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f3ac4f027b264fa25a11c53f8a37cf9c90addd1a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f3ac4f027b264fa25a11c53f8a37cf9c90addd1a commit f3ac4f027b264fa25a11c53f8a37cf9c90addd1a Author: Mark Johnston AuthorDate: 2025-06-04 21:13:08 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 dtrace/profile: Stop storing the probe name in struct profile_probe It's unused, and the naked strcpy() was susceptible to buffer overflow if one creates, say, a probe called "profile-2000000000ns". Reported by: CHERI MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 98ef590f77392159938d2e6f9fd45bf31d10b9c1) --- sys/cddl/dev/profile/profile.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index a939c13aad45..3b95254be537 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -119,7 +119,6 @@ struct profile_probe_percpu; #endif typedef struct profile_probe { - char prof_name[PROF_NAMELEN]; dtrace_id_t prof_id; int prof_kind; #ifdef illumos @@ -303,7 +302,6 @@ profile_create(hrtime_t interval, char *name, int kind) } prof = kmem_zalloc(sizeof (profile_probe_t), KM_SLEEP); - (void) strcpy(prof->prof_name, name); #ifdef illumos prof->prof_interval = interval; prof->prof_cyclic = CYCLIC_NONE; From nobody Fri Jun 20 13:52:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS86nXHz5y3yD; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS62vpcz3XkZ; Fri, 20 Jun 2025 13:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tssK62qtU5xxv4JT38pGmT4XNPOhVYSoW8MM2iXrSnw=; b=QMJjCke0vxyeZSABHPtS0oDsTjVrPORmKPYMgINYczoGAvdyjfdW8lGTfl06uESJXN2Inc GqkeN3dkR+VwroSE8Q7Ys1uvHlJ4dLRbIg7B2cubwWX7v0SQA0WwFfjS1cu9q/L/vJVQNL MVxpuHV0vBQ0QgcASmys1bADrDzqEyhbiWVgy644cJq/u+4fFcF/aRS2W+aBnQ6CvONTTK THbkXNBfG2TSoJZUfsWKGkralzq4Vuq28YwW/SXCQt7wHD4hH0DWy276YxhagW8fO5MBb/ Uqi0KKQ5euUazWK+83/jIY3CQabuWgwVL7zECast4LoZjABY7d+vD3aO4VKf3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tssK62qtU5xxv4JT38pGmT4XNPOhVYSoW8MM2iXrSnw=; b=rfmHxYsHfwxhFkVVp/2IuymTt1JeCyc2ogULL2N3Vd713Wr9EW+6dVipAiZQppZXqkaCEn RdyowEPhQPdtCxvrUeERrOUjnJyRIPLoue90/V/FAVSFmn0eJARKPaeKqHCFE5hiJsi7S8 /gAr6t4tv3UqtGyuc15RQ/S1mQg966prc/yEd8qFhrada4mpA0rwW433vE+h5DkP1CaCcd T2315IXR0xiO8/UbQ+T/4Itn82DdPO99fMG2g2oqX4fid3GBgjnZsgTI9tKc7wieWpZUVD XDHlhsa+b5TcpQjADzbqVoS+LYyTEn4Yg4yT1Cfa++SJyOoDrR2xceNXyftkEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427542; a=rsa-sha256; cv=none; b=XJrHWTljIxqsP3lBR65NhuLKcDbii5U/BHkDkkkQ6fLqAv+grxopixCcdRfIUoK2QK5EmS sYsgLE5eVQi8JBjrpk87N0rVCU528ZYf2GuSH+w+RIZdFkafRg1s554Eld2PM/RDpwPkMy BLqzipjpUZuHoCrG+Gep3TMRB8AvQSNq4hUOaroSYfkj6WLTaDFUWTkeMLkUx8Pq8h1kHU zqGjvJ/vT4oXNULMstary4wMbdSXPbXgTvaqF+F4WiLj62JxpY4rS2JznopengwJeHN/eZ iIHVY5BJ5YogpYkjdynb47/Y67gmycbaS+DILgGVhufpvsWF8g1ezazmuZWYfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS62CDvznCs; Fri, 20 Jun 2025 13:52: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 55KDqMbT058016; Fri, 20 Jun 2025 13:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqMOV058013; Fri, 20 Jun 2025 13:52:22 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:22 GMT Message-Id: <202506201352.55KDqMOV058013@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: d22903d79b48 - stable/14 - namei: Fix cn_flags width in various places List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: d22903d79b48b119388ebe5fd8c246da2237155b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d22903d79b48b119388ebe5fd8c246da2237155b commit d22903d79b48b119388ebe5fd8c246da2237155b Author: Mark Johnston AuthorDate: 2025-05-27 13:29:14 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 namei: Fix cn_flags width in various places This truncation is mostly harmless today, but fix it anyway to avoid pain later down the road. Reviewed by: olce, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50417 (cherry picked from commit 0d224af399a66f00a5b33e5512fc018062cabf1d) --- sys/fs/cd9660/cd9660_lookup.c | 2 +- sys/fs/fuse/fuse_vnops.c | 9 ++++----- sys/fs/smbfs/smbfs_vnops.c | 2 +- sys/fs/unionfs/union_vnops.c | 2 +- sys/kern/uipc_mqueue.c | 3 ++- sys/kern/vfs_cache.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c index 02e9c6bb5aa6..ec177036acb1 100644 --- a/sys/fs/cd9660/cd9660_lookup.c +++ b/sys/fs/cd9660/cd9660_lookup.c @@ -129,7 +129,7 @@ cd9660_lookup(struct vop_cachedlookup_args *ap) char *name; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - int flags = cnp->cn_flags; + uint64_t flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; ep2 = ep = NULL; diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 87e44051d9a9..423ce05a595f 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1432,8 +1432,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) struct timespec now; int nameiop = cnp->cn_nameiop; - int flags = cnp->cn_flags; - int islastcn = flags & ISLASTCN; + bool isdotdot = cnp->cn_flags & ISDOTDOT; + bool islastcn = cnp->cn_flags & ISLASTCN; struct mount *mp = vnode_mount(dvp); struct fuse_data *data = fuse_get_mpdata(mp); int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; @@ -1466,8 +1466,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) return err; is_dot = cnp->cn_namelen == 1 && *(cnp->cn_nameptr) == '.'; - if ((flags & ISDOTDOT) && !(data->dataflags & FSESS_EXPORT_SUPPORT)) - { + if (isdotdot && !(data->dataflags & FSESS_EXPORT_SUPPORT)) { if (!(VTOFUD(dvp)->flag & FN_PARENT_NID)) { /* * Since the file system doesn't support ".." lookups, @@ -1581,7 +1580,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) } } else { /* Entry was found */ - if (flags & ISDOTDOT) { + if (isdotdot) { struct fuse_lookup_alloc_arg flaa; flaa.nid = nid; diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 1e7dcafb1121..c30995508c00 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -1051,7 +1051,7 @@ smbfs_lookup(struct vop_lookup_args *ap) struct smbfattr fattr, *fap; struct smb_cred *scred; char *name = cnp->cn_nameptr; - int flags = cnp->cn_flags; + uint64_t flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; int nmlen = cnp->cn_namelen; int error, islastcn, isdot; diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index eff437fbcad3..7618e2575819 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -86,8 +86,8 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) struct vattr va; struct componentname *cnp; struct thread *td; + uint64_t cnflags, cnflagsbk; u_long nameiop; - u_long cnflags, cnflagsbk; int iswhiteout; int lockflag; int error , uerror, lerror; diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 75daf94b9849..7f539ac94cf6 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -847,7 +847,8 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap) struct mqfs_node *pd; struct mqfs_node *pn; struct mqfs_info *mqfs; - int nameiop, flags, error, namelen; + uint64_t flags; + int nameiop, error, namelen; char *pname; struct thread *td; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a61a684e396e..e25efe2986b2 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4087,7 +4087,7 @@ SYSCTL_PROC(_vfs_cache_param, OID_AUTO, fast_lookup, CTLTYPE_INT|CTLFLAG_RW|CTLF */ struct nameidata_outer { size_t ni_pathlen; - int cn_flags; + uint64_t cn_flags; }; struct nameidata_saved { From nobody Fri Jun 20 13:52:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzS55188z602tY; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS51fhYz3Xh3; Fri, 20 Jun 2025 13: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=1750427541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2998HNchk5Qqfy5TYBZEF8ApfCl0d7Dek2KyRUCnAI=; b=LYDohjMfhCZ4mZzIWjQfOFs6rS7FRzq1eyamPOB+KunkAefZRHnC8o8XDwV6VXpDDKVEQj kQzKKkcHXeAgKU70xQH82ZhYJiQ1zZoYh9P40LYYudspLDLBFDiIu/f+t2yI3xnc1lxH5u quc4DJKq1P3diywsiB0K6lvqFh9Uli/dWj0ishqmBCsvkTTbFs7SJzbRQ57dkry5pORLRV JkpW2+mRQiW9WjxCKfw+86cC51TvWbHImPu/bIW88Q8++VpFhswNM2YTv1UdqbxiCVc92n gmYAJue8fRhsp+IRBbeS6QvYqpjDdcoD/fiBKEceQXX8df4UaFWHTkxNafYVjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2998HNchk5Qqfy5TYBZEF8ApfCl0d7Dek2KyRUCnAI=; b=mOSZoUiY9FoUtqalKETZszypORsZHRMDeBRU1YVwnqlScXGhkZun4el5hGOk72mdtmiBUT OHI2uRGbj6B1IeyujOMjE8AeW91pbaLoFs//w2i3M73QaMZpZKKcQwDWP5l6Z9PVuclh24 qlx05F+TRIaU/7ZwSczkOxakA5hunDxAxBl3yB8u/bgXoS1pwg0/0JigfSIs9C/DSMTaFT atxmVtYNdxsLNId2C7DbMhwVpDQNRWdAk9F6+N3WQAIW2AutldYdPRDzaIp5GDME7oeia9 jzhz91y8wtvrDLdY57NZiji9M6R1nfn4J0aGlMFoAIqFP8ubHxz1veWqqytPRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427541; a=rsa-sha256; cv=none; b=Kure6d4YsobAxU7iADvupIu14d/8OTLd9wI0zdH4fex1ONKf9SGZDyL/IVT/C4x8HDYrMX AMmY8Vob+eu+EfRgybqZvFqdIBGGz0A4nJJ91VRAAyNqhmSVsVTOkGo9Bsr8DS8pZqdiTd opgu213qb45EAs1dkCOEm3YuvtusYcqlERMIA2SmEwJBt73wnxY8yTmI1NkwJWsdJMa/zw +a5srIjTZu9jNm26lpULb+n8tj+8FIGiJ79pRPvdYsaW4Pum7VsYQv+Y9LXEcq8N0jmHPO bb0BZF+U+h4SwR8Q40tOTPF9Ct0fykWuBY/XfOHHRo2zav7ryrwVCpOGjWgUCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS51DrTznt1; Fri, 20 Jun 2025 13: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 55KDqL2l057982; Fri, 20 Jun 2025 13: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 55KDqLnT057979; Fri, 20 Jun 2025 13:52:21 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:21 GMT Message-Id: <202506201352.55KDqLnT057979@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: 35e91b0447f1 - stable/14 - e1000: Fix some issues in em_newitr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 35e91b0447f185085624ee9c5e529f35bf556184 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=35e91b0447f185085624ee9c5e529f35bf556184 commit 35e91b0447f185085624ee9c5e529f35bf556184 Author: Mark Johnston AuthorDate: 2025-05-27 17:08:07 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 e1000: Fix some issues in em_newitr() - Load packet and byte counters exactly once, as they can be concurrently mutated. - Rename bytes_packets to bytes_per_packet, which seems clearer. - Use local variables that have the same types as the counter values, rather than truncating unsigned long to u32. Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50416 (cherry picked from commit 731c145612dd6ffe457a562959a5c027acf13334) --- sys/dev/e1000/if_em.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 27500f936c25..f0ef6051fab1 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1644,14 +1644,16 @@ em_newitr(struct e1000_softc *sc, struct em_rx_queue *que, struct tx_ring *txr, struct rx_ring *rxr) { struct e1000_hw *hw = &sc->hw; + unsigned long bytes, bytes_per_packet, packets; + unsigned long rxbytes, rxpackets, txbytes, txpackets; u32 newitr; - u32 bytes; - u32 bytes_packets; - u32 packets; u8 nextlatency; + rxbytes = atomic_load_long(&rxr->rx_bytes); + txbytes = atomic_load_long(&txr->tx_bytes); + /* Idle, do nothing */ - if ((txr->tx_bytes == 0) && (rxr->rx_bytes == 0)) + if (txbytes == 0 && rxbytes == 0) return; newitr = 0; @@ -1671,18 +1673,20 @@ em_newitr(struct e1000_softc *sc, struct em_rx_queue *que, goto em_set_next_itr; } - bytes = bytes_packets = 0; + bytes = bytes_per_packet = 0; /* Get largest values from the associated tx and rx ring */ - if (txr->tx_bytes && txr->tx_packets) { - bytes = txr->tx_bytes; - bytes_packets = txr->tx_bytes/txr->tx_packets; - packets = txr->tx_packets; + txpackets = atomic_load_long(&txr->tx_packets); + if (txpackets != 0) { + bytes = txbytes; + bytes_per_packet = txbytes / txpackets; + packets = txpackets; } - if (rxr->rx_bytes && rxr->rx_packets) { - bytes = max(bytes, rxr->rx_bytes); - bytes_packets = - max(bytes_packets, rxr->rx_bytes/rxr->rx_packets); - packets = max(packets, rxr->rx_packets); + rxpackets = atomic_load_long(&rxr->rx_packets); + if (rxpackets != 0) { + bytes = lmax(bytes, rxbytes); + bytes_per_packet = + lmax(bytes_per_packet, rxbytes / rxpackets); + packets = lmax(packets, rxpackets); } /* Latency state machine */ @@ -1692,7 +1696,7 @@ em_newitr(struct e1000_softc *sc, struct em_rx_queue *que, break; case itr_latency_lowest: /* 70k ints/s */ /* TSO and jumbo frames */ - if (bytes_packets > 8000) + if (bytes_per_packet > 8000) nextlatency = itr_latency_bulk; else if ((packets < 5) && (bytes > 512)) nextlatency = itr_latency_low; @@ -1700,14 +1704,14 @@ em_newitr(struct e1000_softc *sc, struct em_rx_queue *que, case itr_latency_low: /* 20k ints/s */ if (bytes > 10000) { /* Handle TSO */ - if (bytes_packets > 8000) + if (bytes_per_packet > 8000) nextlatency = itr_latency_bulk; else if ((packets < 10) || - (bytes_packets > 1200)) + (bytes_per_packet > 1200)) nextlatency = itr_latency_bulk; else if (packets > 35) nextlatency = itr_latency_lowest; - } else if (bytes_packets > 2000) { + } else if (bytes_per_packet > 2000) { nextlatency = itr_latency_bulk; } else if (packets < 3 && bytes < 512) { nextlatency = itr_latency_lowest; From nobody Fri Jun 20 13:52:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSD2bZ2z5y46b; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzS96HZdz3Xl4; Fri, 20 Jun 2025 13:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tCzXVqg0QHBibsj3P9+wl2XPGj1zxF8dKx5AofKN/iA=; b=LTRFdpUmOIiN+ltDH2yCykk3aS+HUvwR6dmsIc3URpi2vG2MQsa73qbBf27/lt6r5cSQu7 lwMvlQa/HCF5JLYda7RU+MnERNqfUHCrBrQNYpmG5i5eQz8yy+h6ZsPJKaRkw5x46R906J 573EIrId4morCkDaJmi5blfC/BR49KK79HgZcXOsesHr1/4Dg2I8BNkIU3jk0BpAlTr27Z Y48p4okTQD1FzNPNcXsq0UWn8kmSHnNPc0b3ycnh/QoSa3HW97n9xi6KFYoz0ysj6b+EQr qeykt5gRJ5XUO1fMqHEafC8Pl9OgvVWpFC0JOdgA/pJQK04nJvbG5voOPllDlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tCzXVqg0QHBibsj3P9+wl2XPGj1zxF8dKx5AofKN/iA=; b=QGcsn4ecj6TtSz6Xue6oYEFVVU1EEMLOeMWazPAnV4u6o94SsZH+cqGQXXz6UGiNmEiY0e UEPpmESHF80t30HsMcpfcZHfSaji4oTADmIOw4FfgNXgk36LpLxqDOXdU7FTu3ZwJJHTaT /toSSFqhs433vYvRzZHVc1zNbpvxseOoJp2KYKcE20wrlLE1wWLFKJ7KsW/X+PEhmZe7wk EsvgkL5GcH6HvpHZfpR+BJ2EiT0iRCC/R31qyw/3o/P6QJ40IXrEj6J5mbT4aKXW9L+1ZW /jnX5lqbjtvtSPypZWgxBjO7AkbCEp+t8lwooVYeOrod/ilrgtama1mywHQ84Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427545; a=rsa-sha256; cv=none; b=bQuOB9Dk61GVA1WOXdCNUSdYWSljzdt7jySPK/uoyWiqiYwXlfjSsYOzzh28Qpr5pqB4Us UJrPUxwFr//TQxVotgezPx+nf+qsCz75YG+qRkCwDmx9WkVCTL2DL8Henb6lpVMWKlv4/w AP62GxTbtdefq7OpDa3wGX/3oYWAcbVP5PsQJbTSrrDm6kk0+ScidPoIn4Lm3g4kkEmU/3 9SIbk5JbeA14qLKc2cOSRfOnxDgndR9nKTyAyToRKqL1D6v1esi4m1mBAolupxJuzCnRQL CabGKUO4Di817roiQsaqMwkLOEi4UYSjGNLKiVm19cnzpHEd7/0maE6ThNxESQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzS94nPqznfG; Fri, 20 Jun 2025 13:52: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 55KDqPHQ058124; Fri, 20 Jun 2025 13:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqPMi058121; Fri, 20 Jun 2025 13:52:25 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:25 GMT Message-Id: <202506201352.55KDqPMi058121@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: 7fcba358114b - stable/14 - igc: Initialize helper variables in igc_neweitr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 7fcba358114b147026d83c6952adb7948f4a1585 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7fcba358114b147026d83c6952adb7948f4a1585 commit 7fcba358114b147026d83c6952adb7948f4a1585 Author: Mark Johnston AuthorDate: 2025-05-28 13:31:34 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:09 +0000 igc: Initialize helper variables in igc_neweitr() The justification is the same as in commit a5b5220b1807 ("e1000: Initialize helper variables in em_newitr()"). Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50547 (cherry picked from commit d6a9f49185797c6b67e517a3d83ef63436c8d4f3) --- sys/dev/igc/if_igc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 318d2770911c..f34b0507c1ea 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -936,6 +936,7 @@ igc_neweitr(struct igc_softc *sc, struct igc_rx_queue *que, goto igc_set_next_eitr; } + bytes = bytes_packets = 0; /* Get largest values from the associated tx and rx ring */ if (txr->tx_bytes && txr->tx_packets) { bytes = txr->tx_bytes; From nobody Fri Jun 20 13:52:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSD2Tjjz5y4LY; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSB5l6lz3Xdv; Fri, 20 Jun 2025 13:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmFrz382F5b3c6lQPRTMzj0CGGvcYWytd//8YgDyjU8=; b=ZBxHuxkbzY2OXP85Kg8iO8/AGglI8j2IZOHL1BKFqjx/gIUslrX2rb3+sSLihNFUR6vn9Q kFaB8LhD6QttOw5IAwW96prOEByNKIr3hH4IJY0JZta90/1A6jJI5ae/t/AV1gooAyeb5F 7BAaETI0TfzjGDJ8LlAJNElzogD/LVEYrEo+TzHvLeJw7Te9S/hQxCfLU1egXjvpHVPO6G 7uv3jwhThUZy3e1b/e5GfD+L2vseZVv1HsqSOzVBNzTw8bbdcu6auzgBnVA5NxvaokbkZB c8y+SD2l8B0ZKaNdaj6h4N4lKj/hl20O5aTHC4QvCcmySpwUxG4HWWKYs4sxDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmFrz382F5b3c6lQPRTMzj0CGGvcYWytd//8YgDyjU8=; b=M54mTlOGbAcA9Mrp1PrCmZ1uVwcEi8S8k3mmG7ZU466DqLJ4zRTqLQdMMAi/5EvqAJcjCu BBHtTGGdZkhUQUF8oBdM4wphS190ygZoqVZ7/kI4CVuDd4Oi/4qdARjCXdLOCvw8ezBf5V uSBHDPuwr5np4LV22IhksEqckhe9nHNeugyDAqg+m9SZhzPCZBNQd32g63u1sRwU3nbQ5o pRn6UIo2wwl56xcr/x3VN9SKCYqqb/JHvUj9H+l4GisATiM7BPQ1l+z1w6ISUjaYWHikwZ sKkC/sTJBn7lgZ7qstRsQ/AUecEW3UhZVi0I9aSwAbVLLLG/rrIR1K5utYgAlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427546; a=rsa-sha256; cv=none; b=YaIuXceZQb+SNheu5GWCI5bMgHVSrmoOgJer/v6yjiVyVfc/MKetRk9bqHjo7Ejzm9gVgW Mw7kw2P17Y4eFRKhOooZ2BwQ6HOS2KHi1UydpOnQVjFB5g7Zrvvj71h4lGjL+zoRsxeL+w xrXQzCS+/Hon+T9NKLGLwbc15pqOVpU7LsZJOMdsgZSsD3/J/4LEKCa9NCovSVqO/k3anA e4H9UYtjLsNavj8pVPM2BrvdjUJThllKKT0J3ekEXqBOFMg+lp95EWrLn37i5UcMOuBmgz sGQrd18VvWJwACxGcMi9+hosGhxzP3wPraaq/yI+NeCF9PAmGdyft7Uq8NUNEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSB5Hh0znCv; Fri, 20 Jun 2025 13:52: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 55KDqQsT058158; Fri, 20 Jun 2025 13:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqQMk058154; Fri, 20 Jun 2025 13:52:26 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:26 GMT Message-Id: <202506201352.55KDqQMk058154@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: 021eb07a8b28 - stable/14 - igc: Fix some issues in igc_neweitr() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 021eb07a8b2806f875aed20de4320cd2d2a90ab7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=021eb07a8b2806f875aed20de4320cd2d2a90ab7 commit 021eb07a8b2806f875aed20de4320cd2d2a90ab7 Author: Mark Johnston AuthorDate: 2025-05-28 13:31:44 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:46:10 +0000 igc: Fix some issues in igc_neweitr() The justification is the same as in commit fb876eef219e ("e1000: Fix some issues in em_newitr()"). Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50548 (cherry picked from commit ef062029ceffacb6bde3a5639a2bd8c4d59ca1df) --- sys/dev/igc/if_igc.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index f34b0507c1ea..a1ae35c7aa43 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -909,14 +909,16 @@ igc_neweitr(struct igc_softc *sc, struct igc_rx_queue *que, struct tx_ring *txr, struct rx_ring *rxr) { struct igc_hw *hw = &sc->hw; + unsigned long bytes, bytes_per_packet, packets; + unsigned long rxbytes, rxpackets, txbytes, txpackets; u32 neweitr; - u32 bytes; - u32 bytes_packets; - u32 packets; u8 nextlatency; + rxbytes = atomic_load_long(&rxr->rx_bytes); + txbytes = atomic_load_long(&txr->tx_bytes); + /* Idle, do nothing */ - if ((txr->tx_bytes == 0) && (rxr->rx_bytes == 0)) + if (txbytes == 0 && rxbytes == 0) return; neweitr = 0; @@ -936,18 +938,20 @@ igc_neweitr(struct igc_softc *sc, struct igc_rx_queue *que, goto igc_set_next_eitr; } - bytes = bytes_packets = 0; + bytes = bytes_per_packet = 0; /* Get largest values from the associated tx and rx ring */ - if (txr->tx_bytes && txr->tx_packets) { - bytes = txr->tx_bytes; - bytes_packets = txr->tx_bytes/txr->tx_packets; - packets = txr->tx_packets; + txpackets = atomic_load_long(&txr->tx_packets); + if (txpackets != 0) { + bytes = txbytes; + bytes_per_packet = txbytes / txpackets; + packets = txpackets; } - if (rxr->rx_bytes && rxr->rx_packets) { - bytes = max(bytes, rxr->rx_bytes); - bytes_packets = max(bytes_packets, - rxr->rx_bytes/rxr->rx_packets); - packets = max(packets, rxr->rx_packets); + rxpackets = atomic_load_long(&rxr->rx_packets); + if (rxpackets != 0) { + bytes = lmax(bytes, rxbytes); + bytes_per_packet = + lmax(bytes_per_packet, rxbytes / rxpackets); + packets = lmax(packets, rxpackets); } /* Latency state machine */ @@ -957,7 +961,7 @@ igc_neweitr(struct igc_softc *sc, struct igc_rx_queue *que, break; case eitr_latency_lowest: /* 70k ints/s */ /* TSO and jumbo frames */ - if (bytes_packets > 8000) + if (bytes_per_packet > 8000) nextlatency = eitr_latency_bulk; else if ((packets < 5) && (bytes > 512)) nextlatency = eitr_latency_low; @@ -965,14 +969,14 @@ igc_neweitr(struct igc_softc *sc, struct igc_rx_queue *que, case eitr_latency_low: /* 20k ints/s */ if (bytes > 10000) { /* Handle TSO */ - if (bytes_packets > 8000) + if (bytes_per_packet > 8000) nextlatency = eitr_latency_bulk; else if ((packets < 10) || - (bytes_packets > 1200)) + (bytes_per_packet > 1200)) nextlatency = eitr_latency_bulk; else if (packets > 35) nextlatency = eitr_latency_lowest; - } else if (bytes_packets > 2000) { + } else if (bytes_per_packet > 2000) { nextlatency = eitr_latency_bulk; } else if (packets < 3 && bytes < 512) { nextlatency = eitr_latency_lowest; From nobody Fri Jun 20 13:52:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSD5j8sz5y3yK; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSC6mT4z3Xw7; Fri, 20 Jun 2025 13:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZfQCNsJK2VqV/oELrrmWhbYJB8BmSQH3jLEU0aGn5I=; b=E/psZ7Nz7nP/tvqrafRFKwQ50PeLhCY06akEdnCP39PFby3JTymytv5XSDgJz9OifUCkYg n6KtRXqdsq1S3Q2fgMvtnEJF7l7VSrd1+Izq1XFT133v6xp7hk0G3GC52VWdrssBsz4ePP 0rEFUB7EIUhKX/VCmBYAQRDDNj5taQWSqpy+DR3eJd+hpvtTPV2JsvlYlF1JQd0OXqfMmZ wReuxAOG840k23ZEBHcW0ZZV6Lk3t9I8gIcQGVnxkgUetPiSqUb4S/TzhffzsOpzEsCDQy wNz5Iuwku5NvubAYaOPsYV85QavD1VoSf40XADT/vSjkybZg0L4jHkH9iXOs0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZfQCNsJK2VqV/oELrrmWhbYJB8BmSQH3jLEU0aGn5I=; b=xU9r91+g6laWGP7MTBpQCCiI4NsNxurMF3wPDYpBHiS7GwNBvib2kVXgOgma0+p+yoHtNZ Kc8SYSE3/8deFVCIgQyvqTDn4WQQ4ySX7xlQwpf7ky9TfnmvwLIaBhZhSJ/JXqHSTwqawY McaNZ9ej9f4r4jK1LVIQcqmVkAsdY9oyrGLYja9uV00wpsPh3pEmwBHDDTRiX9cHeTrcp4 IMW1wQ4sPhYQgJ9x/MXmDYLj7GmbQAPmitZU+/AKzCrnvwJ99d98G2xzr0iD/khWMDZze4 fq6Vb9omtl5eNxX66AGIrljne3dJjghOkZBGREOYBzDvXgqP2Ru0sRuqwg7CpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427548; a=rsa-sha256; cv=none; b=rPpgSH8fNzJtU17lFWddgpsKnAZj1K9OutP/+HtkIbr5MjimY6fLiGTbyfshyouXHpsL3k zZC4VuYaToqrvzEDhZZhX4JPsC19XdMCWhagvyzsVMZ/njI5dLW/2UO7airnJXBesBHefj pnH0fY52grgL4aYoH4QDJ56Qv8YCXhXDlGQ6GQF4xkDxWbgeVrEe2Z93RVBoNpzRpHPuCp 7SmQMipOOPqoGJ8tb/aTUSEER0haNRHfOyvN7pFSaqN6rXJghNEZATQqtPGVAN4BXpaiaB eswrxf1/SlsQIczv++EEwC7mMRuEVoOnknTDUiLdQbIGi9bLgftqAsG692enVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSC621czp76; Fri, 20 Jun 2025 13:52: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 55KDqR31058192; Fri, 20 Jun 2025 13:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqRgC058189; Fri, 20 Jun 2025 13:52:27 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:27 GMT Message-Id: <202506201352.55KDqRgC058189@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: 0d698e74fb6b - stable/14 - devfs: Set eofflag in devfs_readdir() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 0d698e74fb6b188037fffb626efc050e41b5afcd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0d698e74fb6b188037fffb626efc050e41b5afcd commit 0d698e74fb6b188037fffb626efc050e41b5afcd Author: Mark Johnston AuthorDate: 2025-05-29 18:25:56 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 devfs: Set eofflag in devfs_readdir() At least vn_dir_next_dirent() checks that eofflag is set appropriately when INVARIANTS is enabled, so the omission here could cause an assertion failure. Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50598 (cherry picked from commit 198d2ed2d4c6c921928a9175f825d0d8345e5a46) --- sys/fs/devfs/devfs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 7d17362df05e..4b6845602218 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1517,6 +1517,8 @@ devfs_readdir(struct vop_readdir_args *ap) */ if (tmp_ncookies != NULL) ap->a_ncookies = tmp_ncookies; + if (dd == NULL && error == 0 && ap->a_eofflag != NULL) + *ap->a_eofflag = 1; return (error); } From nobody Fri Jun 20 13:52:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSF41BNz5y3yP; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSF0lZzz3Xlp; Fri, 20 Jun 2025 13:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9l2gpHg+o5lwPgekZTnIFS9DvzgDpv9qEbbXKTip9T8=; b=jh7vd9kfVc+fg6yNzItfD2Acii7x0NoVxLawDC3SELf3aLmI2X3rZul7nCJuIDQ+mtVO1a jbpaoeoVPQks4DGMJu7lCIAYvQW4NSniBMJPS/Iat2hiYhH56Q+pieG7vbeV5lHUo+Asbb rmZcE0tBsRt09AgJQfkMlwMuTjZwydXRZubHZScSywMGPe+1INXSfcMOiRByP7cXbbtaeT 4Eqcxms5a2Ua3S6vvfBZlYJAjiEnp0tW/GD+jIsRhkPRq1zLYt2Yn5FoyNEUdfFkJoFJWD X5YlVIj84fPgdNDbnfXW84GyFBgQk5aMpO9pF1wlBsvdrZdG+EOMRKqNdnAkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9l2gpHg+o5lwPgekZTnIFS9DvzgDpv9qEbbXKTip9T8=; b=FquP8XEbVFlCaazDwIRzglMdOOcheRAHJeGWWIFT/nc9MV8v0upW9sEgHp+TBQipjKOgns i8eo06gms4+m0v5L1ps0UsNitaTOZ6OLIlnkOV187rYGhmYgZVOt8P2gV+cNeIObM7N/K/ th7A4ZaaxBJII5xyZT4JtZfWXlKKQjksQdaUP0LRyl5IAZnOpFs5hIOGCg4V4vfGTlKK/v PtNhXbmSn/zND1rqxXHm+N+YvLzmXsoTXkLFfqRFLW565d9+c7HEsWqU+I9hDGA3gwo8FV t82OC9jfj3uoyQnH5Hd8AgTVoogwaPlwaebQu8cMFPbnHpbxVZ8hFTwuTHv3aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427549; a=rsa-sha256; cv=none; b=xHVdCrELQw0ukGwYfQxLIA3DQaYQIyb7WUNb+ChSy4RDqI6P2yyR+ko2XVixJDOUQpOccn AOizRfCEJcH0wHDxTZGUKveGWvbYTY+GrMKSDLdWzmjkBvBV344bF4zJlRD5HsIjvli9na R9AEKPUGFZDuKPsherl9UZk8GiVb0QH/OEHVt+DEN52CbpvNdvnpyB/sSDtCRE+Ox3JoZV ZwCrVCvVhFi+X26cr0AMQY2m0q1FO6qbdGvsJyCzBjDXBDQBlOHreiIxa4QXf8Iu4JVk20 wncdAEDmzGKcQ0UZcUSGkjroEWYQCZbANvH6zY4uCGE8a3qmWRWiRYtgcZcSvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSF0Hq2znSL; Fri, 20 Jun 2025 13:52: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 55KDqSOY058225; Fri, 20 Jun 2025 13: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 55KDqS1a058222; Fri, 20 Jun 2025 13:52:28 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:28 GMT Message-Id: <202506201352.55KDqS1a058222@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: f3ab96aeb509 - stable/14 - gve: Fix timestamp invalidation for DQO queue formats List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f3ab96aeb509c4c645e5e3ea63ec2f1002a2c070 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f3ab96aeb509c4c645e5e3ea63ec2f1002a2c070 commit f3ab96aeb509c4c645e5e3ea63ec2f1002a2c070 Author: Jasper Tran O'Leary AuthorDate: 2025-06-05 17:21:06 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 gve: Fix timestamp invalidation for DQO queue formats We need to invalidate timestamps when a TX queue is cleared so that the TX timeout detection callout does not mistakenly fire for cleared packets. When using DQO queue formats, timestamps are set on the pending packet array whose length is not the same as the length of the descriptor ring itself. This commit fixes logic which invalidated the wrong number of pending packets. Signed-off-by: Jasper Tran O'Leary Fixes: 3d2957336c7d ("gve: Add callout to detect and handle TX timeouts") Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50688 (cherry picked from commit 46fce000843215ff3d574d1c24fc24771975973e) --- sys/dev/gve/gve_tx_dqo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index bbf2ee1b0324..551a7e308d19 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -987,11 +987,8 @@ gve_tx_clear_desc_ring_dqo(struct gve_tx_ring *tx) struct gve_ring_com *com = &tx->com; int i; - for (i = 0; i < com->priv->tx_desc_cnt; i++) { + for (i = 0; i < com->priv->tx_desc_cnt; i++) tx->dqo.desc_ring[i] = (union gve_tx_desc_dqo){}; - gve_invalidate_timestamp( - &tx->dqo.pending_pkts[i].enqueue_time_sec); - } bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map, BUS_DMASYNC_PREWRITE); @@ -1033,6 +1030,8 @@ gve_clear_tx_ring_dqo(struct gve_priv *priv, int i) for (j = 0; j < tx->dqo.num_pending_pkts; j++) { if (gve_is_qpl(tx->com.priv)) gve_clear_qpl_pending_pkt(&tx->dqo.pending_pkts[j]); + gve_invalidate_timestamp( + &tx->dqo.pending_pkts[j].enqueue_time_sec); tx->dqo.pending_pkts[j].next = (j == tx->dqo.num_pending_pkts - 1) ? -1 : j + 1; tx->dqo.pending_pkts[j].state = GVE_PACKET_STATE_FREE; From nobody Fri Jun 20 13:52:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSH6ksmz5y422; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSH3DJ1z3Y4P; Fri, 20 Jun 2025 13:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J+OxV2ZbJURvsFLqvnXDdHF3UgOl7aQMc2GeBlm6Mp8=; b=EVYbaznI7BJtMhF18k2h3OfGF15+Wrad66u0IStQBf7U8FChFjeicMTkjw3JkE6EyvFLuV htoJxLZyvhr1RIjed/cZ+d0zMhiKvwbHJahfhqID8tEniiIPo1H2qns1oRnJLXT84bc5+3 dJP/sol06ZETCrePsvecbiPxD56KAVIsIye0/eJ3I0C77PW2h/mKGOQhbrIIO3osAAyLj0 BpGzIrACduUdqJ1fi0886BLm4ypAWuxWVvnGewhN2rjGVeNtYrJOb+YLkREhVNHMcpVcfx KlrqUt8KkwvnmBuRpDUIL4oqZQpAjbyGj/H2MAzklTmRwi5giZg0nD/viHcLSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J+OxV2ZbJURvsFLqvnXDdHF3UgOl7aQMc2GeBlm6Mp8=; b=P463QEIP3u8ZU2kGMwZAcTwpiob+44hEStRiZQ+GkQLAIFf3RnBUc4BG30eE5uHBXxhM0G OyCd1s9cHX4Q9zovB+6kvYOzh5fjW/pQ6KKxgadNH9e8bcHxLDNp8SN6vPNV5wox9yKmqp q6ertHBQW+xwzszbol1WX8ekU3dOmLC9cDGtKRlixka+PEkQXX0mVTN6j85ewK6ukHrYj9 GswsNJrZ9vL9HWYJX/Mt3uMCNhHTKne2FUX3RHWKULxni0pT32StoGBjIxj401eQ+Hf87I eYS8gqeG7xkTlOtNqtVRkG48gEgfAhPld8IGYullTqWJ2VpyecfCiLQ4PBUjBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427551; a=rsa-sha256; cv=none; b=ZN0yXN1ib1NudD7JpkxmZqMkOmfrUs/ExQRsHJR2VExX/6lhhhCk6Go2JBWLpwh5IMmVem f48QaSdA+Ka1GEq35c0td2DTayzDr2JWkSXHBUw2XMItbgwWz0v6WzMA/l7QCKQG5A9yu5 EXf1CyBWmpgBYlfGCVt7uNdW2IZDz7PAtZ5u5BvizOU+YEFWymXbqJuNnq2NXj4B0dwiqT 6l8A85MicTTfamsN8dy08YAWHC/pZjfAJYdVp+6mdLlX5x5ugcqvzEQBTSv2kOP4+rrL+b TksiYBvM6O3YXXM7hr8bN7R4Td8w1tD4y9+kJe3JMYPB4KttanIrpQRB6AMDsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSH2qNnznhb; Fri, 20 Jun 2025 13:52: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 55KDqVLv058299; Fri, 20 Jun 2025 13:52:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqVEG058296; Fri, 20 Jun 2025 13:52:31 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:31 GMT Message-Id: <202506201352.55KDqVEG058296@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: 5c78efa63b44 - stable/14 - qat: fix typos and formatting issues List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 5c78efa63b44588d0597f7ae56a62334fe4fce13 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c78efa63b44588d0597f7ae56a62334fe4fce13 commit 5c78efa63b44588d0597f7ae56a62334fe4fce13 Author: Hareshx Sankar Raj AuthorDate: 2025-04-29 23:13:11 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: fix typos and formatting issues Multiple typos are corrected across the source code. Formatting corrections are done to improve code quality and maintainability. Some files which did not have proper Copyright license are updated. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit 25f09d4a9c358c5452435d299e00c1a1bdafff87) --- sys/dev/qat/include/common/adf_uio_cleanup.h | 3 +- sys/dev/qat/include/common/adf_uio_control.h | 3 +- sys/dev/qat/qat/qat_ocf.c | 3 +- .../qat/qat_api/common/compression/dc_datapath.c | 12 +---- .../common/crypto/sym/include/lac_session.h | 26 ++++----- .../qat_api/common/crypto/sym/include/lac_sym.h | 12 ++--- .../common/crypto/sym/include/lac_sym_alg_chain.h | 7 +-- .../qat_api/common/crypto/sym/include/lac_sym_cb.h | 6 +-- .../common/crypto/sym/include/lac_sym_cipher.h | 6 +-- .../common/crypto/sym/include/lac_sym_hash.h | 13 ++--- .../common/crypto/sym/include/lac_sym_hash_defs.h | 4 +- .../crypto/sym/include/lac_sym_hash_precomputes.h | 6 +-- .../common/crypto/sym/include/lac_sym_key.h | 21 ++++---- .../common/crypto/sym/include/lac_sym_partial.h | 4 +- .../common/crypto/sym/include/lac_sym_qat.h | 4 +- .../common/crypto/sym/include/lac_sym_qat_cipher.h | 4 +- .../common/crypto/sym/include/lac_sym_qat_hash.h | 6 +-- .../sym/include/lac_sym_qat_hash_defs_lookup.h | 4 +- .../common/crypto/sym/include/lac_sym_stats.h | 6 +-- .../qat_api/common/crypto/sym/key/lac_sym_key.c | 22 +++----- .../qat_api/common/crypto/sym/lac_sym_alg_chain.c | 10 ++-- .../qat/qat_api/common/crypto/sym/lac_sym_api.c | 14 ++--- .../qat_api/common/crypto/sym/lac_sym_auth_enc.c | 3 +- sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c | 15 +++--- .../qat/qat_api/common/crypto/sym/lac_sym_cipher.c | 7 ++- .../common/crypto/sym/lac_sym_compile_check.c | 7 +-- sys/dev/qat/qat_api/common/crypto/sym/lac_sym_dp.c | 7 +-- .../qat/qat_api/common/crypto/sym/lac_sym_hash.c | 3 +- .../crypto/sym/lac_sym_hash_sw_precomputes.c | 4 +- .../qat/qat_api/common/crypto/sym/lac_sym_queue.c | 4 +- .../qat_api/common/crypto/sym/qat/lac_sym_qat.c | 6 +-- .../common/crypto/sym/qat/lac_sym_qat_cipher.c | 23 ++++---- .../crypto/sym/qat/lac_sym_qat_hash_defs_lookup.c | 8 +-- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 22 +------- sys/dev/qat/qat_api/common/include/lac_common.h | 3 +- sys/dev/qat/qat_api/common/include/lac_hooks.h | 4 +- sys/dev/qat/qat_api/common/include/lac_mem.h | 6 +-- sys/dev/qat/qat_api/common/include/lac_mem_pools.h | 14 ++--- sys/dev/qat/qat_api/common/include/lac_sal.h | 10 ++-- sys/dev/qat/qat_api/common/include/lac_sal_types.h | 6 +-- .../qat/qat_api/common/include/sal_qat_cmn_msg.h | 4 +- .../qat/qat_api/common/qat_comms/sal_qat_cmn_msg.c | 4 +- sys/dev/qat/qat_api/common/utils/lac_buffer_desc.c | 6 +-- sys/dev/qat/qat_api/firmware/include/icp_qat_fw.h | 7 ++- .../qat/qat_api/firmware/include/icp_qat_fw_comp.h | 15 ++---- .../qat/qat_api/firmware/include/icp_qat_fw_la.h | 10 ++-- .../qat/qat_api/firmware/include/icp_qat_fw_mmp.h | 14 +++-- .../qat_api/firmware/include/icp_qat_fw_mmp_ids.h | 5 +- .../qat/qat_api/firmware/include/icp_qat_fw_pke.h | 4 +- sys/dev/qat/qat_api/firmware/include/icp_qat_hw.h | 6 +-- .../qat_api/firmware/include/icp_qat_hw_20_comp.h | 3 +- sys/dev/qat/qat_api/include/cpa.h | 12 ++--- sys/dev/qat/qat_api/include/cpa_dev.h | 18 +++---- sys/dev/qat/qat_api/include/cpa_types.h | 12 ++--- sys/dev/qat/qat_api/include/dc/cpa_dc.h | 23 ++++---- sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h | 14 ++--- sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h | 56 +++++++++---------- sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h | 12 ++--- sys/dev/qat/qat_api/include/icp_buffer_desc.h | 9 ++-- sys/dev/qat/qat_api/include/icp_sal_user.h | 6 +-- sys/dev/qat/qat_api/include/lac/cpa_cy_common.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h | 20 +++---- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_im.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_key.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h | 20 +++---- sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h | 12 ++--- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 62 ++++++++++++---------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 16 +++--- .../qat_api/qat_direct/include/icp_accel_devices.h | 4 +- .../qat/qat_api/qat_direct/include/icp_adf_init.h | 4 +- .../qat_kernel/src/lac_adf_interface_freebsd.c | 6 +-- sys/dev/qat/qat_api/qat_utils/include/qat_utils.h | 7 ++- .../qat/qat_api/qat_utils/src/QatUtilsServices.c | 4 +- sys/dev/qat/qat_common/qat_uclo.c | 1 + 80 files changed, 385 insertions(+), 467 deletions(-) diff --git a/sys/dev/qat/include/common/adf_uio_cleanup.h b/sys/dev/qat/include/common/adf_uio_cleanup.h index 8f1132181355..876843cd9aa8 100644 --- a/sys/dev/qat/include/common/adf_uio_cleanup.h +++ b/sys/dev/qat/include/common/adf_uio_cleanup.h @@ -1,10 +1,9 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2023 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_UIO_CLEANUP_H #define ADF_UIO_CLEANUP_H void adf_uio_do_cleanup_orphan(int bank, struct adf_uio_control_accel *accel); - #endif diff --git a/sys/dev/qat/include/common/adf_uio_control.h b/sys/dev/qat/include/common/adf_uio_control.h index 4662c02233b6..032baa9b54c2 100644 --- a/sys/dev/qat/include/common/adf_uio_control.h +++ b/sys/dev/qat/include/common/adf_uio_control.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2023 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef QAT_UIO_CONTROL_H #define QAT_UIO_CONTROL_H #include @@ -38,5 +38,4 @@ struct adf_uio_control_accel { }; - #endif /* end of include guard: QAT_UIO_CONTROL_H */ diff --git a/sys/dev/qat/qat/qat_ocf.c b/sys/dev/qat/qat/qat_ocf.c index b25135b6a678..3ed834d48e03 100644 --- a/sys/dev/qat/qat/qat_ocf.c +++ b/sys/dev/qat/qat/qat_ocf.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* System headers */ #include #include @@ -1282,7 +1282,6 @@ static driver_t qat_ocf_driver = { .size = sizeof(struct qat_ocf_softc), }; - DRIVER_MODULE_ORDERED(qat, nexus, qat_ocf_driver, diff --git a/sys/dev/qat/qat_api/common/compression/dc_datapath.c b/sys/dev/qat/qat_api/common/compression/dc_datapath.c index de14be2fdb0d..f5a8600eadfa 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_datapath.c +++ b/sys/dev/qat/qat_api/common/compression/dc_datapath.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** * @file dc_datapath.c @@ -523,7 +523,7 @@ dcCheckOpData(sal_compression_service_t *pService, CpaDcOpData *pOpData) if (CPA_TRUE == pOpData->integrityCrcCheck && NULL == pOpData->pCrcData) { LAC_INVALID_PARAM_LOG("Integrity CRC data structure " - "not intialized in CpaDcOpData"); + "not initialized in CpaDcOpData"); return CPA_STATUS_INVALID_PARAM; } @@ -1401,7 +1401,6 @@ cpaDcCompressData(CpaInstanceHandle dcInstance, CpaInstanceHandle insHandle = NULL; Cpa64U srcBuffSize = 0; - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1507,7 +1506,6 @@ cpaDcCompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if ((CPA_TRUE == pOpData->compressAndVerify) && (CPA_TRUE == pOpData->compressAndVerifyAndRecover) && (CPA_FALSE == pOpData->integrityCrcCheck)) { @@ -1526,7 +1524,6 @@ cpaDcCompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_UNSUPPORTED; } - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1703,7 +1700,6 @@ dcDecompressDataCheck(CpaInstanceHandle insHandle, return CPA_STATUS_INVALID_PARAM; } - *srcBufferSize = srcBuffSize; return CPA_STATUS_SUCCESS; @@ -1724,7 +1720,6 @@ cpaDcDecompressData(CpaInstanceHandle dcInstance, Cpa64U srcBuffSize = 0; CpaStatus status = CPA_STATUS_SUCCESS; - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1783,7 +1778,6 @@ cpaDcDecompressData(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if (CPA_DC_STATEFUL == pSessionDesc->sessState) { /* Lock the session to check if there are in-flight stateful * requests */ @@ -1864,7 +1858,6 @@ cpaDcDecompressData2(CpaInstanceHandle dcInstance, callbackTag); } - if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) { insHandle = dcGetFirstHandle(); } else { @@ -1931,7 +1924,6 @@ cpaDcDecompressData2(CpaInstanceHandle dcInstance, return CPA_STATUS_INVALID_PARAM; } - if (CPA_DC_STATEFUL == pSessionDesc->sessState) { /* Lock the session to check if there are in-flight stateful * requests */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h index afb3994daad7..6c9de34e7691 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_session.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -56,7 +56,7 @@ * while there are requests in flight. * * Reference Count\n - * - The perform funcion increments the reference count for the session. + * - The perform function increments the reference count for the session. * - The callback function decrements the reference count for the session. * - The Remove function checks the reference count to ensure that it is 0. * @@ -256,14 +256,14 @@ typedef struct lac_session_desc_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -442,14 +442,14 @@ typedef struct lac_session_desc_d1_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -594,14 +594,14 @@ typedef struct lac_session_desc_d2_s { /**< Cipher slice type to be used, set at init session time */ Cpa8U cipherAesXtsKey1Forward[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< Cached AES XTS Forward key - * For CPM2.0 AES XTS key convertion need to be done in SW. + * For CPM2.0 AES XTS key conversions need to be done in SW. * Because use can update session direction at any time, * also forward key needs to be cached */ Cpa8U cipherAesXtsKey1Reverse[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< AES XTS Reverse key - * For CPM2.0 AES XTS key convertion need to be done in SW. - * Reverse key always will be calcilated at session setup time and + * For CPM2.0 AES XTS key conversions need to be done in SW. + * Reverse key always will be calculated at session setup time and * cached to be used when needed */ Cpa8U cipherAesXtsKey2[LAC_CIPHER_AES_XTS_KEY_MAX_LENGTH]; /**< For AES XTS session need to store Key2 value in order to generate @@ -625,7 +625,7 @@ typedef struct lac_session_desc_d2_s { sizeof(LAC_ARCH_UINT)) /**< @ingroup LacSym_Session * Size of the memory that the client has to allocate for a session. Extra - * memory is needed to internally re-align the data. The pointer to the algined + * memory is needed to internally re-align the data. The pointer to the aligned * data is stored at the start of the user allocated memory hence the extra * space for an LAC_ARCH_UINT */ @@ -669,7 +669,7 @@ typedef struct lac_session_desc_d2_s { * * @param[in] instanceHandle_in Instance Handle * @param[in] pSymCb callback function -* @param[in] pSessionSetupData pointer to the strucutre containing the setup +* @param[in] pSessionSetupData pointer to the structure containing the setup *data * @param[in] isDpSession CPA_TRUE for a data plane session * @param[out] pSessionCtx Pointer to session context diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h index 3eb41432aced..f7468b5d20dd 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -18,7 +18,7 @@ * The symmetric component demuliplexes the following crypto operations to * the appropriate sub-components: cipher, hash, algorithm chaining and * authentication encryption. It is a common layer between the above - * mentioned components where common resources are allocated and paramater + * mentioned components where common resources are allocated and parameter * checks are done. The operation specific resource allocation and parameter * checks are done in the sub-component itself. * @@ -32,15 +32,15 @@ * chain to ensure it is valid. * - \ref LacSymStats "Statistics": Manages statistics for symmetric * - \ref LacSymQat "Symmetric QAT": The symmetric qat component is - * initialiased by the symmetric component. - * - \ref LacCipher "Cipher" : demultiplex cipher opertions to this component. - * - \ref LacHash "Hash" : demultiplex hash opertions to this component. + * initialised by the symmetric component. + * - \ref LacCipher "Cipher" : demultiplex cipher operations to this component. + * - \ref LacHash "Hash" : demultiplex hash operations to this component. * to this component. * - \ref LacAlgChain "Algorithm Chaining": The algorithm chaining component * - OSAL : Memory allocation, Mutex's, atomics * * @lld_initialisation - * This component is initialied during the LAC initialisation sequence. It + * This component is initialized during the LAC initialisation sequence. It * initialises the session table, statistics, symmetric QAT, initialises the * hash definitions lookup table, the hash alg supported lookup table and * registers a callback function with the symmetric response handler to process diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h index 1750fd0bebf4..095b7a426732 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_alg_chain.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h index 58caa321c410..703fa92b614a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -21,7 +21,7 @@ * Dequeue pending requests * @description * This function is called by a callback function of a blocking - * operation (either a partial packet or a hash precompute operaion) + * operation (either a partial packet or a hash precompute operation) * in softIRQ context. It dequeues requests for the following reasons: * 1. All pre-computes that happened when initialising a session * have completed. Dequeue any requests that were queued on the @@ -40,7 +40,7 @@ CpaStatus LacSymCb_PendingReqsDequeue(lac_session_desc_t *pSessionDesc); /** ***************************************************************************** * @ingroup LacSym - * Register symmetric callback funcion handlers + * Register symmetric callback function handlers * * @description * This function registers the symmetric callback handler functions with diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h index 3ae237939b2c..c3d8203dd8b0 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_cipher.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -23,14 +23,14 @@ * and Triple-DES cipher algorithms, in ECB, CBC and CTR modes. The ARC4 stream * cipher algorithm is also supported. Data may be provided as a full packet, * or as a sequence of partial packets. The result of the operation can be - * written back to the source buffer (in-place) or to a seperate output buffer + * written back to the source buffer (in-place) or to a separate output buffer * (out-of-place). Data must be encapsulated in ICP buffers. * * The cipher component is responsible for implementing the cipher-specific * functionality for registering and de-registering a session, for the perform * operation and for processing the QAT responses to cipher requests. Statistics * are maintained for cipher in the symmetric \ref CpaCySymStats64 "stats" - * structure. This module has been seperated out into two. The cipher QAT module + * structure. This module has been separated out into two. The cipher QAT module * deals entirely with QAT data structures. The cipher module itself has minimal * exposure to the QAT data structures. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h index 4451e91ea5d6..19f6f5ddc69a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -24,7 +21,7 @@ * * The hash component supports hashing in 3 modes. PLAIN, AUTH and NESTED. * Plain mode is used to provide data integrity while auth mode is used to - * provide integrity as well as its authenticity. Nested mode is inteded + * provide integrity as well as its authenticity. Nested mode is intended * for use by non standard HMAC like algorithms such as for the SSL master * key secret. Partial packets is supported for both plain and auth modes. * In-place and out-of-place processing is supported for all modes. The @@ -33,7 +30,7 @@ * The hash component is responsible for implementing the hash specific * functionality for initialising a session and for a perform operation. * Statistics are maintained in the symmetric \ref CpaCySymStats64 "stats" - * structure. This module has been seperated out into two. The hash QAT module + * structure. This module has been separated out into two. The hash QAT module * deals entirely with QAT data structures. The hash module itself has minimal * exposure to the QAT data structures. * @@ -62,7 +59,7 @@ * the data path by the length of time it takes to do two hashes on a block * size of data. Note: a partial packet operation generates an intermediate * state. The final operation on a partial packet or when a full packet is - * used applies padding and gives the final hash result. Esentially for the + * used applies padding and gives the final hash result. Essentially for the * inner hash, a partial packet final is issued on the data, using the * precomputed intermediate state and returns the digest. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h index 6ebdcf659360..de9e74b31577 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_defs.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -313,7 +313,7 @@ /**< @ingroup LacSymQatHash * Macro to check for qat hash mode is set to 2 and the hash mode is * Auth. This applies to HMAC algorithms (no pre compute). This is used - * to differntiate between TLS and HMAC */ + * to differentiate between TLS and HMAC */ #define IS_HASH_MODE_2_NESTED(qatHashMode, hashMode) \ ((IS_HASH_MODE_2(qatHashMode)) && \ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h index cdb252fb5b46..cf5e21a14c5f 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_hash_precomputes.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -34,7 +34,7 @@ /**< maximum size of the working data for the HMAC precompute operations * * Maximum size of lac_sym_hash_precomp_op_data_t is 264 bytes. For hash - * precomputes there are 2 of these structrues and a further + * precomputes there are 2 of these structures and a further * lac_sym_hash_precomp_op_t structure required. This comes to a total of 536 * bytes. * For the asynchronous version of the precomputes, the memory for the hash @@ -122,7 +122,7 @@ typedef struct lac_sym_hash_aes_precomp_qat_s { Cpa8U contentDesc[LAC_SYM_QAT_MAX_CIPHER_SETUP_BLK_SZ]; /**< Content descriptor for a cipher operation */ Cpa8U data[LAC_SYM_HASH_PRECOMP_MAX_AES_ECB_DATA]; - /**< The data to be ciphered is conatined here and the result is + /**< The data to be ciphered is contained here and the result is * written in place back into this buffer */ icp_qat_fw_la_cipher_req_params_t cipherReqParams; /**< Request parameters as read in by the QAT */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h index bae0d8faabc7..25c919d9b38d 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_key.h @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -16,7 +13,7 @@ * * @lld_overview * - * Key generation component is reponsible for SSL, TLS & MGF operations. All + * Key generation component is responsible for SSL, TLS & MGF operations. All * memory required for the keygen operations is got from the keygen cookie * structure which is carved up as required. * @@ -24,8 +21,8 @@ * outer hash and SHA1 as the inner hash. * * Refer to sections in draft-freier-ssl-version3-02.txt: - * 6.1 Asymmetric cryptographic computations - This refers to coverting - * the pre master secret to the master secret. + * 6.1 Asymmetric cryptographic computations - This refers to converting + * the pre-master secret to the master secret. * 6.2.2 Converting the master secret into keys and MAC secrets - Using * the master secret to generate the key material. * @@ -40,11 +37,11 @@ * * @lld_dependencies * \ref LacSymQatHash: for building up hash content descriptor - * \ref LacMem: for virt to phys coversions + * \ref LacMem: for virt to phys conversions * * @lld_initialisation - * The reponse handler is registered with Symmetric. The Maximum SSL is - * allocated. A structure is allocated containing all the TLS lables that + * The response handler is registered with Symmetric. The Maximum SSL is + * allocated. A structure is allocated containing all the TLS labels that * are supported. On shutdown the memory for these structures are freed. * * @lld_module_algorithms @@ -115,7 +112,7 @@ * * @description * This structure is used to hold the various TLS labels. Each field is - * on an 8 byte boundary provided the structure itslef is 8 bytes aligned. + * on an 8 byte boundary provided the structure itself is 8 bytes aligned. *****************************************************************************/ typedef struct lac_sym_key_tls_labels_s { Cpa8U masterSecret[ICP_QAT_FW_LA_TLS_LABEL_LEN_MAX]; diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h index 3f6c75ca7fb7..633d1c7afa96 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_partial.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -20,7 +20,7 @@ * proceed where they would get an incorrect digest, cipher result. * * Maintain a SpinLock for partials in flight per session. Try and acquire this - * SpinLock. If it cant be acquired return an error straight away to the client + * SpinLock. If it can't be acquired return an error straight away to the client * as there is already a partial in flight. There is no blocking in the data * path for this. * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h index 986e230dc1ff..dc72601bae44 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -24,7 +24,7 @@ * - \ref LacMem "Memory" - Inline memory functions * * @lld_initialisation - * This component is initialied during the LAC initialisation sequence. It + * This component is initialized during the LAC initialisation sequence. It * is called by the Symmetric Initialisation function. * * @lld_module_algorithms diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h index 2f1d36dcd669..2f4a4511f4fc 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_cipher.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -172,7 +172,7 @@ void LacSymQat_CipherXTSModeUpdateKeyLen(lac_session_desc_t *pSessionDesc, * LacSymQat_CipherCtrlBlockInitialize() * * @description - * intialize the cipher control block with all zeros + * initialize the cipher control block with all zeros * * @param[in] pMsg Pointer to the common request message * diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h index 38c5892b0cc4..51a215ffc72a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -42,7 +42,7 @@ * hash precomputes * * @description - * This structure contains infomation on the hash precomputes + * This structure contains information on the hash precomputes * *****************************************************************************/ typedef struct lac_sym_qat_hash_precompute_info_s { @@ -62,7 +62,7 @@ typedef struct lac_sym_qat_hash_precompute_info_s { * hash state prefix buffer info * * @description - * This structure contains infomation on the hash state prefix aad buffer + * This structure contains information on the hash state prefix aad buffer * *****************************************************************************/ typedef struct lac_sym_qat_hash_state_buffer_info_s { diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h index decc5d8c491b..050dd42ba9b2 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_qat_hash_defs_lookup.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -117,7 +117,7 @@ void LacSymQat_HashAlgLookupGet(CpaInstanceHandle instanceHandle, /** ******************************************************************************* * @ingroup LacSymQatHashDefsLookup -* get hash defintions from lookup table. +* get hash definitions from lookup table. * * @description * This function looks up the hash lookup array for a structure diff --git a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h index 96f579b26c4c..ac7439713681 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h +++ b/sys/dev/qat/qat_api/common/crypto/sym/include/lac_sym_stats.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -9,7 +9,7 @@ * * @ingroup LacSym * - * Symetric Common consists of common statistics, buffer and partial packet + * Symmetric Common consists of common statistics, buffer and partial packet * functionality. * ***************************************************************************/ @@ -123,7 +123,7 @@ void LacSym_StatsFree(CpaInstanceHandle instanceHandle); /** ******************************************************************************* * @ingroup LacSymStats -* Inrement a stat +* Increment a stat * * @description * This function incrementes a stat for a specific engine. diff --git a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c index cab8d6c7796c..965874e7466f 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -365,7 +362,6 @@ cpaCyKeyGenQueryStats(CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -393,7 +389,6 @@ cpaCyKeyGenQueryStats64(CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -917,7 +912,6 @@ cpaCyKeyGenMgf(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -956,7 +950,6 @@ cpaCyKeyGenMgfExt(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2194,11 +2187,11 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, /* Api max value */ /* ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX needs to be * multiplied - * by 4 in order to verifiy the 512 conditions. We did + * by 4 in order to verify the 512 conditions. We did * not change * ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX as it * represents - * the max value tha firmware can handle. + * the max value that firmware can handle. */ maxSecretLen = ICP_QAT_FW_LA_TLS_V1_1_SECRET_LEN_MAX * 4; @@ -2206,11 +2199,11 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, /* Api max value */ /* ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX needs to be * multiplied - * by 8 in order to verifiy the 512 conditions. We did + * by 8 in order to verify the 512 conditions. We did * not change * ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX as it * represents - * the max value tha firmware can handle. + * the max value that firmware can handle. */ maxSecretLen = ICP_QAT_FW_LA_TLS_V1_2_SECRET_LEN_MAX * 8; @@ -2596,7 +2589,6 @@ cpaCyKeyGenTls(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2669,7 +2661,6 @@ cpaCyKeyGenTls2(const CpaInstanceHandle instanceHandle_in, { CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -2756,7 +2747,6 @@ cpaCyKeyGenTls3(const CpaInstanceHandle instanceHandle_in, return CPA_STATUS_INVALID_PARAM; } - return LacSymKey_KeyGenSslTls(instanceHandle_in, pKeyGenCb, pCallbackTag, diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c index 5b4ebdc85654..56f211025103 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_alg_chain.c @@ -1,8 +1,5 @@ -/*************************************************************************** - * - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -403,7 +400,6 @@ LacAlgChain_HashCDBuild( &sizeInBytes); } } - static Cpa16U LacAlgChain_GetCipherConfigSize(lac_session_desc_t *pSessionDesc) { @@ -1178,7 +1174,7 @@ LacAlgChain_SessionInit(const CpaInstanceHandle instanceHandle, &cipherOffsetInConstantsTable, &hashOffsetInConstantsTable); - /* for a certain combination of Algorthm Chaining we want to + /* for a certain combination of Algorithm Chaining we want to use an optimised cd block */ if (pSessionDesc->symOperation == diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c index a0891278cb52..6f330835902c 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -336,7 +336,6 @@ LacSymSession_ParamCheck(const CpaInstanceHandle instanceHandle, return CPA_STATUS_SUCCESS; } - /** * @ingroup LacSym * Function which perform parameter checks on data buffers for symmetric @@ -445,7 +444,7 @@ LacSymPerform_BufferParamCheck(const CpaBufferList *const pSrcBuffer, } } - /* check for partial packet suport for the session operation */ + /* check for partial packet support for the session operation */ if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { if (CPA_FALSE == pSessionDesc->isPartialSupported) { /* return out here to simplify cleanup */ @@ -569,7 +568,6 @@ LacSym_InitSession(const CpaInstanceHandle instanceHandle, return CPA_STATUS_INVALID_PARAM; } - pCipherSetupData = &pSessionSetupData->cipherSetupData; pHashSetupData = &pSessionSetupData->hashSetupData; @@ -673,7 +671,6 @@ cpaCySymRemoveSession(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; Cpa64U numPendingRequests = 0; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -794,7 +791,6 @@ LacSym_Perform(const CpaInstanceHandle instanceHandle, } } - /* If synchronous Operation - Callback function stored in the session * descriptor so a flag is set in the perform to indicate that * the perform is being re-called for the synchronous operation */ @@ -872,7 +868,7 @@ LacSym_Perform(const CpaInstanceHandle instanceHandle, pVerifyResult); if (CPA_STATUS_SUCCESS == status) { - /* check for partial packet suport for the session operation */ + /* check for partial packet support for the session operation */ if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { LacSym_PartialPacketStateUpdate( pOpData->packetType, &pSessionDesc->partialState); @@ -923,7 +919,6 @@ cpaCySymQueryStats(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -955,7 +950,6 @@ cpaCySymQueryStats64(const CpaInstanceHandle instanceHandle_in, CpaInstanceHandle instanceHandle = NULL; - if (CPA_INSTANCE_HANDLE_SINGLE == instanceHandle_in) { instanceHandle = Lac_GetFirstHandle(SAL_SERVICE_TYPE_CRYPTO_SYM); @@ -1037,7 +1031,6 @@ cpaCySymSessionCtxGetDynamicSize( /* Choose Session Context size */ getCtxSize(pSessionSetupData, pSessionCtxSizeInBytes); - return CPA_STATUS_SUCCESS; } @@ -1116,6 +1109,5 @@ cpaCyBufferListGetMetaSize(const CpaInstanceHandle instanceHandle_in, (sizeof(icp_flat_buffer_desc_t) * numBuffers) + ICP_DESCRIPTOR_ALIGNMENT_BYTES; - return CPA_STATUS_SUCCESS; } diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c index dd018a25a88c..67ffeafcd48d 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_auth_enc.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -91,7 +91,6 @@ LacSymAlgChain_CheckCCMData(Cpa8U *pAdditionalAuthData, return CPA_STATUS_SUCCESS; } - /** * @ingroup LacAuthEnc */ diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c index 4e47de384a1a..d88c6707b9df 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_cb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *** 2511 LINES SKIPPED *** From nobody Fri Jun 20 13:52:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSG3xTBz5y44X; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSG1Mvkz3Xng; Fri, 20 Jun 2025 13:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GLdpyV8OVTs010eRkPFkoWDO/hItFsEbAIat8vejIY=; b=TksLGzqN5LKjwxDz/jDcaB3JucXRJUdOJEajmJi0D1HaTzyb1/l4gjdibdgiByqkh5BD9E d8T3RyVnKns49uYbnWduuOPKuYsd+szbQGPD6VS6wE86Srd73nrGAcqI3PFIKuqMxih4VZ gZ471nFbEqnLQFASDvKzto52gVrHog/hzyAPPfiMAPGK52AZXKe8PG5yjswAOZNxzQKURq R1NVs47cPrhSU/Q/ExoW5cfXGzxalI+S5azK/afd7poNg16xudOr9/TfquiEjExK/SA3wq 7nQoSdfggV3MUCBhA2oPOaDVIzN6wPnmshr9MtAMe0M/+WI/Ed/ceEDn2itIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GLdpyV8OVTs010eRkPFkoWDO/hItFsEbAIat8vejIY=; b=UHCuMh/9zLa8KZNSAznxyUQvNJTtau/kyvaKg+NF0Gub9AGg2Tuck5Jheiou0LySOyNtw/ B4AAilN1zC9JST6Q9mmViqtv8MDxQoWHgtZBJVvKCAfuwlaYdTEDlPGI/yUDl1KqA0dBrf hdrRtpcTVNNSIRLPPmLicvgi6GSe2sGYL4iUj6IuHMJexMh4+TwI0psH3tae0gt8AjFNzY O8I1CAGOM0lEOVCOw0J6v4fWa7w171VRNXq8mLNAueXUmrJiQ8muSCoHuGvTWlr8juhaVs f53mV982SRT+XbkmIipM6p4O81Cq/twmzKjnUe94Y8TQyJsD9Eb97spGQwO9ZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427550; a=rsa-sha256; cv=none; b=X+eIw1K8FO8/6FxDIoc9MsicDBBa7rL+yYYD6ZsBmioqqEWIWiaJjEtUoS7FwXeXX0qf6P 2qvdaNcs/oWBteBoBgAoCN5dh/ugjzUCFwXR7xFphiGyR22Fq87XXe3C502GAvVzNUmt2E s+fwaAo3qYz9zqUmJrcqPq/qiTWe2ddzhjVwsq6JFPSbS37aFBpVFL/fu39K6SvOMWGr0C SBA8kns4k69uSYoQPdK2r5mLvuFPNVcQbBPMQupjkulGP6BTWs693ru7Qxh/NIBG41AHPg f6Lxgb10+hefM0G2LcC6aioZI1pNA/7fwWzfkI2jf/mRMU/lnw9Zdy+3ctO1wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSG0zS7znCw; Fri, 20 Jun 2025 13:52: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 55KDqU2M058264; Fri, 20 Jun 2025 13:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqU7A058261; Fri, 20 Jun 2025 13:52:30 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:30 GMT Message-Id: <202506201352.55KDqU7A058261@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: b089e3135685 - stable/14 - dtrace tests: Fix nits in some test programs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: b089e31356855b7a64ac31218481b0d67b286821 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b089e31356855b7a64ac31218481b0d67b286821 commit b089e31356855b7a64ac31218481b0d67b286821 Author: Mark Johnston AuthorDate: 2025-06-04 20:52:16 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 dtrace tests: Fix nits in some test programs Otherwise these tests fail spuriously, depending on which compiler is installed as cc. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit fdaba0128c17ecb3d6e2a458bdc00a7b36a4da51) --- .../opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh | 7 ++++--- .../cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh index 9620b97cb019..c8f0d1e5f8c0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh @@ -40,8 +40,8 @@ echo '#pragma D option aggsortkey' >> test.d cat > test.c < -void -main() +int +main(void) { EOF @@ -52,7 +52,7 @@ for oogle in doogle bagnoogle; do #include void -$oogle() +$oogle(void) { DTRACE_PROBE($oogle, knows); } @@ -79,6 +79,7 @@ EOF fi objs="$objs $oogle.o $oogle.d.o" + echo "extern void $oogle(void);" >> test.c echo $oogle'();' >> test.c echo $oogle'$target:::{@[probefunc] = count()}' >> test.d done diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh index 2e404f4b8df6..4dd54f3fb633 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh @@ -35,8 +35,8 @@ cd $DIR cat > test.c < -void -main() +int +main(void) { EOF @@ -74,6 +74,7 @@ EOF fi objs="$objs $oogle.o $oogle.d.o" + echo "extern void $oogle(void);" >> test.c echo $oogle'();' >> test.c done From nobody Fri Jun 20 13:52:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSK4YWXz5y4Ny; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSJ584lz3Y0y; Fri, 20 Jun 2025 13:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yNqo+Y3i2yF9TgjDrOIsuPWfDTsdBHoFDXPdv0LcC4E=; b=CpAdFO1LEhgXQQ3LOEYtkuXRxJyi+n49ZhSDd45TYQs3/P0Bd+b3nASxdHsxfT0xTi5yac NQY0R26qSTm3YDobf9FXfm0gM1/dS3ARfH0S9GFlfN8PI3ZnQzPNy8Ev/bR57aLMT7dN7r PS+WMtfKLjBnkBM1m8GoaEP2p6G2zi4xn6yv8E2dFuCcI64XcNO5ojdhwvPCjNB0o9ccum ExwfKkOHGmWvHzARhJcIetUlVjjTcYgecJRvHVKH0atizPu0bqblDooD6dHadkrc3bMZrS m+eFQc/4KOWI1PXen4JzTHCRzN0ockfoN0rLmxC8euEHaUrB+6qb97PVbSCEqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yNqo+Y3i2yF9TgjDrOIsuPWfDTsdBHoFDXPdv0LcC4E=; b=xlbqms64DMQHxt7ovZhAoZzmQQV/JCqTLfaCFUz/UXrIwKbQ7NJiPkM+H0giZ/hfKQNiCh WisIExbHj0ktYe5igxT5s3E0LZM1lwcrBCH1t4+oEf6NAKlDE9C1hCUUgdpeNgTdGExl7j J2zcpy59O2m/jVOdjiAuMuS59WXXqdonXGIBQSGLW2NS51rwD0vrEBIajMhAcN5BWGMPr2 eHE8KiU3NptRzETI2/UKsB+di4H8ykwrZisx/oreogkn2I0lFQoc0WSBOxnzJE+Yng0Gcp 3ylutxu6EywGzQ1LXhLYuRlOnTGZOlL6fhvTW5F4H4aesyN7vUGDAixuYzXIaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427552; a=rsa-sha256; cv=none; b=eE0pR4UQwEIKTZBETtTLSZt27s4BXnUnFOwqLA9iH3U5z4qAX86gTp+V1laz+NE2MPUTMZ V7UA2erkigsGyNwVbdRS/6I7VnWqTiQ+jShhMYppaH/uFrMQuA+BxCqlO++t0BXGYDu6IC IGUUOomcJIBT7YrCXJiw7KdXGkLoYPy6IuKaJVN4gOZ7WVi685oZMl9qYe698+VGD9cCNa HMlJA5fJQkdLxhfRcwcwuSsxBZ8jdcoEK69v/VQisQZVOMxa/60N5dVDMmll0+EYIC/S26 YXErbNBtqL894R9x7YMYlWGvNUN78JmLE9PFXzkztQheueLbXl6A+y/CnZ5sBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSJ3g40znCx; Fri, 20 Jun 2025 13:52: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 55KDqWtj058334; Fri, 20 Jun 2025 13:52:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqWIp058331; Fri, 20 Jun 2025 13:52:32 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:32 GMT Message-Id: <202506201352.55KDqWIp058331@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: 82172ed4c98c - stable/14 - qat: add disable safe dc mode for QAT SPR devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 82172ed4c98c4dd56b735a351bfa7174def9b9cc Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=82172ed4c98c4dd56b735a351bfa7174def9b9cc commit 82172ed4c98c4dd56b735a351bfa7174def9b9cc Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 00:00:01 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: add disable safe dc mode for QAT SPR devices Build and sysctl configuration modes are introduced for QAT SPR devices to disable safe dc mode. A new QAT driver build option ‘QAT_DISABLE_SAFE_DC_MODE’ is required to build the QAT driver with code that allows a request to be sent to FW to override the ‘History Buffer’ mitigation. Default QAT driver builds do not include this ‘QAT_DISABLE_SAFE_DC_MODE’ build option. Even if the QAT driver was built with code that allows a request to be sent to FW to override the ‘History Buffer’ mitigation, the QAT driver must still be configured using sysctl to request an override of the ‘History Buffer’ mitigation if desired. The default QAT driver configuration option sysctl dev.qat.X.disable_safe_dc_mode does not allow override of the mitigation. The new sysctl attribute disable_safe_dc_mode is to be set to 1 for overriding the history buffer mitigation. Firmware for qat_4xxx is updated for this change. If this mode is enabled, decompression throughput increases but may result in a data leak if num_user_processes is more than 1. This option is to be enabled only if your system is not prone to user data leaks. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit 5a8e5215cef0dac1115853889e925099f61bb5fa) --- share/man/man4/qat.4 | 11 +++- sys/conf/NOTES | 3 + sys/conf/options | 3 + sys/contrib/dev/qat/qat_4xxx.bin | Bin 665356 -> 665356 bytes sys/dev/qat/include/common/adf_accel_devices.h | 8 ++- sys/dev/qat/include/icp_qat_fw_init_admin.h | 7 ++- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 4 ++ sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 75 +++++++++++++++++++++++++ sys/modules/qat/qat/Makefile | 13 ++++- sys/modules/qat/qat_api/Makefile | 13 ++++- sys/modules/qat/qat_common/Makefile | 13 ++++- sys/modules/qat/qat_hw/Makefile | 13 ++++- 12 files changed, 154 insertions(+), 9 deletions(-) diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index e7907c7c6331..613091df2e7e 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-3-Clause -.\" Copyright(c) 2007-2022 Intel Corporation -.Dd May 16, 2025 +.\" Copyright(c) 2007-2025 Intel Corporation +.Dd June 2, 2025 .Dt QAT 4 .Os .Sh NAME @@ -108,6 +108,13 @@ Default value "ks;us". Override the number of uio user space processes that can connect to the QAT device. Default: 2 +.It Va dev.qat.X.disable_safe_dc_mode +Override history buffer mitigation. +Disabled by default. +If enabled, decompression throughput increases but may result in a data leak if +.Va dev.qat.X.num_user_processes +is more than 1. +Enable this option only if your system is not prone to user data leaks. .El .Pp The following diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 8dff052258a6..91532028bae0 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2866,3 +2866,6 @@ options STATS # File system monitoring device filemon # file monitoring for make(1) meta-mode + +# Options for the Intel QuickAssist (QAT) driver. +options QAT_DISABLE_SAFE_DC_MODE # Disable QAT safe data compression mode (only for 4940 devices). diff --git a/sys/conf/options b/sys/conf/options index 7314a58a6a4f..b05e146b7428 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1018,3 +1018,6 @@ HIDRAW_MAKE_UHID_ALIAS opt_hid.h # This option is insecure except in controlled environments where the static # environment's contents are known to be safe. PRESERVE_EARLY_KENV opt_global.h + +# Options for the Intel QuickAssist (QAT) driver. +QAT_DISABLE_SAFE_DC_MODE opt_qat.h diff --git a/sys/contrib/dev/qat/qat_4xxx.bin b/sys/contrib/dev/qat/qat_4xxx.bin index 23eb8077241a..7783d361a93c 100644 Binary files a/sys/contrib/dev/qat/qat_4xxx.bin and b/sys/contrib/dev/qat/qat_4xxx.bin differ diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index 0a1248b9a68e..3731cf6587b2 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_ACCEL_DEVICES_H_ #define ADF_ACCEL_DEVICES_H_ @@ -7,6 +7,8 @@ #include "adf_cfg_common.h" #include "adf_pfvf_msg.h" +#include "opt_qat.h" + #define ADF_CFG_NUM_SERVICES 4 #define ADF_DH895XCC_DEVICE_NAME "dh895xcc" @@ -687,6 +689,10 @@ struct adf_accel_dev { struct adf_accel_pci accel_pci_dev; struct adf_accel_compat_manager *cm; u8 compat_ver; +#ifdef QAT_DISABLE_SAFE_DC_MODE + struct sysctl_oid *safe_dc_mode; + u8 disable_safe_dc_mode; +#endif /* QAT_DISABLE_SAFE_DC_MODE */ union { struct { /* vf_info is non-zero when SR-IOV is init'ed */ diff --git a/sys/dev/qat/include/icp_qat_fw_init_admin.h b/sys/dev/qat/include/icp_qat_fw_init_admin.h index 3537fb3f8cfd..cd4edbdbc93b 100644 --- a/sys/dev/qat/include/icp_qat_fw_init_admin.h +++ b/sys/dev/qat/include/icp_qat_fw_init_admin.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef _ICP_QAT_FW_INIT_ADMIN_H_ #define _ICP_QAT_FW_INIT_ADMIN_H_ @@ -43,6 +43,8 @@ enum icp_qat_fw_cnv_error_type { CNV_ERR_TYPE_UNKNOWN_ERROR }; +#define ICP_QAT_FW_INIT_DISABLE_SAFE_DC_MODE_FLAG 0x02 + #define CNV_ERROR_TYPE_GET(latest_error) \ ({ \ __typeof__(latest_error) _lerror = latest_error; \ @@ -69,7 +71,8 @@ struct icp_qat_fw_init_admin_req { struct { u64 resrvd2; u16 ibuf_size_in_kb; - u16 resrvd3; + u8 fw_flags; + u8 resrvd3; u32 resrvd4; }; /* ICP_QAT_FW_CONSTANTS_CFG */ diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c index 3326d7cb4ffb..43e530c3a6f1 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c @@ -709,6 +709,10 @@ adf_4xxx_send_admin_init(struct adf_accel_dev *accel_dev) memset(&req, 0, sizeof(req)); memset(&resp, 0, sizeof(resp)); req.cmd_id = ICP_QAT_FW_INIT_ME; +#ifdef QAT_DISABLE_SAFE_DC_MODE + if (accel_dev->disable_safe_dc_mode) + req.fw_flags = ICP_QAT_FW_INIT_DISABLE_SAFE_DC_MODE_FLAG; +#endif /* QAT_DISABLE_SAFE_DC_MODE */ if (adf_send_admin(accel_dev, &req, &resp, ae_mask)) { device_printf(GET_DEV(accel_dev), "Error sending init message\n"); diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index f4a673e25a40..9b585fe7d3d1 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -47,6 +47,74 @@ adf_probe(device_t dev) return ENXIO; } +#ifdef QAT_DISABLE_SAFE_DC_MODE +static int adf_4xxx_sysctl_disable_safe_dc_mode(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + int error, value = accel_dev->disable_safe_dc_mode; + + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || !req->newptr) + return error; + + if (value != 1 && value != 0) + return EINVAL; + + if (adf_dev_started(accel_dev)) { + device_printf( + GET_DEV(accel_dev), + "QAT: configuration can only be changed in \"down\" device state\n"); + return EBUSY; + } + + accel_dev->disable_safe_dc_mode = (u8)value; + + return 0; +} + +static void +adf_4xxx_disable_safe_dc_sysctl_add(struct adf_accel_dev *accel_dev) +{ + struct sysctl_ctx_list *qat_sysctl_ctx; + struct sysctl_oid *qat_sysctl_tree; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + qat_sysctl_tree = + device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); + accel_dev->safe_dc_mode = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "disable_safe_dc_mode", + CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_TUN | + CTLFLAG_SKIP, + accel_dev, + 0, + adf_4xxx_sysctl_disable_safe_dc_mode, + "LU", + "Disable QAT safe data compression mode"); +} + +static void +adf_4xxx_disable_safe_dc_sysctl_remove(struct adf_accel_dev *accel_dev) +{ + int ret; + struct sysctl_ctx_list *qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + ret = sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->safe_dc_mode); + if (ret) { + device_printf(GET_DEV(accel_dev), "Failed to delete entry\n"); + } else { + ret = sysctl_remove_oid(accel_dev->safe_dc_mode, 1, 1); + if (ret) + device_printf(GET_DEV(accel_dev), + "Failed to delete oid\n"); + } +} +#endif /* QAT_DISABLE_SAFE_DC_MODE */ + static void adf_cleanup_accel(struct adf_accel_dev *accel_dev) { @@ -76,6 +144,9 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_4XXX); accel_dev->hw_device = NULL; } +#ifdef QAT_DISABLE_SAFE_DC_MODE + adf_4xxx_disable_safe_dc_sysctl_remove(accel_dev); +#endif /* QAT_DISABLE_SAFE_DC_MODE */ adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -153,6 +224,10 @@ adf_attach(device_t dev) if (ret) goto out_err; +#ifdef QAT_DISABLE_SAFE_DC_MODE + adf_4xxx_disable_safe_dc_sysctl_add(accel_dev); +#endif /* QAT_DISABLE_SAFE_DC_MODE */ + pci_set_max_read_req(dev, 4096); ret = bus_dma_tag_create(bus_get_dma_tag(dev), diff --git a/sys/modules/qat/qat/Makefile b/sys/modules/qat/qat/Makefile index 14f3a566063f..cee1ee8fb1b1 100644 --- a/sys/modules/qat/qat/Makefile +++ b/sys/modules/qat/qat/Makefile @@ -4,7 +4,7 @@ KMOD= qat SRCS+= qat_ocf.c qat_ocf_mem_pool.c qat_ocf_utils.c -SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h +SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h opt_qat.h CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -I${SRCTOP}/sys/dev/qat/include @@ -17,6 +17,17 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include .if ${COMPILER_TYPE} == "clang" diff --git a/sys/modules/qat/qat_api/Makefile b/sys/modules/qat/qat_api/Makefile index f30d49cd8269..24fbcb46a987 100644 --- a/sys/modules/qat/qat_api/Makefile +++ b/sys/modules/qat/qat_api/Makefile @@ -60,7 +60,7 @@ SRCS+= qat_utils/src/QatUtilsSemaphore.c SRCS+= qat_utils/src/QatUtilsSpinLock.c SRCS+= qat_utils/src/QatUtilsAtomic.c SRCS+= qat_utils/src/QatUtilsCrypto.c -SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h vnode_if.h +SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h vnode_if.h opt_qat.h CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/lac @@ -74,6 +74,17 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common CFLAGS+= ${LINUXKPI_INCLUDES} +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include CWARNFLAGS+= -Wno-cast-qual diff --git a/sys/modules/qat/qat_common/Makefile b/sys/modules/qat/qat_common/Makefile index b0f847ae9a96..c2131cc1e24b 100644 --- a/sys/modules/qat/qat_common/Makefile +++ b/sys/modules/qat/qat_common/Makefile @@ -23,10 +23,21 @@ SRCS+= adf_gen4vf_hw_csr_data.c SRCS+= adf_freebsd_transport_debug.c adf_clock.c SRCS+= adf_freebsd_cnvnr_ctrs_dbg.c SRCS+= adf_freebsd_pfvf_ctrs_dbg.c -SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h +SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h opt_qat.h CFLAGS+= -I${SRCTOP}/sys/dev/qat/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common CFLAGS+= ${LINUXKPI_INCLUDES} +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include diff --git a/sys/modules/qat/qat_hw/Makefile b/sys/modules/qat/qat_hw/Makefile index 2a51640bd327..4ab8db5f0c56 100644 --- a/sys/modules/qat/qat_hw/Makefile +++ b/sys/modules/qat/qat_hw/Makefile @@ -12,7 +12,7 @@ SRCS+= qat_dh895xcc/adf_dh895xcc_hw_data.c qat_dh895xcc/adf_drv.c SRCS+= qat_c4xxx/adf_c4xxx_hw_data.c qat_c4xxx/adf_drv.c qat_c4xxx/adf_c4xxx_ae_config.c qat_c4xxx/adf_c4xxx_misc_error_stats.c SRCS+= qat_c4xxx/adf_c4xxx_pke_replay_stats.c qat_c4xxx/adf_c4xxx_ras.c qat_c4xxx/adf_c4xxx_res_part.c SRCS+= qat_c4xxx/adf_c4xxx_reset.c -SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h +SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h opt_qat.h CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -I${SRCTOP}/sys/dev/qat/include @@ -25,4 +25,15 @@ CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include +.if !defined(KERNBUILDDIR) +CFLAGS+= -include opt_qat.h +MKDEP= -include opt_qat.h + +opt_qat.h: + :> ${.TARGET} +.if defined(QAT_DISABLE_SAFE_DC_MODE) && ${QAT_DISABLE_SAFE_DC_MODE} == "1" + @echo "#define QAT_DISABLE_SAFE_DC_MODE 1" >> ${.TARGET} +.endif +.endif + .include From nobody Fri Jun 20 13:52:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSL1QJbz5y4MB; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSK51tTz3Y2W; Fri, 20 Jun 2025 13:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dud0TXrdiEm54tSRGJxiB4td52JWeUtnvClLsqbfkro=; b=wtBh9TU8f6NYs3NCXbWMEbZ79Y9M5zm7YmEGbfSuYallPLGaiyn9Mubk/vjPRzgeQHVwkd WWcwUynn6GIdJLGZdX+ij07YAOqx1Gs2wek/sbcMeQqrOeMoAvLECmXCuXwVwyJRxbHn4P bs/2zssHHXU38ikRb7Gb+AKJKG1kNnr/Qt+oEkF+XUFhlFZnQA6cZ03nWmgqzmMm37BhaA sayNBMwAkrSo9XsjMfGoHXz1NDndfDheFq2RzgIH86xqiFxSGe22CsTrkv2zf8I9cWXnOT G4VfUS7qyls0Z7f5GxKHzcqnp8nTbSQnYqbyPS95EupD3rsoXqWS+Co7jeNovg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dud0TXrdiEm54tSRGJxiB4td52JWeUtnvClLsqbfkro=; b=c0MmVGeb3Avc93BanD330mPeTwA0llxeNUZixpfNYDngCPtcG6jSZ/STdsVQXO+jFxLvtX 9akoSwg1tsvdz8uOCQIVzdAEFExNtnGAh/pMokWZVtFCkbrakJz2l/F/ChO56Z8B3mAfi6 nGtIP+3pgrHG1/73MV4vFo/uNwYQn5V/R8EoBV5RdCLT0ETUuS7iSCiKpx/jGfEOlHg2uu UeR4TMUmdZ1rqYYSasHl8OkvKkyULiqpRAPUVIbG1aiUKtGpHSxzjMCONFS/y3eE07ioYR TEQwhIEFQ4V3mNAK/uAjDF4JCmX+WDA5RsMOZRm5ZKG7+WZb7pxZoelhvK+KWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427553; a=rsa-sha256; cv=none; b=tggj7AjEyR+RAIP50+mFS5hTrbj0rXEchONDixNC3rkJo9Ls5Tr41UKNeSACEXnTgjouWG rNE+6h1m3N93JhFoh70t2/jlJPzremS9aCQ0UjB+jK+dHjOKQABrBcRYzqR8kbucJFum5M t8lRXovcm1hsSXvCxNChKR3oArzpnhJkGAex88pWl68SFS7GxaE5YM+x0Hf+WiDmAVfHpa oTlzZGwTobfVVqqZDgIcyKtVN1stZ6Ul+8uMMywmQ3nde2U0epGW26WSvFCkC02C6kNOvv 7RCKHk+1pJ+ZQJ5PkzVLTLoFLxpNNHtiNVEJVLcHLY/U1bEFcbXZWc2sCVClRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSK4LYrzp78; Fri, 20 Jun 2025 13:52: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 55KDqXAX058368; Fri, 20 Jun 2025 13:52:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqXHE058365; Fri, 20 Jun 2025 13:52:33 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:33 GMT Message-Id: <202506201352.55KDqXHE058365@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: 8de50b4e29ef - stable/14 - qat: update 4xxx capabilities handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 8de50b4e29ef7496e99597ebbd64bfb6e16dc364 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8de50b4e29ef7496e99597ebbd64bfb6e16dc364 commit 8de50b4e29ef7496e99597ebbd64bfb6e16dc364 Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 19:48:44 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: update 4xxx capabilities handling Some capabilities were not properly fused out based on the hardware slices. Hence updated the function accordingly. Both PF and VF are changed. This change also streamlines capability handling for SYM service: - Lack of UCS slice does not mean that CIPHER capabilities are not available. - SYM capabilities should be considered disabled only if both AUTH and CIPHER capabilities are not present. - AUTH capability shouldn't disable CIPHER. SMX slice mask for qat_4xxx is also corrected to check for both SM3 and SM4 support. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit 4da5c15e5c84738903fd306b54b18a0aaf166d5f) --- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 98 +++++++++++++--------- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h | 4 +- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c | 89 +++++++++++++------- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h | 14 +++- 4 files changed, 133 insertions(+), 72 deletions(-) diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c index 43e530c3a6f1..9a84ad652282 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -212,57 +212,77 @@ adf_4xxx_get_hw_cap(struct adf_accel_dev *accel_dev) { device_t pdev = accel_dev->accel_pci_dev.pci_dev; u32 fusectl1; - u32 capabilities; + u32 capabilities_sym, capabilities_sym_cipher, capabilities_sym_auth, + capabilities_asym, capabilities_dc, capabilities_other; + + capabilities_other = ICP_ACCEL_CAPABILITIES_RL; /* Read accelerator capabilities mask */ fusectl1 = pci_read_config(pdev, ADF_4XXX_FUSECTL1_OFFSET, 4); - capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CIPHER | - ICP_ACCEL_CAPABILITIES_AUTHENTICATION | - ICP_ACCEL_CAPABILITIES_COMPRESSION | - ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | - ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | - ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_HKDF | - ICP_ACCEL_CAPABILITIES_SHA3_EXT | ICP_ACCEL_CAPABILITIES_SM3 | + + capabilities_sym_cipher = ICP_ACCEL_CAPABILITIES_HKDF | ICP_ACCEL_CAPABILITIES_SM4 | ICP_ACCEL_CAPABILITIES_CHACHA_POLY | - ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2 | - ICP_ACCEL_CAPABILITIES_RL | ICP_ACCEL_CAPABILITIES_ECEDMONT | - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2; + capabilities_sym_auth = ICP_ACCEL_CAPABILITIES_SM3 | + ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_SHA3_EXT; + /* A set bit in fusectl1 means the feature is OFF in this SKU */ if (fusectl1 & ICP_ACCEL_4XXX_MASK_CIPHER_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_HKDF; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; - } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_AUTH_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_AUTHENTICATION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SHA3; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_HKDF; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; } - if (fusectl1 & ICP_ACCEL_MASK_PKE_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_UCS_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AES_V2; } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_AUTH_SLICE) { + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; } + if (fusectl1 & ICP_ACCEL_4XXX_MASK_SMX_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM3; - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; } - if (fusectl1 & ICP_ACCEL_4XXX_MASK_UCS_SLICE) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; - capabilities &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; - capabilities &= ~ICP_ACCEL_CAPABILITIES_AES_V2; - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_cipher) + capabilities_sym_cipher |= ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_auth) + capabilities_sym_auth |= ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + capabilities_sym = capabilities_sym_cipher | capabilities_sym_auth; + + if (capabilities_sym) + capabilities_sym |= ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; + + capabilities_asym = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | + ICP_ACCEL_CAPABILITIES_SM2 | ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_PKE_SLICE) { + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_SM2; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; + } + + capabilities_dc = ICP_ACCEL_CAPABILITIES_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | + ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (fusectl1 & ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE) { + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; } - return capabilities; + return capabilities_sym | capabilities_dc | capabilities_asym | + capabilities_other; } static u32 diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h index b6a5da92fdb5..c35ebbcadcd7 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007 - 2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_4XXX_HW_DATA_H_ #define ADF_4XXX_HW_DATA_H_ @@ -105,7 +105,7 @@ enum icp_qat_4xxx_slice_mask { ICP_ACCEL_4XXX_MASK_COMPRESS_SLICE = BIT(3), ICP_ACCEL_4XXX_MASK_UCS_SLICE = BIT(4), ICP_ACCEL_4XXX_MASK_EIA3_SLICE = BIT(5), - ICP_ACCEL_4XXX_MASK_SMX_SLICE = BIT(6), + ICP_ACCEL_4XXX_MASK_SMX_SLICE = BIT(7), }; void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 id); diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c index 27e5ef8162ab..f3d4ae3c7b38 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -133,45 +133,74 @@ adf_4xxxvf_get_hw_cap(struct adf_accel_dev *accel_dev) { device_t pdev = accel_dev->accel_pci_dev.pci_dev; u32 vffusectl1; - u32 capabilities; - - capabilities = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC + - ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC + - ICP_ACCEL_CAPABILITIES_CIPHER + - ICP_ACCEL_CAPABILITIES_AUTHENTICATION + - ICP_ACCEL_CAPABILITIES_COMPRESSION + - ICP_ACCEL_CAPABILITIES_SHA3_EXT + ICP_ACCEL_CAPABILITIES_SM2 + - ICP_ACCEL_CAPABILITIES_SM3 + ICP_ACCEL_CAPABILITIES_SM4 + - ICP_ACCEL_CAPABILITIES_CHACHA_POLY + - ICP_ACCEL_CAPABILITIES_AESGCM_SPC + - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64 + - ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION + - ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + u32 capabilities_sym, capabilities_sym_cipher, capabilities_sym_auth, + capabilities_asym, capabilities_dc; /* Get fused capabilities */ vffusectl1 = pci_read_config(pdev, ADF_4XXXIOV_VFFUSECTL1_OFFSET, 4); - if (vffusectl1 & BIT(7)) { - capabilities &= - ~(ICP_ACCEL_CAPABILITIES_SM3 + ICP_ACCEL_CAPABILITIES_SM4); + capabilities_sym_cipher = ICP_ACCEL_CAPABILITIES_HKDF | + ICP_ACCEL_CAPABILITIES_SM4 | ICP_ACCEL_CAPABILITIES_CHACHA_POLY | + ICP_ACCEL_CAPABILITIES_AESGCM_SPC | ICP_ACCEL_CAPABILITIES_AES_V2; + capabilities_sym_auth = ICP_ACCEL_CAPABILITIES_SM3 | + ICP_ACCEL_CAPABILITIES_SHA3 | ICP_ACCEL_CAPABILITIES_SHA3_EXT; + + /* A set bit in vffusectl1 means the feature is OFF in this SKU */ + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_CIPHER_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_HKDF; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; } - if (vffusectl1 & BIT(6)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_SM3; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_UCS_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_CHACHA_POLY; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AESGCM_SPC; + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_AES_V2; } - if (vffusectl1 & BIT(3)) { - capabilities &= ~(ICP_ACCEL_CAPABILITIES_COMPRESSION + - ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64); + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_AUTH_SLICE) { + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SHA3_EXT; } - if (vffusectl1 & BIT(2)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_SMX_SLICE) { + capabilities_sym_cipher &= ~ICP_ACCEL_CAPABILITIES_SM4; + capabilities_sym_auth &= ~ICP_ACCEL_CAPABILITIES_SM3; } - if (vffusectl1 & BIT(1)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + if (capabilities_sym_cipher) + capabilities_sym_cipher |= ICP_ACCEL_CAPABILITIES_CIPHER; + + if (capabilities_sym_auth) + capabilities_sym_auth |= ICP_ACCEL_CAPABILITIES_AUTHENTICATION; + + capabilities_sym = capabilities_sym_cipher | capabilities_sym_auth; + + if (capabilities_sym) + capabilities_sym |= ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; + + capabilities_asym = ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | + ICP_ACCEL_CAPABILITIES_SM2 | ICP_ACCEL_CAPABILITIES_ECEDMONT; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_PKE_SLICE) { + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_SM2; + capabilities_asym &= ~ICP_ACCEL_CAPABILITIES_ECEDMONT; } - if (vffusectl1 & BIT(0)) { - capabilities &= ~ICP_ACCEL_CAPABILITIES_CIPHER; + + capabilities_dc = ICP_ACCEL_CAPABILITIES_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION | + ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION | + ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; + + if (vffusectl1 & ICP_ACCEL_4XXXVF_MASK_COMPRESS_SLICE) { + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_LZ4S_COMPRESSION; + capabilities_dc &= ~ICP_ACCEL_CAPABILITIES_CNV_INTEGRITY64; } - return capabilities; + + return capabilities_sym | capabilities_dc | capabilities_asym; } static void diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h index 83c034f543c9..a702fc69dde7 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_4XXXVF_HW_DATA_H_ #define ADF_4XXXVF_HW_DATA_H_ @@ -27,6 +27,18 @@ #define ADF_4XXXIOV_VFFUSECTL4_OFFSET (0x1C4) #define ADF_4XXXIOV_VFFUSECTL5_OFFSET (0x1C8) +/*qat_4xxxvf fuse bits are same as qat_4xxx*/ +enum icp_qat_4xxxvf_slice_mask { + ICP_ACCEL_4XXXVF_MASK_CIPHER_SLICE = 0x01, + ICP_ACCEL_4XXXVF_MASK_AUTH_SLICE = 0x02, + ICP_ACCEL_4XXXVF_MASK_PKE_SLICE = 0x04, + ICP_ACCEL_4XXXVF_MASK_COMPRESS_SLICE = 0x08, + ICP_ACCEL_4XXXVF_MASK_UCS_SLICE = 0x10, + ICP_ACCEL_4XXXVF_MASK_EIA3_SLICE = 0x20, + /*SM3&SM4 are indicated by same bit*/ + ICP_ACCEL_4XXXVF_MASK_SMX_SLICE = 0x80, +}; + void adf_init_hw_data_4xxxiov(struct adf_hw_device_data *hw_data); void adf_clean_hw_data_4xxxiov(struct adf_hw_device_data *hw_data); u32 adf_4xxxvf_get_hw_cap(struct adf_accel_dev *accel_dev); From nobody Fri Jun 20 13:52:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSM2Z4Mz5y452; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSL5cf1z3Y2s; Fri, 20 Jun 2025 13:52:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7rHS6g9s5sq3Xc62ztJ0PKhuO5VwpXkGTqXjOBAZVmc=; b=YxKqALTx6JwFkACfsERYvsLG/xDSnQLMlHyXgbvPf0c1vAYvmJp/d5k/h3rHsp1nagIb2T iKcJm+3O9fm6bCh9xzW6jfW43eWQC62JnaShQz4JeU3/v9vAeeYjblgqs2hTCTU4+3pI6U mw1UkYoWmMCFuud7bBZ475OpDcS/9ep60896g8fkC+ns77Rb9ItKBwk0sbnfZC17lUWWh9 f9cV/76DCoFAlRyAhHi3Gia7TL4XIn3CNuGXQzLFBXWwdlAGUCsaKrEwj0jFs6ZHmw4i2A r2XEONAOrQSLQCBeYoh7CQolkd7lmNWmw7SRPb50gO3BoWBKTOglA/Gn2LsBfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7rHS6g9s5sq3Xc62ztJ0PKhuO5VwpXkGTqXjOBAZVmc=; b=ssp/ni7uderJIe565w+j8/vH0mYiQNvCYnHY+ZIXa4MMkQlQeNk4wgegrsUSNHCcjvUrgw vhvpPnnl+mTnSE73HLmzc8HAgP0r+6Y+jYythuI/TqmM8SuxyjdN+Ou89Pl+Ol4BauM00h ofCuZuAQRYzdakTtl7GIIicf22ALlJ1opqoqbP5Y/8gLq2nS5i4LZi1OkguOtAzLVPd67K M/FY0Rb+Trom2jURkPLprIJh4kA/GXVRvzhyBmQJj9OWy+HGwTTTO0rovTdydtE6L0E02t Aztar+nItcvx6//W/+WKwygryt1ltLxS9Na/4FB7wjLhWSLDItQ1macESDlPLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427554; a=rsa-sha256; cv=none; b=Jmod7oDIn33jqGPtgg3XqAbhPnOYkqwb/zaubgA7FMlYSprRx+1yHTOpwbtmkIFco8SulA ebVldtmiSNRszUkfIJE2lgoYUU7rRoV4HjjwoTSjK+Zhoo/vMZlll0lpEISc0mYUrF3+xG 5fc5qoMFMIMiG1nY3F2SLIblbSd6F9U7loUszSfPzlC4sPr43aMxM+tM+WMYh8MpZl4egd PRsnEf+xGWw9uFLZdmJX6bQb5DOKACDft12Uk5yK6eaJWFpZ+jbXuQE64YjrMMtIk4jTVV RSPgQWd1BAHYVal6LLgjcisVJ7m7BalH4Wabye864lp9ymZlfaFe84QJnRbQrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSL505hznfJ; Fri, 20 Jun 2025 13:52: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 55KDqYMI058403; Fri, 20 Jun 2025 13:52:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqYXi058399; Fri, 20 Jun 2025 13:52:34 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:34 GMT Message-Id: <202506201352.55KDqYXi058399@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: 84af3e5b2f67 - stable/14 - qat: move debugfs handling to separate file List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 84af3e5b2f6704130b3b5b67cef0a7ee4f4489ef Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=84af3e5b2f6704130b3b5b67cef0a7ee4f4489ef commit 84af3e5b2f6704130b3b5b67cef0a7ee4f4489ef Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 21:53:56 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: move debugfs handling to separate file Moved handling of debugfs entries to a separate file. In addition, it will allow to consolidate the addition of debugfs entries to a single location in the code. This implementation adds infrastructure to create (and remove) debugfs entries at two different stages. - Done when a device is probed, allows to keep debugfs entries persistent between a transition in device state (up to down or vice versa). - Done after the initialization phase, allows to have debugfs entries that are accessible only when the device is up. In addition, moved the creation of debugfs entries for configuration of the newly created function adf_dbgfs_init() and replace symbolic permissions with octal permissions when creating the debugfs files. Added sysctl oids storage for proper cleanup on device down. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit c38bafee7e182fbcdc3c346b2785ed258230cb06) --- sys/dev/qat/include/adf_dbgfs.h | 11 +++ sys/dev/qat/include/adf_heartbeat.h | 6 +- sys/dev/qat/include/common/adf_accel_devices.h | 4 + sys/dev/qat/qat_common/adf_cfg.c | 42 ++-------- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 55 +++++++----- sys/dev/qat/qat_common/adf_freebsd_dbgfs.c | 68 +++++++++++++++ sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c | 98 ++++++++++++++-------- sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c | 98 ++++++++++++++-------- sys/dev/qat/qat_common/adf_fw_counters.c | 42 ++++++---- sys/dev/qat/qat_common/adf_init.c | 7 +- sys/dev/qat/qat_hw/qat_200xx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c | 6 +- sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_c62x/adf_drv.c | 8 +- sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c | 8 +- sys/modules/qat/qat_common/Makefile | 1 + 18 files changed, 325 insertions(+), 161 deletions(-) diff --git a/sys/dev/qat/include/adf_dbgfs.h b/sys/dev/qat/include/adf_dbgfs.h new file mode 100644 index 000000000000..a07933c0f02d --- /dev/null +++ b/sys/dev/qat/include/adf_dbgfs.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ + +#ifndef ADF_DBGFS_H +#define ADF_DBGFS_H + +void adf_dbgfs_init(struct adf_accel_dev *accel_dev); +void adf_dbgfs_add(struct adf_accel_dev *accel_dev); +void adf_dbgfs_rm(struct adf_accel_dev *accel_dev); +void adf_dbgfs_exit(struct adf_accel_dev *accel_dev); +#endif diff --git a/sys/dev/qat/include/adf_heartbeat.h b/sys/dev/qat/include/adf_heartbeat.h index b2eab7139c1f..7a72678e77de 100644 --- a/sys/dev/qat/include/adf_heartbeat.h +++ b/sys/dev/qat/include/adf_heartbeat.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_HEARTBEAT_H_ #define ADF_HEARTBEAT_H_ @@ -18,8 +18,8 @@ struct adf_heartbeat { u64 last_hb_check_time; enum adf_device_heartbeat_status last_hb_status; struct qat_sysctl heartbeat; - struct qat_sysctl *heartbeat_sent; - struct qat_sysctl *heartbeat_failed; + struct qat_sysctl heartbeat_sent; + struct qat_sysctl heartbeat_failed; }; int adf_heartbeat_init(struct adf_accel_dev *accel_dev); diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index 3731cf6587b2..b3f82234bc2b 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -685,6 +685,10 @@ struct adf_accel_dev { struct sysctl_oid *ras_reset; struct sysctl_oid *pke_replay_dbgfile; struct sysctl_oid *misc_error_dbgfile; + struct sysctl_oid *fw_version_oid; + struct sysctl_oid *mmp_version_oid; + struct sysctl_oid *hw_version_oid; + struct sysctl_oid *cnv_error_oid; struct list_head list; struct adf_accel_pci accel_pci_dev; struct adf_accel_compat_manager *cm; diff --git a/sys/dev/qat/qat_common/adf_cfg.c b/sys/dev/qat/qat_common/adf_cfg.c index 736ede860840..37ab44fdb1f6 100644 --- a/sys/dev/qat/qat_common/adf_cfg.c +++ b/sys/dev/qat/qat_common/adf_cfg.c @@ -1,15 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_cfg.h" #include "adf_common_drv.h" -#include "adf_cfg_dev_dbg.h" #include "adf_cfg_device.h" #include "adf_cfg_sysctl.h" -#include "adf_heartbeat_dbg.h" -#include "adf_ver_dbg.h" -#include "adf_fw_counters.h" -#include "adf_cnvnr_freq_counters.h" /** * adf_cfg_dev_add() - Create an acceleration device configuration table. @@ -73,31 +68,13 @@ adf_cfg_dev_add(struct adf_accel_dev *accel_dev) ADF_CFG_MAX_VAL); } - if (adf_cfg_sysctl_add(accel_dev)) - goto err; - - if (adf_cfg_dev_dbg_add(accel_dev)) - goto err; - - if (!accel_dev->is_vf) { - if (adf_heartbeat_dbg_add(accel_dev)) - goto err; - - if (adf_ver_dbg_add(accel_dev)) - goto err; - - if (adf_fw_counters_add(accel_dev)) - goto err; - - if (adf_cnvnr_freq_counters_add(accel_dev)) - goto err; + if (adf_cfg_sysctl_add(accel_dev)) { + free(dev_cfg_data, M_QAT); + accel_dev->cfg = NULL; + return EFAULT; } - return 0; -err: - free(dev_cfg_data, M_QAT); - accel_dev->cfg = NULL; - return EFAULT; + return 0; } static void adf_cfg_section_del_all(struct list_head *head); @@ -142,13 +119,6 @@ adf_cfg_dev_remove(struct adf_accel_dev *accel_dev) sx_xunlock(&dev_cfg_data->lock); adf_cfg_sysctl_remove(accel_dev); - adf_cfg_dev_dbg_remove(accel_dev); - if (!accel_dev->is_vf) { - adf_ver_dbg_del(accel_dev); - adf_heartbeat_dbg_del(accel_dev); - adf_fw_counters_remove(accel_dev); - adf_cnvnr_freq_counters_remove(accel_dev); - } free(dev_cfg_data, M_QAT); accel_dev->cfg = NULL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index 960c71472bc8..ead172635e59 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -123,10 +123,12 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) cnvnr_err_str[error_type], latest_error); if (bytes_written <= 0) { - printf("ERROR: No space left in CnV ctrs line buffer\n" - "\tAcceleration ID: %d, Engine: %d\n", - accel_dev->accel_id, - ae); + device_printf( + GET_DEV(accel_dev), + "ERROR: No space left in CnV ctrs line buffer\n" + "\tAcceleration ID: %d, Engine: %d\n", + accel_dev->accel_id, + ae); break; } report_ptr += bytes_written; @@ -141,7 +143,6 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) { struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_cnvnr_ctrs_sysctl_tree; - struct sysctl_oid *oid_rc; /* Defensive checks */ if (!accel_dev) @@ -154,19 +155,22 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); /* Create "cnv_error" string type leaf - with callback */ - oid_rc = SYSCTL_ADD_PROC(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_cnvnr_ctrs_sysctl_tree), - OID_AUTO, - "cnv_error", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - qat_cnvnr_ctrs_dbg_read, - "IU", - "QAT CnVnR status"); - - if (!oid_rc) { - printf("ERROR: Memory allocation failed\n"); + accel_dev->cnv_error_oid = + SYSCTL_ADD_PROC(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_cnvnr_ctrs_sysctl_tree), + OID_AUTO, + "cnv_error", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + qat_cnvnr_ctrs_dbg_read, + "IU", + "QAT CnVnR status"); + + if (!accel_dev->cnv_error_oid) { + device_printf( + GET_DEV(accel_dev), + "Failed to create qat cnvnr freq counters sysctl entry.\n"); return ENOMEM; } return 0; @@ -175,4 +179,17 @@ adf_cnvnr_freq_counters_add(struct adf_accel_dev *accel_dev) void adf_cnvnr_freq_counters_remove(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + + if (!accel_dev) + return; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (accel_dev->cnv_error_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->cnv_error_oid); + sysctl_remove_oid(accel_dev->cnv_error_oid, 1, 1); + accel_dev->cnv_error_oid = NULL; + } } diff --git a/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c b/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c new file mode 100644 index 000000000000..21ffb0adf559 --- /dev/null +++ b/sys/dev/qat/qat_common/adf_freebsd_dbgfs.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ + +#include "adf_accel_devices.h" +#include "adf_cfg_dev_dbg.h" +#include "adf_cnvnr_freq_counters.h" +#include "adf_common_drv.h" +#include "adf_dbgfs.h" +#include "adf_fw_counters.h" +#include "adf_freebsd_pfvf_ctrs_dbg.h" +#include "adf_heartbeat_dbg.h" +#include "adf_ver_dbg.h" + +/** + * adf_dbgfs_init() - add persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + * + * This function creates debugfs entries that are persistent through a device + * state change (from up to down or vice versa). + */ +void +adf_dbgfs_init(struct adf_accel_dev *accel_dev) +{ + adf_cfg_dev_dbg_add(accel_dev); +} + +/** + * adf_dbgfs_exit() - remove persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + */ +void +adf_dbgfs_exit(struct adf_accel_dev *accel_dev) +{ + adf_cfg_dev_dbg_remove(accel_dev); +} + +/** + * adf_dbgfs_add() - add non-persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + * + * This function creates debugfs entries that are not persistent through + * a device state change (from up to down or vice versa). + */ +void +adf_dbgfs_add(struct adf_accel_dev *accel_dev) +{ + if (!accel_dev->is_vf) { + adf_heartbeat_dbg_add(accel_dev); + adf_ver_dbg_add(accel_dev); + adf_fw_counters_add(accel_dev); + adf_cnvnr_freq_counters_add(accel_dev); + } +} + +/** + * adf_dbgfs_rm() - remove non-persistent debugfs entries + * @accel_dev: Pointer to acceleration device. + */ +void +adf_dbgfs_rm(struct adf_accel_dev *accel_dev) +{ + if (!accel_dev->is_vf) { + adf_cnvnr_freq_counters_remove(accel_dev); + adf_fw_counters_remove(accel_dev); + adf_ver_dbg_del(accel_dev); + adf_heartbeat_dbg_del(accel_dev); + } +} diff --git a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c index c22640045fda..8690c000760c 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -48,7 +48,6 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) struct sysctl_ctx_list *qat_hb_sysctl_ctx; struct sysctl_oid *qat_hb_sysctl_tree; struct adf_heartbeat *hb; - struct sysctl_oid *rc = 0; if (accel_dev == NULL) { return EINVAL; @@ -63,43 +62,76 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) qat_hb_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat_sent", - CTLFLAG_RD, - &hb->hb_sent_counter, - 0, - "HB sent count"); - HB_SYSCTL_ERR(rc); - - rc = SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat_failed", - CTLFLAG_RD, - &hb->hb_failed_counter, - 0, - "HB failed count"); - HB_SYSCTL_ERR(rc); - - rc = SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, - SYSCTL_CHILDREN(qat_hb_sysctl_tree), - OID_AUTO, - "heartbeat", - CTLTYPE_INT | CTLFLAG_RD, - accel_dev, - 0, - qat_dev_hb_read, - "IU", - "QAT device status"); - HB_SYSCTL_ERR(rc); + hb->heartbeat_sent.oid = + SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat_sent", + CTLFLAG_RD, + &hb->hb_sent_counter, + 0, + "HB sent count"); + HB_SYSCTL_ERR(hb->heartbeat_sent.oid); + + hb->heartbeat_failed.oid = + SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat_failed", + CTLFLAG_RD, + &hb->hb_failed_counter, + 0, + "HB failed count"); + HB_SYSCTL_ERR(hb->heartbeat_failed.oid); + + hb->heartbeat.oid = SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, + SYSCTL_CHILDREN(qat_hb_sysctl_tree), + OID_AUTO, + "heartbeat", + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, + 0, + qat_dev_hb_read, + "IU", + "QAT device status"); + HB_SYSCTL_ERR(hb->heartbeat.oid); return 0; } int adf_heartbeat_dbg_del(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + struct adf_heartbeat *hb; + + if (!accel_dev) { + return EINVAL; + } + + hb = accel_dev->heartbeat; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (hb->heartbeat.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat.oid); + sysctl_remove_oid(hb->heartbeat.oid, 1, 1); + hb->heartbeat.oid = NULL; + } + + if (hb->heartbeat_failed.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat_failed.oid); + sysctl_remove_oid(hb->heartbeat_failed.oid, 1, 1); + hb->heartbeat_failed.oid = NULL; + } + + if (hb->heartbeat_sent.oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, hb->heartbeat_sent.oid); + sysctl_remove_oid(hb->heartbeat_sent.oid, 1, 1); + hb->heartbeat_sent.oid = NULL; + } + adf_heartbeat_clean(accel_dev); + return 0; } diff --git a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c index 31805d5fb91e..98cde6a742c1 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -86,7 +86,6 @@ adf_ver_dbg_add(struct adf_accel_dev *accel_dev) { struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; if (!accel_dev) return -EINVAL; @@ -96,43 +95,46 @@ adf_ver_dbg_add(struct adf_accel_dev *accel_dev) qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "fw_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_fw_versions, - "A", - "QAT FW version"); - if (!rc) + accel_dev->fw_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "fw_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_fw_versions, + "A", + "QAT FW version"); + if (!accel_dev->fw_version_oid) goto err; - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "hw_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_hw_versions, - "A", - "QAT HW version"); - if (!rc) + accel_dev->hw_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "hw_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_hw_versions, + "A", + "QAT HW version"); + if (!accel_dev->hw_version_oid) goto err; - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "mmp_version", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_sysctl_read_mmp_versions, - "A", - "QAT MMP version"); - if (!rc) + accel_dev->mmp_version_oid = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "mmp_version", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_sysctl_read_mmp_versions, + "A", + "QAT MMP version"); + if (!accel_dev->mmp_version_oid) goto err; return 0; @@ -145,4 +147,30 @@ err: void adf_ver_dbg_del(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; + + if (!accel_dev) + return; + + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + + if (accel_dev->mmp_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, + accel_dev->mmp_version_oid); + sysctl_remove_oid(accel_dev->mmp_version_oid, 1, 1); + accel_dev->mmp_version_oid = NULL; + } + + if (accel_dev->hw_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->hw_version_oid); + sysctl_remove_oid(accel_dev->hw_version_oid, 1, 1); + accel_dev->hw_version_oid = NULL; + } + + if (accel_dev->fw_version_oid) { + sysctl_ctx_entry_del(qat_sysctl_ctx, accel_dev->fw_version_oid); + sysctl_remove_oid(accel_dev->fw_version_oid, 1, 1); + accel_dev->fw_version_oid = NULL; + } } diff --git a/sys/dev/qat/qat_common/adf_fw_counters.c b/sys/dev/qat/qat_common/adf_fw_counters.c index ea674b27bd0f..1acabe4c9364 100644 --- a/sys/dev/qat/qat_common/adf_fw_counters.c +++ b/sys/dev/qat/qat_common/adf_fw_counters.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -211,7 +211,6 @@ adf_fw_counters_add(struct adf_accel_dev *accel_dev) struct adf_fw_counters_data *fw_counters_data; struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; - struct sysctl_oid *rc = 0; fw_counters_data = malloc(sizeof(*fw_counters_data), M_QAT, M_WAITOK | M_ZERO); @@ -225,20 +224,24 @@ adf_fw_counters_add(struct adf_accel_dev *accel_dev) device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_OID(qat_sysctl_ctx, - SYSCTL_CHILDREN(qat_sysctl_tree), - OID_AUTO, - "fw_counters", - CTLTYPE_STRING | CTLFLAG_RD, - accel_dev, - 0, - adf_read_fw_counters, - "A", - "QAT FW counters"); - if (!rc) + fw_counters_data->debug = + SYSCTL_ADD_OID(qat_sysctl_ctx, + SYSCTL_CHILDREN(qat_sysctl_tree), + OID_AUTO, + "fw_counters", + CTLTYPE_STRING | CTLFLAG_RD, + accel_dev, + 0, + adf_read_fw_counters, + "A", + "QAT FW counters"); + if (!fw_counters_data->debug) { + free(fw_counters_data, M_QAT); + accel_dev->fw_counters_data = NULL; return ENOMEM; - else - return 0; + } + + return 0; } static void @@ -396,12 +399,21 @@ adf_fw_counters_section_add(struct adf_accel_dev *accel_dev, void adf_fw_counters_remove(struct adf_accel_dev *accel_dev) { + struct sysctl_ctx_list *qat_sysctl_ctx; struct adf_fw_counters_data *fw_counters_data = accel_dev->fw_counters_data; if (!fw_counters_data) return; + if (fw_counters_data->debug) { + qat_sysctl_ctx = + device_get_sysctl_ctx(accel_dev->accel_pci_dev.pci_dev); + sysctl_ctx_entry_del(qat_sysctl_ctx, fw_counters_data->debug); + sysctl_remove_oid(fw_counters_data->debug, 1, 1); + fw_counters_data->debug = NULL; + } + down_write(&fw_counters_data->lock); adf_fw_counters_section_del_all(&fw_counters_data->ae_sec_list); up_write(&fw_counters_data->lock); diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index f0b75db3f6ed..9f239b8f63d3 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -1,8 +1,9 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" +#include "adf_dbgfs.h" #include "adf_accel_devices.h" #include "icp_qat_uclo.h" #include "icp_qat_fw.h" @@ -489,6 +490,8 @@ adf_dev_start(struct adf_accel_dev *accel_dev) clear_bit(ADF_STATUS_STARTING, &accel_dev->status); set_bit(ADF_STATUS_STARTED, &accel_dev->status); + adf_dbgfs_add(accel_dev); + return 0; } @@ -526,6 +529,8 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) return EBUSY; } + adf_dbgfs_rm(accel_dev); + clear_bit(ADF_STATUS_STARTING, &accel_dev->status); clear_bit(ADF_STATUS_STARTED, &accel_dev->status); diff --git a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c index f9b8c742d339..9e2462c05657 100644 --- a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_200xx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_200XX, "qat_200xx", "qat_200xx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_200XX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -215,6 +215,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index 9b585fe7d3d1..08fbf5d989e2 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007 - 2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -8,13 +8,12 @@ #include "adf_gen4_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_4XXX, "qat_4xxx", "qat_4xxx"); @@ -147,6 +146,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) #ifdef QAT_DISABLE_SAFE_DC_MODE adf_4xxx_disable_safe_dc_sysctl_remove(accel_dev); #endif /* QAT_DISABLE_SAFE_DC_MODE */ + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -280,6 +280,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c index 9b66ae4b2370..42189c28b21a 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include #include @@ -8,6 +8,7 @@ #include "adf_gen4_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include @@ -83,6 +84,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_4XXXVF); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); } @@ -180,6 +182,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + /* Completion for VF2PF request/response message exchange */ init_completion(&accel_dev->u1.vf.msg_received); mutex_init(&accel_dev->u1.vf.rpreset_lock); diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c index 74e9e2292623..9f2c9374e968 100644 --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c3xxx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C3XXX, "qat_c3xxx", "qat_c3xxx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C3XXX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -204,6 +204,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c index 0e206e960a6c..697f5b1ce786 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c4xxx_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C4XXX, "qat_c4xx", "qat_c4xx"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C4XXX); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -203,6 +203,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c index 4035a8385bd5..1d48b85b2e12 100644 --- a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_c62x_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include #include #include -#include "adf_heartbeat_dbg.h" -#include "adf_cnvnr_freq_counters.h" static MALLOC_DEFINE(M_QAT_C62X, "qat_c62x", "qat_c62x"); @@ -73,6 +72,7 @@ adf_cleanup_accel(struct adf_accel_dev *accel_dev) free(accel_dev->hw_device, M_QAT_C62X); accel_dev->hw_device = NULL; } + adf_dbgfs_exit(accel_dev); adf_cfg_dev_remove(accel_dev); adf_devmgr_rm_dev(accel_dev, NULL); } @@ -205,6 +205,8 @@ adf_attach(device_t dev) } pci_enable_busmaster(dev); + adf_dbgfs_init(accel_dev); + if (!accel_dev->hw_device->config_device) { ret = EFAULT; goto out_err; diff --git a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c index f7a31da23ba9..d8f2ba0a99b7 100644 --- a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -7,13 +7,12 @@ #include "adf_dh895xcc_hw_data.h" #include "adf_fw_counters.h" #include "adf_cfg_device.h" +#include "adf_dbgfs.h" #include #include #include *** 36 LINES SKIPPED *** From nobody Fri Jun 20 13:52:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSN1Pylz5y4P3; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSM5fsTz3XpQ; Fri, 20 Jun 2025 13:52:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMwUJmslZF3NAwFhuv+ZfiA2Tv1tuooPyku8egvqU4g=; b=sIqBp0cpFLFR8QOxoATAShZjzLlNf5EZY08r2Hwx4zqF2yF87Y5sY+TOl4hnxq0KEcD3dH NUr7G3yfR5L1C44w+lfX63osL0Ciu/PDojtUNM73FugyUGFe84rd0j6OpwoPtms42zaR2b mjn3knw/oJLRuBtlwbdVOOPhizciKzOS9h5zgbwh0efPxNvhH0w9Jzv86PQJ2BLl2pAPjs V9zqI6zXFhnA1QsJXTtOgbl8t7ajlp9/MmJfueFHTID6//zBgGmaHofXsh3QbU9DY2Ayos ZSSpq8TL8BcU2EBz0c2kEK7HHFZG9iRGKa83jJpmVh2bJ/InFK5PUPVwwKaxZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMwUJmslZF3NAwFhuv+ZfiA2Tv1tuooPyku8egvqU4g=; b=Piw+T0H+QiwaI73sl4HZqa7F/PpEB8dvwgFIudWEO9ggk0LBotXkHzVvcpCydqxGWMxK9U JyNXLVW+VMSjFgNjBW7yTKOzn779KbD85pt6e9XVg/fzveaAWIFEniktf5pHaA5FZKKXPc 62HdJkwxpHjNcE95X1ZdZxMsoIMn2LE1KSe+tYKWm03zM7ySBCur7/FDRnYqrBc5OVLG2l E25Y5ShNI3BioqtgYeOnilOEQyy7xy0kv1I/DDFbagUVEehCwjjcUFpI9ZqoM+KqOaBcht PlJLawsz0NAoFQ4Ge6rtQ3FQJTHEYygtechj4w5uKjj20CKZskTHwI8YhWjLRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427555; a=rsa-sha256; cv=none; b=KlOydgnRzirLMGw3pmfCuijfzDoIuAMYztMI2hZRCSXQVqbRiLWNWlxi0aTziVTBnmlBpI DJXhUAZdR76ZNt9/MIMO6caEs2ECil36q1PH+1mN4ZgQyl4LzuybYmsjAwbUkk09iLvAY1 bW3/GAoIxYjNxLYITzv639qJ8K9c0yoNwMyXTxRdctscsGeuUPY+ofyAt5PcT2MUuvMnWq bCSVGGmCHQyMAWnmX7GMkRk8vD3+x94iBeXUQcFbSdK4INT0QXxF+XwMDEjI5DeTUmpbsW mnRtSqCBNYk6XlYijGZB4+fLFhfxWKb9HBi0g8jJMDLxiz3tMqAywZZIAJe2uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSM5CYxznt3; Fri, 20 Jun 2025 13:52: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 55KDqZ9L058449; Fri, 20 Jun 2025 13:52:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqZgZ058444; Fri, 20 Jun 2025 13:52:35 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:35 GMT Message-Id: <202506201352.55KDqZgZ058444@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: ef712e91a866 - stable/14 - qat: restrict sysctl access to privileged users List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: ef712e91a8669c9ab8bc6456d02027fced6920fc Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ef712e91a8669c9ab8bc6456d02027fced6920fc commit ef712e91a8669c9ab8bc6456d02027fced6920fc Author: Hareshx Sankar Raj AuthorDate: 2025-04-30 22:27:51 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: restrict sysctl access to privileged users Access to crucial QAT driver internals, such as firmware counters and transport debug via sysctl, has been limited to privileged users only. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit 8aa51e6d7de0a828020de64560d1385e15955a1c) --- sys/dev/qat/qat_common/adf_cfg_sysctl.c | 15 ++++- sys/dev/qat/qat_common/adf_clock.c | 34 +++++++++-- sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c | 6 +- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 4 ++ sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c | 66 +++++++++++++++++++--- sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c | 6 +- .../qat/qat_common/adf_freebsd_transport_debug.c | 9 ++- sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c | 10 ++++ sys/dev/qat/qat_common/adf_fw_counters.c | 4 ++ sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c | 7 ++- .../qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c | 6 +- .../qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c | 6 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c | 15 ++++- 13 files changed, 167 insertions(+), 21 deletions(-) diff --git a/sys/dev/qat/qat_common/adf_cfg_sysctl.c b/sys/dev/qat/qat_common/adf_cfg_sysctl.c index 621c3cc5b6c6..1a836765c94a 100644 --- a/sys/dev/qat/qat_common/adf_cfg_sysctl.c +++ b/sys/dev/qat/qat_common/adf_cfg_sysctl.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include #include @@ -10,6 +10,7 @@ #include "adf_common_drv.h" #include #include +#include #define ADF_CFG_SYSCTL_BUF_SZ ADF_CFG_MAX_VAL #define ADF_CFG_UP_STR "up" @@ -105,6 +106,9 @@ static int adf_cfg_sysctl_services_handle(SYSCTL_HANDLER_ARGS) int ret = 0; int i = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -156,6 +160,9 @@ static int adf_cfg_sysctl_mode_handle(SYSCTL_HANDLER_ARGS) int ret = 0; int i = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -204,6 +211,9 @@ static int adf_cfg_sysctl_handle(SYSCTL_HANDLER_ARGS) unsigned int len; int ret = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; @@ -245,6 +255,9 @@ static int adf_cfg_sysctl_num_processes_handle(SYSCTL_HANDLER_ARGS) uint32_t num_user_processes = 0; int ret = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + accel_dev = arg1; if (!accel_dev) return ENXIO; diff --git a/sys/dev/qat/qat_common/adf_clock.c b/sys/dev/qat/qat_common/adf_clock.c index 36204c9939ac..f5d4116505b6 100644 --- a/sys/dev/qat/qat_common/adf_clock.c +++ b/sys/dev/qat/qat_common/adf_clock.c @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_common_drv.h" #include +#include #define MEASURE_CLOCK_RETRIES 10 #define MEASURE_CLOCK_DELTA_THRESHOLD 100 @@ -21,11 +22,30 @@ } \ } while (0) +static int adf_clock_read_frequency(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_hw_device_data *hw_data; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hw_data = accel_dev->hw_device; + + error = sysctl_handle_int(oidp, &hw_data->clock_frequency, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + int adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) { - struct adf_hw_device_data *hw_data = accel_dev->hw_device; - struct sysctl_ctx_list *qat_sysctl_ctx; struct sysctl_oid *qat_sysctl_tree; struct sysctl_oid *rc = 0; @@ -35,13 +55,15 @@ adf_clock_debugfs_add(struct adf_accel_dev *accel_dev) qat_sysctl_tree = device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); - rc = SYSCTL_ADD_UINT(qat_sysctl_ctx, + rc = SYSCTL_ADD_PROC(qat_sysctl_ctx, SYSCTL_CHILDREN(qat_sysctl_tree), OID_AUTO, CLK_DBGFS_FILE, - CTLFLAG_RD, - &hw_data->clock_frequency, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, + adf_clock_read_frequency, + "IU", "clock frequency"); HB_SYSCTL_ERR(rc); return 0; diff --git a/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c index 7585dd9b29d4..6068d7d99496 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cfg_dev_dbg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_common_drv.h" #include "adf_cfg_device.h" @@ -12,6 +12,7 @@ #include #include #include +#include static int qat_dev_cfg_show(SYSCTL_HANDLER_ARGS) { @@ -21,6 +22,9 @@ static int qat_dev_cfg_show(SYSCTL_HANDLER_ARGS) struct sbuf sb; int error; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); dev_cfg = arg1; sx_slock(&dev_cfg->lock); diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index ead172635e59..539059589bc8 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "adf_cnvnr_freq_counters.h" #include "adf_common_drv.h" #include "adf_cfg.h" @@ -45,6 +46,9 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) char report[MAX_REPORT_SIZE]; char *report_ptr = report; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + /* Defensive check */ if (!accel_dev || accel_dev->accel_id > ADF_MAX_DEVICES) return EINVAL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c index 8690c000760c..e7b4840600e1 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_heartbeat_dbg.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "adf_heartbeat_dbg.h" #include "adf_common_drv.h" #include "adf_cfg.h" @@ -17,6 +18,49 @@ } \ } while (0) + +static int qat_dev_hb_read_sent(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_heartbeat *hb; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hb = accel_dev->heartbeat; + + error = sysctl_handle_int(oidp, &hb->hb_sent_counter, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + +static int qat_dev_hb_read_failed(SYSCTL_HANDLER_ARGS) +{ + struct adf_accel_dev *accel_dev = arg1; + struct adf_heartbeat *hb; + int error = EFAULT; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + + if (accel_dev == NULL) + return EINVAL; + + hb = accel_dev->heartbeat; + + error = sysctl_handle_int(oidp, &hb->hb_failed_counter, 0, req); + if (error || !req->newptr) + return error; + + return (0); +} + /* Handler for HB status check */ static int qat_dev_hb_read(SYSCTL_HANDLER_ARGS) { @@ -24,6 +68,10 @@ static int qat_dev_hb_read(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; struct adf_heartbeat *hb; int ret = 0; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev == NULL) { return EINVAL; } @@ -63,24 +111,28 @@ adf_heartbeat_dbg_add(struct adf_accel_dev *accel_dev) device_get_sysctl_tree(accel_dev->accel_pci_dev.pci_dev); hb->heartbeat_sent.oid = - SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, SYSCTL_CHILDREN(qat_hb_sysctl_tree), OID_AUTO, "heartbeat_sent", - CTLFLAG_RD, - &hb->hb_sent_counter, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, - "HB sent count"); + qat_dev_hb_read_sent, + "IU", + "HB failed count"); HB_SYSCTL_ERR(hb->heartbeat_sent.oid); hb->heartbeat_failed.oid = - SYSCTL_ADD_UINT(qat_hb_sysctl_ctx, + SYSCTL_ADD_PROC(qat_hb_sysctl_ctx, SYSCTL_CHILDREN(qat_hb_sysctl_tree), OID_AUTO, "heartbeat_failed", - CTLFLAG_RD, - &hb->hb_failed_counter, + CTLTYPE_INT | CTLFLAG_RD, + accel_dev, 0, + qat_dev_hb_read_failed, + "IU", "HB failed count"); HB_SYSCTL_ERR(hb->heartbeat_failed.oid); diff --git a/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c index 76830e2920c3..a50e5fa62a18 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_pfvf_ctrs_dbg.c @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_common_drv.h" #include "adf_dev_err.h" #include "adf_freebsd_pfvf_ctrs_dbg.h" +#include #define MAX_REPORT_LINES (14) #define MAX_REPORT_LINE_LEN (64) @@ -92,6 +93,9 @@ static int adf_pfvf_ctrs_show(SYSCTL_HANDLER_ARGS) struct pfvf_stats *pfvf_counters = arg1; char report[MAX_REPORT_SIZE]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!pfvf_counters) return EINVAL; diff --git a/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c b/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c index 35375bb20014..78ea6a7a5083 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c +++ b/sys/dev/qat/qat_common/adf_freebsd_transport_debug.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -14,6 +14,7 @@ #include #include #include +#include static int adf_ring_show(SYSCTL_HANDLER_ARGS) { @@ -25,6 +26,9 @@ static int adf_ring_show(SYSCTL_HANDLER_ARGS) int error, word; uint32_t *wp, *end; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); { int head, tail, empty; @@ -125,6 +129,9 @@ static int adf_bank_show(SYSCTL_HANDLER_ARGS) struct sbuf sb; int error, ring_id; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 128, req); bank = arg1; accel_dev = bank->accel_dev; diff --git a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c index 98cde6a742c1..041481435426 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_ver_dbg.c @@ -5,12 +5,16 @@ #include "adf_common_drv.h" #include "adf_accel_devices.h" #include "adf_ver_dbg.h" +#include static int adf_sysctl_read_fw_versions(SYSCTL_HANDLER_ARGS) { struct adf_accel_dev *accel_dev = arg1; char fw_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; @@ -34,6 +38,9 @@ static int adf_sysctl_read_hw_versions(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; char hw_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; @@ -55,6 +62,9 @@ static int adf_sysctl_read_mmp_versions(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; char mmp_version[ADF_CFG_MAX_VAL_LEN_IN_BYTES]; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!accel_dev) return -EINVAL; diff --git a/sys/dev/qat/qat_common/adf_fw_counters.c b/sys/dev/qat/qat_common/adf_fw_counters.c index 1acabe4c9364..1356fa89e775 100644 --- a/sys/dev/qat/qat_common/adf_fw_counters.c +++ b/sys/dev/qat/qat_common/adf_fw_counters.c @@ -9,6 +9,7 @@ #include "icp_qat_fw_init_admin.h" #include #include +#include #define ADF_FW_COUNTERS_BUF_SZ 4096 #define ADF_RAS_EVENT_STR "RAS events" @@ -126,6 +127,9 @@ int adf_read_fw_counters(SYSCTL_HANDLER_ARGS) struct sbuf *sbuf = NULL; char *cbuf = NULL; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev == NULL) { return EINVAL; } diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c index e68d0bca80fc..a2bb36727fd4 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ae_config.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include #include @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,10 @@ static int adf_ae_config_show(SYSCTL_HANDLER_ARGS) u8 ae_index; u8 num_aes; int ret = 0; + + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + u32 num_au = hw_data->get_num_accel_units(hw_data); sbuf_new_for_sysctl(&sb, NULL, 2048, req); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c index 3821e60df746..4fdbec791ce6 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_misc_error_stats.c @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include "adf_c4xxx_misc_error_stats.h" #include "adf_common_drv.h" #include "adf_cfg_common.h" #include #include +#include #define MISC_ERROR_DBG_FILE "misc_error_stats" #define LINE \ @@ -23,6 +24,9 @@ static int qat_misc_error_show(SYSCTL_HANDLER_ARGS) { struct sbuf sb; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "\n"); sbuf_printf(&sb, LINE); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c index 61a879900f9c..06145a3d7906 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_pke_replay_stats.c @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_hw_data.h" #include "adf_c4xxx_pke_replay_stats.h" #include "adf_common_drv.h" #include "icp_qat_fw_init_admin.h" #include #include +#include #define PKE_REPLAY_DBG_FILE "pke_replay_stats" #define LINE \ @@ -21,6 +22,9 @@ static int qat_pke_replay_counters_show(SYSCTL_HANDLER_ARGS) u64 suc_counter = 0; u64 unsuc_counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "\n"); diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c index d7cf8e350fa4..af4c6d123c84 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_ras.c @@ -1,10 +1,11 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_c4xxx_ras.h" #include "adf_accel_devices.h" #include "adf_c4xxx_hw_data.h" #include #include "adf_c4xxx_inline.h" +#include #define ADF_RAS_STR_LEN 64 @@ -13,6 +14,9 @@ static int adf_sysctl_read_ras_correctable(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_CORR]); @@ -24,6 +28,9 @@ static int adf_sysctl_read_ras_uncorrectable(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_UNCORR]); @@ -35,6 +42,9 @@ static int adf_sysctl_read_ras_fatal(SYSCTL_HANDLER_ARGS) struct adf_accel_dev *accel_dev = arg1; unsigned long counter = 0; + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (accel_dev->ras_counters) counter = atomic_read(&accel_dev->ras_counters[ADF_RAS_FATAL]); @@ -47,6 +57,9 @@ static int adf_sysctl_write_ras_reset(SYSCTL_HANDLER_ARGS) int value = 0; int ret = SYSCTL_IN(req, &value, sizeof(value)); + if (priv_check(curthread, PRIV_DRIVER) != 0) + return EPERM; + if (!ret && value != 0 && accel_dev->ras_counters) { } From nobody Fri Jun 20 13:52:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSP3YXHz5y3r1; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSN6r5Lz3Xxt; Fri, 20 Jun 2025 13:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ya3+roezMw+VIPOeWo+uC5IY6Z8GDLZNL3p0ghStWbM=; b=oK+d2QEYFKZjtbAq3bf1ZQIFRiXLo64DwFfFpCUqJ1hyCZeZ/JTypW3kIqOAk/x7TyFnA2 gxakHIGzFsVNwGVvHRtnSZ3+ZT10LWWuxwFqczphU7xpcU9ICrUHiYaHdgU91ObWSSVDL8 syZe1V/BbG5HEZwFACOWB6G28kHLusEKxvv8HhuI3sogavOMiCmUnv2BBtzKpgoDj5h03Z 953FYNNRCSxf+urK8MM2zDBuDrJOZ3Ro75RDsCVmlY3NiUQFNI0CNILUyioa5u7rAl6FQu QU0pSyF/FuzZFastC1rbPoeNaZ6pXYi8yHV1BqmMJbQ7+OZfU+aqjLAwu2n6Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ya3+roezMw+VIPOeWo+uC5IY6Z8GDLZNL3p0ghStWbM=; b=WwZDa9sXImobzi3qfT9/QhcrYBTltZlh+KgPzOi58WTZXG9iKWdE2joYfuEgkkp3bBrECy vBsBmc0zRNgC55agXhdvp6g/G/JnwSzRSTu+a3yO+TErZUHTfvS+XaZ/V+QvKr1tnCWXgv AKOYQURcM6+LbkSFSBdE1cFyG5UPrzd9JbtwAb0hY9Nxm/qqDacwslZRUlTPvm8RGmJVR5 vVzGutMGFWi73o1d0UuP5F2Z0a1Sg9mkBRiPSqcTBnTtp6VlIoRy91AJRJXdk+gtKRue4y BA+/XqU3dyzOaFqziT2RUHsRakCYA56i/HXlQNH6RimkwN3qZxruJZxaucuNGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427556; a=rsa-sha256; cv=none; b=Rl0dJyRdmToYznR6mTGqDGMKEmtC54Eo7iiUoX60F7GkHIxDQWX3V2sYwCb/PtWwJBFr1E ZhCIHV1lGVmrkC8BYAEdLooTEcA9TjSzpKw3SqsWOsXHBswUbYvJjc8tFk69EfJEhqt9Hh GNYqcOGSqMPdYbXf8siLhMZfw0akeSQUGwaTyd5fQe8yrrTnBsw14Qvg/7qil5yoQbU6Sv NenRlxMWo2O3X+ff7+uF4E7uddNh/Y/v79h6fSrb6MjPAWuMywDoWUULIU0FGhXDbkKR5L kiu0uJ4970C223wPi3twkwoppnenQ8SOgflP2P0g3pnS7ltVijStmPbL1VtZdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSN5ZTYznfK; Fri, 20 Jun 2025 13:52: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 55KDqaVu058483; Fri, 20 Jun 2025 13:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqacS058479; Fri, 20 Jun 2025 13:52:36 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:36 GMT Message-Id: <202506201352.55KDqacS058479@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: 9c5211114872 - stable/14 - qat: reimplement cpaCyGetXXXInstances as a wrapper List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 9c521111487295819f34a44f3d6b27c90d9dbb73 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9c521111487295819f34a44f3d6b27c90d9dbb73 commit 9c521111487295819f34a44f3d6b27c90d9dbb73 Author: Hareshx Sankar Raj AuthorDate: 2025-05-01 05:53:54 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:27 +0000 qat: reimplement cpaCyGetXXXInstances as a wrapper Currently code from sal_instances.c and sal_crypto.c for getting cy instances or number of instances is duplicated. This commit replaces cpaCyGetXXXInstances implementation with Lac_GetCyXXXInstancesByType invocation. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit e745eee59c821c1d8ae7f5b25dfbdf0049b4787c) --- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 205 ++------------------- .../qat/qat_api/common/ctrl/sal_get_instances.c | 177 ++++++++++++++---- .../qat_api/common/include/lac_sal_types_crypto.h | 23 ++- 3 files changed, 182 insertions(+), 223 deletions(-) diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c index e8a5ab1361e7..7bfc5ec3ba10 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c @@ -73,6 +73,15 @@ #define NUM_CRYPTO_ASYM_RX_RINGS 1 #define NUM_CRYPTO_NRBG_RX_RINGS 1 +CpaStatus Lac_GetCyInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U numInstances, + CpaInstanceHandle *pInstances); + +CpaStatus Lac_GetCyNumInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U *pNumInstances); + static CpaInstanceHandle Lac_CryptoGetFirstHandle(void) { @@ -1068,84 +1077,8 @@ cpaCyInstanceSetNotificationCb( CpaStatus cpaCyGetNumInstances(Cpa16U *pNumInstances) { - CpaStatus status = CPA_STATUS_SUCCESS; - CpaInstanceHandle cyInstanceHandle; - CpaInstanceInfo2 info; - icp_accel_dev_t **pAdfInsts = NULL; - icp_accel_dev_t *dev_addr = NULL; - sal_t *base_addr = NULL; - sal_list_t *list_temp = NULL; - Cpa16U num_accel_dev = 0; - Cpa16U num_inst = 0; - Cpa16U i = 0; - - LAC_CHECK_NULL_PARAM(pNumInstances); - - /* Get the number of accel_dev in the system */ - status = icp_amgr_getNumInstances(&num_accel_dev); - LAC_CHECK_STATUS(status); - - /* Allocate memory to store addr of accel_devs */ - pAdfInsts = - malloc(num_accel_dev * sizeof(icp_accel_dev_t *), M_QAT, M_WAITOK); - num_accel_dev = 0; - /* Get ADF to return all accel_devs that support either - * symmetric or asymmetric crypto */ - status = icp_amgr_getAllAccelDevByCapabilities( - (ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC), - pAdfInsts, - &num_accel_dev); - if (CPA_STATUS_SUCCESS != status) { - LAC_LOG_ERROR("No support for crypto\n"); - *pNumInstances = 0; - free(pAdfInsts, M_QAT); - return status; - } - - for (i = 0; i < num_accel_dev; i++) { - dev_addr = (icp_accel_dev_t *)pAdfInsts[i]; - if (NULL == dev_addr || NULL == dev_addr->pSalHandle) { - continue; - } - - base_addr = dev_addr->pSalHandle; - list_temp = base_addr->crypto_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - list_temp = base_addr->asym_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - if (CPA_STATUS_SUCCESS == status && - CPA_TRUE == info.isPolled) { - num_inst++; - } - list_temp = SalList_next(list_temp); - } - } - *pNumInstances = num_inst; - free(pAdfInsts, M_QAT); - - - return status; + return Lac_GetCyNumInstancesByType(CPA_ACC_SVC_TYPE_CRYPTO, + pNumInstances); } /** @@ -1155,119 +1088,9 @@ cpaCyGetNumInstances(Cpa16U *pNumInstances) CpaStatus cpaCyGetInstances(Cpa16U numInstances, CpaInstanceHandle *pCyInstances) { - CpaStatus status = CPA_STATUS_SUCCESS; - CpaInstanceHandle cyInstanceHandle; - CpaInstanceInfo2 info; - icp_accel_dev_t **pAdfInsts = NULL; - icp_accel_dev_t *dev_addr = NULL; - sal_t *base_addr = NULL; - sal_list_t *list_temp = NULL; - Cpa16U num_accel_dev = 0; - Cpa16U num_allocated_instances = 0; - Cpa16U index = 0; - Cpa16U i = 0; - - - LAC_CHECK_NULL_PARAM(pCyInstances); - if (0 == numInstances) { - LAC_INVALID_PARAM_LOG("NumInstances is 0"); - return CPA_STATUS_INVALID_PARAM; - } - - /* Get the number of crypto instances */ - status = cpaCyGetNumInstances(&num_allocated_instances); - if (CPA_STATUS_SUCCESS != status) { - return status; - } - - if (numInstances > num_allocated_instances) { - QAT_UTILS_LOG("Only %d crypto instances available\n", - num_allocated_instances); - return CPA_STATUS_RESOURCE; - } - - /* Get the number of accel devices in the system */ - status = icp_amgr_getNumInstances(&num_accel_dev); - LAC_CHECK_STATUS(status); - - /* Allocate memory to store addr of accel_devs */ - pAdfInsts = - malloc(num_accel_dev * sizeof(icp_accel_dev_t *), M_QAT, M_WAITOK); - - num_accel_dev = 0; - /* Get ADF to return all accel_devs that support either - * symmetric or asymmetric crypto */ - status = icp_amgr_getAllAccelDevByCapabilities( - (ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC | - ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC), - pAdfInsts, - &num_accel_dev); - if (CPA_STATUS_SUCCESS != status) { - LAC_LOG_ERROR("No support for crypto\n"); - free(pAdfInsts, M_QAT); - return status; - } - - for (i = 0; i < num_accel_dev; i++) { - dev_addr = (icp_accel_dev_t *)pAdfInsts[i]; - /* Note dev_addr cannot be NULL here as numInstances = 0 - * is not valid and if dev_addr = NULL then index = 0 (which - * is less than numInstances and status is set to _RESOURCE - * above - */ - base_addr = dev_addr->pSalHandle; - if (NULL == base_addr) { - continue; - } - list_temp = base_addr->crypto_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - list_temp = base_addr->asym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) { - break; - } - cyInstanceHandle = SalList_getObject(list_temp); - status = cpaCyInstanceGetInfo2(cyInstanceHandle, &info); - list_temp = SalList_next(list_temp); - if (CPA_STATUS_SUCCESS != status || - CPA_TRUE != info.isPolled) { - continue; - } - pCyInstances[index] = cyInstanceHandle; - index++; - } - } - free(pAdfInsts, M_QAT); - - return status; + return Lac_GetCyInstancesByType(CPA_ACC_SVC_TYPE_CRYPTO, + numInstances, + pCyInstances); } /** diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c b/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c index 27037e99d1ac..f68853dc43a8 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_get_instances.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** @@ -10,7 +10,9 @@ * @ingroup SalCtrl * * @description - * This file contains the main function to get SAL instances. + * This file contains generic functions to get instances of a specified + * service type. Note these are complementary to the already existing + * service-specific functions. * *****************************************************************************/ @@ -34,19 +36,22 @@ #include "lac_mem.h" #include "lac_list.h" #include "lac_sal_types.h" +#include "lac_sal_types_crypto.h" /** ****************************************************************************** * @ingroup SalCtrl * @description - * Get either sym or asym instance number + * Get the total number of either sym, asym or cy instances *****************************************************************************/ -static CpaStatus -Lac_GetSingleCyNumInstances( +CpaStatus +Lac_GetCyNumInstancesByType( const CpaAccelerationServiceType accelerationServiceType, Cpa16U *pNumInstances) { CpaStatus status = CPA_STATUS_SUCCESS; + CpaInstanceHandle instanceHandle; + CpaInstanceInfo2 info; icp_accel_dev_t **pAdfInsts = NULL; icp_accel_dev_t *dev_addr = NULL; sal_t *base_addr = NULL; @@ -71,6 +76,12 @@ Lac_GetSingleCyNumInstances( service = "sym"; break; + case CPA_ACC_SVC_TYPE_CRYPTO: + accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | + ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + service = "cy"; + break; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; @@ -106,14 +117,48 @@ Lac_GetSingleCyNumInstances( } base_addr = dev_addr->pSalHandle; - if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType) { + if (CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->crypto_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } + } + + if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { list_temp = base_addr->asym_services; - } else { - list_temp = base_addr->sym_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } } - while (NULL != list_temp) { - num_inst++; - list_temp = SalList_next(list_temp); + + if (CPA_ACC_SVC_TYPE_CRYPTO_SYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->sym_services; + while (NULL != list_temp) { + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + if (CPA_STATUS_SUCCESS == status && + CPA_TRUE == info.isPolled) { + num_inst++; + } + list_temp = SalList_next(list_temp); + } } } @@ -127,15 +172,17 @@ Lac_GetSingleCyNumInstances( ****************************************************************************** * @ingroup SalCtrl * @description - * Get either sym or asym instance + * Get either sym, asym or cy instance *****************************************************************************/ -static CpaStatus -Lac_GetSingleCyInstances( +CpaStatus +Lac_GetCyInstancesByType( const CpaAccelerationServiceType accelerationServiceType, Cpa16U numInstances, CpaInstanceHandle *pInstances) { CpaStatus status = CPA_STATUS_SUCCESS; + CpaInstanceHandle instanceHandle = NULL; + CpaInstanceInfo2 info; icp_accel_dev_t **pAdfInsts = NULL; icp_accel_dev_t *dev_addr = NULL; sal_t *base_addr = NULL; @@ -163,14 +210,21 @@ Lac_GetSingleCyInstances( accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC; service = "sym"; break; + + case CPA_ACC_SVC_TYPE_CRYPTO: + accel_capability = ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC | + ICP_ACCEL_CAPABILITIES_CRYPTO_ASYMMETRIC; + service = "cy"; + break; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; } /* Get the number of instances */ - status = cpaGetNumInstances(accelerationServiceType, - &num_allocated_instances); + status = Lac_GetCyNumInstancesByType(accelerationServiceType, + &num_allocated_instances); if (CPA_STATUS_SUCCESS != status) { return status; } @@ -216,17 +270,63 @@ Lac_GetSingleCyInstances( continue; } - if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType) + if (CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->crypto_services; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } + } + + if (CPA_ACC_SVC_TYPE_CRYPTO_ASYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { list_temp = base_addr->asym_services; - else - list_temp = base_addr->sym_services; - while (NULL != list_temp) { - if (index > (numInstances - 1)) - break; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } + } - pInstances[index] = SalList_getObject(list_temp); - list_temp = SalList_next(list_temp); - index++; + if (CPA_ACC_SVC_TYPE_CRYPTO_SYM == accelerationServiceType || + CPA_ACC_SVC_TYPE_CRYPTO == accelerationServiceType) { + list_temp = base_addr->sym_services; + while (NULL != list_temp) { + if (index > (numInstances - 1)) + break; + + instanceHandle = SalList_getObject(list_temp); + status = cpaCyInstanceGetInfo2(instanceHandle, + &info); + list_temp = SalList_next(list_temp); + if (CPA_STATUS_SUCCESS != status || + CPA_TRUE != info.isPolled) { + continue; + } + pInstances[index] = instanceHandle; + index++; + } } } free(pAdfInsts, M_QAT); @@ -242,16 +342,24 @@ CpaStatus cpaGetNumInstances(const CpaAccelerationServiceType accelerationServiceType, Cpa16U *pNumInstances) { + LAC_CHECK_NULL_PARAM(pNumInstances); + switch (accelerationServiceType) { case CPA_ACC_SVC_TYPE_CRYPTO_ASYM: case CPA_ACC_SVC_TYPE_CRYPTO_SYM: - return Lac_GetSingleCyNumInstances(accelerationServiceType, - pNumInstances); case CPA_ACC_SVC_TYPE_CRYPTO: - return cpaCyGetNumInstances(pNumInstances); + return Lac_GetCyNumInstancesByType(accelerationServiceType, + pNumInstances); + case CPA_ACC_SVC_TYPE_DATA_COMPRESSION: return cpaDcGetNumInstances(pNumInstances); + case CPA_ACC_SVC_TYPE_PATTERN_MATCH: + case CPA_ACC_SVC_TYPE_RAID: + case CPA_ACC_SVC_TYPE_XML: + QAT_UTILS_LOG("Unsupported service type\n"); + return CPA_STATUS_UNSUPPORTED; + default: QAT_UTILS_LOG("Invalid service type\n"); *pNumInstances = 0; @@ -268,18 +376,25 @@ cpaGetInstances(const CpaAccelerationServiceType accelerationServiceType, Cpa16U numInstances, CpaInstanceHandle *pInstances) { + LAC_CHECK_NULL_PARAM(pInstances); + switch (accelerationServiceType) { case CPA_ACC_SVC_TYPE_CRYPTO_ASYM: case CPA_ACC_SVC_TYPE_CRYPTO_SYM: - return Lac_GetSingleCyInstances(accelerationServiceType, + case CPA_ACC_SVC_TYPE_CRYPTO: + return Lac_GetCyInstancesByType(accelerationServiceType, numInstances, pInstances); - case CPA_ACC_SVC_TYPE_CRYPTO: - return cpaCyGetInstances(numInstances, pInstances); case CPA_ACC_SVC_TYPE_DATA_COMPRESSION: return cpaDcGetInstances(numInstances, pInstances); + case CPA_ACC_SVC_TYPE_PATTERN_MATCH: + case CPA_ACC_SVC_TYPE_RAID: + case CPA_ACC_SVC_TYPE_XML: + QAT_UTILS_LOG("Unsupported service type\n"); + return CPA_STATUS_UNSUPPORTED; + default: QAT_UTILS_LOG("Invalid service type\n"); return CPA_STATUS_INVALID_PARAM; diff --git a/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h b/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h index c26603e4b582..952c174adfec 100644 --- a/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h +++ b/sys/dev/qat/qat_api/common/include/lac_sal_types_crypto.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** @@ -187,4 +187,25 @@ typedef struct sal_crypto_service_s { CpaInstanceHandle Lac_GetFirstHandle(sal_service_type_t svc_type); +/** + ****************************************************************************** + * @ingroup SalCtrl + * @description + * Get the total number of either sym, asym or cy instances + *****************************************************************************/ +CpaStatus Lac_GetCyNumInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U *pNumInstances); + +/** + ****************************************************************************** + * @ingroup SalCtrl + * @description + * Get either sym, asym or cy instance + *****************************************************************************/ +CpaStatus Lac_GetCyInstancesByType( + const CpaAccelerationServiceType accelerationServiceType, + Cpa16U numInstances, + CpaInstanceHandle *pInstances); + #endif /*LAC_SAL_TYPES_CRYPTO_H_*/ From nobody Fri Jun 20 13:52:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSQ2Dm6z5y3r4; Fri, 20 Jun 2025 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSP72npz3Y42; Fri, 20 Jun 2025 13: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=1750427558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PbOWff20Kto29oGJYTAKs7UcD7S9mGZYev9t2p3tko=; b=bFW8g5gr+hmL4ixjYJ228gnUOVNATSyNxIoa+OtkjGcQSKjT7Iua9tQUwIcw20fDFmEEZL Dw+T5CsmRIr6EwRruL6YTQ2jZm/eXzbmUjoLR9orS0eYKzPWIdv3dENupYIxaHN6egcIr5 3jhhX2rWOprp1WYNVm8/JfWfOPThN5vYw1GNFe/3vETaxLgNp6/wm94OFx/gQC05Ip65u/ Rbp2eCBrnlTyymC1PDpxeaMk+LM0KnHnYh/+JUnsHKnz9AfxZUQ38WTwnsnp+dMAYuVpV3 QcS7uD4xnMcNvnrsxXh448B0qmsVqV0jIBgsyr+4xziRRFAsGfMjh1Vyz/idew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PbOWff20Kto29oGJYTAKs7UcD7S9mGZYev9t2p3tko=; b=xUVCAfHecghv+8NbADHRCvVcKtQfUHXfJG0MtWbrPF/FNNqL9t2tD3x6B0QkzIoYIdrwEJ 27nfc7Avca02TD8aQG9/SY0RWL1W1e5iszurkfGQME+8WU5GXOJGIBn3MD6XDg0kh4y0Bb FbszNmE5hzufgLZFDDpmrxwp8gmWVe/CejRknwpn7IhPPzYcEKjj703nvdi/w2wARxZTBd ebblicWiFoyqc0pFG8eV8Ik/re41ZQgNpaFPhLYtT2vYxbuXLpTPLEd7Pk5H7Ba15qaBS4 9FcK3NwvFyQOxNpPQnLB49XFXe+oTgdHtTs2Mt+A0Ia2/iOXTPq2Mj9VCYDVsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427558; a=rsa-sha256; cv=none; b=cU4ZY7rj0HrOVewBAwQFF9r3pmVC5+9qO9yuMt82SH5yms/WN6gcj+nclO5KRkqk6U64Qy kXue3fJgBCkzHM3CK7UTxB/x0gUHzidIi7RVkibiIeI7EEqP5XNSos+aawUQDUspE0oFLD 8+YMnwxjKa6dtGnNq5lEiJSvF/CohWqtWrDN6celtxSmr/Qz/oaeMuU6yLpbs3WIcn3NVx wBION1IKPRLlGUFN9wEh7WkjYWj2GQRIeV+5ACdePhwt9kLsthNxD7V0FvKHYVd0GEw9m0 wGXGFjRyLRgaM/1cbKIWkc/uiqvbfR7lJQ3ZzpgFWthZgV7CvQlIK8p75l4LDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSP6KPGznfL; Fri, 20 Jun 2025 13: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 55KDqbwx058519; Fri, 20 Jun 2025 13: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 55KDqbHW058516; Fri, 20 Jun 2025 13:52:37 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:37 GMT Message-Id: <202506201352.55KDqbHW058516@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: cabd847e400f - stable/14 - qat: driver updates to improve code and fix bugs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: cabd847e400f2c738e15cf6760939f80e24cf8a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cabd847e400f2c738e15cf6760939f80e24cf8a9 commit cabd847e400f2c738e15cf6760939f80e24cf8a9 Author: Hareshx Sankar Raj AuthorDate: 2025-05-07 09:38:21 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:28 +0000 qat: driver updates to improve code and fix bugs Bug fixes and improvements are done for the qat code base to improve code quality. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit ded037e65e5239671b1292ec987a2e0894b217b5) --- sys/dev/qat/include/adf_cfg_device.h | 4 +- sys/dev/qat/include/adf_gen4vf_hw_csr_data.h | 4 +- sys/dev/qat/include/adf_pfvf_vf_msg.h | 3 +- sys/dev/qat/include/common/adf_accel_devices.h | 2 + sys/dev/qat/include/common/adf_cfg_common.h | 4 +- sys/dev/qat/include/common/adf_common_drv.h | 3 +- sys/dev/qat/include/common/adf_gen4_hw_data.h | 6 +- sys/dev/qat/include/common/adf_pfvf_msg.h | 8 ++- sys/dev/qat/include/icp_qat_fw_init_admin.h | 2 +- .../qat/qat_api/common/compression/dc_datapath.c | 11 +++- .../qat_api/common/crypto/sym/key/lac_sym_key.c | 8 +++ .../qat/qat_api/common/crypto/sym/lac_sym_hash.c | 11 ++-- .../common/crypto/sym/qat/lac_sym_qat_cipher.c | 35 +++++++++--- sys/dev/qat/qat_api/common/ctrl/sal_compression.c | 8 +-- sys/dev/qat/qat_api/common/ctrl/sal_crypto.c | 4 +- .../qat_api/common/include/sal_types_compression.h | 4 +- sys/dev/qat/qat_api/include/icp_sal_versions.h | 4 +- sys/dev/qat/qat_common/adf_aer.c | 11 +++- sys/dev/qat/qat_common/adf_cfg_device.c | 14 ++++- .../qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c | 1 + sys/dev/qat/qat_common/adf_freebsd_dev_processes.c | 20 ++----- sys/dev/qat/qat_common/adf_gen2_hw_data.c | 6 +- sys/dev/qat/qat_common/adf_gen4_pfvf.c | 3 +- sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c | 8 +-- sys/dev/qat/qat_common/adf_init.c | 66 +++++++++++++++++++++- sys/dev/qat/qat_common/adf_pfvf_vf_msg.c | 20 ++++++- sys/dev/qat/qat_common/adf_pfvf_vf_proto.c | 17 ++++-- sys/dev/qat/qat_common/adf_vf_isr.c | 15 ++++- sys/dev/qat/qat_common/qat_hal.c | 17 ++++-- sys/dev/qat/qat_common/qat_uclo.c | 12 ++-- sys/dev/qat/qat_hw/qat_200xx/adf_200xx_hw_data.h | 6 +- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 3 + sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 5 -- sys/dev/qat/qat_hw/qat_4xxxvf/adf_4xxxvf_hw_data.c | 3 + sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h | 6 +- sys/dev/qat/qat_hw/qat_c4xxx/adf_c4xxx_hw_data.c | 6 +- 36 files changed, 262 insertions(+), 98 deletions(-) diff --git a/sys/dev/qat/include/adf_cfg_device.h b/sys/dev/qat/include/adf_cfg_device.h index f2891e4eb805..1419292a262f 100644 --- a/sys/dev/qat/include/adf_cfg_device.h +++ b/sys/dev/qat/include/adf_cfg_device.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_CFG_DEVICE_H_ #define ADF_CFG_DEVICE_H_ @@ -79,4 +79,6 @@ int adf_cfg_device_init(struct adf_cfg_device *device, void adf_cfg_device_clear(struct adf_cfg_device *device, struct adf_accel_dev *accel_dev); +void adf_cfg_device_clear_all(struct adf_accel_dev *accel_dev); + #endif diff --git a/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h b/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h index ed78ab54ec4e..5143b88907ba 100644 --- a/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h +++ b/sys/dev/qat/include/adf_gen4vf_hw_csr_data.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_GEN4VF_HW_CSR_DATA_H_ #define ADF_GEN4VF_HW_CSR_DATA_H_ @@ -51,7 +51,7 @@ struct resource *_csr_base_addr = csr_base_addr; \ u32 _bank = bank; \ u32 _ring = ring; \ - dma_addr_t _value = value; \ + bus_addr_t _value = value; \ u32 l_base = 0, u_base = 0; \ l_base = (u32)((_value)&0xFFFFFFFF); \ u_base = (u32)(((_value)&0xFFFFFFFF00000000ULL) >> 32); \ diff --git a/sys/dev/qat/include/adf_pfvf_vf_msg.h b/sys/dev/qat/include/adf_pfvf_vf_msg.h index 3cf6d5ed0815..44066ca1fe85 100644 --- a/sys/dev/qat/include/adf_pfvf_vf_msg.h +++ b/sys/dev/qat/include/adf_pfvf_vf_msg.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_PFVF_VF_MSG_H #define ADF_PFVF_VF_MSG_H @@ -8,5 +8,6 @@ void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev); int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev); int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev); int adf_vf2pf_get_ring_to_svc(struct adf_accel_dev *accel_dev); +void adf_vf2pf_restarting_complete(struct adf_accel_dev *accel_dev); #endif /* ADF_PFVF_VF_MSG_H */ diff --git a/sys/dev/qat/include/common/adf_accel_devices.h b/sys/dev/qat/include/common/adf_accel_devices.h index b3f82234bc2b..c09aee8ea4bd 100644 --- a/sys/dev/qat/include/common/adf_accel_devices.h +++ b/sys/dev/qat/include/common/adf_accel_devices.h @@ -448,6 +448,7 @@ struct adf_hw_device_data { uint8_t num_accel; uint8_t num_logical_accel; uint8_t num_engines; + bool get_ring_to_svc_done; int (*get_storage_enabled)(struct adf_accel_dev *accel_dev, uint32_t *storage_enabled); u8 query_storage_cap; @@ -721,5 +722,6 @@ struct adf_accel_dev { bool is_vf; u32 accel_id; void *lac_dev; + struct mutex lock; /* protect accel_dev during start/stop e.t.c */ }; #endif diff --git a/sys/dev/qat/include/common/adf_cfg_common.h b/sys/dev/qat/include/common/adf_cfg_common.h index 4a85e021aeb7..eb3edec41742 100644 --- a/sys/dev/qat/include/common/adf_cfg_common.h +++ b/sys/dev/qat/include/common/adf_cfg_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_CFG_COMMON_H_ #define ADF_CFG_COMMON_H_ @@ -62,7 +62,7 @@ struct adf_pci_address { unsigned char bus; unsigned char dev; unsigned char func; -} __packed; +}; #define ADF_CFG_SERV_RING_PAIR_0_SHIFT 0 #define ADF_CFG_SERV_RING_PAIR_1_SHIFT 3 diff --git a/sys/dev/qat/include/common/adf_common_drv.h b/sys/dev/qat/include/common/adf_common_drv.h index b6bc2511bfba..f9f4463f69c3 100644 --- a/sys/dev/qat/include/common/adf_common_drv.h +++ b/sys/dev/qat/include/common/adf_common_drv.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_DRV_H #define ADF_DRV_H @@ -304,6 +304,7 @@ void adf_flush_vf_wq(struct adf_accel_dev *accel_dev); int adf_pf2vf_handle_pf_restarting(struct adf_accel_dev *accel_dev); int adf_pf2vf_handle_pf_rp_reset(struct adf_accel_dev *accel_dev, struct pfvf_message msg); +int adf_pf2vf_handle_pf_error(struct adf_accel_dev *accel_dev); bool adf_recv_and_handle_pf2vf_msg(struct adf_accel_dev *accel_dev); static inline int adf_sriov_configure(device_t *pdev, int numvfs) diff --git a/sys/dev/qat/include/common/adf_gen4_hw_data.h b/sys/dev/qat/include/common/adf_gen4_hw_data.h index d0423eaa17cf..cde5ae1f4e10 100644 --- a/sys/dev/qat/include/common/adf_gen4_hw_data.h +++ b/sys/dev/qat/include/common/adf_gen4_hw_data.h @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2021 Intel Corporation */ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_GEN4_HW_CSR_DATA_H_ #define ADF_GEN4_HW_CSR_DATA_H_ @@ -62,7 +62,7 @@ struct resource *_csr_base_addr = csr_base_addr; \ u32 _bank = bank; \ u32 _ring = ring; \ - dma_addr_t _value = value; \ + bus_addr_t _value = value; \ u32 l_base = 0, u_base = 0; \ l_base = lower_32_bits(_value); \ u_base = upper_32_bits(_value); \ diff --git a/sys/dev/qat/include/common/adf_pfvf_msg.h b/sys/dev/qat/include/common/adf_pfvf_msg.h index 349db9a13b22..abd9cd46014f 100644 --- a/sys/dev/qat/include/common/adf_pfvf_msg.h +++ b/sys/dev/qat/include/common/adf_pfvf_msg.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #ifndef ADF_PFVF_MSG_H #define ADF_PFVF_MSG_H @@ -97,6 +97,7 @@ enum pf2vf_msgtype { ADF_PF2VF_MSGTYPE_RESTARTING = 0x01, ADF_PF2VF_MSGTYPE_VERSION_RESP = 0x02, ADF_PF2VF_MSGTYPE_BLKMSG_RESP = 0x03, + ADF_PF2VF_MSGTYPE_FATAL_ERROR = 0x04, /* Values from 0x10 are Gen4 specific, message type is only 4 bits in Gen2 devices. */ ADF_PF2VF_MSGTYPE_RP_RESET_RESP = 0x10, @@ -111,6 +112,7 @@ enum vf2pf_msgtype { ADF_VF2PF_MSGTYPE_LARGE_BLOCK_REQ = 0x07, ADF_VF2PF_MSGTYPE_MEDIUM_BLOCK_REQ = 0x08, ADF_VF2PF_MSGTYPE_SMALL_BLOCK_REQ = 0x09, + ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE = 0x0a, /* Values from 0x10 are Gen4 specific, message type is only 4 bits in Gen2 devices. */ ADF_VF2PF_MSGTYPE_RP_RESET = 0x10, @@ -124,8 +126,10 @@ enum pfvf_compatibility_version { ADF_PFVF_COMPAT_FAST_ACK = 0x03, /* Ring to service mapping support for non-standard mappings */ ADF_PFVF_COMPAT_RING_TO_SVC_MAP = 0x04, + /* Fallback compat */ + ADF_PFVF_COMPAT_FALLBACK = 0x05, /* Reference to the latest version */ - ADF_PFVF_COMPAT_THIS_VERSION = 0x04, + ADF_PFVF_COMPAT_THIS_VERSION = 0x05, }; /* PF->VF Version Response */ diff --git a/sys/dev/qat/include/icp_qat_fw_init_admin.h b/sys/dev/qat/include/icp_qat_fw_init_admin.h index cd4edbdbc93b..f3e0ff9d0064 100644 --- a/sys/dev/qat/include/icp_qat_fw_init_admin.h +++ b/sys/dev/qat/include/icp_qat_fw_init_admin.h @@ -198,8 +198,8 @@ struct icp_qat_fw_init_admin_resp { enum icp_qat_fw_init_admin_init_flag { ICP_QAT_FW_INIT_FLAG_PKE_DISABLED = 0 }; struct icp_qat_fw_init_admin_hb_cnt { - u16 resp_heartbeat_cnt; u16 req_heartbeat_cnt; + u16 resp_heartbeat_cnt; }; #define ICP_QAT_FW_COMN_HEARTBEAT_OK 0 diff --git a/sys/dev/qat/qat_api/common/compression/dc_datapath.c b/sys/dev/qat/qat_api/common/compression/dc_datapath.c index f5a8600eadfa..312b2d6749cc 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_datapath.c +++ b/sys/dev/qat/qat_api/common/compression/dc_datapath.c @@ -118,14 +118,19 @@ dcCompression_ProcessCallback(void *pRespMsg) /* Cast response message to compression response message type */ pCompRespMsg = (icp_qat_fw_comp_resp_t *)pRespMsg; - + if (!(pCompRespMsg)) { + QAT_UTILS_LOG("pCompRespMsg is NULL\n"); + return; + } /* Extract request data pointer from the opaque data */ LAC_MEM_SHARED_READ_TO_PTR(pCompRespMsg->opaque_data, pReqData); + if (!(pReqData)) { + QAT_UTILS_LOG("pReqData is NULL\n"); + return; + } /* Extract fields from the request data structure */ pCookie = (dc_compression_cookie_t *)pReqData; - if (!pCookie) - return; pSessionDesc = DC_SESSION_DESC_FROM_CTX_GET(pCookie->pSessionHandle); pService = (sal_compression_service_t *)(pCookie->dcInstance); diff --git a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c index 965874e7466f..36e0175f988a 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/key/lac_sym_key.c @@ -2160,6 +2160,14 @@ LacSymKey_CheckParamSslTls(const void *pKeyGenOpData, } } + /* check 0 secret length as it is not valid for SSL3 Key Gen + * request */ + if (0 == uSecretLen) { + LAC_INVALID_PARAM_LOG1("%u secret.dataLenInBytes", + uSecretLen); + return CPA_STATUS_INVALID_PARAM; + } + /* Only seed length for SSL3 Key Gen request */ if (maxSeedLen != uSeedLen) { LAC_INVALID_PARAM_LOG("seed.dataLenInBytes"); diff --git a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c index 5ad64ca09a0b..46f652cfd5c6 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/lac_sym_hash.c @@ -751,10 +751,13 @@ LacHash_PerformParamCheck(CpaInstanceHandle instanceHandle, &pHashAlgInfo); /* check if the message is a multiple of the block size. */ - if ((pOpData->messageLenToHashInBytes % - pHashAlgInfo->blockLength) != 0) { - LAC_INVALID_PARAM_LOG( - "messageLenToHashInBytes not block size"); + if (pOpData->messageLenToHashInBytes % + pHashAlgInfo->blockLength != + 0) { + LAC_INVALID_PARAM_LOG2( + "message(%d) not block-size(%d) multiple", + pOpData->messageLenToHashInBytes, + pHashAlgInfo->blockLength); return CPA_STATUS_INVALID_PARAM; } } diff --git a/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c b/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c index c6fbeb1b888a..d8a7ac75aec1 100644 --- a/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c +++ b/sys/dev/qat/qat_api/common/crypto/sym/qat/lac_sym_qat_cipher.c @@ -214,6 +214,11 @@ static const uint8_t key_size_f8[] = { ICP_QAT_HW_CIPHER_ALGO_AES256 /* ICP_QAT_HW_AES_256_F8_KEY_SZ */ }; +/* This array must be kept aligned with CpaCySymCipherAlgorithm enum but + * offset by -1 as that enum starts at 1. LacSymQat_CipherGetCfgData() + * below relies on that alignment and uses that enum -1 to index into this + * array. + */ typedef struct _icp_qat_hw_cipher_info { icp_qat_hw_cipher_algo_t algorithm; icp_qat_hw_cipher_mode_t mode; @@ -542,7 +547,7 @@ LacSymQat_CipherGetCfgData(lac_session_desc_t *pSession, sal_crypto_service_t *pService = (sal_crypto_service_t *)pSession->pInstance; - CpaCySymCipherAlgorithm cipherAlgorithm = 0; + int cipherIdx = 0; icp_qat_hw_cipher_dir_t cipherDirection = 0; /* Set defaults */ @@ -551,21 +556,33 @@ LacSymQat_CipherGetCfgData(lac_session_desc_t *pSession, *pMode = ICP_QAT_HW_CIPHER_ECB_MODE; *pDir = ICP_QAT_HW_CIPHER_ENCRYPT; - /* decrease since it's numbered from 1 instead of 0 */ - cipherAlgorithm = pSession->cipherAlgorithm - 1; + /* offset index as CpaCySymCipherAlgorithm enum starts from 1, not from + * 0 */ + cipherIdx = pSession->cipherAlgorithm - 1; cipherDirection = pSession->cipherDirection == CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT ? ICP_QAT_HW_CIPHER_ENCRYPT : ICP_QAT_HW_CIPHER_DECRYPT; - *pAlgorithm = icp_qat_alg_info[cipherAlgorithm].algorithm; - *pMode = icp_qat_alg_info[cipherAlgorithm].mode; - *pDir = icp_qat_alg_info[cipherAlgorithm].dir[cipherDirection]; + /* Boundary check against the last value in the algorithm enum */ + if (!(pSession->cipherAlgorithm <= CPA_CY_SYM_CIPHER_SM4_CTR)) { + QAT_UTILS_LOG("Invalid cipherAlgorithm value\n"); + return; + } + + if (!(cipherDirection <= ICP_QAT_HW_CIPHER_DECRYPT)) { + QAT_UTILS_LOG("Invalid cipherDirection value\n"); + return; + } + + *pAlgorithm = icp_qat_alg_info[cipherIdx].algorithm; + *pMode = icp_qat_alg_info[cipherIdx].mode; + *pDir = icp_qat_alg_info[cipherIdx].dir[cipherDirection]; *pKey_convert = - icp_qat_alg_info[cipherAlgorithm].key_convert[cipherDirection]; + icp_qat_alg_info[cipherIdx].key_convert[cipherDirection]; - if (IS_KEY_DEP_NO != icp_qat_alg_info[cipherAlgorithm].isKeyLenDepend) { - *pAlgorithm = icp_qat_alg_info[cipherAlgorithm] + if (IS_KEY_DEP_NO != icp_qat_alg_info[cipherIdx].isKeyLenDepend) { + *pAlgorithm = icp_qat_alg_info[cipherIdx] .pAlgByKeySize[pSession->cipherKeyLenInBytes]; } diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_compression.c b/sys/dev/qat/qat_api/common/ctrl/sal_compression.c index c0f5a411d87e..e8ae47f0f0d3 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_compression.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_compression.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** ***************************************************************************** * @file sal_compression.c @@ -371,9 +371,6 @@ SalCtrl_CompressionInit(icp_accel_dev_t *device, sal_service_t *service) SAL_SERVICE_GOOD_FOR_INIT(pCompressionService); - pCompressionService->generic_service_info.state = - SAL_SERVICE_STATE_INITIALIZING; - if (CPA_FALSE == pCompressionService->generic_service_info.is_dyn) { section = icpGetProcessName(); } @@ -1438,7 +1435,8 @@ cpaDcInstanceGetInfo2(const CpaInstanceHandle instanceHandle, pInstanceInfo2->isOffloaded = CPA_TRUE; /* Get the instance name and part name from the config file */ dev = icp_adf_getAccelDevByAccelId(pCompressionService->pkgID); - if (NULL == dev) { + if (NULL == dev || + 0 == strnlen(dev->deviceName, ADF_DEVICE_TYPE_LENGTH + 1)) { QAT_UTILS_LOG("Can not find device for the instance.\n"); LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2)); return CPA_STATUS_FAIL; diff --git a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c index 7bfc5ec3ba10..3e134f43af6e 100644 --- a/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c +++ b/sys/dev/qat/qat_api/common/ctrl/sal_crypto.c @@ -1235,7 +1235,8 @@ cpaCyInstanceGetInfo2(const CpaInstanceHandle instanceHandle_in, /* Get the instance name and part name */ dev = icp_adf_getAccelDevByAccelId(pCryptoService->pkgID); - if (NULL == dev) { + if (NULL == dev || + 0 == strnlen(dev->deviceName, ADF_DEVICE_TYPE_LENGTH + 1)) { LAC_LOG_ERROR("Can not find device for the instance\n"); LAC_OS_BZERO(pInstanceInfo2, sizeof(CpaInstanceInfo2)); return CPA_STATUS_FAIL; @@ -1717,7 +1718,6 @@ Lac_GetFirstHandle(sal_service_type_t svc_type) default: LAC_LOG_ERROR("Invalid service type\n"); return NULL; - break; } /* Only need 1 dev with crypto enabled - so check all devices*/ status = icp_amgr_getAllAccelDevByEachCapability(capabilities, diff --git a/sys/dev/qat/qat_api/common/include/sal_types_compression.h b/sys/dev/qat/qat_api/common/include/sal_types_compression.h index d7bfe33cab08..4b17438b3258 100644 --- a/sys/dev/qat/qat_api/common/include/sal_types_compression.h +++ b/sys/dev/qat/qat_api/common/include/sal_types_compression.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** * @file sal_types_compression.h @@ -24,6 +24,8 @@ #define DC_NUM_RX_RINGS (1) #define DC_NUM_COMPRESSION_LEVELS (CPA_DC_L12) +#define MAX_SGL_NUM 0x10000 + /** ***************************************************************************** * @ingroup SalCtrl diff --git a/sys/dev/qat/qat_api/include/icp_sal_versions.h b/sys/dev/qat/qat_api/include/icp_sal_versions.h index db1ba297adc6..03bcef4fcbbb 100644 --- a/sys/dev/qat/qat_api/include/icp_sal_versions.h +++ b/sys/dev/qat/qat_api/include/icp_sal_versions.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ /** *************************************************************************** * @file icp_sal_versions.h @@ -26,7 +26,7 @@ /* Part name and number of the accelerator device */ #define SAL_INFO2_DRIVER_SW_VERSION_MAJ_NUMBER 3 -#define SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER 14 +#define SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER 15 #define SAL_INFO2_DRIVER_SW_VERSION_PATCH_NUMBER 0 /** diff --git a/sys/dev/qat/qat_common/adf_aer.c b/sys/dev/qat/qat_common/adf_aer.c index 7fdeba873420..123baaa244c3 100644 --- a/sys/dev/qat/qat_common/adf_aer.c +++ b/sys/dev/qat/qat_common/adf_aer.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -280,6 +280,15 @@ adf_notify_fatal_error_work(struct work_struct *work) struct adf_fatal_error_data *wq_data = container_of(work, struct adf_fatal_error_data, work); struct adf_accel_dev *accel_dev = wq_data->accel_dev; + struct adf_hw_device_data *hw_device = accel_dev->hw_device; + + if (adf_dev_in_use(accel_dev)) { + if (hw_device->pre_reset) { + device_printf(GET_DEV(accel_dev), + "Performing pre reset save\n"); + hw_device->pre_reset(accel_dev); + } + } adf_error_notifier((uintptr_t)accel_dev); if (!accel_dev->is_vf) { diff --git a/sys/dev/qat/qat_common/adf_cfg_device.c b/sys/dev/qat/qat_common/adf_cfg_device.c index a26d2fdfd32e..4860a4064b97 100644 --- a/sys/dev/qat/qat_common/adf_cfg_device.c +++ b/sys/dev/qat/qat_common/adf_cfg_device.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_cfg_instance.h" #include "adf_cfg_section.h" #include "adf_cfg_device.h" @@ -677,6 +677,18 @@ adf_cfg_device_clear(struct adf_cfg_device *device, device->instances = NULL; } +void +adf_cfg_device_clear_all(struct adf_accel_dev *accel_dev) +{ + sx_xlock(&accel_dev->cfg->lock); + if (accel_dev->cfg->dev) { + adf_cfg_device_clear(accel_dev->cfg->dev, accel_dev); + free(accel_dev->cfg->dev, M_QAT); + accel_dev->cfg->dev = NULL; + } + sx_xunlock(&accel_dev->cfg->lock); +} + /* * Static configuration for userspace */ diff --git a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c index 539059589bc8..e4ddbf489192 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c +++ b/sys/dev/qat/qat_common/adf_freebsd_cnvnr_ctrs_dbg.c @@ -93,6 +93,7 @@ static int qat_cnvnr_ctrs_dbg_read(SYSCTL_HANDLER_ARGS) /* Extracting number of Acceleration Engines */ num_aes = hw_device->get_num_aes(hw_device); + explicit_bzero(&request, sizeof(struct icp_qat_fw_init_admin_req)); for (ae = 0; ae < num_aes; ae++) { if (accel_dev->au_info && !test_bit(ae, &dc_ae_msk)) continue; diff --git a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c index 661d5bd0f14e..67e1d4ad2cab 100644 --- a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c +++ b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ - +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -85,7 +84,7 @@ static struct cdevsw adf_state_cdevsw = { .d_name = ADF_DEV_STATE_NAME, }; -static const struct filterops adf_state_read_filterops = { +static struct filterops adf_state_read_filterops = { .f_isfd = 1, .f_attach = NULL, .f_detach = adf_state_kqread_detach, @@ -410,17 +409,6 @@ adf_state_set(int dev, enum adf_event event) state->state.dev_state = event; state->state.dev_id = dev; STAILQ_INSERT_TAIL(head, state, entries_state); - if (event == ADF_EVENT_STOP) { - state = NULL; - state = malloc(sizeof(struct entry_state), - M_QAT, - M_NOWAIT | M_ZERO); - if (!state) - continue; - state->state.dev_state = ADF_EVENT_SHUTDOWN; - state->state.dev_id = dev; - STAILQ_INSERT_TAIL(head, state, entries_state); - } } mtx_unlock(&mtx); callout_schedule(&callout, ADF_STATE_CALLOUT_TIME); @@ -451,7 +439,7 @@ adf_state_event_handler(struct adf_accel_dev *accel_dev, enum adf_event event) case ADF_EVENT_START: return ret; case ADF_EVENT_STOP: - break; + return ret; case ADF_EVENT_ERROR: break; #if defined(QAT_UIO) && defined(QAT_DBG) @@ -548,6 +536,7 @@ adf_state_destroy(void) struct entry_proc_events *proc_events = NULL; adf_service_unregister(&adf_state_hndl); + destroy_dev(adf_state_dev); mtx_lock(&callout_mtx); callout_stop(&callout); mtx_unlock(&callout_mtx); @@ -560,7 +549,6 @@ adf_state_destroy(void) } mtx_unlock(&mtx); mtx_destroy(&mtx); - destroy_dev(adf_state_dev); } static int diff --git a/sys/dev/qat/qat_common/adf_gen2_hw_data.c b/sys/dev/qat/qat_common/adf_gen2_hw_data.c index 10e86f8cd218..92fd2b9bc8e5 100644 --- a/sys/dev/qat/qat_common/adf_gen2_hw_data.c +++ b/sys/dev/qat/qat_common/adf_gen2_hw_data.c @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2021 Intel Corporation */ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_gen2_hw_data.h" #include "icp_qat_hw.h" @@ -54,7 +54,7 @@ write_csr_ring_config(struct resource *csr_base_addr, WRITE_CSR_RING_CONFIG(csr_base_addr, bank, ring, value); } -static dma_addr_t +static bus_addr_t read_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring) { return READ_CSR_RING_BASE(csr_base_addr, bank, ring); diff --git a/sys/dev/qat/qat_common/adf_gen4_pfvf.c b/sys/dev/qat/qat_common/adf_gen4_pfvf.c index 03bb90938e85..122abb301d31 100644 --- a/sys/dev/qat/qat_common/adf_gen4_pfvf.c +++ b/sys/dev/qat/qat_common/adf_gen4_pfvf.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include -#include #include #include "adf_accel_devices.h" #include "adf_common_drv.h" diff --git a/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c b/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c index 5c06b413b528..bfa778ea301b 100644 --- a/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c +++ b/sys/dev/qat/qat_common/adf_gen4vf_hw_csr_data.c @@ -1,10 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "adf_accel_devices.h" #include "adf_gen4vf_hw_csr_data.h" static u64 -build_csr_ring_base_addr(dma_addr_t addr, u32 size) +build_csr_ring_base_addr(bus_addr_t addr, u32 size) { return BUILD_RING_BASE_ADDR_GEN4(addr, size); } @@ -54,7 +54,7 @@ write_csr_ring_config(struct resource *csr_base_addr, WRITE_CSR_RING_CONFIG_GEN4VF(csr_base_addr, bank, ring, value); } -static dma_addr_t +static bus_addr_t read_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring) { return READ_CSR_RING_BASE_GEN4VF(csr_base_addr, bank, ring); @@ -64,7 +64,7 @@ static void write_csr_ring_base(struct resource *csr_base_addr, u32 bank, u32 ring, - dma_addr_t addr) + bus_addr_t addr) { WRITE_CSR_RING_BASE_GEN4VF(csr_base_addr, bank, ring, addr); } diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index 9f239b8f63d3..6bd0d85aae69 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -20,6 +20,10 @@ #include "adf_common_drv.h" #include "icp_qat_fw.h" +#if defined(QAT_UIO) +#include "adf_cfg_device.h" +#endif /* QAT_UIO*/ + /* Mask used to check the CompressAndVerify capability bit */ #define DC_CNV_EXTENDED_CAPABILITY (0x01) @@ -29,6 +33,11 @@ static LIST_HEAD(service_table); static DEFINE_MUTEX(service_lock); +static int adf_dev_init_locked(struct adf_accel_dev *accel_dev); +static int adf_dev_start_locked(struct adf_accel_dev *accel_dev); +static int adf_dev_stop_locked(struct adf_accel_dev *accel_dev); +static void adf_dev_shutdown_locked(struct adf_accel_dev *accel_dev); + static void adf_service_add(struct service_hndl *service) { @@ -261,6 +270,18 @@ adf_set_ssm_wdtimer(struct adf_accel_dev *accel_dev) */ int adf_dev_init(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_init_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_init_locked(struct adf_accel_dev *accel_dev) { struct service_hndl *service; struct list_head *list_itr; @@ -410,6 +431,18 @@ adf_dev_init(struct adf_accel_dev *accel_dev) */ int adf_dev_start(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_start_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_start_locked(struct adf_accel_dev *accel_dev) { struct adf_hw_device_data *hw_data = accel_dev->hw_device; struct service_hndl *service; @@ -507,6 +540,18 @@ adf_dev_start(struct adf_accel_dev *accel_dev) */ int adf_dev_stop(struct adf_accel_dev *accel_dev) +{ + int ret = 0; + + mutex_lock(&accel_dev->lock); + ret = adf_dev_stop_locked(accel_dev); + mutex_unlock(&accel_dev->lock); + + return ret; +} + +static int +adf_dev_stop_locked(struct adf_accel_dev *accel_dev) { struct service_hndl *service; struct list_head *list_itr; @@ -517,6 +562,10 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) accel_dev->accel_id); return ENODEV; } + + if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) + return 0; + if (!adf_dev_started(accel_dev) && !test_bit(ADF_STATUS_STARTING, &accel_dev->status)) { return 0; @@ -570,11 +619,22 @@ adf_dev_stop(struct adf_accel_dev *accel_dev) */ void adf_dev_shutdown(struct adf_accel_dev *accel_dev) +{ + mutex_lock(&accel_dev->lock); + adf_dev_shutdown_locked(accel_dev); + mutex_unlock(&accel_dev->lock); +} + +static void +adf_dev_shutdown_locked(struct adf_accel_dev *accel_dev) { struct adf_hw_device_data *hw_data = accel_dev->hw_device; struct service_hndl *service; struct list_head *list_itr; + if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) + return; + if (test_bit(ADF_STATUS_SYSCTL_CTX_INITIALISED, &accel_dev->status)) { sysctl_ctx_free(&accel_dev->sysctl_ctx); clear_bit(ADF_STATUS_SYSCTL_CTX_INITIALISED, @@ -623,8 +683,12 @@ adf_dev_shutdown(struct adf_accel_dev *accel_dev) } /* Delete configuration only if not restarting */ - if (!test_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) + if (!test_bit(ADF_STATUS_RESTARTING, &accel_dev->status)) { adf_cfg_del_all(accel_dev); +#ifdef QAT_UIO + adf_cfg_device_clear_all(accel_dev); +#endif + } if (hw_data->remove_pke_stats) hw_data->remove_pke_stats(accel_dev); diff --git a/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c b/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c index dc0cb0110ec3..8c0221d344ff 100644 --- a/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c +++ b/sys/dev/qat/qat_common/adf_pfvf_vf_msg.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include "adf_accel_devices.h" #include "adf_common_drv.h" @@ -98,6 +98,22 @@ adf_vf2pf_request_version(struct adf_accel_dev *accel_dev) return 0; } +void +adf_vf2pf_restarting_complete(struct adf_accel_dev *accel_dev) +{ + struct pfvf_message msg = { .type = + ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE }; + + if (accel_dev->u1.vf.pf_compat_ver < ADF_PFVF_COMPAT_FALLBACK) + return; + + if (adf_send_vf2pf_msg(accel_dev, msg)) { + device_printf( + GET_DEV(accel_dev), + "Failed to send Restarting complete event to PF\n"); + } +} + int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev) { @@ -180,5 +196,7 @@ adf_vf2pf_get_ring_to_svc(struct adf_accel_dev *accel_dev) /* Only v1 at present */ accel_dev->hw_device->ring_to_svc_map = rts_map_msg.map; + accel_dev->hw_device->get_ring_to_svc_done = true; + return 0; } diff --git a/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c b/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c index a09ddb819831..2a338b96a5f3 100644 --- a/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c +++ b/sys/dev/qat/qat_common/adf_pfvf_vf_proto.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include #include "adf_accel_devices.h" #include "adf_common_drv.h" @@ -89,9 +89,15 @@ adf_send_vf2pf_req(struct adf_accel_dev *accel_dev, } /* Wait for response, if it times out retry */ - ret = - wait_for_completion_timeout(&accel_dev->u1.vf.msg_received, - timeout); + if (!cold) { + ret = wait_for_completion_timeout( + &accel_dev->u1.vf.msg_received, timeout); + } else { + /* In cold start timers may not be initialized yet */ + DELAY(ADF_PFVF_MSG_RESP_TIMEOUT * 1000); + ret = try_wait_for_completion( + &accel_dev->u1.vf.msg_received); + } if (ret) { if (likely(resp)) *resp = accel_dev->u1.vf.response; @@ -346,6 +352,9 @@ adf_handle_pf2vf_msg(struct adf_accel_dev *accel_dev, struct pfvf_message msg) case ADF_PF2VF_MSGTYPE_RP_RESET_RESP: adf_pf2vf_handle_pf_rp_reset(accel_dev, msg); return true; + case ADF_PF2VF_MSGTYPE_FATAL_ERROR: + adf_pf2vf_handle_pf_error(accel_dev); + return true; case ADF_PF2VF_MSGTYPE_VERSION_RESP: case ADF_PF2VF_MSGTYPE_BLKMSG_RESP: accel_dev->u1.vf.response = msg; diff --git a/sys/dev/qat/qat_common/adf_vf_isr.c b/sys/dev/qat/qat_common/adf_vf_isr.c index 10eaf9d8da1b..e61f8a57d9b8 100644 --- a/sys/dev/qat/qat_common/adf_vf_isr.c +++ b/sys/dev/qat/qat_common/adf_vf_isr.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include #include @@ -17,6 +17,7 @@ #include "adf_transport_access_macros.h" #include "adf_transport_internal.h" #include "adf_pfvf_utils.h" +#include "adf_pfvf_vf_msg.h" static TASKQUEUE_DEFINE_THREAD(qat_vf); static TASKQUEUE_DEFINE_THREAD(qat_bank_handler); @@ -65,6 +66,7 @@ adf_dev_stop_async(struct work_struct *work) /* Re-enable PF2VF interrupts */ hw_data->enable_pf2vf_interrupt(accel_dev); + adf_vf2pf_restarting_complete(accel_dev); kfree(stop_data); } @@ -123,6 +125,17 @@ adf_pf2vf_handle_pf_rp_reset(struct adf_accel_dev *accel_dev, return 0; } +int +adf_pf2vf_handle_pf_error(struct adf_accel_dev *accel_dev) +{ + device_printf(GET_DEV(accel_dev), "Fatal error received from PF\n"); + + if (adf_notify_fatal_error(accel_dev)) + device_printf(GET_DEV(accel_dev), "Couldn't notify fatal error\n"); + + return 0; +} + static void adf_pf2vf_bh_handler(void *data, int pending) { diff --git a/sys/dev/qat/qat_common/qat_hal.c b/sys/dev/qat/qat_common/qat_hal.c index b1e35e77272a..75190246ee1d 100644 --- a/sys/dev/qat/qat_common/qat_hal.c +++ b/sys/dev/qat/qat_common/qat_hal.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright(c) 2007-2022 Intel Corporation */ +/* Copyright(c) 2007-2025 Intel Corporation */ #include "qat_freebsd.h" #include "adf_cfg.h" #include "adf_common_drv.h" @@ -1052,8 +1052,7 @@ qat_hal_init(struct adf_accel_dev *accel_dev) handle->hal_cap_ae_xfer_csr_addr_v = ae_offset; handle->hal_ep_csr_addr_v = ep_offset; handle->hal_cap_ae_local_csr_addr_v = - ((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v + - LOCAL_TO_XFER_REG_OFFSET); + ((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v + LOCAL_TO_XFER_REG_OFFSET); handle->fw_auth = (pci_get_device(GET_DEV(handle->accel_dev)) == ADF_DH895XCC_PCI_DEVICE_ID) ? false : @@ -1283,7 +1282,7 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, unsigned int max_cycle, unsigned int *endpc) { - uint64_t savuwords[MAX_EXEC_INST]; + u64 *savuwords = NULL; unsigned int ind_lm_addr0, ind_lm_addr1; unsigned int ind_lm_addr2, ind_lm_addr3; unsigned int ind_lm_addr_byte0, ind_lm_addr_byte1; @@ -1300,6 +1299,11 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, pr_err("QAT: invalid instruction num %d\n", inst_num); return EINVAL; } + + savuwords = kzalloc(sizeof(u64) * MAX_EXEC_INST, GFP_KERNEL); + if (!savuwords) + return ENOMEM; + /* save current context */ qat_hal_rd_indr_csr(handle, ae, ctx, LM_ADDR_0_INDIRECT, &ind_lm_addr0); qat_hal_rd_indr_csr(handle, ae, ctx, LM_ADDR_1_INDIRECT, &ind_lm_addr1); @@ -1360,8 +1364,10 @@ qat_hal_exec_micro_inst(struct icp_qat_fw_loader_handle *handle, qat_hal_wr_ae_csr(handle, ae, CTX_SIG_EVENTS_ACTIVE, 0); qat_hal_enable_ctx(handle, ae, (1 << ctx)); /* wait for micro codes to finish */ - if (qat_hal_wait_cycles(handle, ae, max_cycle, 1) != 0) + if (qat_hal_wait_cycles(handle, ae, max_cycle, 1) != 0) { + kfree(savuwords); *** 154 LINES SKIPPED *** From nobody Fri Jun 20 13:52:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSR3hx9z5y4Rs; Fri, 20 Jun 2025 13:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSR04Tyz3YGK; Fri, 20 Jun 2025 13:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n0lRvC/SjX2OxLjlDUTUSeAfDxto7N7LrjTlBTyfOhE=; b=ooDB8qFhW6u4KjmHqgXKC+Tgmra4S4OHDKhmG2GjZlY5nSWP3wxDxhxwQiApUndAEaU4dS zmC5FUU9uY3zUbgHMYQx6/x/4R4tyYJOn4VBbrNkYJjsjhA/5p6BfiujFQt0itdVj//mI7 3qwJMYzde1aUWvYqPRDCpBKU6n5HShicDfo9QGOTIebcbJR2fWekepJRlnaLVl/SxFo3Jc zDLq8sQp1vTaJGuNp5HtU9OzNW9fILm01jweaUwJ0NNfjxz/LQDtIlezpAkrXOK9L14g2o Uj0aYM1uIIqSBG3IpuBfwh676wQmG95UQ00hUldtShjxqPkOPJPt+2DFpluO2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n0lRvC/SjX2OxLjlDUTUSeAfDxto7N7LrjTlBTyfOhE=; b=tNdcYe2ut0dBffHL/v2o3tg9HUZSM4MdV0rMJ3JcxtZGaBByZC5U+NGtl6OGz5LYnGefNC DfZZPiu/ve3Vl3aQe98CJpiDL6Tx26Jt1lQw/IvtLFLBj9qc6km63IAgQUdYei3QSQls68 WxrAkxkpE4zeYdBbTP47soNhVan03TYeV/AszWs7hyq1ciXaW2q/ocQyj4ltfzwZu1cJXf o6TqLEQX8mFFRbXSOsd7w0B/M8AijeSTNHyyX0bsLGZ4QGxyeW7XIi4xSQWHc9Wh8Dc3oX 0gd6fkUv7TtkGresyX4r7QbqiRitl09d5cRp6EVA1PiZ06ARGa/ycp3KzltBZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427559; a=rsa-sha256; cv=none; b=iDrT8MR89c0Hv2x+o7g4fSnA+riAzSjlhuW8Mwtv8OtnM5B6dlrYjpURxocsc/Tyz1qWOV V0MuWWTDCYwkt8Pjo7nxe9doW+/qmoCo1AzQkLTB5GIsGWX3QC8PRRW2jPVMXGz2NP/i0X Mv4dQv9sLQrk6jA+8KzvXUNr1tcFEQpznH2ShceVPYEHk7KqrHnEEosxKeCMSd4W1mM6mO eowOLdoQYBD/95UxpB/SPaWvi0kEsNoytXppuDKIvayiKRN7qobJ+Y8FhF8fJorpprjRvD DrhYqwGg0HSxPHnWeKMDbPnikDJPvUmF69h1sG1ajtWNlkqK5E3F4XLxCu4uiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSQ6cjrznCy; Fri, 20 Jun 2025 13: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 55KDqcBc058553; Fri, 20 Jun 2025 13: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 55KDqcge058549; Fri, 20 Jun 2025 13:52:38 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:38 GMT Message-Id: <202506201352.55KDqcge058549@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: a66d631a385e - stable/14 - qat: refactor error handling and add mutex locks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: a66d631a385ea35db9f3b31cecc355725a16022d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a66d631a385ea35db9f3b31cecc355725a16022d commit a66d631a385ea35db9f3b31cecc355725a16022d Author: Hareshx Sankar Raj AuthorDate: 2025-05-07 09:32:10 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:28 +0000 qat: refactor error handling and add mutex locks Error handling in qat driver code has been refactored. Mutex lock handling has also been added during driver attach and detach. Also pci_disable_busmaster() is called in adf_detach() to ensure proper cleanup during device detachment. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit ae1dc27639c88038d150660c4096753e210aec42) --- sys/dev/qat/qat_common/adf_init.c | 13 ------------- sys/dev/qat/qat_hw/qat_200xx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c | 22 ++++++++++++++++++---- sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_c62x/adf_drv.c | 23 +++++++++++++++++------ sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c | 24 ++++++++++++++++++------ 8 files changed, 121 insertions(+), 53 deletions(-) diff --git a/sys/dev/qat/qat_common/adf_init.c b/sys/dev/qat/qat_common/adf_init.c index 6bd0d85aae69..a7ebb70dde3d 100644 --- a/sys/dev/qat/qat_common/adf_init.c +++ b/sys/dev/qat/qat_common/adf_init.c @@ -449,12 +449,6 @@ adf_dev_start_locked(struct adf_accel_dev *accel_dev) struct list_head *list_itr; set_bit(ADF_STATUS_STARTING, &accel_dev->status); - if (adf_devmgr_verify_id(&accel_dev->accel_id)) { - device_printf(GET_DEV(accel_dev), - "QAT: Device %d not found\n", - accel_dev->accel_id); - return ENODEV; - } if (adf_ae_start(accel_dev)) { device_printf(GET_DEV(accel_dev), "AE Start Failed\n"); return EFAULT; @@ -556,13 +550,6 @@ adf_dev_stop_locked(struct adf_accel_dev *accel_dev) struct service_hndl *service; struct list_head *list_itr; - if (adf_devmgr_verify_id(&accel_dev->accel_id)) { - device_printf(GET_DEV(accel_dev), - "QAT: Device %d not found\n", - accel_dev->accel_id); - return ENODEV; - } - if (!test_bit(ADF_STATUS_CONFIGURED, &accel_dev->status)) return 0; diff --git a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c index 9e2462c05657..816010dc06f8 100644 --- a/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_200xx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i = 0, bar_nr = 0, reg_val = 0; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -96,6 +96,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -108,9 +109,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -213,18 +215,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -243,8 +247,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -260,7 +269,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c index 0813ccf5baf0..cb534dd03b86 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_drv.c @@ -158,7 +158,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 512. Implemented to avoid the issue of @@ -170,6 +170,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -180,9 +181,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -273,18 +275,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -303,8 +307,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -320,7 +329,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c index 42189c28b21a..2bbccb4d6b17 100644 --- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c @@ -101,6 +101,7 @@ adf_attach(device_t dev) struct adf_cfg_device *cfg_dev = NULL; accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); accel_dev->is_vf = true; pf = adf_devmgr_pci_to_accel_dev(pci_find_pf(dev)); @@ -112,11 +113,13 @@ adf_attach(device_t dev) accel_pci_dev->node = 0; /* Add accel device to accel table */ - if (adf_devmgr_add_dev(accel_dev, pf)) { + ret = adf_devmgr_add_dev(accel_dev, pf); + if (ret) { device_printf(GET_DEV(accel_dev), "Failed to add new accelerator device.\n"); - return -EFAULT; + goto out_err_lock; } + /* Allocate and configure device configuration structure */ hw_data = malloc(sizeof(*hw_data), M_QAT_4XXXVF, M_WAITOK | M_ZERO); accel_dev->hw_device = hw_data; @@ -152,6 +155,8 @@ adf_attach(device_t dev) NULL, NULL, &accel_dev->dma_tag); + if (ret) + goto out_err; hw_data->accel_capabilities_mask = adf_4xxxvf_get_hw_cap(accel_dev); @@ -180,7 +185,9 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); @@ -190,7 +197,7 @@ adf_attach(device_t dev) ret = hw_data->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (!ret) @@ -212,8 +219,13 @@ adf_attach(device_t dev) return ret; +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -231,7 +243,9 @@ adf_detach(device_t dev) clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); adf_dev_stop(accel_dev); adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c index 9f2c9374e968..b91daefb45d4 100644 --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -106,9 +107,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -202,18 +204,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -232,8 +236,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -249,7 +258,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c index 697f5b1ce786..f333101cce50 100644 --- a/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c4xxx/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -96,6 +96,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -108,9 +109,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -201,18 +203,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_start(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -231,8 +235,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -248,7 +257,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c index 1d48b85b2e12..955f6c48a071 100644 --- a/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_c62x/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -106,9 +107,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -203,18 +205,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -233,8 +237,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -250,7 +259,9 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); return 0; } diff --git a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c index d8f2ba0a99b7..a74de5eb592d 100644 --- a/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c +++ b/sys/dev/qat/qat_hw/qat_dh895xcc/adf_drv.c @@ -84,7 +84,7 @@ adf_attach(device_t dev) struct adf_accel_pci *accel_pci_dev; struct adf_hw_device_data *hw_data; unsigned int i, bar_nr; - int ret, rid; + int ret = 0, rid; struct adf_cfg_device *cfg_dev = NULL; /* Set pci MaxPayLoad to 256. Implemented to avoid the issue of @@ -95,6 +95,7 @@ adf_attach(device_t dev) accel_dev = device_get_softc(dev); + mutex_init(&accel_dev->lock); INIT_LIST_HEAD(&accel_dev->crypto_list); accel_pci_dev = &accel_dev->accel_pci_dev; accel_pci_dev->pci_dev = dev; @@ -104,9 +105,10 @@ adf_attach(device_t dev) /* Add accel device to accel table. * This should be called before adf_cleanup_accel is called */ - if (adf_devmgr_add_dev(accel_dev, NULL)) { + ret = adf_devmgr_add_dev(accel_dev, NULL); + if (ret) { device_printf(dev, "Failed to add new accelerator device.\n"); - return ENXIO; + goto out_err_lock; } /* Allocate and configure device configuration structure */ @@ -191,18 +193,20 @@ adf_attach(device_t dev) bar->base_addr = rman_get_start(bar->virt_addr); bar->size = rman_get_size(bar->virt_addr); } - pci_enable_busmaster(dev); + ret = pci_enable_busmaster(dev); + if (ret) + goto out_err; adf_dbgfs_init(accel_dev); if (!accel_dev->hw_device->config_device) { ret = EFAULT; - goto out_err; + goto out_err_disable; } ret = accel_dev->hw_device->config_device(accel_dev); if (ret) - goto out_err; + goto out_err_disable; ret = adf_dev_init(accel_dev); if (ret) @@ -221,8 +225,13 @@ out_dev_stop: adf_dev_stop(accel_dev); out_dev_shutdown: adf_dev_shutdown(accel_dev); +out_err_disable: + pci_disable_busmaster(dev); out_err: adf_cleanup_accel(accel_dev); +out_err_lock: + mutex_destroy(&accel_dev->lock); + return ret; } @@ -238,7 +247,10 @@ adf_detach(device_t dev) adf_dev_shutdown(accel_dev); + pci_disable_busmaster(dev); adf_cleanup_accel(accel_dev); + mutex_destroy(&accel_dev->lock); + return 0; } From nobody Fri Jun 20 13:52:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bNzSS4kRjz5y4PB; Fri, 20 Jun 2025 13:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bNzSS0xHqz3YK5; Fri, 20 Jun 2025 13:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9qpTd44h95hmUXfZhXfUWTvA96I+W1K3ctGc7NXW/E=; b=qOKKgfj6IpdWeDxXmteXYVEUnl8rvl9C3RokWwym0aFIBFiL7vwu9WiXJGPQAMZ6Os5oiw 1dxebj2cbwc725iESv5eIBA20F6Bv1Gu6tCX2xBVnS7sN6CSNNCaQad+w/WH2xVLHmAXSJ 7Ex1Y90jOs/CDeQswFzVcpSZ/MQ96aaqAr53EmVsi4B+kpLNpSB/4v0WlGNA150sqo68wQ Sr7Q8XLmlgzvXMpPQeXYbE7E/a1HlsZIH4gg/CReA9T+wM4gxH4Vmx2EuYQz761JbenLDa HIUuv5XTiOGjdc8iOwSjgRYVVy9CkQd/bgebGdV0GOC3Ls1fPzvfrau0Pa2WHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750427560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9qpTd44h95hmUXfZhXfUWTvA96I+W1K3ctGc7NXW/E=; b=jZdhHgGPM9tPMceUARnnRKXQO2Jolobm0wB0u9xhmM4oXl7eRilMnx/q8i6fGdjYS24IH9 P14WF0iJK++0KA8dBtFUm+nBYHs8lU3BQ3o1x1GfGBLV1Dq1FbcyChE/s9jyz0CpofVhUl wbo0SRKDuvSpMUpHtqeezRmWYDsLOYBvqdHw8ETZrwRz3mipsr22w0B2exuqy26M3TTCvr Z6I66chvseli/+YV1eIQ4LsFyZpSlwZFCSmBLQm5r7hjc/oIU60SUIBnkYQ9o1+UG+W/bC xP8v9hmORPGl66UxOwsIyTHFWekxdw1Upnoi1R8JQrLsgt/80jieVJ+4mSr+jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750427560; a=rsa-sha256; cv=none; b=Nanudm8wxIJmGdw5lIScKOs+iMENhSaEvC1Xer6X6Xo4oA6WpNLODfwBYFbtWLfrAhTm06 Mau7v+Prb87u77H3wTc2vzlNaF7x+/wWHKo68b5fQfraRDAJmGr8KTqPnS03W2mjh/37yh 68FwWBUiYtO27I973AGqTHKpmamaQX/9jFL6XRuiPnx4HojkYQ72/OZSxrHzf3zZlJ1Gyo Ovam/hSGwT2irTrVRWwWNisOCbxRKEew1PHxX47AOy0iWKrCgAgoGGsjNczwxBb253QBUw Wlmn64boX4hDdwi+QysRU0251us45zfxvlS+69kfHtFwimsFbDUN/4AnhSrtyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bNzSS0GJtzny7; Fri, 20 Jun 2025 13:52: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 55KDqdFH058587; Fri, 20 Jun 2025 13:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KDqd7R058584; Fri, 20 Jun 2025 13:52:39 GMT (envelope-from git) Date: Fri, 20 Jun 2025 13:52:39 GMT Message-Id: <202506201352.55KDqd7R058584@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: ef360183df81 - stable/14 - qat: update API files to use SPDX identifier List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: ef360183df813e3e89f3eb9dcf2ad0e47a58102c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ef360183df813e3e89f3eb9dcf2ad0e47a58102c commit ef360183df813e3e89f3eb9dcf2ad0e47a58102c Author: Hareshx Sankar Raj AuthorDate: 2025-05-29 08:14:59 +0000 Commit: Mark Johnston CommitDate: 2025-06-20 12:47:28 +0000 qat: update API files to use SPDX identifier API files are updated to have SPDX identifier and remove longer form of license to ensure consistency with the license format across all files. Reviewed by: markj, ziaee MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D50379 (cherry picked from commit 2542189532b3025577fa4e782904494f3587008b) --- sys/dev/qat/qat_api/include/cpa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/cpa_dev.h | 37 ++----------------------- sys/dev/qat/qat_api/include/cpa_types.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h | 37 ++----------------------- sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_common.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_im.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_key.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 37 ++----------------------- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 37 ++----------------------- 22 files changed, 44 insertions(+), 770 deletions(-) diff --git a/sys/dev/qat/qat_api/include/cpa.h b/sys/dev/qat/qat_api/include/cpa.h index f91de67caf5a..a3e32e4ef1d4 100644 --- a/sys/dev/qat/qat_api/include/cpa.h +++ b/sys/dev/qat/qat_api/include/cpa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/cpa_dev.h b/sys/dev/qat/qat_api/include/cpa_dev.h index bb6dd1d76f2a..9c1c7ccff45e 100644 --- a/sys/dev/qat/qat_api/include/cpa_dev.h +++ b/sys/dev/qat/qat_api/include/cpa_dev.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/cpa_types.h b/sys/dev/qat/qat_api/include/cpa_types.h index 93bed46f3730..712f1cf88b93 100644 --- a/sys/dev/qat/qat_api/include/cpa_types.h +++ b/sys/dev/qat/qat_api/include/cpa_types.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc.h b/sys/dev/qat/qat_api/include/dc/cpa_dc.h index 3002c62776c5..d1751fc7ee16 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h index 67a70c7193a7..3243f46d0518 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_bp.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h index 8679b64fa5b5..7c0102d8d838 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_chain.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h b/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h index a0aac8037855..95c34e631b9e 100644 --- a/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h +++ b/sys/dev/qat/qat_api/include/dc/cpa_dc_dp.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h index a7cdb711e60b..87c73fe7f05d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_common.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h index c99aa449ec06..b82bf63642a9 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_dh.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h index eea346ddadae..149a888f1744 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_dsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h index e6466ab7476a..45f724a8d629 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ec.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h index d968b5931a26..3a7ce1a820c0 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdh.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h index f1bb2b0240dc..af1eea223e89 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecdsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h index c7c89e3c6e8a..5d5e2b209aa1 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ecsm2.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2023 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h index f70e43fcf047..a9410523367f 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_im.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h index a0eaf35ec760..c51d57fd8ca6 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_key.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h index dbf510cacb82..e3efc2163848 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_kpt.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h index 6039720d3368..1049bb114948 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_ln.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h index 11e4773a05d1..313a2aca7649 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_prime.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h index fb6c83725745..bd85b7ee178d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_rsa.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - ***************************************************************************/ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2007-2025 Intel Corporation */ /* ***************************************************************************** diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h index adc1671c7f57..45f456d4a31d 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h @@ -1,38 +1,5 @@ -/*************************************************************************** - * - * BSD LICENSE - * - * Copyright(c) 2007-2025 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * *** 51 LINES SKIPPED *** From nobody Fri Jun 20 17:34:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bP4NQ01YSz5yKkh; Fri, 20 Jun 2025 17:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bP4NP68Z8z49cD; Fri, 20 Jun 2025 17:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750440869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7PAkZSqK/QauKDY7NpvLU260RbfI1qffOppih5S2Bc=; b=MG0+1sqbNyHpYxJ+Z+iI29WwbsYOEWmJxtzh3w3FWNKo2vsPq0rQsN62mDSHI2xIqfqBZW fuBCgPJAWY3p26c3SkyEIdj573Kj3EWksJWvvPJI1u8/BCmrkY1Y+D65cePPpc8xIYbKd4 FXvwLh2iv2pZW7fLyGg54aljkniI8rvVse6cM7+jjTAZQ5n+xdz9sWFTfE7MSUyadEdqTd D9T5wdTXPreNYEk2HpMrTL8BxZXk2bd/puz7KaTVJM2ummDVxpt40gnm7PDPcfJk3hwPQg Lfs5yCUiWMmK7kzs9FSGib231EJR3RhZm8TIEyjackWmvuUC2XM9XNJVsZa4mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750440869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7PAkZSqK/QauKDY7NpvLU260RbfI1qffOppih5S2Bc=; b=wHG4LBiQEq7i2Ztr/3TVU4FsDge86DAtsxJ0EjzQ3kQYsurw3kQT3xZDyHK7+A+8BOsdB8 IG/fW9GRXMNDyUTDNVxkNT2Xobl+JDNHCE1l5kwfMnR5BDxp3MW3q0LY/JJK3S894qdb++ KZBKlntKQ/M008dbNBBbD577pRWXymDszPT3Sj1wTVZS7KgXfpThrQF1DjVeu2toDDuXrQ Ca60LqgZiW2x3FOceeUPnEr2oyBNUaa3Irld7wwalVKF8e6W6rLF17n04rcWetzpAeBRAy gPC/v+FSqZFjlh/7AndGWF2Pc5lr61tHmj/l0seDXOENzAuoWHu7gBarHA+O1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750440869; a=rsa-sha256; cv=none; b=LGQq9nihZbmhQSLDdS6exktNcHB5TDADdjLqB69GToQVZCmFWBPrKenPwOvaXAvHGD6HhM muewqg0TKb1dFgG6pOawKpKE8+LocjjaeM8FAaR8KszHUNWyNMBQhUnj/eczYRWHyfmqr/ Do5WiA0YXY/xC24DYZuAd1U+J4EmHJeOFxrkmaV2pbvc8OiudAjzMr1mc9el/ztyKOBU+Z tAidf5N8bpv0GWPNe1Ruox2neYHs83O4ehQfVrL2vVXYhsJhlOmI+Nrz42jWxli52vc15J 6fLxRaC0xG4ynvkoXh4/lThf5BDqA1hNxjnjokY1J4sxvKl60D9QGLR0yw9LPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bP4NP5TjGzv6t; Fri, 20 Jun 2025 17:34: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 55KHYTWl073429; Fri, 20 Jun 2025 17:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KHYTwQ073426; Fri, 20 Jun 2025 17:34:29 GMT (envelope-from git) Date: Fri, 20 Jun 2025 17:34:29 GMT Message-Id: <202506201734.55KHYTwQ073426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 610a0ffabae6 - stable/13 - zfsboot: fix misuse of the phrase zpool List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 610a0ffabae6aa711ad03e0d6c2c81753220fef6 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=610a0ffabae6aa711ad03e0d6c2c81753220fef6 commit 610a0ffabae6aa711ad03e0d6c2c81753220fef6 Author: Graham Perrin AuthorDate: 2025-01-10 18:02:25 +0000 Commit: Lexi Winter CommitDate: 2025-06-20 17:33:39 +0000 zfsboot: fix misuse of the phrase zpool A pool is not a zpool. Reviewed by: jbh, ivy Approved by: des (mentor) MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1569 (cherry picked from commit f69afe4201ff33da0b3c3ca464a92e2e0b07ac43) --- usr.sbin/bsdinstall/scripts/zfsboot | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 83e7929f19f2..975b5c2b6cc5 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -116,7 +116,7 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_BOOT_TYPE:=} # -# How much swap to put on each block device in the boot zpool +# How much swap to put on each block device in the boot pool # NOTE: Value passed to gpart(8); which supports SI unit suffixes. # : ${ZFSBOOT_SWAP_SIZE:=2g} @@ -132,7 +132,7 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_SWAP_MIRROR=} # -# Default ZFS datasets for root zpool +# Default ZFS datasets for root pool # # NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME # NOTE: Anything after pound/hash character [#] is ignored as a comment. @@ -279,12 +279,12 @@ msg_odd_disk_selected="An even number of disks must be selected to create a RAID msg_ok="OK" msg_partition_scheme="Partition Scheme" msg_partition_scheme_help="Select partitioning scheme. GPT is recommended." -msg_please_enter_a_name_for_your_zpool="Please enter a name for your zpool:" +msg_please_enter_a_name_for_your_pool="Please enter a name for your pool:" msg_please_enter_amount_of_swap_space="Please enter amount of swap space (SI-Unit suffixes\nrecommended; e.g., \`2g' for 2 Gigabytes):" -msg_please_select_one_or_more_disks="Please select one or more disks to create a zpool:" +msg_please_select_one_or_more_disks="Please select one or more disks to create a pool:" msg_pool_name="Pool Name" msg_pool_name_cannot_be_empty="Pool name cannot be empty." -msg_pool_name_help="Customize the name of the zpool to be created (Required)" +msg_pool_name_help="Customize the name of the pool to be created (Required)" msg_pool_type_disks="Pool Type/Disks:" msg_pool_type_disks_help="Choose type of ZFS Virtual Device and disks to use (Required)" msg_processing_selection="Processing selection..." @@ -317,9 +317,9 @@ msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." msg_yes="YES" msg_zfs_configuration="ZFS Configuration" -msg_please_enter_options_for_your_zpool="Please enter options for your zpool" +msg_please_enter_options_for_your_pool="Please enter options for your pool" msg_zfs_options_name="ZFS Pool Options" -msg_zfs_options_name_help="Customize ZFS options for the zpool to be created" +msg_zfs_options_name_help="Customize ZFS options for the pool to be created" ############################################################ FUNCTIONS @@ -733,8 +733,8 @@ dialog_menu_layout() # zfs_create_diskpart $disk $index # -# For each block device to be used in the zpool, rather than just create the -# zpool with the raw block devices (e.g., da0, da1, etc.) we create partitions +# For each block device to be used in the pool, rather than just create the +# pool with the raw block devices (e.g., da0, da1, etc.) we create partitions # so we can have some real swap. This also provides wiggle room incase your # replacement drivers do not have the exact same sector counts. # @@ -890,7 +890,7 @@ zfs_create_diskpart() fi fi - # NB: zpool will use the `zfs#' GPT labels + # NB: ZFS pools will use `zfs#' GPT labels if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then if [ "$ZFSBOOT_BOOT_POOL" ]; then bootpart=p3 swappart=p4 targetpart=p4 @@ -985,7 +985,7 @@ zfs_create_diskpart() f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE - # NB: zpool will use s1a (no labels) + # NB: ZFS pools will use s1a (no labels) bootpart=s1a swappart=s1b targetpart=s1d mbrindex=4 # @@ -1550,7 +1550,7 @@ dialog_menu_diskinfo() return $SUCCESS } -dialog_zpool_name() +dialog_pool_name() { local prompt="$* is already taken, please enter a name for the ZFS pool \ (Or confirm using the same name by just pressing enter)" @@ -1595,8 +1595,8 @@ for pool in ${pools}; do f_dprintf "Checking ${pool} against ${ZFSBOOT_POOL_NAME}" if [ "${pool}" = "${ZFSBOOT_POOL_NAME}" ]; then f_dprintf "Pool ${pool} already taken" - ZFSBOOT_POOL_NAME=$(dialog_zpool_name "${ZFSBOOT_POOL_NAME}") - break; + ZFSBOOT_POOL_NAME=$(dialog_pool_name "${ZFSBOOT_POOL_NAME}") + break fi done @@ -1723,7 +1723,7 @@ while :; do ?" $msg_pool_name") # Prompt the user to input/change the name for the new pool f_dialog_input input \ - "$msg_please_enter_a_name_for_your_zpool" \ + "$msg_please_enter_a_name_for_your_pool" \ "$ZFSBOOT_POOL_NAME" && ZFSBOOT_POOL_NAME="$input" ;; @@ -1812,7 +1812,7 @@ while :; do ?" $msg_zfs_options_name") # Prompt the user to input/change the pool options f_dialog_input input \ - "$msg_please_enter_options_for_your_zpool" \ + "$msg_please_enter_options_for_your_pool" \ "$ZFSBOOT_POOL_CREATE_OPTIONS" && ZFSBOOT_POOL_CREATE_OPTIONS="$input" ;; From nobody Fri Jun 20 20:43:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bP8ZY3cK0z5yW4b; Fri, 20 Jun 2025 20:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bP8ZY2y7Mz49rP; Fri, 20 Jun 2025 20:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750452213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AjXpCEOHcPmyR0GBCSQVICEjOI6CBNk6q3sRfBPayfs=; b=ky2r2y1ilJBVLacsVrG9KuhqCCzpmGt2eL7YPVBw7S5Bh9OAVXSJQFrKaPRt6rLPPfZD0h Ni5FTW+iOUgsGVCK77MDdQwHXTB3pAEdcAS9bHXY5tCbIfMQxZKKuLMypx23v9A7hM40e1 cJ7GElXeg31qOTFmd4kOtmeXgutIW4slbJ60xkUji0TE5l8e3KTv2qMsVnRgOsYeE1nILj KJXpI1x9SZC6jMjPO4ahNt+pdBjR6mfOyz/46Rmy2LqkmWirOg1/OwEIncou8r++jViZTl JyucHYw4Dkw+XrJl03ci3zHwc8edE8z1jyKqTLitsNeSe3iCxuUuw/oa0aRoJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750452213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AjXpCEOHcPmyR0GBCSQVICEjOI6CBNk6q3sRfBPayfs=; b=wwuRIzrkQC7TJ1mUmNCgJWTseYhtC6QltJjimF5Q2B+scqao2GIbYdHwMIU2jsZ1rHxdBr 0Q7aN5KDQZjG7xMeKwbriMK7ItuWooS2kaASZX/rIjT7JpqDnO2q90wbhUEhiRhgGgu8F6 /ICyJq8FO3my7g0PtpX/rK64K/Vc+gpsvQ0d/WSb4U/n4+8uWY0CfTgsl64w0inX9Yy6ka DXVkw1QIE50zxa397Pz4pH1y3p/ZRXFM9WrYac4u1Bm6iWAITWq5fw1EINUjYMWhktz7AM et5rQJaik9R3NqWfMExYp1g1GgVo3fXLziBR9mcNl0brDL2iiTAvWS34Czpjfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750452213; a=rsa-sha256; cv=none; b=HirSL3r4pFbYpmO7YQV6WxvGImYPpSxuxx7m0P7/RJ2U1ujlHPD9ouanT5QMg3sJ2XEBSO CVmEJGiv3qlgGfkF9TvxgRPee/dDjHVi+5R64BuO40hx/Y/+FtlVv+yPtjxM0DDZKLsweZ ucCWpevxjOkzzKvRlnFx4/xaiIdYGY7kWFTO+eL0ubZ9R2Y0qNghWy1JoInXzKLUb9btOT 91H3rmgY+gsCPzq7Z/hv/wFs3Vzz7Dpo3fLELWg4CAjMNGlJTiBcsB8O1v9Pdevs2bpAl0 us0jR/TmBj96UqMbpoHsnUbg/SxXOgJoA/vy91UTZ61qczCAkv2hcTNLrP9E6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bP8ZY2PLkz11Hj; Fri, 20 Jun 2025 20:43: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 55KKhXV8031203; Fri, 20 Jun 2025 20:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KKhWot031198; Fri, 20 Jun 2025 20:43:32 GMT (envelope-from git) Date: Fri, 20 Jun 2025 20:43:32 GMT Message-Id: <202506202043.55KKhWot031198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: f47afeb2ce1e - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f47afeb2ce1eb04a787a4b8c1a6d7752940268da Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f47afeb2ce1eb04a787a4b8c1a6d7752940268da commit f47afeb2ce1eb04a787a4b8c1a6d7752940268da Author: Martin Matuska AuthorDate: 2025-06-01 20:16:26 +0000 Commit: Martin Matuska CommitDate: 2025-06-20 20:14:01 +0000 libarchive: merge from vendor branch libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname (CVE-2024-57970) #2532 tar reader: fix unchecked return value in list_item_verbose() (CVE-2025-25724) #2532 unzip: fix null pointer dereference (CVE-2025-1632) #2568 warc: prevent signed integer overflow (CVE-2025-5916) #2584 rar: do not skip past EOF while reading (CVE-2025-5918) #2588 tar: fix overflow in build_ustar_entry (CVE-2025-5917) #2598 rar: fix double free with over 4 billion nodes (CVE-2025-5914) #2599 rar: fix heap-buffer-overflow (CVE-2025-5915) Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724, CVE-2025-5914, CVE-2025-5915, CVE-2025-5916, CVE-2025-5917, CVE-2025-5918 PR: 286944 (exp-run on main, libarchive 3.8.0) (cherry picked from commit 2e113ef82465598b8c26e0ca415fbe90677fbd47) --- contrib/libarchive/COPYING | 2 +- contrib/libarchive/NEWS | 8 + contrib/libarchive/README.md | 9 +- .../github_actions/install-macos-dependencies.sh | 19 + contrib/libarchive/cpio/cpio.c | 2 +- contrib/libarchive/cpio/test/test_format_newc.c | 12 +- contrib/libarchive/cpio/test/test_option_a.c | 2 +- contrib/libarchive/cpio/test/test_option_c.c | 8 +- contrib/libarchive/libarchive/archive.h | 57 +- contrib/libarchive/libarchive/archive_acl.c | 14 +- .../libarchive/libarchive/archive_acl_private.h | 2 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 +- .../libarchive/archive_cryptor_private.h | 8 + contrib/libarchive/libarchive/archive_digest.c | 344 +- .../libarchive/libarchive/archive_digest_private.h | 35 +- .../libarchive/archive_disk_acl_freebsd.c | 4 +- contrib/libarchive/libarchive/archive_entry.c | 54 +- contrib/libarchive/libarchive/archive_entry.h | 84 +- .../libarchive/archive_entry_link_resolver.c | 8 + .../libarchive/libarchive/archive_entry_locale.h | 2 +- .../libarchive/libarchive/archive_entry_private.h | 13 +- .../libarchive/libarchive/archive_hmac_private.h | 2 +- contrib/libarchive/libarchive/archive_match.c | 102 +- contrib/libarchive/libarchive/archive_options.c | 4 +- .../libarchive/archive_options_private.h | 4 +- contrib/libarchive/libarchive/archive_pack_dev.h | 2 +- .../{archive_getdate.c => archive_parse_date.c} | 65 +- contrib/libarchive/libarchive/archive_platform.h | 5 + .../libarchive/libarchive/archive_platform_acl.h | 2 +- .../libarchive/libarchive/archive_platform_xattr.h | 2 +- contrib/libarchive/libarchive/archive_ppmd7.c | 11 +- contrib/libarchive/libarchive/archive_ppmd8.c | 15 +- .../libarchive/libarchive/archive_ppmd_private.h | 18 +- .../libarchive/libarchive/archive_random_private.h | 2 +- contrib/libarchive/libarchive/archive_rb.h | 2 +- contrib/libarchive/libarchive/archive_read.c | 6 - .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_entry_from_file.c | 2 +- .../libarchive/archive_read_disk_posix.c | 9 +- .../libarchive/archive_read_disk_private.h | 7 +- .../libarchive/libarchive/archive_read_format.3 | 15 + .../libarchive/libarchive/archive_read_open_fd.c | 42 +- .../libarchive/libarchive/archive_read_open_file.c | 121 +- .../libarchive/archive_read_open_filename.c | 61 +- .../archive_read_support_filter_by_code.c | 14 - .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_lz4.c | 1 - .../libarchive/archive_read_support_format_7zip.c | 445 +- .../archive_read_support_format_by_code.c | 15 - .../libarchive/archive_read_support_format_cab.c | 7 +- .../libarchive/archive_read_support_format_cpio.c | 22 +- .../archive_read_support_format_iso9660.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 73 +- .../libarchive/archive_read_support_format_rar.c | 184 +- .../libarchive/archive_read_support_format_rar5.c | 101 +- .../libarchive/archive_read_support_format_tar.c | 409 +- .../libarchive/archive_read_support_format_warc.c | 7 +- .../libarchive/archive_read_support_format_xar.c | 355 +- .../libarchive/archive_read_support_format_zip.c | 33 +- contrib/libarchive/libarchive/archive_string.c | 141 +- .../libarchive/archive_string_composition.h | 3 +- .../libarchive/libarchive/archive_string_sprintf.c | 11 +- contrib/libarchive/libarchive/archive_time.c | 163 + .../{archive_getdate.h => archive_time_private.h} | 26 +- contrib/libarchive/libarchive/archive_util.c | 76 +- .../libarchive/archive_version_details.c | 405 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 2 +- .../libarchive/archive_write_add_filter_gzip.c | 19 +- .../libarchive/archive_write_add_filter_uuencode.c | 2 +- .../libarchive/archive_write_disk_posix.c | 15 +- .../libarchive/archive_write_open_filename.c | 8 +- .../libarchive/archive_write_set_format_7zip.c | 298 +- .../libarchive/archive_write_set_format_gnutar.c | 16 +- .../libarchive/archive_write_set_format_iso9660.c | 25 +- .../libarchive/archive_write_set_format_mtree.c | 123 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_xar.c | 692 +- .../libarchive/archive_write_set_format_zip.c | 986 +- .../libarchive/archive_write_set_options.3 | 43 +- contrib/libarchive/libarchive/libarchive-formats.5 | 20 +- .../libarchive/libarchive/test/read_open_memory.c | 2 +- .../libarchive/test/test_7zip_filename_encoding.c | 200 +- contrib/libarchive/libarchive/test/test_acl_pax.c | 8 +- .../libarchive/test/test_acl_platform_nfs4.c | 10 +- .../libarchive/test/test_acl_platform_posix1e.c | 3 +- .../libarchive/libarchive/test/test_acl_posix1e.c | 8 +- contrib/libarchive/libarchive/test/test_acl_text.c | 2 +- .../libarchive/test/test_archive_match_time.c | 71 +- ...archive_getdate.c => test_archive_parse_date.c} | 21 +- .../test/test_archive_string_conversion.c | 4 +- .../libarchive/test/test_compat_gtar_large.c | 224 + .../libarchive/test/test_compat_solaris_tar_acl.c | 4 +- .../libarchive/test/test_compat_star_acl.c | 6 +- contrib/libarchive/libarchive/test/test_entry.c | 2 +- .../libarchive/libarchive/test/test_open_file.c | 9 +- .../test/test_read_disk_directory_traversals.c | 2 +- .../libarchive/test/test_read_format_7zip.c | 315 +- .../test_read_format_7zip_deflate_powerpc.7z.uu | 55 + .../test_read_format_7zip_extract_second.7z.uu | 22 +- .../test/test_read_format_7zip_lzma2_powerpc.7z.uu | 48 + .../test/test_read_format_7zip_lzma2_riscv.7z.uu | 49 + .../test/test_read_format_7zip_lzma2_sparc.7z.uu | 51 + .../test/test_read_format_7zip_sfx_elf.elf.uu | 9442 ++++++++++++++++++++ .../test_read_format_7zip_sfx_modified_pe.exe.uu | 109 + .../test/test_read_format_7zip_sfx_pe.exe.uu | 4751 ++++++++++ .../test/test_read_format_7zip_zstd_sparc.7z.uu | 59 + .../test/test_read_format_gtar_redundant_L.c | 40 + .../test_read_format_gtar_redundant_L.tar.Z.uu | 16 + .../libarchive/test/test_read_format_gtar_sparse.c | 8 +- .../test/test_read_format_gtar_sparse_length.c | 53 + .../test_read_format_gtar_sparse_length.tar.Z.uu | 12 + ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 18 +- .../libarchive/test/test_read_format_rar.c | 74 +- .../libarchive/test/test_read_format_rar5.c | 29 +- .../test/test_read_format_rar5_unicode.rar.uu | 18 +- .../test/test_read_format_rar_encryption.c | 4 +- .../test/test_read_format_rar_endarc_huge.rar.uu | 4 + .../test/test_read_format_rar_newsub_huge.rar.uu | 5 + .../test/test_read_format_rar_overflow.c | 48 + .../test/test_read_format_rar_overflow.rar.uu | 11 + .../test/test_read_format_rar_symlink_huge.rar.uu | 5 + .../test_read_format_tar_empty_with_gnulabel.c | 2 +- .../test/test_read_format_tar_mac_metadata.c | 85 + .../test_read_format_tar_mac_metadata_1.tar.uu | 231 + .../test/test_read_format_tar_pax_g_large.c | 53 + .../test/test_read_format_tar_pax_g_large.tar.uu | 49 + .../test/test_read_format_tar_pax_negative_time.c | 68 + .../test_read_format_tar_pax_negative_time.tar.uu | 60 + .../libarchive/test/test_read_format_warc.c | 24 + .../test/test_read_format_warc_incomplete.warc.uu | 10 + .../libarchive/test/test_read_format_zip.c | 5 +- .../test/test_read_pax_empty_val_no_nl.c | 65 + .../test/test_read_pax_empty_val_no_nl.tar.uu | 60 + .../libarchive/test/test_read_position.c | 2 +- .../libarchive/libarchive/test/test_sparse_basic.c | 8 +- .../libarchive/libarchive/test/test_tar_large.c | 2 +- .../libarchive/test/test_write_disk_perms.c | 8 +- .../test/test_write_disk_secure_noabsolutepaths.c | 4 +- .../libarchive/test/test_write_filter_gzip.c | 5 +- .../libarchive/test/test_write_format_7zip.c | 6 + .../libarchive/test/test_write_format_7zip_large.c | 6 + .../libarchive/test/test_write_format_gnutar.c | 29 +- .../test/test_write_format_mtree_preset_digests.c | 2107 +++++ .../libarchive/test/test_write_format_tar_sparse.c | 4 +- .../libarchive/test/test_write_format_xar.c | 39 + .../test/test_write_format_zip64_stream.c | 192 +- .../test/test_write_format_zip_compression_bzip2.c | 362 + .../test_write_format_zip_compression_lzmaxz.c | 425 + .../test/test_write_format_zip_compression_store.c | 277 +- .../test/test_write_format_zip_compression_zstd.c | 366 + .../test/test_write_format_zip_entry_size_unset.c | 150 +- .../libarchive/test/test_write_format_zip_file.c | 164 +- .../test/test_write_format_zip_file_zip64.c | 192 +- .../libarchive/test/test_write_format_zip_large.c | 35 +- .../libarchive/test/test_write_format_zip_stream.c | 156 +- contrib/libarchive/libarchive_fe/passphrase.c | 10 +- contrib/libarchive/tar/bsdtar.1 | 74 +- contrib/libarchive/tar/bsdtar.c | 35 +- contrib/libarchive/tar/bsdtar.h | 12 +- contrib/libarchive/tar/cmdline.c | 2 + contrib/libarchive/tar/subst.c | 1 + contrib/libarchive/tar/test/test_list_item.c | 63 + contrib/libarchive/tar/test/test_list_item.tar.uu | 169 + contrib/libarchive/tar/test/test_option_C_mtree.c | 4 +- .../{test_option_P.c => test_option_P_upper.c} | 0 .../libarchive/tar/test/test_option_ignore_zeros.c | 4 +- contrib/libarchive/tar/test/test_option_mtime.c | 82 + contrib/libarchive/tar/test/test_option_s.c | 14 +- contrib/libarchive/tar/test/test_stdio.c | 48 +- contrib/libarchive/tar/util.c | 57 +- contrib/libarchive/tar/write.c | 4 + contrib/libarchive/test_utils/test_common.h | 2 +- contrib/libarchive/test_utils/test_main.c | 192 +- contrib/libarchive/test_utils/test_utils.c | 48 + contrib/libarchive/test_utils/test_utils.h | 11 +- contrib/libarchive/unzip/bsdunzip.c | 21 +- contrib/libarchive/unzip/la_getline.h | 16 + lib/libarchive/Makefile | 3 +- lib/libarchive/tests/Makefile | 35 +- usr.bin/tar/tests/Makefile | 5 +- 181 files changed, 25587 insertions(+), 2345 deletions(-) diff --git a/contrib/libarchive/COPYING b/contrib/libarchive/COPYING index 1b9723574a7b..9d0bcf81ff61 100644 --- a/contrib/libarchive/COPYING +++ b/contrib/libarchive/COPYING @@ -20,7 +20,7 @@ the actual statements in the files are controlling. libarchive/mtree.5 * The following source files are in the public domain: - libarchive/archive_getdate.c + libarchive/archive_parse_date.c * The following source files are triple-licensed with the ability to choose from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 6af50e4e4033..caca7d5cbdb9 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,11 @@ +Jun 01, 2026: libarchive 3.8.1 released + +May 20, 2025: libarchive 3.8.0 released + +Mar 30, 2025: libarchive 3.7.9 released + +Mar 20, 2025: libarchive 3.7.8 released + Oct 13, 2024: libarchive 3.7.7 released Sep 23, 2024: libarchive 3.7.6 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 933de6986425..0d63357292ec 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats: * PWB binary cpio * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) - * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives * XAR archives The library also detects and handles any of the following before evaluating the archive: @@ -120,15 +121,18 @@ The library can create archives in any of the following formats: * PWB binary cpio * shar archives * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives * XAR archives When creating archives, the result can be filtered with any of the following: * uuencode + * base64 * gzip compression * bzip2 compression * compress/LZW compression @@ -241,4 +245,3 @@ questions we are asked about libarchive: appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations. - diff --git a/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh new file mode 100755 index 000000000000..2aa4823fc3d0 --- /dev/null +++ b/contrib/libarchive/build/ci/github_actions/install-macos-dependencies.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -eux + +# Uncommenting these adds a full minute to the CI time +#brew update > /dev/null +#brew upgrade > /dev/null + +# This does an upgrade if the package is already installed +brew install \ + autoconf \ + automake \ + libtool \ + pkg-config \ + cmake \ + xz \ + lz4 \ + zstd \ + libxml2 \ + openssl diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 6bc6eb22e967..2bf1bfa2985a 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1206,7 +1206,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else strcpy(date, "invalid mtime"); - fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", + fprintf(out, "%s%3u %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), archive_entry_nlink(entry), uname, gname, size, date, diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c index 884b6c9c4da7..33aa16d07a81 100644 --- a/contrib/libarchive/cpio/test/test_format_newc.c +++ b/contrib/libarchive/cpio/test/test_format_newc.c @@ -189,10 +189,10 @@ DEFINE_TEST(test_format_newc) gid = from_hex(e + 30, 8); /* gid */ assertEqualMem(e + 38, "00000003", 8); /* nlink */ t = from_hex(e + 46, 8); /* mtime */ - failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now, + failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now, (intmax_t)now); assert(t <= now); /* File wasn't created in future. */ - failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2, + failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2, (intmax_t)now - 2); assert(t >= now - 2); /* File was created w/in last 2 secs. */ failure("newc format stores body only with last appearance of a link\n" @@ -219,7 +219,7 @@ DEFINE_TEST(test_format_newc) assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ assert(is_hex(e + 6, 8)); /* ino */ -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) /* Mode: Group members bits and others bits do not work. */ assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0); #else @@ -230,7 +230,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000001", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created" - " at t2=%#08jx", (intmax_t)t, (intmax_t)t2); + " at t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -266,7 +266,7 @@ DEFINE_TEST(test_format_newc) #endif t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); @@ -300,7 +300,7 @@ DEFINE_TEST(test_format_newc) assertEqualMem(e + 38, "00000003", 8); /* nlink */ t2 = from_hex(e + 46, 8); /* mtime */ failure("First entry created at t=%#08jx this entry created at" - "t2=%#08jx", (intmax_t)t, (intmax_t)t2); + "t2=%#08jx", (uintmax_t)t, (uintmax_t)t2); assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */ fs = (uint64_t)from_hex(e + 54, 8); diff --git a/contrib/libarchive/cpio/test/test_option_a.c b/contrib/libarchive/cpio/test/test_option_a.c index e6b87948c65a..28e5b73765d7 100644 --- a/contrib/libarchive/cpio/test/test_option_a.c +++ b/contrib/libarchive/cpio/test/test_option_a.c @@ -52,7 +52,7 @@ test_create(void) * #ifdef this section out. Most of the test below is * still valid. */ memset(×, 0, sizeof(times)); -#if defined(_WIN32) && !defined(CYGWIN) +#if defined(_WIN32) && !defined(__CYGWIN__) times.actime = 86400; times.modtime = 86400; #else diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index e8748449514b..2414a4658bb1 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -18,7 +18,7 @@ is_octal(const char *p, size_t l) return (1); } -static long long int +static unsigned long long int from_octal(const char *p, size_t l) { long long int r = 0; @@ -117,7 +117,7 @@ DEFINE_TEST(test_option_c) gid = (int)from_octal(e + 30, 6); assertEqualMem(e + 36, "000001", 6); /* nlink */ failure("file entries should not have rdev set (dev field was 0%o)", - dev); + (unsigned int)dev); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ assert(t <= now); /* File wasn't created in future. */ @@ -133,7 +133,7 @@ DEFINE_TEST(test_option_c) assert(is_octal(e, 76)); /* Entire header is octal digits. */ assertEqualMem(e + 0, "070707", 6); /* Magic */ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */ - assert(ino != from_octal(e + 12, 6)); /* ino */ + assert(ino != (int)from_octal(e + 12, 6)); /* ino */ #if !defined(_WIN32) || defined(__CYGWIN__) /* On Windows, symbolic link and group members bits and * others bits do not work. */ @@ -163,7 +163,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(dev, from_octal(e + 6, 6)); /* Ino must be different from first entry. */ assert(is_octal(e + 12, 6)); /* ino */ - assert(ino != from_octal(e + 12, 6)); + assert(ino != (int)from_octal(e + 12, 6)); #if defined(_WIN32) && !defined(__CYGWIN__) /* Group members bits and others bits do not work. */ assertEqualMem(e + 18, "040777", 6); /* Mode */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5b65475f61e2..002190a24663 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,12 +34,15 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007007 +#define ARCHIVE_VERSION_NUMBER 3008001 #include #include /* for wchar_t */ #include /* For FILE * */ +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* time_t is slated to be removed from public includes in 4.0 */ #include /* For time_t */ +#endif /* * Note: archive.h is for use outside of libarchive; the configuration @@ -63,12 +66,15 @@ #define __LA_INT64_T_DEFINED # if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__) typedef __int64 la_int64_t; +typedef unsigned __int64 la_uint64_t; # else # include /* ssize_t */ # if defined(_SCO_DS) || defined(__osf__) typedef long long la_int64_t; +typedef unsigned long long la_uint64_t; # else typedef int64_t la_int64_t; +typedef uint64_t la_uint64_t; # endif # endif #endif @@ -94,6 +100,22 @@ typedef ssize_t la_ssize_t; # endif #endif +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for time_t */ +#define __LA_TIME_T time_t +#else +/* Use 64-bits integer types for time_t */ +#define __LA_TIME_T la_int64_t +#endif + +#if ARCHIVE_VERSION_NUMBER < 4000000 +/* Use the platform types for dev_t */ +#define __LA_DEV_T dev_t +#else +/* Use 64-bits integer types for dev_t */ +#define __LA_DEV_T la_int64_t +#endif + /* Large file support for Android */ #if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__) #include "android_lf.h" @@ -132,7 +154,7 @@ typedef ssize_t la_ssize_t; #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif -#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define __LA_DEPRECATED __attribute__((deprecated)) #else # define __LA_DEPRECATED @@ -155,7 +177,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.7" +#define ARCHIVE_VERSION_ONLY_STRING "3.8.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -178,6 +200,23 @@ __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); __LA_DECL const char * archive_libzstd_version(void); +__LA_DECL const char * archive_liblzo2_version(void); +__LA_DECL const char * archive_libexpat_version(void); +__LA_DECL const char * archive_libbsdxml_version(void); +__LA_DECL const char * archive_libxml2_version(void); +__LA_DECL const char * archive_mbedtls_version(void); +__LA_DECL const char * archive_nettle_version(void); +__LA_DECL const char * archive_openssl_version(void); +__LA_DECL const char * archive_libmd_version(void); +__LA_DECL const char * archive_commoncrypto_version(void); +__LA_DECL const char * archive_cng_version(void); +__LA_DECL const char * archive_wincrypt_version(void); +__LA_DECL const char * archive_librichacl_version(void); +__LA_DECL const char * archive_libacl_version(void); +__LA_DECL const char * archive_libattr_version(void); +__LA_DECL const char * archive_libiconv_version(void); +__LA_DECL const char * archive_libpcre_version(void); +__LA_DECL const char * archive_libpcre2_version(void); /* Declare our basic types. */ struct archive; @@ -449,6 +488,8 @@ __LA_DECL int archive_read_support_format_by_code(struct archive *, int); __LA_DECL int archive_read_support_format_cab(struct archive *); __LA_DECL int archive_read_support_format_cpio(struct archive *); __LA_DECL int archive_read_support_format_empty(struct archive *); +/* archive_read_support_format_gnutar() is an alias for historical reasons + * of archive_read_support_format_tar(). */ __LA_DECL int archive_read_support_format_gnutar(struct archive *); __LA_DECL int archive_read_support_format_iso9660(struct archive *); __LA_DECL int archive_read_support_format_lha(struct archive *); @@ -828,6 +869,10 @@ __LA_DECL int archive_write_set_format_filter_by_ext(struct archive *a, const ch __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +__LA_DECL int archive_write_zip_set_compression_lzma(struct archive *); +__LA_DECL int archive_write_zip_set_compression_xz(struct archive *); +__LA_DECL int archive_write_zip_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_zip_set_compression_zstd(struct archive *); /* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, @@ -1083,6 +1128,10 @@ __LA_DECL int archive_compression(struct archive *) __LA_DEPRECATED; #endif +/* Parses a date string relative to the current time. + * NOTE: This is not intended for general date parsing, and the resulting timestamp should only be used for libarchive. */ +__LA_DECL time_t archive_parse_date(time_t now, const char *datestr); + __LA_DECL int archive_errno(struct archive *); __LA_DECL const char *archive_error_string(struct archive *); __LA_DECL const char *archive_format_name(struct archive *); @@ -1201,8 +1250,10 @@ __LA_DECL int archive_match_include_gname_w(struct archive *, const wchar_t *); /* Utility functions */ +#if ARCHIVE_VERSION_NUMBER < 4000000 /* Convenience function to sort a NULL terminated list of strings */ __LA_DECL int archive_utility_string_sort(char **); +#endif #ifdef __cplusplus } diff --git a/contrib/libarchive/libarchive/archive_acl.c b/contrib/libarchive/libarchive/archive_acl.c index bbb085afe7af..9e71f5ee5610 100644 --- a/contrib/libarchive/libarchive/archive_acl.c +++ b/contrib/libarchive/libarchive/archive_acl.c @@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, /* Set remaining fields to blank. */ for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; + + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } - if (field[0].start != NULL && *(field[0].start) == L'#') { + if (*(field[0].start) == L'#') { /* Comment, skip entry */ continue; } @@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text, for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - if (field[0].start != NULL && *(field[0].start) == '#') { + if (field[0].start == NULL || field[0].end == NULL) { + /* This should never happen */ + return (ARCHIVE_FATAL); + } + + if (*(field[0].start) == '#') { /* Comment, skip entry */ continue; } diff --git a/contrib/libarchive/libarchive/archive_acl_private.h b/contrib/libarchive/libarchive/archive_acl_private.h index 2c9b5053430e..54e4439692ed 100644 --- a/contrib/libarchive/libarchive/archive_acl_private.h +++ b/contrib/libarchive/libarchive/archive_acl_private.h @@ -80,4 +80,4 @@ int archive_acl_from_text_l(struct archive_acl *, const char * /* text */, int archive_acl_from_text_nl(struct archive_acl *, const char * /* text */, size_t /* size of text */, int /* type */, struct archive_string_conv *); -#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ +#endif /* !ARCHIVE_ACL_PRIVATE_H_INCLUDED */ diff --git a/contrib/libarchive/libarchive/archive_cmdline.c b/contrib/libarchive/libarchive/archive_cmdline.c index 2e5428cae516..23bb05d6424a 100644 --- a/contrib/libarchive/libarchive/archive_cmdline.c +++ b/contrib/libarchive/libarchive/archive_cmdline.c @@ -71,7 +71,7 @@ get_argument(struct archive_string *as, const char *p) archive_string_empty(as); /* Skip beginning space characters. */ - while (*s != '\0' && *s == ' ') + while (*s == ' ') s++; /* Copy non-space characters. */ while (*s != '\0' && *s != ' ') { diff --git a/contrib/libarchive/libarchive/archive_cryptor_private.h b/contrib/libarchive/libarchive/archive_cryptor_private.h index c13f29260a07..4b3c6c161433 100644 --- a/contrib/libarchive/libarchive/archive_cryptor_private.h +++ b/contrib/libarchive/libarchive/archive_cryptor_private.h @@ -64,6 +64,7 @@ typedef struct { #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA #include +#define ARCHIVE_CRYPTOR_USE_CNG 1 /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS @@ -86,6 +87,7 @@ typedef struct { #include #include #include +#define ARCHIVE_CRYPTOR_USE_MBED 1 #define AES_MAX_KEY_SIZE 32 #define AES_BLOCK_SIZE 16 @@ -105,6 +107,7 @@ typedef struct { #endif #include #include +#define ARCHIVE_CRYPTOR_USE_NETTLE 1 typedef struct { #if NETTLE_VERSION_MAJOR < 3 @@ -125,6 +128,7 @@ typedef struct { #elif defined(HAVE_LIBCRYPTO) #include "archive_openssl_evp_private.h" +#define ARCHIVE_CRYPTOR_USE_OPENSSL 1 #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 @@ -140,6 +144,10 @@ typedef struct { #else +#if defined(_WIN32) && !defined(__CYGWIN__) && !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) +#define ARCHIVE_CRYPTOR_USE_WINCRYPT 1 +#endif + #define AES_BLOCK_SIZE 16 #define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3776831b21c9..45fc36af1145 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) +// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards. +// We need to continue supporting this feature regardless, so suppress the warnings. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + static int __archive_md5init(archive_md5_ctx *ctx) { @@ -218,13 +225,46 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif defined(ARCHIVE_CRYPTO_MD5_WIN) + +static int +__archive_md5init(archive_md5_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif +} + +static int +__archive_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_md5final(archive_md5_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 16, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int __archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_starts(ctx) == 0) +#else if (mbedtls_md5_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -234,7 +274,11 @@ static int __archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_update(ctx, indata, insize) == 0) +#else if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -243,7 +287,11 @@ __archive_md5update(archive_md5_ctx *ctx, const void *indata, static int __archive_md5final(archive_md5_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_md5_finish(ctx, md) == 0) { +#else if (mbedtls_md5_finish_ret(ctx, md) == 0) { +#endif mbedtls_md5_free(ctx); return (ARCHIVE_OK); } else { @@ -311,31 +359,6 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_MD5_WIN) - -static int -__archive_md5init(archive_md5_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); -#endif -} - -static int -__archive_md5update(archive_md5_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_md5final(archive_md5_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 16, ctx)); -} - #else static int @@ -420,7 +443,11 @@ static int __archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_starts(ctx) == 0) +#else if (mbedtls_ripemd160_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -430,7 +457,11 @@ static int __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_update(ctx, indata, insize) == 0) +#else if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -439,7 +470,11 @@ __archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, static int __archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_ripemd160_finish(ctx, md) == 0) { +#else if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { +#endif mbedtls_ripemd160_free(ctx); return (ARCHIVE_OK); } else { @@ -605,13 +640,42 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) + +static int +__archive_sha1init(archive_sha1_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif +} + +static int +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} + +static int +__archive_sha1final(archive_sha1_ctx *ctx, void *md) +{ + return (win_crypto_Final(md, 20, ctx)); +} + #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int __archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_starts(ctx) == 0) +#else if (mbedtls_sha1_starts_ret(ctx) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -621,7 +685,11 @@ static int __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_update(ctx, indata, insize) == 0) +#else if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) +#endif return (ARCHIVE_OK); else return (ARCHIVE_FATAL); @@ -630,7 +698,11 @@ __archive_sha1update(archive_sha1_ctx *ctx, const void *indata, static int __archive_sha1final(archive_sha1_ctx *ctx, void *md) { +#if MBEDTLS_VERSION_NUMBER > 0x03000000 + if (mbedtls_sha1_finish(ctx, md) == 0) { +#else if (mbedtls_sha1_finish_ret(ctx, md) == 0) { +#endif mbedtls_sha1_free(ctx); return (ARCHIVE_OK); } else { @@ -698,31 +770,6 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) return (ARCHIVE_OK); } -#elif defined(ARCHIVE_CRYPTO_SHA1_WIN) - -static int -__archive_sha1init(archive_sha1_ctx *ctx) -{ -#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA - return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); -#else - return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); -#endif -} - -static int -__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, - size_t insize) -{ - return (win_crypto_Update(ctx, indata, insize)); -} - -static int -__archive_sha1final(archive_sha1_ctx *ctx, void *md) -{ - return (win_crypto_Final(md, 20, ctx)); -} - #else static int @@ -873,13 +920,42 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_WIN) + +static int +__archive_sha256init(archive_sha256_ctx *ctx) +{ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else + return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif +} + +static int +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, + size_t insize) +{ + return (win_crypto_Update(ctx, indata, insize)); +} *** 35191 LINES SKIPPED *** From nobody Fri Jun 20 20:43:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bP8Zc1Gk0z5yX6Q; Fri, 20 Jun 2025 20:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bP8Zb4fccz4BG2; Fri, 20 Jun 2025 20:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750452215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kApgzNJDoxERFs60rpD3hZyutjRI2SWYF7bJsUsLFFM=; b=g0wExUtHfZkeDdHAfKvZJSPh/0vzcJRm+Pup4yluh1UYXerPIxiwk4GyBGc0KVtDdvZQLp UB0swIs11jFaQylU1Mhlhzfhq1h1+soOgfVC29OrJ53GKx0llIdxFMb76M6v8PXnlVcqb8 zsqxmV4bn26upusx4gVRPpQTkGasG1EENaKvYbQNftB0hGcGpECUTw4CAjOSFHxlNNz4RA A21p56hzH5hsRTG45KtJcgEuIc3Y0rqG+yEyacfme9x0PbflhLLv21etK834bLpDmJZ09H I10+Xnx3nDSf9yk5Nai8+W0BvmPVFohtDv6WSbF35wIjawoLd9zslEnbY3i/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750452215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kApgzNJDoxERFs60rpD3hZyutjRI2SWYF7bJsUsLFFM=; b=kulpLi1AHWQ590p9YyiudkWSRlZdfMfN5tceyF4/onhz/bkGUZsJXZDuXhpmviFfIwsAsF IHQxmuER68qFMBHGAdFVxh9vlNr/AbdgufV/8f3xbXBPjLe+khEjl7eP40Fkg9mTqObNkx IArSqDNDMc+SI2oCC0EKBq8hZ+cYuBJ2Pzi+TwvSHox+4KzT6Z7ejrLr5VtaIMBmASzhRK VlJZ/ALLHm/HZ8+ZKFbvmg9PTSiAZVzKyhbGsO8r9Lcv3U3bgALURpmpKXrgBTXjfrgHj8 z63h+2wKZD2XqLzxEKr6pRUy7WChWPJNCvQEv/ENIGZRL5J3fkVvcGPuivXslw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750452215; a=rsa-sha256; cv=none; b=DctLEIgxvq2O9lGb1+eOTRV1QIeE8ExQMMD2ImfE/KvAMGn7qLEoAYH72hFQ6BOH3x2/tl gkYXyzOGTIomVBmq3JO8c6aKTVETP5r8i+Tk91pTh0N3FIZREvd6lYPIT+8FD4+1EyJpQZ KMyjFbyVREopea1bJ0VojVka50YwGukHUb65aBza8WAVbSZYmAzLfFQc+nUnEAyVNKRfyL /GhFA7ImZvuPHyylU3K0vy/A3OUk4pEu19t1T+SfO5iAQOF3WdesfFLFasLPOeQ54kI0MQ +5CCAPA9xstuGpkM18uWQjEvreKlOZ0LmZkhAWRO12sfkW3El1CpP206GFTYrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bP8Zb4DwGz11SQ; Fri, 20 Jun 2025 20:43: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 55KKhZ3U031279; Fri, 20 Jun 2025 20:43:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55KKhZ0M031276; Fri, 20 Jun 2025 20:43:35 GMT (envelope-from git) Date: Fri, 20 Jun 2025 20:43:35 GMT Message-Id: <202506202043.55KKhZ0M031276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 0106e5d72533 - stable/13 - libarchive/test: fix build when memcpy() is a macro List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0106e5d725331d5a0acaa9790f6d7a4c0c4c16b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=0106e5d725331d5a0acaa9790f6d7a4c0c4c16b5 commit 0106e5d725331d5a0acaa9790f6d7a4c0c4c16b5 Author: Kyle Evans AuthorDate: 2025-06-17 14:17:59 +0000 Commit: Martin Matuska CommitDate: 2025-06-20 20:15:19 +0000 libarchive/test: fix build when memcpy() is a macro After importing the latest libarchive into FreeBSD, Shawn Webb @ HardenedBSD noted that the test build is broken when FORTIFY_SOURCE=2 while building the base system. Braced initializer lists are a special case that need some extra fun parentheses when we're dealing with the preprocessor. While it's not a particularly common setup, the extra parentheses don't really hurt readability all that much so it's worth fixing for wider compatibility. This corresponds to libarchive PR #2660 Reported by: Shawn Webb (HardenedBSD) (cherry picked from commit e2a605e7ab7ff83d15b1a0b994223768169b0f1e) --- .../test/test_write_format_mtree_preset_digests.c | 68 +++++++++++----------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c b/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c index cdf789b4b002..bb8ddf49431b 100644 --- a/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c +++ b/contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c @@ -326,10 +326,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -419,10 +419,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -519,10 +519,10 @@ DEFINE_TEST(test_write_format_mtree_digests_md5_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.md5, (unsigned char[]) { + memcpy(ed.md5, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, - }, sizeof(ed.md5)); + }), sizeof(ed.md5)); #ifdef ARCHIVE_HAS_RMD160 assertEqualInt(ARCHIVE_OK, archive_rmd160_init(&expectedRmd160Ctx)); @@ -710,10 +710,10 @@ DEFINE_TEST(test_write_format_mtree_digests_rmd160_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.rmd160, (unsigned char[]) { + memcpy(ed.rmd160, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.rmd160)); + }), sizeof(ed.rmd160)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -810,10 +810,10 @@ DEFINE_TEST(test_write_format_mtree_digests_rmd160_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.rmd160, (unsigned char[]) { + memcpy(ed.rmd160, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.rmd160)); + }), sizeof(ed.rmd160)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -910,10 +910,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1003,10 +1003,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1103,10 +1103,10 @@ DEFINE_TEST(test_write_format_mtree_digests_sha1_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha1, (unsigned char[]) { + memcpy(ed.sha1, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha1)); + }), sizeof(ed.sha1)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1203,12 +1203,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1298,12 +1298,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1400,12 +1400,12 @@ DEFINE_TEST(test_write_format_mtree_digests_sha256_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha256, (unsigned char[]) { + memcpy(ed.sha256, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha256)); + }), sizeof(ed.sha256)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1502,13 +1502,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1598,13 +1598,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1701,13 +1701,13 @@ DEFINE_TEST(test_write_format_mtree_digests_sha384_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha384, (unsigned char[]) { + memcpy(ed.sha384, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha384)); + }), sizeof(ed.sha384)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1804,7 +1804,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_no_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -1812,7 +1812,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_no_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -1903,7 +1903,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -1911,7 +1911,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_empty_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); @@ -2009,7 +2009,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_non_empty_data) struct archive_entry *entry; struct expected_digests ed; - memcpy(ed.sha512, (unsigned char[]) { + memcpy(ed.sha512, ((unsigned char[]) { 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, @@ -2017,7 +2017,7 @@ DEFINE_TEST(test_write_format_mtree_digests_sha512_digest_set_non_empty_data) 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed, 0xfe, 0xed - }, sizeof(ed.sha512)); + }), sizeof(ed.sha512)); #ifdef ARCHIVE_HAS_MD5 assertEqualInt(ARCHIVE_OK, archive_md5_init(&expectedMd5Ctx)); From nobody Sat Jun 21 22:35:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bPq1Q730wz604hH; Sat, 21 Jun 2025 22:35: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bPq1Q6LSBz3Jv6; Sat, 21 Jun 2025 22:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750545338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y6pNgfMGijw+w4tzCPdD5cHJXSrg+PDIaD95LKvaSj0=; b=OpA8plVBzOxLjGMmL2KDwCarv3mm3WTUuWTDZZe0nHWONVPaH7wgxnMLqzDQ4Nb9pXBTgm tt06TIQlcHRBf1ArsBWnLWIMw452ISVmeX5F+zdjLhM+ODtrayW8m59mhIfV5OVHbL49Mh SuzFtawXDcCNl535Ij49/e60I6DNo/MDYKr+3XCg2A2+sxvAB5+3qBLNRzV88OMbcaBpXP DRDHKLrQ7We/XrINMBcmBYAkzSOdkUZEpSFjgzo6MTuMW6vKleiZbuAR/W+fJXhPMjF9Fn T30Rtb3DCVVIdEBC6pVW7IsBgyKzdlDOTkRcww7gxQZUizV7VtYJXQB4jYePDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750545338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y6pNgfMGijw+w4tzCPdD5cHJXSrg+PDIaD95LKvaSj0=; b=Z8lpoXbMch8ToSLYz3q2Rcl1XGS0iVdDxiUGjpzSwidYZz5BF8z8ZcPac+/gYTqM2VZy+3 0Lm9IdL9L8K/2gOWwpQOOTmgbHN3OongBO2CLBMcppKLWBTM2HVpvGbCG2pdeClmwcUyWb cD0rd5MYmddQFoBZZ0PLSkj1N7rrQRvarylhy3X6C2DC5Dakwm92bDixOXAH7xRs11xKzp k5fYttMbShil/2adWbOSrfAOU5mhFmtTJFTthPHT8XCxMlC2l/4bWLSr60MptDtFUJK14b P5dgp2YJitay8DTrL3AOb2ajGoZyG1InH99sJ0QeHGpUVanNFLUQstJ59QGB0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750545338; a=rsa-sha256; cv=none; b=W/8ssW4eHcvU5AicnNTn5hFfl3cGvMpZZA2+huy7V0J2/ZO37tw/9hCaPnnmXjNIyYbCQ/ x9R4Z1br1V5XBQsXU3rH36L0lyfTuN0rIGEV8kAqkVvnQ1P1j+pVyFSgu+/LnCuDAnklKz JdqGerRMmj/uLxfkBWFJepPlk0k1Dafb7mdfXj9IbBoV7LS2KEfMfcW8n9W7c7o5Jw2GEh 6YwwvlT42UicqRKCbhWvuUz5DBahILu0bsQRpg9vfSzla+DB32JTtAh4Mhjf5ar+yERbjf G6t8QywQEutEWBTA9qnc6UapiMhfg1s3h6J5Tu0o4XTEgWQhzBwICKVI3/g6YA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bPq1Q5qvqzrGv; Sat, 21 Jun 2025 22:35: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 55LMZcto041646; Sat, 21 Jun 2025 22:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55LMZamx041634; Sat, 21 Jun 2025 22:35:36 GMT (envelope-from git) Date: Sat, 21 Jun 2025 22:35:36 GMT Message-Id: <202506212235.55LMZamx041634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 6abe6a8a0d54 - stable/14 - zfs: merge openzfs/zfs@3e4a3e161 (zfs-2.2-release) into stable/14 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6abe6a8a0d54a28e8bc35bd6cd5cb1c23b94cc03 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=6abe6a8a0d54a28e8bc35bd6cd5cb1c23b94cc03 commit 6abe6a8a0d54a28e8bc35bd6cd5cb1c23b94cc03 Merge: ef360183df81 3e4a3e161c00 Author: Martin Matuska AuthorDate: 2025-06-21 22:05:40 +0000 Commit: Martin Matuska CommitDate: 2025-06-21 22:22:44 +0000 zfs: merge openzfs/zfs@3e4a3e161 (zfs-2.2-release) into stable/14 OpenZFS release 2.2.8 Notable upstream pull request merges: #17180 0a73e91d2 Block remap for cloned blocks on device removal #17255 be72364ad ARC: Avoid overflows in arc_evict_adj() #17273 4ee13684b cred: properly pass and test creds on other threads #17340 b144b160b Fix 2 bugs in non-raw send with encryption #17343 050517c41 icp: Use explicit_memset() exclusively in gcm_clear_ctx() #17353 827fd20d0 dmu_objset_hold_flags() should call dsl_dataset_rele_flags() on error Obtained from: OpenZFS OpenZFS commit: 3e4a3e161c00273303cd9fa9e0dc09ead3499a8a OpenZFS tag: zfs-2.2.8 .../openzfs/.github/PULL_REQUEST_TEMPLATE.md | 1 + .../openzfs/.github/workflows/checkstyle.yaml | 2 +- sys/contrib/openzfs/.github/workflows/labels.yml | 49 +++ .../.github/workflows/scripts/generate-ci-type.py | 1 + .../.github/workflows/scripts/qemu-1-setup.sh | 44 +-- .../.github/workflows/scripts/qemu-2-start.sh | 93 +++-- .../.github/workflows/scripts/qemu-3-deps-vm.sh | 260 ++++++++++++++ .../.github/workflows/scripts/qemu-3-deps.sh | 251 ++------------ .../.github/workflows/scripts/qemu-4-build-vm.sh | 379 +++++++++++++++++++++ .../.github/workflows/scripts/qemu-4-build.sh | 150 +------- .../.github/workflows/scripts/qemu-5-setup.sh | 38 +-- .../.github/workflows/scripts/qemu-6-tests.sh | 22 +- .../.github/workflows/scripts/qemu-7-prepare.sh | 9 +- .../.github/workflows/scripts/qemu-8-summary.sh | 2 +- .../workflows/scripts/qemu-prepare-for-build.sh | 8 + .../.github/workflows/scripts/qemu-test-repo-vm.sh | 90 +++++ .../.github/workflows/scripts/qemu-wait-for-vm.sh | 10 + .../scripts/replace-dupes-with-symlinks.sh | 32 ++ .../.github/workflows/zfs-qemu-packages.yml | 140 ++++++++ sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 74 ++-- sys/contrib/openzfs/.github/workflows/zloop.yml | 2 +- sys/contrib/openzfs/META | 4 +- .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 3 +- sys/contrib/openzfs/config/kernel-automount.m4 | 41 ++- sys/contrib/openzfs/config/kernel-kthread.m4 | 37 +- sys/contrib/openzfs/config/kernel-mkdir.m4 | 57 +++- sys/contrib/openzfs/config/kernel-objtool.m4 | 19 ++ sys/contrib/openzfs/config/kernel-sb-dying.m4 | 19 ++ sys/contrib/openzfs/config/kernel-timer.m4 | 32 ++ .../openzfs/config/kernel-vfs-migrate_folio.m4 | 27 ++ .../openzfs/config/kernel-vfs-migratepage.m4 | 27 ++ sys/contrib/openzfs/config/kernel.m4 | 13 + sys/contrib/openzfs/config/zfs-build.m4 | 2 + sys/contrib/openzfs/contrib/debian/control | 1 + .../contrib/initramfs/scripts/local-top/zfs | 4 +- .../openzfs/include/os/freebsd/spl/sys/policy.h | 1 - .../include/os/linux/kernel/linux/blkdev_compat.h | 2 +- .../include/os/linux/kernel/linux/page_compat.h | 4 +- .../openzfs/include/os/linux/spl/sys/taskq.h | 1 + sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 4 +- .../openzfs/include/os/linux/zfs/sys/abd_os.h | 10 +- .../openzfs/include/os/linux/zfs/sys/policy.h | 1 - sys/contrib/openzfs/include/sys/dmu_recv.h | 1 - sys/contrib/openzfs/include/sys/dsl_dataset.h | 4 +- sys/contrib/openzfs/include/sys/dsl_dir.h | 4 +- sys/contrib/openzfs/include/sys/frame.h | 8 + sys/contrib/openzfs/include/sys/zcp.h | 1 - sys/contrib/openzfs/include/sys/zfs_context.h | 4 +- sys/contrib/openzfs/lib/libspl/os/linux/zone.c | 8 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 7 - sys/contrib/openzfs/man/man4/zfs.4 | 35 +- sys/contrib/openzfs/module/Kbuild.in | 13 - sys/contrib/openzfs/module/Makefile.in | 2 + sys/contrib/openzfs/module/icp/algs/modes/modes.c | 4 +- .../module/icp/asm-x86_64/modes/aesni-gcm-x86_64.S | 17 + .../module/icp/asm-x86_64/sha2/sha256-x86_64.S | 17 + .../module/icp/asm-x86_64/sha2/sha512-x86_64.S | 13 + .../openzfs/module/os/freebsd/spl/spl_policy.c | 7 - .../openzfs/module/os/linux/spl/spl-taskq.c | 7 +- .../openzfs/module/os/linux/spl/spl-thread.c | 6 +- sys/contrib/openzfs/module/os/linux/zfs/policy.c | 44 +-- .../openzfs/module/os/linux/zfs/vdev_disk.c | 8 +- .../openzfs/module/os/linux/zfs/vdev_file.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 3 - .../openzfs/module/os/linux/zfs/zpl_ctldir.c | 18 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 9 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 17 +- .../openzfs/module/os/linux/zfs/zpl_super.c | 26 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 17 +- sys/contrib/openzfs/module/zcommon/zfs_valstr.c | 4 +- sys/contrib/openzfs/module/zfs/arc.c | 15 +- sys/contrib/openzfs/module/zfs/ddt.c | 3 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 27 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 48 ++- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 29 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 42 ++- sys/contrib/openzfs/module/zfs/metaslab.c | 8 + sys/contrib/openzfs/module/zfs/zcp.c | 8 +- sys/contrib/openzfs/module/zfs/zcp_synctask.c | 2 - sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 7 + sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in | 4 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 4 +- sys/contrib/openzfs/tests/runfiles/common.run | 2 +- .../tests/zfs-tests/cmd/file/largest_file.c | 2 +- .../openzfs/tests/zfs-tests/cmd/getversion.c | 2 +- .../openzfs/tests/zfs-tests/include/blkdev.shlib | 19 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 1 + .../cli_root/zpool_status/zpool_status_003_pos.ksh | 2 +- .../cli_root/zpool_status/zpool_status_004_pos.ksh | 2 +- .../zfs-tests/tests/functional/io/io_uring.ksh | 7 - .../tests/functional/rsend/send_leak_keymaps.ksh | 82 +++++ sys/modules/zfs/zfs_config.h | 38 ++- sys/modules/zfs/zfs_gitrev.h | 2 +- 94 files changed, 1854 insertions(+), 782 deletions(-) diff --cc sys/contrib/openzfs/.github/workflows/labels.yml index 000000000000,6193c8afeae9..6193c8afeae9 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/workflows/labels.yml +++ b/sys/contrib/openzfs/.github/workflows/labels.yml diff --cc sys/contrib/openzfs/.github/workflows/scripts/qemu-3-deps-vm.sh index 000000000000,a581b13c2f58..a581b13c2f58 mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/qemu-3-deps-vm.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/qemu-3-deps-vm.sh diff --cc sys/contrib/openzfs/.github/workflows/scripts/qemu-4-build-vm.sh index 000000000000,17e976ebcc39..17e976ebcc39 mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/qemu-4-build-vm.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/qemu-4-build-vm.sh diff --cc sys/contrib/openzfs/.github/workflows/scripts/qemu-prepare-for-build.sh index 000000000000,a5a9e422ba6e..a5a9e422ba6e mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/qemu-prepare-for-build.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/qemu-prepare-for-build.sh diff --cc sys/contrib/openzfs/.github/workflows/scripts/qemu-test-repo-vm.sh index 000000000000,e3cafcbb67cc..e3cafcbb67cc mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/qemu-test-repo-vm.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/qemu-test-repo-vm.sh diff --cc sys/contrib/openzfs/.github/workflows/scripts/qemu-wait-for-vm.sh index 000000000000,e8afdb3f7b98..e8afdb3f7b98 mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/qemu-wait-for-vm.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/qemu-wait-for-vm.sh diff --cc sys/contrib/openzfs/.github/workflows/scripts/replace-dupes-with-symlinks.sh index 000000000000,5412c954ad2f..5412c954ad2f mode 000000,100755..100755 --- a/sys/contrib/openzfs/.github/workflows/scripts/replace-dupes-with-symlinks.sh +++ b/sys/contrib/openzfs/.github/workflows/scripts/replace-dupes-with-symlinks.sh diff --cc sys/contrib/openzfs/.github/workflows/zfs-qemu-packages.yml index 000000000000,5b5afe746859..5b5afe746859 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/workflows/zfs-qemu-packages.yml +++ b/sys/contrib/openzfs/.github/workflows/zfs-qemu-packages.yml diff --cc sys/contrib/openzfs/config/kernel-sb-dying.m4 index 000000000000,882f3e542357..882f3e542357 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-sb-dying.m4 +++ b/sys/contrib/openzfs/config/kernel-sb-dying.m4 diff --cc sys/contrib/openzfs/config/kernel-timer.m4 index 000000000000,c89ea204e83d..c89ea204e83d mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-timer.m4 +++ b/sys/contrib/openzfs/config/kernel-timer.m4 diff --cc sys/contrib/openzfs/config/kernel-vfs-migrate_folio.m4 index 000000000000,186cd0581a17..186cd0581a17 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-migrate_folio.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-migrate_folio.m4 diff --cc sys/contrib/openzfs/config/kernel-vfs-migratepage.m4 index 000000000000,05db3af511eb..05db3af511eb mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-migratepage.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-migratepage.m4 diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_leak_keymaps.ksh index 000000000000,6ab8da6fd740..6ab8da6fd740 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_leak_keymaps.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_leak_keymaps.ksh diff --cc sys/modules/zfs/zfs_config.h index 3c67896111ca,000000000000..b0fc72c654f3 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,822 -1,0 +1,848 @@@ +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* __assign_str() has one arg */ +/* #undef HAVE_1ARG_ASSIGN_STR */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* struct queue_limits has a features field */ +/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* backing_dev_info is available through queue gendisk */ +/* #undef HAVE_BLK_QUEUE_DISK_BDI */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + ++/* Define to 1 if you have the Mac OS X function ++ CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ ++/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ ++ ++/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in ++ the CoreFoundation framework. */ ++/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ ++ +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + - /* dequeue_signal() takes a task argument */ - /* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TASK */ ++/* 3-arg dequeue_signal() takes a type argument */ ++/* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TYPE */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + ++/* dops->d_revalidate() takes 4 args */ ++/* #undef HAVE_D_REVALIDATE_4ARGS */ ++ +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* file->f_version exists */ +/* #undef HAVE_FILE_F_VERSION */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* GENHD_FL_EXT_DEVT flag is available */ +/* #undef HAVE_GENHD_FL_EXT_DEVT */ + +/* GENHD_FL_NO_PART flag is available */ +/* #undef HAVE_GENHD_FL_NO_PART */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + ++/* iops->mkdir() returns struct dentry* */ ++/* #undef HAVE_IOPS_MKDIR_DENTRY */ ++ +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_get_pages() is available */ +/* #undef HAVE_IOV_ITER_GET_PAGES */ + +/* iov_iter_get_pages2() is available */ +/* #undef HAVE_IOV_ITER_GET_PAGES2 */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* PG_error flag is available */ +/* #undef HAVE_MM_PAGE_FLAG_ERROR */ + +/* page_mapping() is available */ +/* #undef HAVE_MM_PAGE_MAPPING */ + +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* proc_handler ctl_table arg is const */ +/* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* If available, contains the Python version number currently in use. */ +/* #undef HAVE_PYTHON */ + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_sz exists */ +/* #undef HAVE_REGISTER_SYSCTL_SZ */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + ++/* STACK_FRAME_NON_STANDARD asm macro is defined */ ++/* #undef HAVE_STACK_FRAME_NON_STANDARD_ASM */ ++ +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the 'strerror_l' function. */ +#define HAVE_STRERROR_L 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the 'strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the 'strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + ++/* timer_delete_sync is available */ ++/* #undef HAVE_TIMER_DELETE_SYNC */ ++ +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the 'udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* fops->clone_file_range() is available */ +/* #undef HAVE_VFS_CLONE_FILE_RANGE */ + +/* fops->dedupe_file_range() is available */ +/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* generic_copy_file_range() is available */ +/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + ++/* migratepage exists */ ++/* #undef HAVE_VFS_MIGRATEPAGE */ ++ ++/* migrate_folio exists */ ++/* #undef HAVE_VFS_MIGRATE_FOLIO */ ++ +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ + +/* read_folio exists */ +/* #undef HAVE_VFS_READ_FOLIO */ + +/* fops->remap_file_range() is available */ +/* #undef HAVE_VFS_REMAP_FILE_RANGE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* splice_copy_file_range() is available */ +/* #undef HAVE_VFS_SPLICE_COPY_FILE_RANGE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* int (*writepage_t)() takes struct folio* */ +/* #undef HAVE_WRITEPAGE_T_FOLIO */ + +/* xattr_handler->get() wants dentry and inode and flags */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() takes mnt_idmap */ +/* #undef HAVE_XATTR_SET_IDMAP */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if host toolchain supports XSAVE */ +#define HAVE_XSAVE 1 + +/* Define if host toolchain supports XSAVEOPT */ +#define HAVE_XSAVEOPT 1 + +/* Define if host toolchain supports XSAVES */ +#define HAVE_XSAVES 1 + +/* ZERO_PAGE() is GPL-only */ +/* #undef HAVE_ZERO_PAGE_GPL_ONLY */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* using complete_and_exit() instead */ +/* #undef SPL_KTHREAD_COMPLETE_AND_EXIT */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE *** 71 LINES SKIPPED *** From nobody Sun Jun 22 07:18:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bQ2dD27jFz5yNCK; Sun, 22 Jun 2025 07:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQ2dD1PLtz4894; Sun, 22 Jun 2025 07:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750576736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lkyHJg0oPWAiu3CC9G/z+tCl4sCgQkLmM3Z99DXJ/KU=; b=mWZmWyw8e8S7S4hnAB/ysUpD32VwaUHNfLPgbdelyL416hqGvb9HQBvn7CeAqHBwNkd0eJ QaQM/oJv9aLeH7zeb14PDxiM+zBLNOuDvUwVjed1FVY0xogoUASAfgumw4+29AwWhv88U8 Jep5mdql9owao5MGJ57LaT/N9aQrGBQh1BphUNJB3C1DU18G4AA7RwE5oEFEtTUE9hODFo S1EeCRQ66zA1rmop0zh0axa9EFZafn4Ul/hOrpXt1YjoKDcxDtVogXIWx5GwmBQhO4lDlB Ot/9m1uQrIusKLXKEV5yIyW3NGbxlZKOxflH6cwmcgYkZpVAQncliXtHJ6CzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750576736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lkyHJg0oPWAiu3CC9G/z+tCl4sCgQkLmM3Z99DXJ/KU=; b=wS3e/uLnClz356q/fZKMYn4B86HTg0CK7S2LjrIQ4YsbQGXkYtH1e/tyN3pkc6fNHkw6rd hjX1SCuoPprJkUjlBSQMwsF2Xem/bhV08jwXaNhtdG3b16UkpAwA51OmCiIUXpCI1rjGQC 5CQlir9xRNC6BFQqyeIDruNl86Qt/JkeiDMIokOYtlAPibSGF4s1ALMHMuKMV3d5Cj2iWi Hh04ke6ruiA+5/JX9bgJPuKOHhFTtqBhTesEIfYqyzmvzi+6eJllZupWROCARkALTnpR31 T88SNeU0bQzLAmzFsoTsLqrAmNhUchm7JHaF2nMsAC8hCuc6Xfe/ikllH4wa4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750576736; a=rsa-sha256; cv=none; b=IP4WhB/pRirYG05ouAoJj4SkINsoWk3dpPIM4HmPxsaDWopwcru5PA+r0a1eGuhEoLhuIC ez/9bYTPlXlMKV2fFokpD2f+Qo952I9zyewxsrMOlDdZsKY5b9d5U23L7P5TUviCRiCP8F kA3uVtzrlPB79zB5cvj1R7XKbfB458sWus+Lsa55On/XwkAw0Vem5hw+8na+y/5xNL9dXm ceTXuI6Cx28vKbJFXYtJ0fxFnZXkmyG/a5/FqpbBBJpShmHmxpUNd1tmO068qM0Lvk6z70 hE52C2Qa3sx9l9ZNkBZIi0dX9TP7baGhswfqOJcH29Kvyf/nHkG/o/+MkP04ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bQ2dD0D0xz163L; Sun, 22 Jun 2025 07:18: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 55M7It1E016102; Sun, 22 Jun 2025 07:18:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55M7Itdu016099; Sun, 22 Jun 2025 07:18:55 GMT (envelope-from git) Date: Sun, 22 Jun 2025 07:18:55 GMT Message-Id: <202506220718.55M7Itdu016099@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: 33f65f12eba1 - stable/14 - bnxt: Fix BASE-T, 40G AOC, 1G-CX, autoneg and unknown media lists List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 33f65f12eba10588827a13d232337616f6f4facf Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=33f65f12eba10588827a13d232337616f6f4facf commit 33f65f12eba10588827a13d232337616f6f4facf Author: Kevin Bowling AuthorDate: 2025-06-14 23:46:05 +0000 Commit: Kevin Bowling CommitDate: 2025-06-22 07:18:41 +0000 bnxt: Fix BASE-T, 40G AOC, 1G-CX, autoneg and unknown media lists This was broken in c63d67e137f3, the early returns prevent building the media lists as expected. The BASE-T parts of the patch were suggested by "cyric@mm.st", while I am adding the additional 40G AOC, 1CX, autoneg and unknown PHY fixes based on code inspection. There may be additional work left here for Broadcom but this is certainly better than the returns. PR: 287395 Reported by: mickael.maillot@gmail.com, cyric@mm.st Tested by: Einar Bjarni Halldórsson (cherry picked from commit 5e6e4f752833acc96f1efc893318d3f6b74b9689) --- sys/dev/bnxt/bnxt_en/if_bnxt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index eea956759e9e..169255c9433e 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -4609,34 +4609,34 @@ bnxt_add_media_types(struct bnxt_softc *softc) case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE: media_type = BNXT_MEDIA_AC; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX: media_type = BNXT_MEDIA_BASECX; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE: media_type = BNXT_MEDIA_BASET; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: media_type = BNXT_MEDIA_BASEKX; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY: media_type = BNXT_MEDIA_BASESGMII; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: /* Only Autoneg is supported for TYPE_UNKNOWN */ - return; + break; default: /* Only Autoneg is supported for new phy type values */ device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); - return; + break; } switch (link_info->sig_mode) {